Skip to content

Realize extend-prose-tagging-target-to-pinned-capabilities (D-5, one PR): pinned-target resolution arm, tests, four markers, docs, INDEX - #1040

Merged
brettheap merged 11 commits into
mainfrom
change/realize-extend-prose-tagging-target-to-pinned-capabilities
Sep 14, 2026
Merged

brettheap merged 11 commits into
mainfrom
change/realize-extend-prose-tagging-target-to-pinned-capabilities

Conversation

@brettheap

@brettheap brettheap commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Lane: openxfactory-2 (openXfactory-2)

REALIZATION of extend-prose-tagging-target-to-pinned-capabilities — design D-5's ONE pull request, on Brett Heap's word "realize it" (2026-09-14; #992 comment 5662218844; realization CLAIMED on #992, comment 5662204807), after the packet was RATIFIED with the fail-closed tightening of task 1.2 by PR #1019 → e6e1c968 (RATIFIED record #992 5659201929). Opened as DRAFT; its merge is a separate word. Authored on a fresh clone by the lane's Opus author (three commits, each carrying the packet's own reasoning); reviewed and completed by the lane after the author was stopped twice by the account session limit.

What this realizes — the four surfaces, in the packet's words

  1. The resolver arm (scripts/doc_health/families.py, § 3.1–3.2). A candidate marker's target= may name pinned:<pin-id>/<capability>. THE REGEXES DO NOT MOVE (D-1: _CAND_OPEN and _ATTR already admit : and /); the LEXICAL GRAMMAR — exactly two [a-z0-9]+(-[a-z0-9]+)* components joined by one / — is checked BEFORE any pin-record path is built. The arm FAILS CLOSED (D-2 as re-ruled 2026-09-13): a pinned target resolves only where the pin id resolves — under the in-tree arm's own root precedence, document root then openxFactory root — to a kind: pinned_contract_manifest record COMPLETE FOR ITS RECORD SHAPE, that record carries a well-formed non-empty top-level capabilities: enumeration, and <capability> is a member of it. Every finding names the root it resolved against or failed to; ABSENT and MALFORMED enumerations are two findings (publisher's act vs. repair the member) with one outcome; the in-tree arm never judges a pinned value; xspec:supersedes spec=pinned:… is refused with the scenario's sentence (D-1.1). verify_pin: is compared against the verifier the adapter tracks and never followed; a differing value is a finding BESIDE the resolution.
  2. The tests (tests/doc-health/, § 3.3 (a)–(p), every lettered case). test_tag_hygiene_pinned_targets.py drives (a)–(o) over a new committed corpus fixtures/tag-hygiene-pinned/ plus tmp_path trees for the cases no repository should carry (a corrupt record per shape; the four containment escapes and their positive; the three verify_pin: non-use cases; the two-root aggregate and the single-root negative), asserting (h) and (m) on the READ SURFACE. test_pin_shape_adapter.py is (p): the RECORD leg over each real record in contracts/ (accepted as it stands; refused NAMING each table member removed; still accepted with each of the 38 non-table, non-kind members removed) and the GUARD leg importing each verifier at its FIXED, AUTHORED path — 29 member entries, 27 on the guard leg, 2 (files under shape (a)) on the citation route, re-READ at the cited line. Neither leg asserts sufficiency. EXPECTED_ACTIONS gains the arm's TWELVE action strings (j), and both derivations widen to reach them.
  3. The four markers + the docs (§ 3.4–3.5). openxwallet-neutral-home.md lines 222, 242, 280 and notebook-access-wallet-governance.md line 107 now read target=pinned:openxwallet/openxwallet; docs/document-lifecycle.md's Prose Tagging Markers section carries the form, its scope (candidate target= only) and D-3's stale-target sentence verbatim.
  4. The stale INDEX line (§ 3.6): ideation/staging/INDEX.md's "all targeting openxwallet, all resolving" is made TRUE rather than deleted.

tasks.md boxes 3.1–3.6 are ticked and no other byte of that file moves; 3.7 (evidence) is TICKED (refreshed in round 7, c111fec0) citing the final code tree da54bed4 and its green run 34897473169; § 4 stays open.

The file bound (proposal.md:2 code_surface:) — all three admitted further files used, none beyond

  • (1) the shape-adapter module: scripts/doc_health/pin_shapes.py — the ONE code-fixed route; pure, non-executing; holds the per-shape table with each entry's measured script:line citation; imports no verifier.
  • (2) the shared containment helper: scripts/pin_containment.py — neutral, top of scripts/ beside output_boundary.py/path_slug.py, standard library only; receives the RESOLVING ROOT AS A PARAMETER; boundary_dir checks <root>/contracts is a real, non-symlink, non-redirecting directory BEFORE any candidate.
  • (3) scripts/validate-pin-registrations.py as the helper's second caller — resolve_in_tree keeps its name, signature and refusal TEXT and delegates.
  • No pin record, schema, verifier, contracts/ byte, openspec/specs/ file, spec delta, .openspec.yaml or README byte moves (git diff --stat origin/main -- <those> is empty).

THE HONEST OUTCOME: the four findings CHANGE FORM and stay FOUR

Under fail-closed D-2, retargeting does NOT clear the four error-band tag-hygiene findings, because contracts/openxwallet-pin.yaml carries no capabilities: enumeration. They change from unresolved target=openxwallet — name a capability under openspec/specs/ or an active change to unresolved pinned target=pinned:openxwallet/openxwallet at line N: contracts/openxwallet-pin.yaml in root <root> carries no capabilities: enumeration — the publisher adds capabilities: to the pin record through a neutral-product-pin change. Still four, still error, and for the first time naming the act that clears them — the PUBLISHER's, no part of this packet.

Evidence at 16ce87d9 (fresh full clone)

  • doc-health scripts/doc-health.py --single-repo . --as-of 2026-09-14: Findings: 31 critical, 6 error, 28 warning, 24 info. New regressions vs previous report: 0. Finding-by-finding diff against a worktree at the base dd073746 (same clone): the ONLY content difference is the four tag-hygiene findings changing form — the four unresolved target=openxwallet at line 107/222/242/280 findings are GONE and four unresolved pinned target=pinned:openxwallet/openxwallet at line 107/222/242/280: contracts/openxwallet-pin.yaml in root <root> carries no capabilities: enumeration findings appear at the same four paths and lines; totals 31/10/28/24 → 31/6/28/24 because four release-inventory-drift errors that appear in ANY git-worktree checkout regardless of commit (measured: this same head shows 1 such error in the branch checkout and 5 in a git worktree of it) are counted in the worktree base and not in the branch checkout — a quirk of how that family reads a worktree, unrelated to this change and noted for the lane, not fixed here
  • pytest (targeted, the suites the change touches): pytest -q tests/doc-health tests/pin_registrations tests/openxwallet_pin tests/openreposhape_pin tests/opendox_pin tests/openxdox_pin tests/proposal-support tests/sequenced_after -p no:cacheprovider → 2460 passed, 7 warnings, 74 subtests passed in 400.41s — the CI pytest-suite at this head is the tree-grain evidence § 3.7 cites.
  • python3 scripts/proposal-support.py . verify → proposal support verification ok; python3 scripts/validate-sequenced-after.py . --ledger-diff → per-change sweep ledger consistent with the corpus (214 rows); python3 scripts/validate-scope-globs.py . → passed; python3 scripts/validate-pin-registrations.py → OK openxwallet-pin … OK contracts/manifest.yaml: 2 pin registration(s) cohere; OPENSPEC_TELEMETRY=0 openspec validate --all --strict → Totals: 107 passed, 2 failed (109 items) — the same two pre-existing, unrelated MODIFIED-scenario omissions (add-chain-attestation, add-composed-view-authoring) as origin/main.
  • A local run of the WHOLE suite in the lane's container stopped at collection on 11 unrelated tests/ideation-dashboard errors (openxdox.domain_profile.AlreadyRegistered, an environment condition of that container); the required CI pytest-suite is the arbiter for the full suite.

Not done by this PR — separate later words, none given

Merge (Brett's word); tick of 3.7 (lane, after green CI); archive (§ 4, on merged-plus-green realization evidence via scripts/proposal-support.py); the publisher's capabilities: enumeration (openXwallet, neutral-product-pin — recorded as prose, not filed, not owed).

Fix round 1 (9e40d749)
Copilot's review of 16ce87d9 (three threads, four suppressed comments), all RULED ACCEPT by the lane (fix1040-round1.md) except the 3.7 nit: (R1) a missing PyYAML no longer returns silently — it is a controlled ERROR finding with its own action string, so the fail-closed check cannot pass open (EXPECTED_ACTIONS → thirteen); (R2) _pin_record_text catches UnicodeError beside OSError — a non-UTF-8 record is the unreadable-record finding, run completes; (R3) every Path.resolve() in the containment helper is guarded (RuntimeError on a symlink loop, OSError on an unreadable link) and maps to a new refusal code unresolvable; the arm branches on the code, never the reason text, and reuses the containment action; (R4) pinned_by_commit_only: MEASURED verify-openxwallet-pin.py:443 / validate-openreposhape-pin.py:487 read pin.get(...) or [], so every falsey value is empty and admitted — the adapter refusing null was WIDER than the guard; (R5) dispositions: null: MEASURED validate-openspec-cli-pin.py:801-803 if raw is None: return [] — accepted; (R6) fullmatch for capability names and the pinned value (a YAML block scalar can carry a trailing newline). Tests added for each. 3.7 (the suppressed nit): that box is the EVIDENCE box the lane ticks after THIS round's CI is green, citing the run — as stated above; it was not "claimed ticked". Threads replied and resolved.
EVIDENCE at 9e40d749: pytest -q tests/doc-health tests/pin_registrations -p no:cacheprovider → 1881 passed, 7 warnings; --family tag-hygiene doc-health still shows exactly the four unresolved pinned target errors naming contracts/openxwallet-pin.yaml; verifiers/contracts/specs untouched (git diff --stat origin/main -- … empty).

Fix round 2 (62bc53e1)
Copilot's pass on 9e40d749 (0 threads, ONE suppressed comment, pin_shapes.py:303) RULED ACCEPT by the lane (fix1040-round2.md): the product-identity entry admitted either spelling for EVERY shape-(a) record, so contracts/openxwallet-pin.yaml minus submodule_path was still ACCEPTED (it also carries source_repository) although verify-openxwallet-pin.py:194 refuses it — the adapter was NARROWER than the guard for a known record, and the record leg had removed both spellings. D-2 resolves that entry AT THE RECORD GRAIN to the record's own verifier's set, and tasks 3.3(p) counts source_repository among openxwallet-pin.yaml's nine NON-table members. Now: a code-fixed PRODUCT_IDENTITY_BY_PIN beside TRACKED_VERIFIERS (keyed by the PIN ID from the marker, never by the record's verify_pin:) makes judge(record, pin_id) require submodule_path for openxwallet and source_repository for openreposhape, the other spelling being a non-table member of that record; an UNKNOWN pin id keeps the either-spelling reading and still refuses a record naming no product. The record leg now removes the ONE spelling each record's verifier reads (openxwallet minus submodule_path → REFUSED naming it; minus source_repository → accepted), and the 38-member test asserts the per-record LISTS by name. No action string, verifier, pin record, spec or delta byte moves; the file bound is unchanged. (No thread to reply to — suppressed.)
EVIDENCE at 62bc53e1: pytest -q tests/doc-health tests/pin_registrations -p no:cacheprovider → 1881 passed, 7 warnings; --family tag-hygiene doc-health still exactly the four unresolved pinned target errors; forbidden-surface diff empty.

Fix round 3 (0138384f)
Copilot's pass on 62bc53e1 (one thread, one suppressed comment), both RULED ACCEPT by the lane (fix1040-round3.md): (R1) Path.resolve() raises ValueError on a claimed path carrying an embedded NUL — which a YAML registration can supply — so the containment helper now maps ValueError (beside OSError/RuntimeError) to the unresolvable refusal and resolve_in_tree refuses instead of tracing back; helper-level test added (a marker cannot carry NUL; the lexical grammar refuses it first). (R2, suppressed) the resolver's module-level bare from pin_containment import … works only with scripts/ on sys.path, while this repository's own tests reach the package as scripts.doc_health.*; it now falls back to the package-relative spelling (scripts is a namespace package; the neutral helper is its sibling), proven by a fresh-interpreter test from the repository root with no PYTHONPATH. Thread replied and resolved. No action string, verifier, pin record, spec or delta byte moves.
EVIDENCE at 0138384f: pytest -q tests/doc-health/test_tag_hygiene_pinned_targets.py tests/doc-health/test_pin_shape_adapter.py tests/pin_registrations tests/doc-health/test_import_direction.py -p no:cacheprovider → 145 passed; the CI pytest-suite at this head is the tree-grain run § 3.7 cites.

Round 4 (f4198a57, tests only) — RULED STANDS; and 3.7 TICKED (0b1496ef)
Copilot's suppressed comment on 0138384f (pin_shapes.py:517: "an unknown pin carrying both submodule_path and source_repository resolves, though the shape is exactly one product-identity member and the union must be refused") is RULED STANDS by the lane (fix1040-round4.md): D-2's "EXACTLY ONE product-identity member" describes the TABLE ENTRY, resolved per record — not a prohibition on a record CARRYING the other spelling as an extra top-level member; "the UNION would refuse openxwallet-pin.yaml" is about REQUIRING both, and the real openxwallet record carries BOTH spellings today. Neither shape-(a) verifier refuses a record for carrying the spelling it does not read, so an adapter refusing co-presence would be WIDER than the guards — the defect the two-leg test forbids. Pinned by a test (unknown pin with both → accepted; with neither → refused naming both); no adapter byte moves.
Task 3.7 is now ticked (0b1496ef, tasks.md only) at the tree grain: code tree 0138384f, required pytest-suite GREEN there (run 34875251402, all six required green); doc-health --single-repo 0 new regressions, and finding-by-finding against dd073746 the only content change is the four tag-hygiene findings changed in form (re-measured with --family tag-hygiene at 9e40d749, 62bc53e1, 0138384f: exactly four, still error). The four do not reach zero. § 3 carries no unticked box; § 4 (archive) stays open for a separate word. The two commits after 0138384f are tests-only and the tick; CI re-runs on them.
MERGE WORD GIVEN (see Round 6 below); the lane lands on green at da54bed4. Merge as SQUASH (the lane's Rule 6 landing), a separate word from Brett Heap; none given.

Round 5 (e1138d8d, docstrings + one assertion; no code byte)
Copilot's two suppressed comments on 0b1496ef read the docstrings ("satisfied by either … refuses only NEITHER"; "no record must carry both") against the loop and found the WORDS wrong. RULED by the lane (fix1040-round5.md): the BEHAVIOUR stands — for an unknown pin the product-identity entry is MISSING only when neither spelling is present, a record may carry both (the real openxwallet record does), and a spelling that IS present is judged by its own form, a present-but-malformed one being MALFORMED exactly as an optional member present in the wrong form is (a broken byte is never a silent pass). required_spellings's docstring, the _PRODUCT_IDENTITY comment and the round-4 test now say exactly that, and one more assertion pins it (unknown pin, valid submodule_path + malformed source_repository → MALFORMED naming source_repository).

Round 6 (da54bed4)
Copilot's three suppressed comments on e1138d8d, all RULED ACCEPT (fix1040-round6.md): (R1) a DANGLING contracts symlink was classified missing because exists() follows the link — the symlink test now comes first and the boundary is REDIRECTING (test added); (R2) a document whose repository has NO resolution root in the run passed silently (nothing to search, nothing emitted) where the in-tree arm reports an unresolved target — it is now one controlled finding naming the repository, with its own action (EXPECTED_ACTIONS → fourteen; test added); (R3) the boundary refusal's action was reused for four refusal codes with words that fit one — replaced by one neutral sentence (present, a directory, not a symlink or a redirection), the rule text carrying the specific reason. No verifier, pin record, spec or delta byte moves.
EVIDENCE at da54bed4: pytest -q tests/doc-health/test_tag_hygiene_pinned_targets.py tests/doc-health/test_pin_shape_adapter.py tests/doc-health/test_families.py tests/pin_registrations -p no:cacheprovider → 191 passed.
Brett Heap's MERGE WORD stands (#992 5670841396, "merge 1040 when green, then post the records"): the lane lands this PR under Rule 6 once the six required checks are green at da54bed4, ruling any further Lite-effort suppressed nit STANDS unless substantive.

Round 7 (c111fec0, no code byte) — the 3.7 evidence refreshed
Copilot's two suppressed comments on da54bed4 ("Approval recommended"), both RULED ACCEPT (fix1040-round7.md): the ticked 3.7 evidence cited the 0138384f tree and called the later commits tests-only, which round 6 made untrue — it now cites the FINAL code tree da54bed4 and its green required pytest-suite run 34897473169, with the --family tag-hygiene re-measure at that tree (exactly four findings, changed in form, still error); and the test name repositorys → repositories. The one commit after da54bed4 is this refresh plus that rename.
Landing on green at c111fec0 under Brett Heap's standing word (#992 5670841396).

refs #992

🤖 Generated with Claude Code

Summary by Sourcery

Extend prose candidate tagging to resolve capabilities from validated pinned product records while failing closed on malformed, unsafe, or unsupported references.

New Features:

  • Support resolving prose candidate markers against pinned capabilities using validated pin records and capability enumerations.
  • Add fail-closed validation for pinned target grammar, pin record shapes, capability membership, containment boundaries, verifier metadata, and unsupported supersedes usage.

Bug Fixes:

  • Prevent pinned target resolution from following path escapes, redirected contract registries, malformed records, or verifier paths supplied by pin data.
  • Correct documentation and index descriptions for capabilities that have moved out of the repository.

Enhancements:

  • Introduce shared pin containment utilities and a pure adapter for validating supported pinned contract manifest shapes.
  • Retarget four prose markers to the pinned capability form and preserve distinct diagnostics for publisher, record, and marker defects.

Documentation:

  • Document the pinned candidate target form, its resolution rules, scope restrictions, and stale-target handling.

Tests:

  • Add comprehensive coverage for pinned target resolution, malformed and incomplete pin records, containment escapes, multi-root precedence, verifier non-use, and shape-adapter consistency.

Chores:

  • Mark realization tasks 3.1–3.6 complete and update the staging index to reflect unresolved pinned targets.

brettheap and others added 3 commits September 14, 2026 15:51
`extend-prose-tagging-target-to-pinned-capabilities` § 3.1-3.2. An
`xspec:candidate` marker's `target=` may now name a capability of a neutral
product this repository pins, as `pinned:<pin-id>/<capability>`, and the arm
FAILS CLOSED (D-2 as re-ruled 2026-09-13, #992 comment 5649935136): a pinned
target resolves only where the pin id resolves to a `kind:
pinned_contract_manifest` record COMPLETE FOR ITS RECORD SHAPE, that record
carries a well-formed non-empty top-level `capabilities:` enumeration, and the
capability is a member of it.

THE REGEXES DO NOT MOVE. `_CAND_OPEN`'s `[^\s>]+` and `_ATTR`'s `\S+` already
admit `:` and `/` — which is why this form was chosen — so the LEXICAL GRAMMAR
is the guard instead, and it is checked BEFORE any pin-record path is built or
any file is read: validating after building a path is how `pinned:../../etc/…`
becomes a read outside the registry.

`scripts/doc_health/pin_shapes.py` is the ONE CODE-FIXED ROUTE (further file 1
of the three `proposal.md:2` admits). It holds the per-shape required-member
table — each entry the shape's SHAPE-GUARD-REQUIRED SET, cited script:line from
the verifier that refuses it — reads the record and nothing else, and never
executes, imports or opens a path a record selects. `verify_pin:` is data the
arm may COMPARE and must not follow; a value differing from what the adapter
tracks is a controlled finding BESIDE the resolution.

`scripts/pin_containment.py` is the shared containment helper (further file 2),
neutral at the top of `scripts/` on the precedent of `output_boundary.py` and
`path_slug.py`, and `scripts/validate-pin-registrations.py` becomes its second
caller (further file 3) with its own refusal text unchanged. The helper receives
the RESOLVING ROOT AS A PARAMETER — a module-global root cannot speak for the
per-repository and fixture roots this family runs against — and checks the
root's `contracts/` boundary BEFORE any candidate: a boundary that can be
redirected is no boundary, so a `contracts` that is itself a symlink refuses for
that root with nothing read.

Every finding names the root it resolved against or failed to, the in-tree arm
is unchanged and never judges a pinned value, and a `supersedes` `spec=` that
carries the reserved prefix is refused (D-1.1).

Lane: openxfactory-2
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
`extend-prose-tagging-target-to-pinned-capabilities` § 3.3(a)-(p), every
lettered case.

`tests/doc-health/test_tag_hygiene_pinned_targets.py` carries (a)-(o) over a new
committed corpus, `tests/doc-health/fixtures/tag-hygiene-pinned/` — kept apart
from `fixtures/tag-hygiene/` so `test_tag_hygiene`'s own assertions stay true —
plus `tmp_path` trees for the cases no repository should carry: a corrupt record
per shape, the four containment escapes (two the candidate's, two the boundary's
own) with their positive, the three `verify_pin:` non-use cases and the
two-root aggregate. The enumeration prerequisite gets all four of its states,
and ABSENT and MALFORMED are asserted as TWO texts with ONE outcome. (h) and (m)
assert on the READ SURFACE that no path was built and nothing was read, not on a
finding's text.

`tests/doc-health/test_pin_shape_adapter.py` is (p): the RECORD leg over each
real record in `contracts/` (accepted as it stands; refused and NAMING each of
its table members removed; still accepted with each of the 38 non-table,
non-`kind` members removed) and the GUARD leg, which imports each verifier at
its FIXED, AUTHORED path and calls the cited source-free guard on the record
minus the member. 29 member entries, 27 on the guard leg and 2 — `files` under
shape (a) — on the citation route, where the test RE-READS the quoted refusal at
the cited line rather than running it. Neither leg asserts sufficiency, and the
test says so where it asserts the `pinned_by_commit_only:` negative. It also
carries (l)'s missing+malformed matrix at the member grain.

`EXPECTED_ACTIONS` gains the arm's TWELVE new action strings (3.3(j)) — the
table that keeps the pin-registry remedy from drifting back to the in-tree one —
and both derivations widen to reach them: the pinned corpus behaviourally, and
`harvest_static`'s scope by naming the arm's two functions.

Lane: openxfactory-2
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
`extend-prose-tagging-target-to-pinned-capabilities` § 3.4-3.6.

The four markers issue #992 was filed for take the pinned form —
`openxwallet-neutral-home.md` lines 222, 242 and 280 and
`notebook-access-wallet-governance.md` line 107, re-measured at this branch's
base. UNDER THE FAIL-CLOSED D-2 THIS DOES NOT CLEAR THEM, and nothing here
claims it does: `contracts/openxwallet-pin.yaml` carries no `capabilities:`
enumeration, so the four CHANGE FORM and stay four, still `error`-band — from
"unresolved target=openxwallet — name a capability under openspec/specs/", which
instructed the author to write something false, to an unresolved PINNED target
naming the record, the root and the PUBLISHER's act. They reach zero when
openXwallet's pin publishes an enumeration, which is the publisher's act and no
part of this packet.

`docs/document-lifecycle.md`'s Prose Tagging Markers section gains the form, its
grammar, its scope (candidate `target=` only, per D-1.1) and D-3's stale-target
sentence verbatim — a rule the house had twice reasoned and never written down.

`ideation/staging/INDEX.md`'s "all targeting `openxwallet`, all resolving"
sentence, false since 2026-08-28, is made TRUE rather than deleted.

`tasks.md` boxes 3.1-3.6 are ticked and no other byte of that file moves; 3.7 is
evidence the orchestrator ticks after CI, and § 4 stays open.

Lane: openxfactory-2
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@sourcery-ai

sourcery-ai Bot commented Sep 14, 2026

Copy link
Copy Markdown

Reviewer's Guide

This PR realizes pinned capability targeting end to end: it adds a fail-closed, containment-safe resolver backed by a pure pin-shape adapter and extensive tests, updates shared registration containment, retargets four prose markers, and documents the resulting publisher-owned unresolved state.

Sequence diagram for pinned capability target resolution

sequenceDiagram
    participant Marker as Candidate marker
    participant Hygiene as fam_tag_hygiene
    participant Containment as pin_containment
    participant Record as Pin record
    participant Adapter as pin_shapes

    Marker->>Hygiene: target=pinned:<pin-id>/<capability>
    Hygiene->>Hygiene: Validate pinned target grammar
    Hygiene->>Containment: boundary_dir(root)
    Containment-->>Hygiene: contracts boundary or refusal
    Hygiene->>Containment: resolve_in_root(record, root, boundary)
    Containment-->>Hygiene: Record path or refusal
    Hygiene->>Record: _pin_record_text(path)
    Record-->>Hygiene: YAML text
    Hygiene->>Adapter: judge(content)
    Adapter-->>Hygiene: Record-shape verdict
    Hygiene->>Adapter: enumeration(content)
    Adapter-->>Hygiene: capabilities state
    Hygiene-->>Marker: Resolve or emit fail-closed finding
Loading

File-Level Changes

Change Details Files
Added fail-closed resolution for pinned capability targets in prose-tagging health checks.
  • Recognize and validate the exact pinned:<pin-id>/<capability> grammar before filesystem access.
  • Resolve pin records using existing repository-root precedence and a contracts-boundary check.
  • Require the pinned contract-manifest kind, shape-complete record, and valid non-empty capability enumeration.
  • Report root, record, enumeration, containment, and verifier-metadata defects with dedicated actions.
  • Reject the pinned form in xspec:supersedes spec= while leaving the in-tree capability arm unchanged.
scripts/doc_health/families.py
scripts/doc_health/pin_shapes.py
scripts/pin_containment.py
scripts/validate-pin-registrations.py
Established adapter and containment coverage for pinned-target safety and pin-record shape validation.
  • Define pure, non-executing per-shape validation tables for source, tree-digest, and published-artifact pins.
  • Track verifier citations and test required-member equivalence against real contract records.
  • Share path containment logic between doc-health and pin-registration validation.
  • Cover malformed records, lexical and symlink escapes, root precedence, unreadable data, and non-use of verify_pin:.
tests/doc-health/test_pin_shape_adapter.py
tests/doc-health/test_tag_hygiene_pinned_targets.py
tests/doc-health/test_families.py
tests/doc-health/fixtures/tag-hygiene-pinned/
Retargeted prose markers and documented the pinned-target lifecycle and fail-closed semantics.
  • Change four candidate markers to target=pinned:openxwallet/openxwallet.
  • Document grammar, candidate-only scope, enumeration prerequisites, and stale-target handling.
  • Update the staging index to describe the markers as unresolved pinned targets and identify the publisher-owned remedy.
  • Mark realization tasks 3.1–3.6 complete.
docs/document-lifecycle.md
ideation/staging/openxwallet-neutral-home/openxwallet-neutral-home.md
ideation/staging/notebook-access-wallet-governance/notebook-access-wallet-governance.md
ideation/staging/INDEX.md
openspec/changes/extend-prose-tagging-target-to-pinned-capabilities/tasks.md

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

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.

🟡 Changes recommended

Unresolved critical and moderate review findings remain, along with a task-status inconsistency.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Extends doc-health prose-tagging to resolve pinned:<pin-id>/<capability> targets with fail-closed validation, containment checks, tests, and documentation.

Changes:

  • Adds pinned-target resolution, pin-shape validation, and shared containment handling.
  • Adds resolver, verifier-equivalence, malformed-record, and boundary tests.
  • Retargets four markers and updates the staging index.
  • Documents the target grammar and stale-target behavior.
File summaries
File Summary / final review note
tests/doc-health/test_tag_hygiene_pinned_targets.py Tests pinned-target behavior, malformed records, boundaries, precedence, and verifier non-use.
tests/doc-health/test_pin_shape_adapter.py Tests pin-shape and verifier equivalence.
tests/doc-health/test_families.py Covers the new tag-hygiene actions and derivations.
tests/doc-health/fixtures/tag-hygiene-pinned/alpha/openspec/specs/widget/spec.md In-tree capability fixture.
tests/doc-health/fixtures/tag-hygiene-pinned/alpha/docs/wrong-kind.md Wrong-kind scenario fixture.
tests/doc-health/fixtures/tag-hygiene-pinned/alpha/docs/supersedes-pinned.md Pinned supersedes rejection fixture.
tests/doc-health/fixtures/tag-hygiene-pinned/alpha/docs/resolving.md Successful resolution fixture.
tests/doc-health/fixtures/tag-hygiene-pinned/alpha/docs/no-such-pin.md Missing-pin fixture.
tests/doc-health/fixtures/tag-hygiene-pinned/alpha/docs/malformed-value.md Malformed target fixture.
tests/doc-health/fixtures/tag-hygiene-pinned/alpha/docs/invalid-pin.md Invalid-pin fixture.
tests/doc-health/fixtures/tag-hygiene-pinned/alpha/docs/enumeration-omits.md Omitted-capability fixture.
tests/doc-health/fixtures/tag-hygiene-pinned/alpha/docs/enumeration-malformed.md Malformed-enumeration fixture.
tests/doc-health/fixtures/tag-hygiene-pinned/alpha/docs/enumeration-absent.md Absent-enumeration fixture.
tests/doc-health/fixtures/tag-hygiene-pinned/alpha/contracts/workflow-kind-pin.yaml Pin-shape fixture.
tests/doc-health/fixtures/tag-hygiene-pinned/alpha/contracts/tree-digest-pin.yaml Pin-shape fixture.
tests/doc-health/fixtures/tag-hygiene-pinned/alpha/contracts/scalar-enumeration-pin.yaml Enumeration-shape fixture.
tests/doc-health/fixtures/tag-hygiene-pinned/alpha/contracts/published-artifact-pin.yaml Pin-shape fixture.
tests/doc-health/fixtures/tag-hygiene-pinned/alpha/contracts/openxwallet-pin.yaml OpenXwallet pin fixture.
tests/doc-health/fixtures/tag-hygiene-pinned/alpha/contracts/null-enumeration-pin.yaml Null-enumeration fixture.
tests/doc-health/fixtures/tag-hygiene-pinned/alpha/contracts/no-path-only-pin.yaml Pin-shape fixture.
tests/doc-health/fixtures/tag-hygiene-pinned/alpha/contracts/no-integrity-pin.yaml Pin-shape fixture.
tests/doc-health/fixtures/tag-hygiene-pinned/alpha/contracts/no-commit-pin.yaml Pin-shape fixture.
tests/doc-health/fixtures/tag-hygiene-pinned/alpha/contracts/named-capability-pin.yaml Capability fixture.
tests/doc-health/fixtures/tag-hygiene-pinned/alpha/contracts/mixed-shape-pin.yaml Mixed-shape fixture.
tests/doc-health/fixtures/tag-hygiene-pinned/alpha/contracts/mapping-enumeration-pin.yaml Mapping-enumeration fixture.
tests/doc-health/fixtures/tag-hygiene-pinned/alpha/contracts/kind-only-pin.yaml Minimal pin-shape fixture.
tests/doc-health/fixtures/tag-hygiene-pinned/alpha/contracts/item-enumeration-pin.yaml Item-enumeration fixture.
tests/doc-health/fixtures/tag-hygiene-pinned/alpha/contracts/evil-pin.yaml Containment-boundary fixture.
tests/doc-health/fixtures/tag-hygiene-pinned/alpha/contracts/empty-enumeration-pin.yaml Empty-enumeration fixture.
tests/doc-health/fixtures/tag-hygiene-pinned/alpha/contracts/absent-enumeration-pin.yaml Absent-enumeration fixture.
scripts/validate-pin-registrations.py Reuses shared containment validation.
scripts/pin_containment.py Adds shared containment checks. Final comment: moderate (2 votes), line 101, resolution failures such as symlink loops should produce controlled refusals.
scripts/doc_health/pin_shapes.py Adds pure pin-shape validation. Final comments: moderate (1 vote), line 208, preserve dispositions: null as empty; moderate (1 vote), line 575, use exact matching for capability items; moderate (1 vote), line 160, preserve falsey pinned_by_commit_only semantics.
scripts/doc_health/families.py Implements pinned-target resolution. Final comments: critical (2 votes), line 1629, report unavailable PyYAML explicitly; moderate (3 votes), line 1534, catch UnicodeError for unreadable records.
openspec/changes/extend-prose-tagging-target-to-pinned-capabilities/tasks.md Updates realization tasks. Final comment: nit (1 vote), line 609, item 3.7 remains unchecked despite the description claiming it was ticked.
ideation/staging/openxwallet-neutral-home/openxwallet-neutral-home.md Retargets three prose markers.
ideation/staging/notebook-access-wallet-governance/notebook-access-wallet-governance.md Retargets one prose marker.
ideation/staging/INDEX.md Updates target-resolution status.
docs/document-lifecycle.md Documents pinned targets, scope, and stale-target handling.
Review details

Suppressed comments (4)

openspec/changes/extend-prose-tagging-target-to-pinned-capabilities/tasks.md:611

  • The PR description says item 3.7 has been ticked after the green required pytest-suite run, but the realization packet still leaves item 3.7 unchecked immediately below this changed section. Please either add the cited tree-grain evidence and tick it once that run is green, or correct the description to reflect the packet's actual status.
- [x] 3.6 Correct `ideation/staging/INDEX.md:2262-2265`, which still describes
  three `openxwallet` blocks as "all resolving" and has been false since
  2026-08-28.

scripts/doc_health/pin_shapes.py:212

  • The tracked CLI verifier treats an explicit dispositions: null the same as an absent key (validate-openspec-cli-pin.py:801-803 returns an empty list when raw is None), but this optional-member predicate rejects None whenever the key is present. A valid record can consequently be refused by the adapter even though the verifier accepts it; preserve the verifier's None-as-empty behavior.
def _is_disposition_list(value) -> bool:
    """A list of entries. Absent is EMPTY at this guard
    (`validate-openspec-cli-pin.py:801-803`), so `dispositions:` is not a
    required member; present and not a list is refused (`:804-809`)."""
    return isinstance(value, list)

scripts/doc_health/pin_shapes.py:576

  • re.match with a $-terminated pattern accepts a trailing newline, so a YAML item such as "wallet-carve\n" is classified as WELL_FORMED even though it is not an exact capability name. That violates the documented grammar and reports a misleading missing-capability finding instead of the malformed-enumeration finding; use a full match for each item.
    for item in raw:
        if not isinstance(item, str) or not CAPABILITY_RE.match(item):

scripts/doc_health/pin_shapes.py:162

  • The optional pinned_by_commit_only form is stricter than both tracked verifiers: verify-openxwallet-pin.py:443 and validate-openreposhape-pin.py:487 normalize any falsey value with pin.get(...) or [], so an explicit YAML null is accepted there, while _is_path_only_list rejects it. The adapter can therefore refuse a record that its required guards accept; mirror the verifier's falsey-to-empty semantics and cover the null case in the equivalence tests.
    if not isinstance(value, list):
        return False
    return all(_is_text(entry) for entry in value)
  • Files reviewed: 39/39 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread scripts/doc_health/families.py Resolved
Comment thread scripts/doc_health/families.py Resolved
Comment thread scripts/pin_containment.py Resolved
…cord and an unresolvable link; hold the two optional members to their guards' falsey-is-empty reading; exact-match capability names

R1 (Copilot thread PRRT_kwDOTAvnrs6iMGCu, :1632): `_judge_pinned_record`'s
`except ImportError: return` dropped every pinned-target finding silently,
so a fail-closed check passed OPEN when PyYAML is unavailable. It now emits
a controlled ERROR finding naming the record and root, with its own action
string — the remedy is the environment's, not the record's — added to
EXPECTED_ACTIONS (twelve pinned-arm actions become thirteen).

R2 (Copilot thread PRRT_kwDOTAvnrs6iMGDF, :1536): `_pin_record_text` caught
only `OSError`, but `Path.read_text(encoding="utf-8")` raises
`UnicodeDecodeError` — a `UnicodeError` — on a non-UTF-8 record, which would
have escaped the family. It now also catches `UnicodeError` and reports the
existing "repair the pin record" finding, exercised by a new non-UTF-8-bytes
case beside the (k) corrupt-record tests.

R3 (Copilot thread PRRT_kwDOTAvnrs6iMGDY, :103): `resolve_in_root` and
`boundary_dir` promise a refusal tuple, but their `.resolve()` calls can
raise `RuntimeError` on a symlink loop (Python 3.12) or `OSError` on an
unreadable link. Every `.resolve()` call in both is now wrapped, returning
a new `UNRESOLVABLE` code; `_pinned_arm` branches on the refusal code,
reusing the existing "symlink out of contracts/" action for every
non-boundary refusal rather than inventing one, and never interpolating
the reason text (it may carry a host path). A self-looping
`contracts/loop-pin.yaml` fixture proves the refusal and that the read
seam is never reached.

R4 (verify-openxwallet-pin.py:443, validate-openreposhape-pin.py:487): both
verifiers read `pin.get("pinned_by_commit_only") or []`, so every falsey
value — not only absence — is empty and admitted. `_is_path_only_list` now
returns True for any falsey value before the list/entry checks, so the
adapter no longer refuses `null` or `""` where the guards it tracks do not.

R5 (validate-openspec-cli-pin.py:801-803): `if raw is None: return []`
treats `dispositions: null` as empty. `_is_disposition_list` now admits
`None` explicitly, matching the guard it tracks.

R6 (pin_shapes.py enumeration, was :575; families.py `_PINNED_VALUE`):
`CAPABILITY_RE.match`'s trailing `$` admits a trailing newline (an
"openxwallet\n" YAML block scalar), so both now use `fullmatch`.
`_PINNED_VALUE` in families.py moves to `fullmatch` too for consistency;
the marker grammar admits no whitespace, so behaviour there is unchanged.

Lane: openxfactory-2
Co-Authored-By: Claude Sonnet 5 <[email protected]>
Copilot AI review requested due to automatic review settings September 14, 2026 16: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.

🔵 Needs a closer look

A moderate unresolved shape-validation issue remains, and the broad change requires human review.

Review details

Suppressed comments (1)

scripts/doc_health/pin_shapes.py:303

  • The identity entry is not actually constrained to the verifier-specific spelling promised by the design: _first_failure treats submodule_path and source_repository as interchangeable. For a known openxwallet pin, a record with only source_repository therefore passes the adapter even though verify-openxwallet-pin.py requires submodule_path (and a malformed extra source_repository can reject a wallet record whose verifier ignores that field). This breaks the fail-closed record-shape check; select the expected identity from the tracked pin/verifier and add asymmetric missing/unused-field tests.
_PRODUCT_IDENTITY = Member(
    spellings=("submodule_path", "source_repository"),
    form=_is_text,
    citations=(Citation(_OPENXWALLET, 194, guard="_submodule_path"),
               Citation(_OPENREPOSHAPE, 258, guard="_source_repository")),
  • Files reviewed: 39/39 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot's one suppressed comment at `9e40d749` (`pin_shapes.py:303`) is right
against D-2's letter, and the lane RULED it accepted. `_PRODUCT_IDENTITY`
admitted EITHER spelling for EVERY shape-(a) record, so
`contracts/openxwallet-pin.yaml` with `submodule_path` deleted was still
ACCEPTED — it carries `source_repository` as well — although
`scripts/verify-openxwallet-pin.py:194` REFUSES it. That is the adapter NARROWER
than the guard it tracks for a KNOWN record, which is the exact defect the
two-leg equivalence test exists to catch; the record leg passed only because it
removed BOTH spellings at once.

D-2: "shape (a)'s entry is `revision_kind`, `commit`, `files` and EXACTLY ONE
product-identity member, and AT THE RECORD GRAIN it resolves to that record's
own verifier's set." Task 3.3(p) measures the same thing from the other side,
listing `source_repository` among `openxwallet-pin.yaml`'s NINE NON-table
members and `submodule_path` in its table.

THE RECORD GRAIN WITHOUT THE RECORD CHOOSING ITS JUDGE. The adapter already
holds a code-fixed map keyed by PIN ID — the id the MARKER named and the
REGISTRY stem carries, never `verify_pin:`. `PRODUCT_IDENTITY_BY_PIN` joins it,
cited to the two guard lines it was measured from
(`verify-openxwallet-pin.py:194` `_submodule_path`,
`validate-openreposhape-pin.py:258` `_source_repository`), and `judge(record,
pin_id=None)` stays a pure function of its two inputs. Two regimes: a KNOWN pin
requires THAT record's spelling (missing names it, malformed by that spelling's
form) and the other spelling is a non-table member of that record; an UNKNOWN
pin — a fixture, `contracts/evil-pin.yaml`, any future product — keeps the
ALTERNATION, so a record naming NO product is still refused. Selecting the
regime by the PRESENCE of `submodule_path` would be the record choosing again,
and would accept the very deletion this closes. `families._judge_pinned_record`
passes the pin id it already parsed out of the marker.

TESTS. The record leg now removes the ONE spelling that record's own verifier
reads: `openxwallet-pin.yaml` minus `submodule_path` REFUSES naming it, minus
`source_repository` still ACCEPTS, and `openreposhape-pin.yaml` minus
`source_repository` REFUSES naming it. The 38-member test asserts design D-2's
and task (p)'s PER-RECORD LISTS by name rather than a bare count — one number
could not tell apart `source_repository`'s two places — and the
product-identity test is rewritten to the two regimes. The guard leg is
unchanged: its citations were already per spelling. `Member.name`, the accessor
that flattened both spellings into one string, is removed with the flattening it
served.

No action string moves, no verifier, pin record, spec or delta byte moves, and
no file is added: `PRODUCT_IDENTITY_BY_PIN` lives beside `TRACKED_VERIFIERS` in
the adapter the file bound already admits.

Lane: openxfactory-2
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings September 14, 2026 17:19

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.

🟡 Changes recommended

Two unresolved review findings remain for package-import compatibility and malformed-path handling.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (1)

scripts/doc_health/families.py:56

  • This module-level bare import only works when scripts/ has been injected into sys.path. The package itself supports relative imports, and callers that import it as scripts.doc_health.families (or vendor the package without that path injection) will fail during module import before doc-health can run. Use a standalone/package-relative import fallback here, and cover the package import path so this new dependency does not make the family unavailable outside scripts/doc-health.py.
from pin_containment import (OUTSIDE_BOUNDARY, OUTSIDE_ROOT, boundary_dir,
                             resolve_in_root)
  • Files reviewed: 39/39 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread scripts/pin_containment.py Resolved
…he containment helper under the dotted package path too

Copilot's review of 62bc53e (one thread, one suppressed comment), both RULED
ACCEPT by the lane (fix1040-round3.md).

- R1 pin_containment.py: `Path.resolve()` raises ValueError ("embedded null
  byte") on a claimed path carrying NUL, which a YAML registration can supply,
  so `resolve_in_tree` in validate-pin-registrations.py would traceback instead
  of refusing. ValueError joins OSError and RuntimeError in the three guards and
  maps to the `unresolvable` code; the reason names the malformed path. Test on
  the helper (a marker cannot carry NUL — the lexical grammar refuses it first).
- R2 families.py: the module-level bare `from pin_containment import …` works
  only with `scripts/` on sys.path, while this repository's own tests reach the
  package as `scripts.doc_health.*`. The import now falls back to the
  package-relative spelling, `scripts` being a namespace package and the neutral
  helper its sibling. Test: a fresh interpreter from the repository root with no
  PYTHONPATH imports `scripts.doc_health.families`.

No action string, verifier, pin record, spec or delta byte moves.

Lane: openxfactory-2
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Copilot AI review requested due to automatic review settings September 14, 2026 17:31

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.

🔵 Needs a closer look

An unresolved moderate finding remains in scripts/doc_health/pin_shapes.py regarding multiple product-identity alternatives.

Review details

Suppressed comments (1)

scripts/doc_health/pin_shapes.py:517

  • For an unknown pin id, required_spellings() returns both product-identity alternatives, but this loop only checks that each present value is well-formed and then accepts the record. A record carrying both submodule_path and source_repository therefore resolves, even though the shape is defined as exactly one product-identity member and the test's own contract says the union must be refused. Reject multiple alternatives after the per-field validation (and add the missing assertion for the unknown-pin case).
        for name in present:
            if not member.form_for(name)(record.get(name)):
                return Failure(shape.title, name, MALFORMED)
  • Files reviewed: 39/39 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

brettheap and others added 2 commits September 14, 2026 17:48
Copilot's suppressed comment on 0138384 read D-2's "EXACTLY ONE product-identity
member" as a prohibition on a record carrying both spellings. RULED STANDS
(fix1040-round4.md): the phrase describes the TABLE ENTRY, resolved per record;
the real openxwallet record carries both spellings today and neither shape-(a)
verifier refuses the one it does not read, so an adapter refusing co-presence
would be WIDER than the guards. Tests only; no adapter byte moves.

Lane: openxfactory-2
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Required pytest-suite GREEN at 0138384 (run 34875251402, all six required
green); doc-health --single-repo: 0 new regressions, and finding-by-finding
against dd07374 the only content change is the four tag-hygiene findings
changed in form — unresolved pinned targets naming contracts/openxwallet-pin.yaml
and the publisher's remedy — still four, still error, as the box requires the
evidence to state. Boxes 3.1–3.6 were ticked by the realization commit; § 4
(archive) stays open for Brett Heap's separate word.

Lane: openxfactory-2
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Copilot AI review requested due to automatic review settings September 14, 2026 17:48

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.

🔵 Needs a closer look

A moderate adapter finding remains, and the change is too complex for safe automated approval.

Review details

Suppressed comments (2)

scripts/doc_health/pin_shapes.py:517

  • For an unknown pin_id, required_spellings() returns both product-identity alternatives, so this loop treats both present fields as required. That contradicts the documented alternation (pin_shapes.py:491-505) and the test's “either or both ... refuses only NEITHER” contract: a record with a valid submodule_path plus a malformed source_repository is rejected even though either spelling should satisfy the unknown-pin shape. Accept the alternatives when at least one present spelling is valid, and report MALFORMED only when none are valid.
        for name in present:
            if not member.form_for(name)(record.get(name)):
                return Failure(shape.title, name, MALFORMED)

tests/doc-health/test_pin_shape_adapter.py:553

  • This sentence now contradicts the behavior documented and asserted immediately below: the unknown-pin regime explicitly accepts a record carrying both spellings, and the later test says the alternation “admits either or both.” As written, “no record must carry both” describes the opposite contract and could lead a future adapter change in the wrong direction; update this sentence to say that either or both are accepted and only neither is refused.
  • Files reviewed: 39/39 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

…nt spelling is judged by its form

Copilot's two suppressed comments on 0b1496e read the docstrings' "satisfied
by either … refuses only NEITHER" and "no record must carry both" against the
loop and found the words wrong. RULED (fix1040-round5.md): the BEHAVIOUR
stands — for an unknown pin the entry is MISSING only when neither spelling is
present, a record may carry both (the real openxwallet record does), and a
spelling that IS present is judged by its own form, a present-but-malformed one
being MALFORMED exactly as an optional member present in the wrong form is; a
broken byte is never a silent pass. The docstrings and the _PRODUCT_IDENTITY
comment now say that, and one more assertion pins it. No code byte moves.

Lane: openxfactory-2
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Copilot AI review requested due to automatic review settings September 14, 2026 20:53

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.

🔵 Needs a closer look

Two moderate findings remain for missing pin roots and dangling symlink classification; one boundary remediation message also needs correction.

Review details

Suppressed comments (3)

scripts/doc_health/families.py:1596

  • This action is reused for BOUNDARY_MISSING, BOUNDARY_NOT_A_DIRECTORY, BOUNDARY_REDIRECTS, and UNRESOLVABLE, but “rather than a redirection” only describes one of those defects. A missing or regular-file contracts/ path therefore tells the operator to look for a symlink instead of explaining the required repair; branch on the refusal code or use a neutral message covering existence, directory type, and non-redirection.
                "make the resolution root's contracts/ a real directory rather "
                "than a redirection (document-lifecycle grammar)")

scripts/doc_health/families.py:1623

  • When ctx.repo_paths has no entry for the document's repository (and no openxFactory entry), _pin_roots() yields no roots, searched remains empty, and this function returns without emitting any finding. That silently accepts a target=pinned:... marker, whereas the existing in-tree arm reports unresolved targets in the same context and the pinned contract requires a controlled unresolved-registry finding; add an explicit no-root failure path so the marker cannot pass merely because the run supplied an incomplete context.
    if searched:
        hit(ERROR, doc,
            f"unresolved pinned target={target} at line {lineno}: no {record} "
            f"under root(s) {', '.join(searched)}",
            "name a pin the registry under contracts/ carries "
            "(document-lifecycle grammar)")

scripts/pin_containment.py:153

  • A dangling contracts symlink is classified as BOUNDARY_MISSING because exists() is checked before is_symlink(). That produces the wrong remediation for a boundary that violates the explicit non-symlink requirement (and mkdir contracts cannot repair a dangling symlink); check is_symlink() first so this case is reported as a redirecting boundary.
    if not lexical.exists():
        return None, (BOUNDARY_MISSING,
                      f"carries no {name}/ directory to resolve a record in")
    if lexical.is_symlink():
  • Files reviewed: 39/39 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

…cument with no resolution root fails closed; one neutral boundary remedy

Copilot's three suppressed comments on e1138d8, all RULED ACCEPT by the lane
(fix1040-round6.md).

- R1 pin_containment.py `boundary_dir`: `exists()` follows a link, so a DANGLING
  `contracts` symlink read as MISSING and sent the operator to `mkdir` a
  directory a link already occupies. The symlink test now comes first and the
  boundary is REDIRECTING. Test added.
- R2 families.py `_pinned_arm`: where `repo_paths` carried neither the
  document's repository nor `openxFactory`, the arm found no root, searched
  nothing and emitted nothing — a pinned marker passing merely because there was
  nothing to search, where the in-tree arm reports an unresolved target. It is
  now one controlled finding naming the repository, with its own action string
  (EXPECTED_ACTIONS → fourteen). Test added.
- R3 families.py: the boundary refusal's action was reused for four codes and
  its words fit one; it is now one neutral sentence covering presence,
  directory type and non-redirection, the rule text carrying the specific
  reason. Tests updated.

No verifier, pin record, spec or delta byte moves.

Lane: openxfactory-2
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Copilot AI review requested due to automatic review settings September 14, 2026 21:12

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.

🟢 Approval recommended

Only minor documentation and naming nits remain; no blocking issues were identified.

Review details

Suppressed comments (2)

openspec/changes/extend-prose-tagging-target-to-pinned-capabilities/tasks.md:623

  • Task 3.7's checked evidence is stale: this box cites code tree 0138384f and says later commits are tests-only, but the PR's later round 6 changes (da54bed4) modify resolver/containment behavior (including no-root handling, dangling-boundary classification, and the neutralized action text). Please rerun the required pytest-suite and doc-health checks on the final tree and update this record to cite that tree and run; otherwise the checked evidence does not establish the final implementation.
  #1040, at the TREE grain:** the code tree is `0138384f` (rounds 1–3 folded;
  the two commits after it are tests-only and the 3.7 tick itself). Required
  `pytest-suite` GREEN at `0138384f`: run 34875251402 (all six required

tests/doc-health/test_tag_hygiene_pinned_targets.py:775

  • The new test name spells the plural as repositorys; use repositories so the test name is grammatically correct and searchable.
  • Files reviewed: 39/39 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

…tories"

Copilot's two suppressed comments on da54bed, both RULED ACCEPT
(fix1040-round7.md). The ticked 3.7 evidence cited the 0138384 tree and
called the later commits tests-only, which round 6 made untrue; it now cites
the final code tree da54bed and its green required pytest-suite run
34897473169, with the --family tag-hygiene re-measure at that tree (exactly
four findings, changed in form, still error). The one commit after da54bed is
this refresh and a test rename; no code byte moves.

Lane: openxfactory-2
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Copilot AI review requested due to automatic review settings September 14, 2026 21:44
@sonarqubecloud

Copy link
Copy Markdown

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.

🔵 Needs a closer look

The adapter must reject malformed disposition entries; the diagnostic wording nit also remains unresolved.

Review details

Suppressed comments (2)

scripts/doc_health/families.py:1625

  • resolve_in_root returns UNRESOLVABLE for symlink loops and unreadable links, but this branch always uses the remedy for a record symlink escaping contracts/. For the self-loop case covered by the tests, the record is not outside the boundary, so the action points at the wrong defect; branch on the refusal code or use neutral wording such as making the record path resolvable inside contracts/.
            hit(ERROR, doc, rule,
                "keep the pin record inside its root's contracts/ directory "
                "rather than a symlink out of it (document-lifecycle grammar)")

scripts/doc_health/pin_shapes.py:223

  • _is_disposition_list accepts every list, including [{}], [null], or entries missing cited_to/authority. The tracked verifier rejects those entries in pinned_dispositions() (scripts/validate-openspec-cli-pin.py:811-855), and this adapter is the only validation used by the pinned-target arm, so such a malformed shape can still resolve a capability. Mirror the verifier's pure entry checks here (while retaining None/empty-list acceptance) and add a regression case for a malformed list entry.
    return value is None or isinstance(value, list)
  • Files reviewed: 39/39 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@brettheap
brettheap marked this pull request as ready for review September 14, 2026 22:14

@sourcery-ai sourcery-ai Bot 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.

Sorry @brettheap, your pull request is larger than the review limit of 150,000 diff characters

@brettheap
brettheap merged commit 7434837 into main Sep 14, 2026
13 checks passed
brettheap added a commit that referenced this pull request Sep 15, 2026
…ged-plus-green realization evidence (PR #1040 → 7434837) (#1042)

Lane: openxfactory-2 (openXfactory-2)

**ARCHIVE of `extend-prose-tagging-target-to-pinned-capabilities`** (§ 4.1–4.3), on Brett Heap's SEPARATE ARCHIVE WORD — verbatim *"archive it"*, 2026-09-15, in session to lane openxfactory-2 — recorded on #992 (5686413187) and mirrored on #745 (5686413478); given after *"realize it"* (5662218844) and *"merge 1040 when green, then post the records"* (5670841396).

**Why it may archive now.** The packet's `code_surface` is non-empty, so under `release-realization` it archives only on merged-plus-green realization evidence: the realization **PR #1040 → `74348374bcf999b80ac2e442b3fd3bf98473a20a`** on `main` (2026-09-14T22:14:26Z; REALIZED record #992 5671554584) and `main`'s OWN required `pytest-suite` run **34903098178** — `event: push`, head the merge commit itself, `conclusion: success` (22:14:29Z→22:34:47Z). No tree-equality argument is needed.

**What this PR does.** `scripts/proposal-support.py . archive extend-prose-tagging-target-to-pinned-capabilities --yes` (never bare openspec): **ORIGIN RETAINED** (the declaration is unchanged since the ratifying merge `e6e1c968`; act 5's tightening is the accepted mutation of `openspec/origin-dispositions.yaml`'s first entry); the packet moved to `openspec/changes/archive/2026-09-15-…/`; the two `## MODIFIED` blocks promoted — **measured byte-identical** to canon: `document-lifecycle` *Prose tagging marker hygiene* 40,464 bytes sha256 `bb106900ac5ce1c7…` (canon `--numstat` +447 −1); `doc-health` *Tag hygiene enforced by reference* 3,686 bytes sha256 `16c290ab796ea56f…` (+36 −4). `tasks.md` § 4.1–4.3 ticked with the evidence and the measurement; an `## Addendum` appended to `review/ratification-2026-09-12.md` after everything it already said (nothing above it edited). README: the active bullet retired; the archived-ledger entry added; item (7) of `split-openxwallet-repo`'s entry annotated **DISCHARGED** by this change (its realization PR #1040). The per-change sweep ledger row is re-seeded with this PR's number in the second commit. **No ordered-delta child depends on this change** (searched).

**The honest outcome, on the record:** the four `error`-band `tag-hygiene` findings CHANGED FORM and stay FOUR until openXwallet's pin record publishes a `capabilities:` enumeration — the publisher's act, recorded as prose, not filed.

**Validation at the archive commit:** `openspec validate --all --strict` → `Totals: 106 passed, 2 failed (108 items)` (the same two pre-existing unrelated failures; one fewer active change); `proposal-support.py . verify` ok; `validate-scope-globs.py` passed; doc-health `--family promotion-fidelity` → 0 findings; `--family modified-block-currency` → 0 errors; `--family tag-hygiene` → exactly the four pinned findings. pytest and the sweep-ledger check are reported in the second commit's note below.

Lands under Rule 6 (this PR touches `openspec/changes/`) when the six required checks are green, on the standing word. Then the ARCHIVED record on #992 and #745, and #992 closes.

**Second and third commits (`8afb1325`, `e2fb500d`).** `8afb1325`: the sweep-ledger row re-seeded (`validate-sequenced-after.py . --seed-ledger --moved-by '#1042'` → 214 rows, one moved; `--ledger-diff` consistent) and this PR named in the README entry. `e2fb500d`: the carriage-ledger self-gate (`test_every_carriage_ledger_finding_over_the_real_tree_is_named`, `==` over named subjects) failed by name over the archived tree exactly as designed — the two rows this packet opened on 2026-09-12 are no longer reported because both blocks are promoted — so, as its message directs, the two rows are retired with a note in their place and the population narrative and docstring say which subjects moved and why (sixteen → fourteen). No code byte moves in this PR.
**pytest at `e2fb500d` (fresh clone):** `tests/sequenced_after` → `286 passed`; `tests/doc-health/test_modified_block_currency_self_gate.py tests/doc-health/test_modified_block_currency.py` → `163 passed`; `tests/doc-health/test_modified_block_currency_self_gate.py tests/proposal-support tests/doc-health/test_families.py` → `265 passed, 289 subtests passed`; the earlier subset over `test_families`, `test_tag_hygiene_pinned_targets`, `test_pin_shape_adapter` and `tests/proposal-support` → `490 passed, 289 subtests` with the one self-gate failure this third commit resolves. Copilot at `8afb1325`: "Approval recommended", 0 comments.

refs #992

🤖 Generated with [Claude Code](https://claude.com/claude-code)

## Summary by Sourcery

Archive the pinned-capability tagging change and promote its ratified requirements into the canonical specifications after verified realization.

Enhancements:
- Promote the pinned-capability prose-tagging requirements into the canonical document-lifecycle and doc-health specifications.
- Record the change as archived after merged, green realization evidence and retire its active validation ledger entries.
- Discharge the split-openxwallet-repo successor item while preserving the remaining publisher-owned capability-enumeration findings.

Documentation:
- Move the change from the active README list to the archived ledger and document its realization, archive evidence, and successor-item discharge.
- Append the archive record to the ratification review without altering the prior record.

Tests:
- Update modified-block currency and sequencing-ledger tests to reflect the archived change and its promoted canonical requirements.
brettheap added a commit that referenced this pull request Sep 16, 2026
Lane: openxfactory-2 (openXfactory-2)

## Summary

`_pinned_arm`'s `resolve_in_root` containment refusal reused 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. 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_BOUNDARY` keep the existing remedy: "keep
  the pin record inside its root's contracts/ directory rather than a
  symlink out of it (document-lifecycle grammar)".
- every other code (the `unresolvable` class) 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 `tests/doc-health/test_families.py` grows from
fourteen 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_refused` and
`test_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 the `hit(...)`
  action string on the refusal code instead of one shared literal.
- `tests/doc-health/test_families.py` -- add the new action string to
  `EXPECTED_ACTIONS` (14 -> 15 pinned-arm entries); FOURTEEN -> FIFTEEN
  in the docstring and inline comment.
- `tests/doc-health/test_tag_hygiene_pinned_targets.py` -- update the
  self-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, 1
  skipped, 7 failed. The 7 failures are pre-existing and unrelated:
  `test_ideation_readiness.py` (x3) and `test_readiness_dispatch.py`
  (x1) hit a validator harness error, and `test_sentinel_vocabulary.py`
  (x2) / `test_status_reader_real_lines.py` (x1) raise
  `carved_reach.CarveReachUnavailable` because this fresh clone has no
  `openDox`/`openXdox` submodules materialized (`git submodule status`
  shows both `-` prefixed). Confirmed identical on this branch's parent
  commit 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 support
  verification 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 a
  `contracts/openxwallet-pin.yaml` missing a `capabilities:`
  enumeration in two `ideation/staging/` docs; identical with the diff
  stashed, so unrelated to this change.

## Open questions

None.

refs #1046

🤖 Generated with [Claude Code](https://claude.com/claude-code)

## Summary by Sourcery

Differentiate pinned-arm containment remediation guidance by refusal code without changing validation behavior.

Bug Fixes:
- Use a refusal-specific remediation message for unresolvable pinned-arm targets so symlink loops, unreadable links, and malformed paths are described accurately.

Tests:
- Expand pinned-arm action coverage and update assertions for unresolvable and boundary-refusal cases.
brettheap added a commit that referenced this pull request Sep 16, 2026
…onal dispositions: reading reaches the entry grain its verifier's pure guard already does (#1050)

Lane: openxfactory-2 (openXfactory-2)

**A PROPOSAL PACKET — NOW RATIFIED (see the RATIFIED note below: Brett Heap's word "ratify 1052 when green, then 1050", 2026-09-16, citation #1045 comment 5698480736; `tasks.md` § 1 TICKED at `4c32b183`). DOCS ONLY — NO CODE BYTE MOVES.** Filed unratified on 2026-09-15; the sections below describe the packet as filed and the round notes carry every review round since.
No byte of `scripts/doc_health/pin_shapes.py`, of the realization test files
under `tests/doc-health/`, of any pin verifier, of any record under `contracts/`
or of any file under `openspec/specs/` moves in this pull request. One
bookkeeping row moves, honestly named: the sweep-ledger row in
`tests/sequenced_after/corpus-ledger.yaml` (task 2.6). (Fix round 5 briefly
added a carriage-ledger subject to the self-gate; round 6 removed it with the
reverted scenario edit — the self-gate is clean without it.)

## The finding, measured

`scripts/doc_health/pin_shapes.py`'s `_is_disposition_list` (`:217-223`) judges
the OPTIONAL shape-(c) member `dispositions:` at the MEMBER grain only —
`value is None or isinstance(value, list)`. The full verifier's
`pinned_dispositions` (`scripts/validate-openspec-cli-pin.py:787-857`) ALSO
refuses malformed ENTRIES, in the SAME PURE, SOURCE-FREE pass: it takes one
argument, the parsed record, and is called at `:1966` as part of check 1,
BEFORE `repository_identity` (`:1973`) and before any fetch.

Measured in the authoring session by importing the verifier at its fixed
authored path and calling the guard on in-memory records — no file, no `git`, no
network. **TEN records the guard REFUSES are ACCEPTED by
`judge(record, "openspec-cli")`; ZERO in the other direction** (the filing said EIGHT; the D-1 table counts ten once `why: ""` and `level: ""` are counted as the separate records they are — corrected in review round 3 and in the ratification commit).

| what the guard refuses | condition | raised at | measured input |
| --- | --- | --- | --- |
| an ENTRY that is not a mapping | `:813-817` | `:814` | `[null]`, `["a"]` |
| an entry missing any of `DISPOSITION_REQUIRED` (`:353-354`), falsey counting as missing | `:818-827` | `:820` | `[{}]`, no `cited_to`, `cited_to: []`, `why: ""` |
| an entry whose `cited_to` is truthy but not a NON-EMPTY list | `:828-836` | `:830` | `cited_to: "x"` |
| an entry whose `level` is not `None` and, upper-cased, is outside `BLOCKING_LEVELS` (`:366`) | `:837-848` | `:843` | `level: "WARNING"`, `level: ""` |
| an entry naming no authority (`DISPOSITION_AUTHORITY`, `:361`) | `:849-855` | `:850` | entry with neither `ratified_by` nor `recorded_by` |

So the adapter is NARROWER than the guard on the entries and nowhere WIDER —
the one direction canon calls a defect: *"a resolver that ACCEPTED what the
shape's own GUARD REFUSES would … admit a record the repository's own gate
rejects at its first shape check"*. `design.md` D-1 carries the full table,
including the two readings the measurement corrected (`cited_to: []` is refused
as the MISSING key at `:820`, not at `:830`; `level: "error"` is ADMITTED,
case-folded, while `level: ""` is REFUSED).

**AND THE ENTRY RULES ARE RATIFIED CANON — the gap is sharper than the issue
states it.** `neutral-product-pin`'s requirement *A dispositioned finding is
cited, upgrade-coupled, and refused when stale*
(`openspec/specs/neutral-product-pin/spec.md:577`) already obliges every reading
above: a disposition *"SHALL carry a non-empty CITATION … and SHALL name the
authority that granted it"* (`:578`); it *"SHALL identify ONE finding — the
repository, the item, the delta path, and the finding's own text"* (`:586-588`);
and its scenario *A disposition carries no citation* (`:633-636`) says that one
recording *"no `cited_to:`, an empty one, or no granting authority"* makes the
pin *"REFUSED as malformed, **before any artifact is fetched**"*. So the adapter
today **resolves a pinned target on a record a ratified requirement of this
estate calls malformed** — and reaching the entry grain imposes **no new
obligation on any pin's author**, every obligation already being theirs there.
**No `neutral-product-pin` delta is carried:** #1045 offers the act as one
against `document-lifecycle` "and/or `neutral-product-pin`", and measured the
second is not owed — that text is already correct and complete on this member.
What is missing is the OFFLINE RESOLVER's reading, and the resolver is
`document-lifecycle`'s grammar.

**The asymmetry is internal to the adapter.** The table carries exactly TWO
optional members. For shape (a)'s `pinned_by_commit_only:` the adapter ALREADY
reaches the entry grain (`_is_path_only_list` refuses `[{}]`, matching
`scripts/verify-openxwallet-pin.py:449-454` and
`scripts/validate-openreposhape-pin.py:493-498`), and **canon already states
that rule** in *A source pin enumerates its members in two different forms*.
This packet adds the counterpart for shape (c), placed immediately after it.

## The delta

ONE `## MODIFIED Requirements` block over `document-lifecycle`'s *Prose tagging
marker hygiene*, restating the promoted requirement **IN FULL** — `diff` against
`openspec/specs/document-lifecycle/spec.md:218-688` is **9 added lines and 0
removed** — plus ONE scenario, *A pin record's optional
dispositions member carries a malformed entry*.

`dispositions:` **stays OPTIONAL** and stays out of the shape-guard-required
set: canon's *"`dispositions:` is NOT in the set: it is read with an
absent-is-empty default (`:801-803`)"* is carried verbatim and stays true, the
measured `(29, 27, 2)` table split does not move, and `null` and `[]` are still
read as empty. `neutral-product-pin` is not touched.

## The successor a ruling named

Raised by review on PR #1040 (round 8) and **RULED STANDS** there, the ruling
naming what it declined: *"Extending the optional-member form to the entry grain
is a legitimate later delta … noted, not filed."* This packet is that delta; a
corpus search returns no other successor.

## Commits

1. **`26b2cc96`** — the packet: `proposal.md`, `design.md`, `tasks.md`,
   `.openspec.yaml` (`declare-adhoc`, drafting provenance only), the
   `## MODIFIED` delta, the README bullet.
2. **`34937197`** — a MEASUREMENT CORRECTION found while proofreading, and the
   strongest fact in the packet: `design.md` had claimed `neutral-product-pin`
   "does not name `dispositions:` at all", which is false. Corrected, and the
   ratified ground named in `design.md` D-1, `proposal.md`, the README bullet and
   one new scenario bullet.
3. **`f5e82c2a`** — the sweep-ledger row seeded against this pull request's
   number by the sanctioned writer, plus `neutral-product-pin:622-624` (the
   sixth key, `why:`) added to D-1's ratified-ground list and `tasks.md` 2.6
   ticked with the act it names.

## Decisions put for veto

- **D-2** — the entry-grain reading is the OPTIONAL member's FORM, not a new
  required member. Alternative (make it required) is priced: WIDER than the
  guard, two canon passages rewritten, a carriage-ledger row owed, `(29, 27, 2)`
  re-measured, and a guard leg asserting a refusal the verifier does not make.
  The two-leg equivalence test's OPTIONAL arm gains an ENTRY case held by a
  **CALL** to `pinned_dispositions` (source-free) rather than by the weaker
  citation re-read the two `files:` entries use.
- **D-3** — act at all. (a) leave as is (the round-8 position, priced),
  (c) restate the verifier's entry rules as PROSE in canon (refused in canon's
  own words), (d) have the ADAPTER call the verifier (refused by its
  constitutional no-import rule).

## Validation (this branch, fresh clone of `main` at `8944758c`)

- `OPENSPEC_TELEMETRY=0 openspec validate adopt-entry-grain-dispositions-form --strict` → **valid**
- `OPENSPEC_TELEMETRY=0 openspec validate --all --strict` → **107 passed, 2 failed (109 items)** — the same two pre-existing failures as `origin/main`: `add-chain-attestation`, `add-composed-view-authoring`
- `python3 scripts/proposal-support.py . verify` → **ok**
- `pytest -q tests/doc-health -p no:cacheprovider` → **1824 passed, 0 failed** — run twice, at `34937197` (6m00s) and again at the final head `f5e82c2a` (5m06s)
- `pytest -q tests/openspec_cli_pin` → **154 passed**; `pytest -q tests/proposal-support` → **199 passed, 291 subtests**; `pytest -q tests/doc-health/test_tag_hygiene_pinned_targets.py` → **31 passed** — none of them moved, no verifier or adapter byte having moved
- `python3 scripts/doc-health.py --single-repo . --as-of 2026-09-15 --skip-family document-catalog` (ALL other families) → exit 0; the corpus's standing findings are unchanged and **not one names this change or `README.md`**
- `pytest -q tests/sequenced_after -p no:cacheprovider` → **4 failed / 282 passed BEFORE the row was seeded** (all four `test_sweep.py`, all four that staleness) and **286 passed** after `f5e82c2a`
- `pytest -q tests/doc-health/test_modified_block_currency_self_gate.py tests/doc-health/test_pin_shape_adapter.py` → **70 passed** (run on its own, and re-covered by the full suite above) — the carriage-ledger self-gate names **no block of this packet**, every canon unit being carried verbatim, so **no `_LEDGER_SUBJECTS` row is added**
- `python3 scripts/doc-health.py --single-repo . --as-of 2026-09-15 --family …` → `proposal-origin`, `status-validity`, `duplicate-packet`, `promotion-fidelity`: **no findings**; `modified-block-currency`: 14 INFO findings, **none naming this change**; `register-lifecycle-consistency`: 10 warnings, **identical before and after** (measured by stashing the change and re-running)
- `python3 scripts/validate-sequenced-after.py . --ledger-diff` → **seven findings** before seeding, all one cause (the missing row plus the six derived totals it moves: change_ids 214→215, active 46→47, co_modified 159→160, active_co_modified 28→29, declaring 37→38, declaring_ids); after `--seed-ledger --moved-by '#1050'` → **"per-change sweep ledger consistent with the corpus (215 rows)"**

**Environment note, not a defect of this branch:** in a bare `gh repo clone`,
seven `tests/doc-health` tests fail on `CarveReachUnavailable` / a harness error
because `openDox`/`openXdox` are not materialized. The tests say so themselves
and name the remedy; after `git submodule update --init --recursive openDox
openXdox` all seven pass on `origin/main` and on this branch alike.

**Fix round 1 (`ee5fdcd5`, plus a follow-up commit aligning two further sentences)** — Copilot's threads on `f5e82c2a`, RULED by the lane (`findings/fix1050-round1.md`): the packet had claimed all five entry-grain refusals are ratified canon imposing no new author obligation. Measured, `neutral-product-pin` :577-636 names the citation, the authority and the identity keys; it never defines a `why:` member or the `level`/`BLOCKING_LEVELS` rule — those two are the verifier's own pure guard. The ADAPTER RULE IS UNCHANGED (per the archived D-2 the optional member's form is the verifier's pure source-free guard, measured and cited), and the CLAIM is corrected everywhere it appears: D-1 gains a "named by canon / guard-only" column, and the guard-only two are said to impose no obligation BEYOND what `pinned_dispositions` already enforces on every landed pin. Also: tasks.md gains 3.5, a family-level test through `fam_tag_hygiene` asserting the finding names `dispositions` AND the offending entry; task 1.3's inserted-line count corrected to nine (`git diff --numstat` of the MODIFIED block vs canon: 9/0). The ledger thread was already satisfied by `f5e82c2a`. Threads replied and resolved.

**Fix round 2 (`3cd6a424`)** — RULED by the lane (`findings/fix1050-round2.md`): the canon-vs-guard correction now applied everywhere it remained (design D-3(c) and the "does not decide" bullet; proposal's Why and Impact) — three of the five entry-grain refusals are canon-named (citation, authority, identity keys), `why` and `level`/BLOCKING_LEVELS are the verifier's guard with no obligation beyond what it already enforces; the declared surface now names `tests/doc-health/test_tag_hygiene_pinned_targets.py` and the shared `Failure`/`Verdict.render()`/`_first_failure` machinery; tasks.md gains 3.4 "Extend the FAILURE REPRESENTATION" so the finding can name the offending entry (a bare boolean from `_is_disposition_list` cannot), 3.5–3.11 renumbered. Three open threads replied and resolved. MODIFIED block vs canon unchanged at 9/0. Validation: strict valid; `--all --strict` 107/2 (pre-existing); proposal-support ok; self-gate + adapter 70 passed; ledger consistent (215 rows).

**Fix round 3 (`14e8433c`)** — RULED (`findings/fix1050-round3.md`): the citation's LIST SHAPE refusal (`validate-openspec-cli-pin.py:828-836`) is guard-only too — canon `:578` is satisfied by any non-empty citation — so the classification is now stated by enumeration rather than a ratio: canon-named = the identity keys, the citation's non-empty requirement, the authority pair; guard-only = the citation's list shape, `why`, `level`/BLOCKING_LEVELS; applied in D-1, D-3(c), README, proposal Why/Impact and spec :420. The impossible-precondition phrasing is corrected everywhere ("complete for its required shape members, whose optional `dispositions:` entry is the sole malformed part"). All threads resolved. Strict valid; 107/2; proposal-support ok; self-gate + adapter 70 passed.

**Fix round 4 (`2a93c0d3`)** — Copilot's five suppressed comments on `14e8433c`, RULED ACCEPT ×5 (`findings/fix1050-round4.md`): the new scenario's WHEN now carries the enumeration prerequisite its siblings carry (a well-formed, non-empty `capabilities:` naming `<capability>`), so it is disjoint from the no-enumeration scenarios, and D-1 states that the entry-grain check is reached only after the enumeration prerequisites hold; task 3.4's key reporting is conditional on mapping entries (bare entries report index and value); task 1.1 describes D-2 as changing the optional member's form while admitting 3.4's representation change; task 2.1's refusal-line evidence applies to the six refusal readings (row 0 raises none); task 3.5 parameterizes over every measured entry form and key. MODIFIED block vs canon still 9/0; strict valid; 107/2; proposal-support ok; self-gate + adapter 70 passed.

**RATIFIED (`4c32b183`)** — on Brett Heap's word "ratify 1052 when green, then 1050" (2026-09-16T13:43Z; THE ONE CITATION: [#1045 comment 5698480736](#1045 (comment))). Edits: tasks.md § 1 ticked with RATIFIED annotations; `.openspec.yaml` gains `approved_by`/`approved_on` beside the unmoved drafting pair (`declare-adhoc` refuses a second declaration — origins are immutable — so the approval pair was written by hand in the archived predecessor's shape); `Status: ratified` + `Ratified:` in proposal.md, design.md, tasks.md; `review/ratification-2026-09-16.md` with exactly one citation line; README bullet → ratified. Two Copilot nits folded (the GAP tally is TEN, with `why: ""` and `level: ""`; "moves no byte of any test" narrowed — the sweep-ledger row moved as bookkeeping). Validation: strict valid; `--all --strict` 107/2 (pre-existing); proposal-support ok; ledger consistent; `ratified-provenance` names nothing of this packet; self-gate + proposal-support 218 passed. `code_surface` is non-empty: realization (§ 3) and archive (§ 4) are LATER words. Lands under Rule 6 on six green AFTER #1052, per the word's order.

**Ratification consistency (`a5b0da27`)** — Copilot's pass on the ratified head `4c32b183`: the PR body's lead still read as unratified (fixed by the lane; the EIGHT count corrected to TEN there too); one thread was false at the head (the ratification record IS present; resolved); tasks.md § 2.2's count, the origin `reason`'s count (a pre-landing correction of the packet's own text, before any ratifying merge exists — `proposed_by`'s filing-time wording stays, by the archived predecessor's convention) and the post-header paragraph that still said "unticked" are corrected; three threads replied and resolved. Strict valid; proposal-support ok; 218 passed.

**Final nits + merge from main (`883bc5a7`, `55db4a3c`)** — Copilot at `15d84816` recommended approval with three suppressed nits, all folded in `883bc5a7`: the `_tracked_table` cross-reference in design.md and tasks.md points at the helper's first line; the ratification record now lists the consistency corrections carried under the ratifying act (the eight→ten tallies in tasks.md § 2.2 and the origin `reason`, the post-header paragraph) and narrows "stands exactly" to the checkbox state. `55db4a3c` merges `origin/main` (`d5dd1ca5`): the PR had been CONFLICTING in README.md's OpenSpec Records block since main archived `add-declared-former-id`, which is why GitHub ran no required workflow on the three previous heads — resolved by keeping this packet's bullet and dropping the archived one. Validation at `55db4a3c` (fresh clone): `--all --strict` 106 passed / 2 failed (the same two pre-existing, one fewer active change than before the merge); proposal-support ok; sequenced-after ledger 215 rows consistent; self-gate + proposal-support 218 passed. MERGEABLE; the six required checks are running on this head.

**Fix round 5 (`a2640c9d`)** — Copilot at `55db4a3c`, one open thread and five suppressed, all RULED ACCEPT (`fix1050-round5.md`). The thread: the positive-resolution scenario required only the shape's required members while the new refusal scenario refused a record with `dispositions: [{}]` — the same input, two normative outcomes. Partitioned: the positive scenario's WHEN now also requires every OPTIONAL member the matched shape admits that is PRESENT to conform at its entry grain to that shape's own in-tree verifier's pure, source-free guard (`dispositions:` a sequence whose every entry the guard accepts; `pinned_by_commit_only:` a sequence of path-only strings); the refusal WHEN is unchanged and the disjointness bullet extended. **Superseded by fix round 6 below: the partition is REVERTED — ratified normative text is the ratifier's to amend.** Editing an existing scenario's body tripped the carriage-ledger self-gate, so the packet names a new ledger subject in `tests/doc-health/test_modified_block_currency_self_gate.py` — the honest cost of the partition, not a code change. The suppressed five: "§ 2 exactly as filed" narrowed to § 2's checkbox state in four places (the fifth cited location was unrelated pin-record prose and stands). Validation at `a2640c9d` (fresh clone): strict valid; `--all --strict` 106/2 (pre-existing); proposal-support ok; self-gate + proposal-support 218 passed. Thread replied and resolved; MERGEABLE; six required running.

**Fix round 6 (`73864686`)** — reverses round 5's partition, on the point Copilot made on the sibling PR #1052: a packet cannot carry `Status: ratified` while recording a normative change as "open to veto"; ratified normative text is the ratifier's to amend (precedent: `add-requirement-ref-resolution-integrity`'s 2026-09-01 amendment, ruled by the ratifier with the contradiction before him). The `## MODIFIED` block is byte-identical to its text as ratified at `4c32b183` (verified by blob sha); the carriage-ledger subject round 5 added is removed, the self-gate proving clean without it; the ratification record states the partition was applied at `a2640c9d` and reverted here, with the overlap on `dispositions: [{}]` before Brett Heap as a RULING NEEDED comment on #1045 (5701323247: "apply the partition" or "leave it", to be settled before realization). Round 5's four "§ 2 as filed" narrowings stay. Validation at `73864686` (fresh clone): strict valid; `--all --strict` 106/2 (pre-existing); proposal-support ok; self-gate + proposal-support 218 passed. Round 6b (`cf701334`) then restored `tests/doc-health/test_modified_block_currency_self_gate.py` to main's exact bytes (round 6 had left a comment-only audit note there), so the PR touches no code file. 0 threads; MERGEABLE; six required running. This head lands, after #1052, on the standing word.

**Landing ruling (`cf701334`).** Copilot's pass on this head reopened the overlap thread (RULED: both scenarios land exactly as ratified; the decision is Brett Heap's, pending on #1045 comments 5701323247 + 5701410009, to be settled before realization; thread replied and resolved) and noted that the ratification record repeats its one citation URL in three places. Correction to the wording above: the record has ONE citation SOURCE — #1045 comment 5698480736 — whose URL appears three times in the record (the header citation, the word's paragraph, and the records section), every occurrence the same comment; no second source is cited. RULED: stands for landing. Six required green, 0 unresolved threads, MERGEABLE: lands SECOND, after #1052, on the standing word.

refs #1045

🤖 Generated with [Claude Code](https://claude.com/claude-code)

## Summary by Sourcery

Ratify the document-lifecycle change that aligns optional pinned `dispositions` form validation with the verifier’s entry-level guard without implementing the adapter changes.

New Features:
- Propose and ratify entry-level validation for optional `dispositions` members in pinned artifact records, including malformed-entry reporting requirements.

Enhancements:
- Document the measured mismatch between the offline shape adapter and the pinned disposition verifier while preserving optional-member semantics and absent/null/empty handling.
- Record the proposal’s design decisions, ratification provenance, validation evidence, and deferred realization/archive work.

Documentation:
- Add the ratified `adopt-entry-grain-dispositions-form` proposal, design, task plan, spec delta, ratification record, and README active-change entry.

Chores:
- Add the change to the sequenced-after corpus ledger.
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