Repository navigation
Ratchet clients: AgentCommsProject owns its ClientSources; --ci-inputs reads CI's cuts - #3630
Merged
Merged
Conversation
…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
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #3566 (base
work/checkout-caller--P883). This returns--ci-inputsto 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: ClientSourcesis the one place that knows where the compared revisions' stack clients come from.ClientSources()clones the head's declared stack once (StackClient.revision, cached).MaterializedClientsreads CI's per-side cuts.AgentCommsProject.from_arguments(root, commands)reads--ci-inputs DIRintoMaterializedClients.read(...). It hands the remaining argv toaudit.ratchet.main. Without the flag, behaviour matches main.ClientTypeErrors.parts(repo: AgentCommsProject, ...)asksrepo.clientsper compared side. Clients still only run whensrc/agent_comms/changed, unlessrequires_clients()says otherwise (MaterializedClientsreturns True, because a companion repo can change while Core doesn't).tools/debt_ratchet.pystill only names the project:AgentCommsProject.from_arguments(Path.cwd(), commands).debt_ratchet.ClientTypeErrors/compare, so they were already broken at a7ab81e. They now buildAgentCommsProject(checkout, clients=...)and callaudit.ratchet.compare.Deleted
ClientTypeErrors.clients: a static clone, about 15 lines.ClientSources.at→StackClient.revisionalready does the same thing. Itsno-any-returnmypy error goes with it.atexit.InstallCommandsandStackSourcesstay becausefrom_argumentsuses them.Two Side families (debt, named)
The ratchet passes
audit.ratchet.Side, butClientSources.at/MaterializedClients.cutsare keyed byagent_comms.head_review.Side. Both declareref(base, head).They can't be made one family in this PR, for two reasons:
Familyregisters every subclass by snake_case name, sohead_review.BaseSide(audit.ratchet.BaseSide)clashes on"base".head_reviewis on the CLI import path, and importingpinned_auditthere costs about 125 ms per CLI call.ClientTypeErrors.cuttherefore picks the materialized cut whose ownref(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):
Familylets a member extend another root's member under the same name.head_review's sides become those members.ref-matching incutgets deleted.mypy, base a7ab81e vs head
Run as
mypy --follow-imports=silent tools/agent_comms_project.py tools/debt_ratchet.py tools/module_layers.pywithPYTHONPATH=src:tools.Probes, not tests
from_argumentswith no flag givesClientSourcesand passes through['--root','src','--base','a','--head','b'].ClientSourcesshowscut(BaseSide)→ the head_reviewBaseSidecut, andcut(HeadSide)→HeadSide.README.mdchanged,partsreturns().Not run: pytest and the ratchet. The root runs
tests/test_integration.py::test_real_client_checker_compares_the_matched_tuple_in_its_one_interpreterandtests/test_module_layers_clients.pytogether with #3566.Assumed: CI passes
--ci-inputs "$RUNNER_TEMP/paired-sources"totools/debt_ratchet.pyin #3566's workflow, as it did before a974c0f.🤖 Generated with Claude Code
https://claude.ai/code/session_01RnH6dS2Kmg1WxNnAc78YHA