Repository navigation
Split the pinned-arm containment remedy by refusal code - #1049
Conversation
`_pinned_arm`'s resolve_in_root refusal carried ONE action string for every refusal code -- "keep the pin record inside its root's contracts/ directory rather than a symlink out of it" -- including the `unresolvable` code (a symlink loop, an unreadable link, a malformed path), for which "a symlink out of it" is not the defect. RULED STANDS at #1040 landing because the rule text already names the code; the action text is the part that fit one code only (#1046). Branch the action on the code: OUTSIDE_ROOT/OUTSIDE_BOUNDARY keep the existing remedy; every other code now gets "make the pin record's path resolvable inside its root's contracts/ -- no symlink loop, no unreadable link, no malformed path (document-lifecycle grammar)". EXPECTED_ACTIONS in test_families.py grows from fourteen to fifteen pinned-arm strings (the FOURTEEN prose corrected to FIFTEEN). The self-looping-symlink (m) test in test_tag_hygiene_pinned_targets.py now asserts the new string; the two boundary-escape (m) tests keep the old one, since their code is still OUTSIDE_ROOT/OUTSIDE_BOUNDARY. Wording only -- no behaviour moves. Lane: openxfactory-2 Co-Authored-By: Claude Sonnet 5 <[email protected]>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis wording-only change splits pinned-arm containment remediation by refusal code: boundary escapes retain the existing guidance, while unresolvable paths receive guidance addressing symlink loops, unreadable links, and malformed paths. Tests and the canonical action inventory are updated accordingly; no detection behavior or OpenSpec packet changes are introduced. Flow diagram for pinned-arm refusal-specific remediationflowchart TD
A[_pinned_arm finds pinned record] --> B{Refusal code}
B -->|OUTSIDE_ROOT or OUTSIDE_BOUNDARY| C[Report containment rule]
C --> D[Keep pin record inside root contracts/ directory rather than a symlink out of it]
B -->|unresolvable| E[Report resolution rule]
E --> F[Make path resolvable inside root contracts/; avoid symlink loops, unreadable links, and malformed paths]
D --> G[hit ERROR]
F --> G
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved review issues remain, and targeted tests passed.
Pull request overview
This PR splits pinned-target containment remediation guidance by refusal code without changing validation behavior.
Changes:
- Uses distinct messages for boundary escapes and unresolvable paths.
- Updates expected action coverage and the affected self-loop test.
File summaries
| File | Description |
|---|---|
tests/doc-health/test_tag_hygiene_pinned_targets.py |
Updates the unresolvable-path assertion. |
tests/doc-health/test_families.py |
Registers the additional action string and count. |
scripts/doc_health/families.py |
Branches remediation wording by refusal code. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
There was a problem hiding this comment.
Sorry @brettheap, you've used your own review budget of 250,000 diff characters for the last 7 days.
You can request another review in 5 minutes by commenting @sourcery-ai review. Upgrade to get a review now.
`origin/main` moved twelve commits since the eighth re-measurement, one of them PR #1064 archiving `add-declared-former-id`, so the merge is taken here and the re-measurement WITH it. $ python3 scripts/validate-code-surface.py . # exit 0 code_surface: 45 active proposals, 45 declaring — 4 `none`, 33 a repository list, 8 named by the register, 0 outside the grammar. archive (read, never judged): 169 proposals, 123 declaring, 3 of them outside the grammar. $ python3 scripts/validate-scope-globs.py . # exit 0 THE SECOND RE-MEASUREMENT AT WHICH THE ACTIVE CORPUS SHRANK, and a measurement rather than an inference: `git diff --name-status 3c614d3..b1df95e -- 'openspec/changes/*/proposal.md'` is exactly one `R100` — `add-declared-former-id` moving to `archive/2026-09-15-add-declared-former-id/` on its merged-plus-green realization evidence (#1064). That carrier CONFORMS — it was one of the 34, which is where the 33 comes from — and is NOT one of the eight, so no carrier arrived, NO ENTRY WENT STALE (`scan().stale` is empty) and the register stands at EIGHT untouched. The other eleven commits are PR #1064's own seven internal commits plus three that reached `main` directly while it was in flight (#1025, #1049, #1031) and this lane's own #1044; none besides the one `R100` touches `gate-code-surface-declarations/`, `code_surface.py` or `code-surface-register.yaml`, and the merge resolved ZERO conflicts. The arm the sixth exercised once now answers a second time the same way: an archiving packet makes its entry stale only if it has one, and this one, like the sixth's, was never registered. Recorded in the three places the packet keeps this — `tasks.md` § 3's transcript, `CLOSED_REGISTER`'s provenance comment and this register's header — and the eighth's "as this transcript/file stands" is demoted to "at that re-measurement" in the same edit, since a clause that means "latest" has to move every time the latest does. tests/code_surface 153, tests/scope_globs 99, tests/target_release 96, 348 for the three suites, all unchanged by the merge. Lane: openxfactory-5 (openXfactory-5) Co-Authored-By: Claude Fable 5.1 <[email protected]>



Lane: openxfactory-2 (openXfactory-2)
Summary
_pinned_arm'sresolve_in_rootcontainment refusal reused ONE actionstring for every refusal code -- "keep the pin record inside its root's
contracts/ directory rather than a symlink out of it" -- including the
unresolvablecode (a symlink loop, an unreadable link, a malformedpath), for which "a symlink out of it" is not the defect. Surfaced by
Copilot on PR #1040 (rounds 1 and 8); RULED STANDS at landing because
the rule text already names the code and round 1 deliberately chose
one remedy string per remedy CLASS. #1046 files the remaining wording
gap as a standalone finding.
This PR branches the action string on the refusal code, wording only,
no behaviour change:
OUTSIDE_ROOT/OUTSIDE_BOUNDARYkeep the existing remedy: "keepthe pin record inside its root's contracts/ directory rather than a
symlink out of it (document-lifecycle grammar)".
unresolvableclass) now gets: "make the pinrecord's path resolvable inside its root's contracts/ -- no symlink
loop, no unreadable link, no malformed path (document-lifecycle
grammar)".
EXPECTED_ACTIONSintests/doc-health/test_families.pygrows fromfourteen to fifteen pinned-arm strings (the FOURTEEN prose corrected to
FIFTEEN in both the docstring and the inline comment). The
self-looping-symlink (m) test in
tests/doc-health/test_tag_hygiene_pinned_targets.py(
test_a_self_looping_symlink_record_cannot_be_resolved_and_reads_nothing)now asserts the new string; the two boundary-escape (m) tests
(
test_a_candidate_symlink_leaving_the_repository_is_refusedandtest_a_candidate_symlink_inside_the_repository_but_outside_contracts_is_refused)keep the old one, since their refusal code is still
OUTSIDE_ROOT/OUTSIDE_BOUNDARY.Code-only change; no OpenSpec packet (per brief).
Files changed
scripts/doc_health/families.py--_pinned_arm: branch thehit(...)action string on the refusal code instead of one shared literal.
tests/doc-health/test_families.py-- add the new action string toEXPECTED_ACTIONS(14 -> 15 pinned-arm entries); FOURTEEN -> FIFTEENin the docstring and inline comment.
tests/doc-health/test_tag_hygiene_pinned_targets.py-- update theself-looping-symlink (m) test's asserted action string; the two
boundary-escape (m) tests are unchanged.
Validation
pytest -q tests/doc-health -p no:cacheprovider-- 1816 passed, 1skipped, 7 failed. The 7 failures are pre-existing and unrelated:
test_ideation_readiness.py(x3) andtest_readiness_dispatch.py(x1) hit a validator harness error, and
test_sentinel_vocabulary.py(x2) /
test_status_reader_real_lines.py(x1) raisecarved_reach.CarveReachUnavailablebecause this fresh clone has noopenDox/openXdoxsubmodules materialized (git submodule statusshows both
-prefixed). Confirmed identical on this branch's parentcommit with the diff stashed -- same 7 tests fail the same way with
none of this PR's changes applied.
pytest -q tests/doc-health/test_families.py tests/doc-health/test_tag_hygiene_pinned_targets.py-- 78 passed.python3 scripts/proposal-support.py . verify-- "proposal supportverification ok".
OPENSPEC_TELEMETRY=0 openspec validate --all --strict | tail -1--"Totals: 106 passed, 2 failed (108 items)", the same two pre-existing
failures as origin/main (
add-chain-attestation,add-composed-view-authoring).python3 scripts/validate-sequenced-after.py . --ledger-diff--"per-change sweep ledger consistent with the corpus (214 rows)."
(no new change packet, so no new ledger row is owed).
python3 scripts/doc-health.py --single-repo . --as-of <today> --family tag-hygiene-- 4 pre-existing findings, all about acontracts/openxwallet-pin.yamlmissing acapabilities:enumeration in two
ideation/staging/docs; identical with the diffstashed, so unrelated to this change.
Open questions
None.
refs #1046
🤖 Generated with Claude Code
Summary by Sourcery
Differentiate pinned-arm containment remediation guidance by refusal code without changing validation behavior.
Bug Fixes:
Tests: