Skip to content

Ratchet clients: AgentCommsProject owns its ClientSources; --ci-inputs reads CI's cuts - #3630

Merged
trissim merged 1 commit into
work/checkout-caller--P883from
claude-nra/ratchet-ci-inputs
Oct 30, 2026
Merged

trissim merged 1 commit into
work/checkout-caller--P883from
claude-nra/ratchet-ci-inputs

Conversation

@trissim

@trissim trissim commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Stacked on #3566 (base work/checkout-caller--P883). This returns --ci-inputs to the debt ratchet so #3566's two workflow lines can pass it again. #3606 took it away.

Summary: 1 commit, 4 files, +54/-33. One static stack clone deleted. mypy on the three touched tool files goes from 4 errors to 3, and no file grows.

What changed

  • AgentCommsProject.clients: ClientSources is the one place that knows where the compared revisions' stack clients come from.
    • The default ClientSources() clones the head's declared stack once (StackClient.revision, cached).
    • MaterializedClients reads CI's per-side cuts.
  • AgentCommsProject.from_arguments(root, commands) reads --ci-inputs DIR into MaterializedClients.read(...). It hands the remaining argv to audit.ratchet.main. Without the flag, behaviour matches main.
  • ClientTypeErrors.parts(repo: AgentCommsProject, ...) asks repo.clients per compared side. Clients still only run when src/agent_comms/ changed, unless requires_clients() says otherwise (MaterializedClients returns True, because a companion repo can change while Core doesn't).
  • tools/debt_ratchet.py still only names the project: AgentCommsProject.from_arguments(Path.cwd(), commands).
  • Two tests still imported the deleted debt_ratchet.ClientTypeErrors / compare, so they were already broken at a7ab81e. They now build AgentCommsProject(checkout, clients=...) and call audit.ratchet.compare.

Deleted

  • ClientTypeErrors.clients: a static clone, about 15 lines. ClientSources.at → StackClient.revision already does the same thing. Its no-any-return mypy error goes with it.
  • Unused imports atexit. InstallCommands and StackSources stay because from_arguments uses them.

Two Side families (debt, named)

The ratchet passes audit.ratchet.Side, but ClientSources.at / MaterializedClients.cuts are keyed by agent_comms.head_review.Side. Both declare ref(base, head).

They can't be made one family in this PR, for two reasons:

  • The audit's Family registers every subclass by snake_case name, so head_review.BaseSide(audit.ratchet.BaseSide) clashes on "base".
  • head_review is on the CLI import path, and importing pinned_audit there costs about 125 ms per CLI call.

ClientTypeErrors.cut therefore picks the materialized cut whose own ref(base, head) selects the same revision as the compared side. It never pairs them by name.

The owner fix belongs in refactor-audit (OpenHCSDev/refactor-audit):

  1. Family lets a member extend another root's member under the same name.
  2. head_review's sides become those members.
  3. The ref-matching in cut gets deleted.

mypy, base a7ab81e vs head

Run as mypy --follow-imports=silent tools/agent_comms_project.py tools/debt_ratchet.py tools/module_layers.py with PYTHONPATH=src:tools.

file base head
tools/debt_ratchet.py 1 1
tools/agent_comms_project.py 3 2
tools/module_layers.py 0 0

Probes, not tests

  • from_arguments with no flag gives ClientSources and passes through ['--root','src','--base','a','--head','b'].
  • A stub ClientSources shows cut(BaseSide) → the head_review BaseSide cut, and cut(HeadSide) → HeadSide.
  • With only README.md changed, parts returns ().

Not run: pytest and the ratchet. The root runs tests/test_integration.py::test_real_client_checker_compares_the_matched_tuple_in_its_one_interpreter and tests/test_module_layers_clients.py together with #3566.

Assumed: CI passes --ci-inputs "$RUNNER_TEMP/paired-sources" to tools/debt_ratchet.py in #3566's workflow, as it did before a974c0f.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RnH6dS2Kmg1WxNnAc78YHA

…s CI's cuts

#3606 moved ClientTypeErrors into AgentCommsProject with a fresh stack clone and no way to
read the integration entrypoint's materialized cuts, so #3566 had to drop --ci-inputs from
debt_ratchet.py (a974c0f). AgentCommsProject now holds one ClientSources (default: the
head's declared stack, cloned once); AgentCommsProject.from_arguments decodes --ci-inputs into
MaterializedClients. ClientTypeErrors.parts asks it per compared side and also runs when the
source requires clients (a companion can change while Core does not). The static clone in
ClientTypeErrors.clients is deleted. Two tests still importing the deleted
debt_ratchet.ClientTypeErrors/compare now build the project with its clients.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RnH6dS2Kmg1WxNnAc78YHA
Copilot AI balanced review requested due to automatic review settings October 30, 2026 02:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@trissim
trissim merged commit 88c2ea1 into work/checkout-caller--P883 Oct 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants