Repository navigation
feat: add the inherit_repo_rules performer option so adapters keep the repository's agent rules by default - #511
Open
BeomSeogKim wants to merge 2 commits into
Open
BeomSeogKim wants to merge 2 commits into
BeomSeogKim wants to merge 2 commits into
Conversation
…e repository's agent rules by default Both shipped adapters stripped the target repository's own agent rules: Claude with --setting-sources "" (no CLAUDE.md or project settings) and Codex with --ignore-rules (no AGENTS.md). A performer working in a user's repository therefore never saw that repository's rules. A cast performer now takes inherit_repo_rules (Boolean, default true). It travels to the adapter as execute.request.inherit_repo_rules, next to model. When it is true the adapters omit the stripping flag; when false they pass it exactly as before. Every other isolation flag is unchanged. adapter.probed records the value sent, so the journal shows whether an attempt inherited the rules; the field is optional so earlier journals stay valid. The resolved-cast projection carries the option only when it is false, so the identity of every existing cast, and of every run-owned resolved-cast.yaml, is unchanged. DESIGN names the option and its default in §3, the request field and its effect in §4 (clause and wire specimen), the adapter.probed field in B.2 (clause and specimen), and the projection exception in the A.4 partitur/resolved-cast row. The clause-staging ledger is regenerated with cmd/partitur-spec-regions from the pre-edit blob with those ranges as the classification delta; baseline pins are re-emitted, the two docmarker carrier and specimen hashes they touch are updated with each new clause counted with its neighbouring annotation run, and the region 7/8 continuation pin names the clause that now straddles that boundary. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
What changed
Both shipped adapters stripped the target repository's own agent rules from the performer: Claude passed
--setting-sources ""(noCLAUDE.mdor project settings) and Codex passed--ignore-rules(noAGENTS.md).inherit_repo_rules(Boolean, optional, defaulttrue). A non-Boolean ornullvalue is a schema error, the same asallow_advisory_enforcement.execute.request.inherit_repo_rules, next tomodel. It uses the same driver path, and no new abstraction is added.true, Claude omits--setting-sources ""and Codex omits--ignore-rules. When it isfalse, both pass the flag exactly as before. All other isolation flags stay the same (--safe-mode,--strict-mcp-config,--ignore-user-config, …).adapter.probedrecords the value that was sent, so a run's journal shows whether each attempt inherited the rules. The field is optional, so journals written before this change still validate.inherit_repo_rulesonly when it isfalse. Every existing cast keeps its hash. A run-ownedresolved-cast.yamlfrom before this change still matches itsrun.startedhash when the run resumes. An opt-out is still persisted and survives a resume.Why the default is
trueA performer working in a user's repository should see that repository's
AGENTS.md/CLAUDE.md. Other agent orchestrators inject these files by default, so stripping them loses on first contact. Stripping was chosen for reproducibility, and it is still one line away:inherit_repo_rules: false.DESIGN sentences touched
inherit_repo_rulesdefaults totrue;" (new anchorinherit-repo-rules.default).execute.request.inherit_repo_rules(anchorexecute-inherit-repo-rules.rule-suppression), andinherit_repo_rules,added to theexecuterequest specimen.adapter.probed.inherit_repo_rulesclause (anchoradapter-probed.inherit-repo-rules), andinherit_repo_rules?added to theadapter.probedspecimen (adapter-probed.payload-shapere-supplied).partitur/resolved-castrow: states the one exception to "every effective default materialized" (domain.resolved-castre-supplied).The clause-staging ledger was regenerated with
cmd/partitur-spec-regions -regenerate … -classification-delta … -emit-pins, starting from the pre-edit blob. Other updates:internal/docclause/baseline_test.gowere re-emitted.blocking-proposal.route-order, the clause that straddles that boundary after the insertion.Tests
The new tests failed before the change and pass after it.
internal/cast:TestInheritRepoRulesDefaultsTrueAndAcceptsFalse,TestCastSchemaConformance/inherit_repo_rules_boolean,TestCastSchemaConformance/inherit_repo_rules_not_null,TestResolvedCastProjectionRecordsOnlyAnOptOutOfRepoRules.TestCastDefaultsHaveEffectiveViewGoldenswas updated for the new default.internal/adapters/claude,internal/adapters/codex:TestBuildCommandStripsRepositoryRulesOnlyWhenNotInherited. The stripping flag is present only when the option isfalse. For Codex, the test also checks that--ignore-user-configstays.internal/driver:TestExecuteRequestAndAdapterProbedCarryInheritRepoRules. A default performer and an opted-out fallback each get the right request value andadapter.probedrecord, throughresolved-cast.yaml.internal/runstate:TestAdapterProbedInheritRepoRulesIsAnOptionalBoolean.The existing adapter argument-list tests are unchanged. Their requests leave the field at its zero value, which still means stripping.
Gate:
gofmt -l internal cmdis empty, andgo build ./...,go vet ./...andgo test -count=1 ./...all pass.-tags=mutationforinternal/docclause,internal/docmarkerandcmd/partitur-spec-regionsalso passes.Not in this PR
execution_dependency_hashand needs its own projection-version decision.--setting-sources, so it loads its default sources: user, project and local. A narrower choice would be--setting-sources project,local, which loads the repository's rules but not the user's. That choice was left for review, because the requested behaviour was to omit the flag.🤖 Generated with Claude Code