AdapterBuiltOutsideEntry has no entry point for a library gem, so it flags the one default adapter of the public API #1667

Open
opened 2026-11-09 22:43:45 +00:00 by jared · 0 comments
Owner

Problem

Sdlc/Structural/AdapterBuiltOutsideEntry has no entry point for a library gem. Its lesson defines an entry as a bin/ script, a file that starts with #!, or an object that reads $stdin, $stdout, $stderr or ARGV. A library's callers live in other repos, so no file in the library is an entry. The cop then flags the one default adapter that the library's public API needs.

# llm-stack, lib/llm/herdr/executables.rb (flagged)
Executables = Data.define(:herdr, :ssh, :sh, :runner) do
  def initialize(**programs) = super(herdr: "herdr", ssh: "ssh", sh: "sh", runner: Runner, **programs)
end

# callers in other repos (hooks, evals)
LLM::Herdr.start(name: "rev", cwd: dir)                                    # works with no setup
LLM::Herdr.start(name: "rev", cwd: dir, on: Machine.local(executables: Executables.new(runner: fake)))  # tests inject

The runner is already injected through a constructor keyword, and a test proves that every herdr command goes through the given runner. The only choices left all fail the cop:

Option Result
Keep one default in Executables flagged
Move the default to the public module LLM::Herdr (on: default) flagged, same offense in another file
Remove every default clean, but every library caller must build Machine.local(executables: Executables.new(runner: LLM::Herdr::Runner))

The same shape is in llm-stack lib/llm/preflight.rb (smi: Gpu::NvidiaSmi.new) and lib/llm/protocols/claude_code_cli.rb (llm-stack #28).

Candidate fixes (not decided)

  • A project config key that names the library's entry files (for example Entries: [lib/llm/herdr.rb, lib/llm/herdr/executables.rb]).
  • Treat a default that a constructor keyword can override, in the library's public facade, as an entry.
  • In the lesson, add a "library" case with a no-smell example.

No allowlist or disable comment in the consumer repo.


Discoverer: ruby-gems/llm-stack, session a0ddd084-33f2-4676-aac9-c6373a206c4c, 2026-11-09. Finishing llm-stack #27 (herdr runner injection) left one offense that no library design can clear. Decision recorded as an os-me Prediction (user AFK): keep one default, file this gap. Ticket-skeptic: VERDICT CREATE; root candidate none found (searched AdapterBuiltOutsideEntry, adapter-built-outside-entry, built outside entry, entry point, library entry, library gem, adapter default, runner).

## Problem `Sdlc/Structural/AdapterBuiltOutsideEntry` has no entry point for a library gem. Its lesson defines an entry as a `bin/` script, a file that starts with `#!`, or an object that reads `$stdin`, `$stdout`, `$stderr` or `ARGV`. A library's callers live in other repos, so no file in the library is an entry. The cop then flags the one default adapter that the library's public API needs. ```ruby # llm-stack, lib/llm/herdr/executables.rb (flagged) Executables = Data.define(:herdr, :ssh, :sh, :runner) do def initialize(**programs) = super(herdr: "herdr", ssh: "ssh", sh: "sh", runner: Runner, **programs) end # callers in other repos (hooks, evals) LLM::Herdr.start(name: "rev", cwd: dir) # works with no setup LLM::Herdr.start(name: "rev", cwd: dir, on: Machine.local(executables: Executables.new(runner: fake))) # tests inject ``` The runner is already injected through a constructor keyword, and a test proves that every herdr command goes through the given runner. The only choices left all fail the cop: | Option | Result | | --- | --- | | Keep one default in `Executables` | flagged | | Move the default to the public module `LLM::Herdr` (`on:` default) | flagged, same offense in another file | | Remove every default | clean, but every library caller must build `Machine.local(executables: Executables.new(runner: LLM::Herdr::Runner))` | The same shape is in llm-stack `lib/llm/preflight.rb` (`smi: Gpu::NvidiaSmi.new`) and `lib/llm/protocols/claude_code_cli.rb` (llm-stack #28). ## Candidate fixes (not decided) - A project config key that names the library's entry files (for example `Entries: [lib/llm/herdr.rb, lib/llm/herdr/executables.rb]`). - Treat a default that a constructor keyword can override, in the library's public facade, as an entry. - In the lesson, add a "library" case with a no-smell example. No allowlist or disable comment in the consumer repo. -------- **Discoverer:** ruby-gems/llm-stack, session a0ddd084-33f2-4676-aac9-c6373a206c4c, 2026-11-09. Finishing llm-stack #27 (herdr runner injection) left one offense that no library design can clear. Decision recorded as an os-me Prediction (user AFK): keep one default, file this gap. Ticket-skeptic: VERDICT CREATE; root candidate none found (searched AdapterBuiltOutsideEntry, adapter-built-outside-entry, built outside entry, entry point, library entry, library gem, adapter default, runner).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jared/cc-os#1667
No description provided.