Skip to content

Amend add-unclassified-finding-class: a drift shape is the arm's template with every interpolated field masked - #461

Merged
brettheap merged 1 commit into
mainfrom
change/amend-unplaced-shape-rule
Aug 28, 2026
Merged

brettheap merged 1 commit into
mainfrom
change/amend-unplaced-shape-rule

Conversation

@brettheap

Copy link
Copy Markdown
Contributor

The ruling

Brett, in session, 2026-08-28, put to him as a multiple choice by the Speckit
026 review. Verbatim:

Amend: shape = arm template, all interpolations masked

The packet add-unclassified-finding-class is RATIFIED but still ACTIVE
(unarchived), so this is an edit to an unpromoted delta rather than a change to
canon.

The measured cause

The ratified delta defined shape identity as rule texts equal after every
single-quoted span, every double-quoted span and every run of digits has been
replaced by a fixed placeholder
. A rule text's UNQUOTED parts are therefore
shape-bearing, and this family's arms interpolate several of them:

  • the promoted spec's path (basis.spec_rel), which differs per capability;
  • the [body] / [bullet] unit-kind list a carriage-ledger finding quotes;
  • a change-id list, in the ordering arm;
  • an unresolved block's why clause, which has two forms.

Measured during realization (Speckit 026-unplaced-finding-drift), with the
dropped pattern named against each figure because a different drop exercises a
different arm:

tree pattern dropped unplaced shapes / drift findings
this repository carriage-ledger 7 6
-two-writers title-resolution 9 4
-markers carriage-ledger 3 3
-unplaced (the feature's own) carriage-ledger 3 1

Six warning rows in the ranked plan for ONE map entry to write. The
feature's own fixture tree collapses to 1 only because its three ledger findings
name the same promoted spec and the same unit kind, which is why the grain had
to be measured against the real tree.

The realization could not fix this on its own: scenario 3's AND pinned the
narrower rule ("differ outside their quoted spans and digit runs MUST yield
two"
), and a realization may not narrow — or widen — the rule it realizes. Full
write-up: specs/026-unplaced-finding-drift/plan.md § OPEN-1.

The delta, before and after

The identity SHALL — before

Two unplaced findings SHALL be treated as ONE SHAPE where their rule texts are
equal after every single-quoted span, every double-quoted span and every run of
digits has been replaced by a fixed placeholder.

The identity SHALL — after

Two unplaced findings SHALL be treated as ONE SHAPE where their rule texts are
equal after EVERY FIELD THE ARM'S TEMPLATE INTERPOLATES has been replaced by a
fixed placeholder — quoted spans, runs of digits, repository-relative paths,
change identifiers, unit-kind lists, and any other value the arm substitutes
into its fixed prose — so that one shape is one template and one remedy.

The family SHALL derive that mask from its own arm templates: an arm's FIXED
PROSE is the shape and every value the arm interpolates into it is not, so the
rule cannot drift from the arms it describes.

The second paragraph is the anti-drift clause: a hand-enumerated mask would go
stale the moment an arm grows a field, which is the exact failure mode this
whole finding class exists to report.

Scenario 3 — before

#### Scenario: Two unplaced findings differ only in a title and a count
- **WHEN** two unplaced findings have rule texts that are equal after every quoted span and every run of digits is replaced by a fixed placeholder
- **THEN** ONE additional finding MUST be emitted for both, naming the count two, one drifted rule shape being one remedy
- **AND** two unplaced findings whose rule texts differ outside their quoted spans and digit runs MUST yield two additional findings, being two remedies

Scenario 3 — after

#### Scenario: Two unplaced findings from one arm template
- **WHEN** two unplaced findings come from the SAME arm template and differ only in the values that template interpolates — a different quoted title, a different promoted-spec path, a different unit-kind list, different change identifiers
- **THEN** ONE additional finding MUST be emitted for both, naming the count two, one drifted arm template being one remedy
- **AND** two unplaced findings from DIFFERENT arm templates — differing in the fixed prose the mask leaves standing — MUST yield two additional findings, being two remedies

What else moves

  • proposal.md — an Amended: front-matter line; the dated amendment note
    at the head of § Orchestrator Decisions, quoting the ruling verbatim; and D3
    rewritten to the wider mask with the measured cause and the 6-for-1 figure
    recorded. D3 stays FLAGGED FOR VETO alongside D1 and D2.
  • tasks.md — new § 1.4 records the ruling; § 2.4 and § 2.6 carry the
    amended grammar and name Speckit 026-unplaced-finding-drift as the in-flight
    feature that builds it (its
    test_the_drift_grain_is_one_finding_per_masked_arm_text_not_one_per_remedy
    already measures the grain on the real tree — under the amended mask that
    measurement reads ONE where it read six); § 2.14 gains mutation (f),
    narrow the mask back to quoted-spans-and-digits and both scenario 3's
    path/kind-list pair and the real-tree grain measurement must fail; § 4.4
    restates the mask's scope as this family's own templates. Predicted severity
    movement is unchanged: ZERO in every band.
  • README.md — the OpenSpec Records entry gains the amendment clause, and
    its now-false shape sentence is corrected.

No promoted spec, no code, no test and no workflow moves in this PR. The delta
stays ADDED-only: no ## MODIFIED Requirements block is opened on any promoted
requirement, so D1's measurement and the zero prediction both stand.

Evidence

gate result
OPENSPEC_TELEMETRY=0 openspec validate add-unclassified-finding-class --strict Change 'add-unclassified-finding-class' is valid
OPENSPEC_TELEMETRY=0 openspec validate --all --strict 76 passed, 0 failed (76 items)
python3 -m pytest tests/doc-health -q -k "proposal_origin or lifecycle or corpus" 71 passed, 1178 deselected

Dogfood — python3 scripts/doc-health.py --single-repo . --family modified-block-currency:

- scenario-title completeness: 0 (warning — the arm carrying this family's gate)
- carriage ledger: 7 (info — editorial, and the arm says so in every finding)
- title resolution and ordering: 0 (warning)
- marker defects: 0 (info)

0 warning, 7 info, unclassified 0 (the residual row does not render),
and no finding names any path under
openspec/changes/add-unclassified-finding-class/
— this PR carries an ADDED
block and no MODIFIED block, and the family reads ## MODIFIED Requirements
blocks only. Byte-identical to the packet's § 3.1 baseline.

🤖 Generated with Claude Code

…late with every interpolated field masked

Ruled in session 2026-08-28 by Brett, put to him as a multiple choice by the
Speckit 026 review. Verbatim: "Amend: shape = arm template, all interpolations
masked".

WHY. The ratified delta defined shape identity as rule texts equal after every
quoted span and every run of digits is masked. Measured during realization
(Speckit 026), that mask leaves the shape-bearing interpolations standing: the
arms also substitute the promoted spec's path (basis.spec_rel), the
[body]/[bullet] unit-kind list a carriage-ledger finding quotes, the ordering
arm's change-id list, and an unresolved block's `why` clause. On the 2026-08-28
openxFactory tree ONE dropped class-map entry (carriage-ledger) yields SEVEN
unplaced findings in SIX shapes — six `warning` rows in the ranked plan for ONE
map entry to write. The realization could not fix it: scenario 3's AND pinned
the narrower rule, and a realization may not narrow the rule it realizes. The
measured table (real tree 7 -> 6; -two-writers 9 -> 4; -markers 3 -> 3;
-unplaced 3 -> 1) is in specs/026-unplaced-finding-drift/plan.md § OPEN-1.

WHAT MOVES. Four files, the packet plus its README record.

specs/doc-health/spec.md — the identity paragraph is widened to every field the
arm's template interpolates, and one normative sentence is added requiring the
family to derive the mask FROM ITS OWN ARM TEMPLATES (the fixed prose is the
shape; the interpolations are not), so the rule cannot drift from the code.
Scenario 3 is rewritten from "differ only in a title and a count" to same arm
template versus DIFFERENT arm templates. Requirement is ADDED-only still; SHALL
stays on the first body line; every scenario keeps WHEN/THEN.

proposal.md — an `Amended:` front-matter line, the dated amendment note at the
head of § Orchestrator Decisions, and D3 rewritten to the wider mask with the
measured cause recorded.

tasks.md — new § 1.4 records the ruling; § 2.4 and § 2.6 carry the amended
grammar and name Speckit 026 as the in-flight feature that builds it; § 2.14
gains mutation (f), narrow the mask back and watch scenario 3 and the real-tree
grain measurement fail; § 4.4 restates the mask's scope. Predicted severity
movement is unchanged: ZERO in every band.

README.md — the OpenSpec Records entry gains the amendment clause, and its
now-false shape sentence is corrected.

EVIDENCE.
- openspec validate add-unclassified-finding-class --strict: valid
- openspec validate --all --strict: 76 passed, 0 failed (76 items)
- python3 scripts/doc-health.py --single-repo . --family modified-block-currency:
  0 warning, 7 info; classes scenario-title 0 / carriage ledger 7 / title
  resolution and ordering 0 / marker defects 0; unclassified 0, residual row
  absent; no finding names any path under
  openspec/changes/add-unclassified-finding-class/ — the packet is ADDED-only
  and the family reads MODIFIED blocks only, so it dogfoods to 0 as predicted.
- python3 -m pytest tests/doc-health -q -k "proposal_origin or lifecycle or
  corpus": 71 passed, 1178 deselected

Co-Authored-By: Claude Opus 5 <[email protected]>
Copilot AI lite review requested due to automatic review settings August 28, 2026 07:30

@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.

Hi @brettheap! 👋

Your private repo does not have access to Sourcery.

Please upgrade to continue using Sourcery ✨

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.

Pull request overview

This PR amends the add-unclassified-finding-class OpenSpec change packet to redefine unplaced finding shape identity as “arm template with all interpolated fields masked,” aligning the spec text with the family’s template-driven drift behavior and preventing shape drift as arms evolve.

Changes:

  • Update the doc-health delta spec to define shape identity as the arm template’s fixed prose with all interpolations masked, and rewrite scenario 3 accordingly.
  • Propagate the amendment through the change packet’s proposal and tasks to record the ruling, measured cause, and updated acceptance scenarios.
  • Update the README OpenSpec Records entry to reflect the amendment and corrected shape definition.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.

File Description
README.md Updates the OpenSpec Records index entry to include the amendment and new shape definition.
openspec/changes/add-unclassified-finding-class/tasks.md Records the amendment and updates implementation/test guidance to match the widened mask.
openspec/changes/add-unclassified-finding-class/specs/doc-health/spec.md Amends the normative shape-identity definition and rewrites the relevant scenario.
openspec/changes/add-unclassified-finding-class/proposal.md Adds amendment metadata and rewrites D3 rationale to match “mask all interpolations.”

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

Comment thread README.md
Comment on lines +501 to +506
realization via Speckit), **AMENDED 2026-08-28 by Brett** (in-session, verbatim
"Amend: shape = arm template, all interpolations masked" — D3's shape-identity
rule widened from quoted-spans-plus-digits to every interpolated field, after
Speckit 026 measured six `warning` rows for one remedy on the real tree;
`specs/026-unplaced-finding-drift/plan.md` § OPEN-1) — the
modified-block-currency family's report block
Comment on lines +53 to +56
family now deriving the mask FROM ITS OWN ARM TEMPLATES; § 2.4 and § 2.6
below carry the build. The measured table is in
`specs/026-unplaced-finding-drift/plan.md` § OPEN-1. **The predicted
severity movement is unchanged — ZERO in every band** — the mask being
target_release: implemented — the openxFactory main line. This surface cuts no contract bundle: no schema under `contracts/schemas/` changes, no digest set moves, and no release tag is owed. The archive gate is therefore merge-plus-green on main, following `add-modified-block-currency-check` and `add-family-enumeration-check` exactly: `python3 -m pytest tests/doc-health` green, `OPENSPEC_TELEMETRY=0 openspec validate --all --strict` green, and a doc-health single-repo run whose severity counts move by exactly the amount this proposal predicts — zero — and in no other line. The change therefore ships ACTIVE and archives only after the merge.
Status: ratified
Ratified: 2026-08-27 by Brett — in-session commissioning, verbatim: "Amend now". The citation covers the DECISION TO BUILD THIS AMENDMENT and nothing else; the three design decisions in § Orchestrator Decisions below were taken by the authoring session under standing patterns, are NOT covered by this citation, and are flagged there for veto. No approving OpenSpec change exists to name, so this cites the record in the spelling `sanction-ratified-record-spelling` sanctioned for that case, clearing its three-way floor on two axes rather than the one it needs: approver (`by Brett`) and date (`2026-08-27`).
Amended: 2026-08-28 by Brett — in-session commissioning, verbatim: "Amend: shape = arm template, all interpolations masked". D3's shape-identity rule is widened from quoted-spans-plus-digit-runs to EVERY field the arm's template interpolates; the measured cause is recorded in § Orchestrator Decisions and in `specs/026-unplaced-finding-drift/plan.md` § OPEN-1. Nothing else in this packet moves and the predicted severity movement stays ZERO.
Comment on lines +43 to +48
- [x] 1.4 AMENDED 2026-08-28 by Brett, in session, verbatim: "Amend: shape = arm
template, all interpolations masked". Put to him as a multiple choice by
the Speckit 026 review, which had measured that the ratified mask (quoted
spans and digit runs only) leaves the promoted spec's path, the
`[body]`/`[bullet]` unit-kind list, change-id lists and an unresolved
block's `why` clause standing — so ONE dropped class-map entry yields
Comment on lines +116 to +118
`basis.spec_rel` (a repository-relative path), the `[body]`/`[bullet]`
unit-kind list a ledger finding quotes, the ordering arm's change-id list,
and the unresolved arm's `why` clause. **The mask is DERIVED FROM THE ARM
Comment on lines +142 to +145
ARM TEMPLATE differing only in the values it interpolates — a different
quoted title, a different `basis.spec_rel`, a different unit-kind list,
different change ids → ONE finding naming the count two; and two unplaced
findings from DIFFERENT arm templates, differing in the fixed prose the
Comment on lines +235 to +238
count remedies: the arms interpolate the promoted spec's path (`basis.spec_rel`),
the `[body]`/`[bullet]` unit-kind list a carriage-ledger finding quotes, a
change-id list in the ordering arm, and an unresolved block's `why` clause,
none of which the quoted-span-and-digit mask touches. On the 2026-08-28
@brettheap
brettheap merged commit 6d100e5 into main Aug 28, 2026
4 checks passed
brettheap pushed a commit that referenced this pull request Aug 28, 2026
…laced

Re-check found this feature's Speckit artifacts still stating the SUPERSEDED
identity rule as normative while the module implemented the amended one — the
same defect class the family this feature extends exists to catch, in the
feature's own documents.

Rewritten to the amended rule, which landed on `main` as `6d100e51` / PR #461:
`spec.md` FR-006 (now naming every interpolated field, and gaining FR-006a for
the derive-from-templates clause and FR-006b for the fail-closed fallback), the
US4 independent test and its first two acceptance scenarios (now the amended
delta's "same template, different interpolations → ONE; different templates →
TWO"), and the "Rule shape" key entity (now the arm template, with "Arm
template" added beside it). `data-model.md` § 4 is rewritten as the template
registry plus the three-step mask, with the lexical rule kept only as step 3's
fallback. `research.md` R3 is marked SUPERSEDED with the ruling and the commit,
kept rather than deleted because it is the reasoning the amendment overturned
and because two of its findings survive it — the left-to-right consumer and the
two-placeholder rule, now living inside steps 1 and 3.

ONE ASSERTION ADDED, and it kills a mutant nothing else could see: a drift rule
text QUOTES a ledger rule text, and `_ArmTemplate`'s pattern carries `\Z` but no
`^` — it relies on `re.match`. Switching that one call to `re.search` finds the
ledger template's segments inside the quotation and files a drift finding under
`carriage-ledger`, the ledger template being earlier in the registry. The
shipping path never shapes a drift finding at all (`_drift_findings` makes one
pass and its own output is never fed back), so the registry's drift entry was
defensive AND untested; it is now reachable in a test, and mutant MF dies.

Nits: the fixture README's one-shape sentence now says "same arm template"
rather than the old mask; tasks T014/T023/T024 carry the amended wording where a
reader meets them rather than only in the far-away § RULED block; `\Z` is
commented as near-inert (four of six templates end in a field, so it bites only
on the two that end in prose) with the note that `re.match` is the anchor that
carries the weight; and the "only place the prose lives" test now states its
reach limit — it catches a REVERTED arm, not a brand-new inline one firing on a
corpus-absent state, and what covers that case is measured instead: a rebuild
with an arm's prose drifted from its template reds 24 tests.

Mutation round: 16 applied, 16 killed, 0 survivors.

Co-Authored-By: Claude Opus 5 <[email protected]>
brettheap pushed a commit that referenced this pull request Aug 28, 2026
… body

The catch-up merge takes this branch's base to `6d100e51` — PR #461, the
amendment Brett ruled — so every figure this feature records was re-taken there
rather than carried over.

The merge also brought a new doc-health family onto `main`, which moves the raw
suite total and would make a bare before/after count unreadable. So the +21 is
read from the CI-SHAPE PAIR instead, where both sides are extractions of the
SAME base: 1229 -> 1250 passed, with the eleven history-dependent failures
compared by name and found IDENTICAL. Eleven rather than the earlier seven
because four of them belong to the new family; not one is this feature's.

Self-gate: the before figure re-taken from a clean extraction of `6d100e51`, the
after re-run on the merged branch, and the diff is still exactly the one line —
the fifth class row reading zero, over a full report, so the comparison still
covers every family rather than this one's block. `openspec validate --all
--strict` reads 76 items where it read 78, packets having archived on `main`
between the two runs. `.github/` and `openspec/` diffs against the new base are
still empty.

`pr-body.md` is written against these figures: the mechanism in three sentences,
the grain table before and after the amendment with the dropped pattern named
per row, the sixteen mutants and the four that survived a first attempt, the
amendment named as a landed precondition, and `Refs #357` — the packet archives
under its own later commit, so this PR closes nothing.

Co-Authored-By: Claude Opus 5 <[email protected]>
brettheap added a commit that referenced this pull request Aug 28, 2026
… — an unplaceable rule shape becomes one warning per arm template (#466)

* A finding this family's own class map cannot place is now a warning, not a text row

Realizes `add-unclassified-finding-class` (ratified 2026-08-27 by Brett,
"Amend now"; PR #446, squash 86b7ca3) as Speckit feature
`026-unplaced-finding-drift`. The packet's tasks.md § 2 is the plan at task
grain and every task cites the box it realizes.

WHAT MOVED. `classify` was already fail-closed: a rule text no pattern of the
family's class map matches is not absorbed into a neighbouring class, it falls
to a named residual row in the report block. That row is PROSE — no severity, so
no `--fail-on` reaches it; not a finding, so the ranked plan never carries it.
The one thing the family reports that its own tooling is wrong about could not
become work.

Now a nonzero residual emits ONE `warning` per DISTINCT unplaced rule SHAPE per
run, naming that shape's count, quoting the first instance's rule text verbatim,
and carrying its repository and delta path. The map places that finding itself,
in a FIFTH class — `unplaced`, label `unplaced-finding drift` — so it is never
counted by the residual it reports; the residual row keeps rendering beside it,
counting the arms' unplaced findings only, and the tally still sums to the rows.

THE THREE DESIGN POINTS THAT ARE NOT DECORATION.

- A FOURTH severity constant, `_DRIFT_SEVERITY`, not a reuse of
  `_LAUNCH_SEVERITY`. § 7.2 of `add-modified-block-currency-check` flips that
  one to `error` together with a `contested` classification, and this finding is
  DESIGNED to disappear when somebody extends the map — `contested` would turn
  that disappearance into an error under the uncited-resolution rule. The drag
  would also be invisible, so it is pinned by a test that executes the module's
  own source with the flip applied and reads the two bands apart.
- The pattern is ANCHORED, and both directions are measured. The finding quotes
  a rule text that may itself begin in the shape of an arm's; and a requirement
  may be TITLED with the fifth class's own opening phrase, in which case an
  unanchored probe matches its ledger finding too — two patterns on one rule.
- The id and label carry no substring `unclassified`: a standing pin asserts
  that string's absence from a fully-classified summary, and a class label
  renders even at a count of zero.

EVIDENCE (specs/026-unplaced-finding-drift/evidence/). Test suite 1215 -> 1227
passed, +12, every one named and every one seen RED before the module moved.
Self-gate before/after over a FULL report: exactly one line differs, the fifth
class row reading 0 — zero movement in every band, which is what the proposal
predicted. `openspec validate --all --strict`: 77 passed, 0 failed. Mutation
round: 9 applied, 9 killed, 0 survivors — the unanchored-pattern mutant survived
the first attempt and exposed a near-miss adversarial title, now fixed and
commented. CI shape proved from a clean `git archive` extraction: the same seven
history-dependent tests fail there at the branch point and here, and 1199 ->
1211 is the same +12.

SCOPE. `git diff` against the merge base over `.github/` and `openspec/` is
EMPTY: no workflow file, and the packet's own task boxes tick at its archive
act, not here. Nothing else moves — no other family, no `report.py`, no
`families.py`, no `Finding` field, no registry, no threshold. The byte-level
report-section contract of `022-modified-block-currency-reporting` is amended at
all four of its class-enumeration sites, because a fifth class landing without
that would leave the corpus carrying a contract false about the code it
describes.

Co-Authored-By: Claude Opus 5 <[email protected]>

* Catch-up merge: both self-gate figures re-taken at the new base, and neither moved

`origin/main` advanced six commits during this feature, one of them a new
proposal, so the branch took a MERGE — never a rebase — and the evidence pair
was re-measured rather than carried over.

The before figure is re-taken from a clean `git archive` extraction of the NEW
merge base `22f15cdf`, and the after figure re-run on the merged branch. The
diff is still exactly one line: `- unplaced-finding drift: 0 (\`warning\`)`. Zero
movement in every band, over a full report, so the comparison still covers all
twenty-two families rather than this one's block.

Nothing else moved either: `git diff 86b7ca3 22f15cd -- tests/doc-health/
scripts/doc_health/` is EMPTY, so the 1215-test baseline still stands against
the merged base and 1227 is still +12. `openspec validate --all --strict` reads
78 passed where it read 77, the extra item being the packet the merge brought
in. `.github/` and `openspec/` diffs against the new merge base are still empty.

Recorded because packet § 3.1 warns this figure moves as active changes land.
Here it did not, and the reason is legible: the incoming packets carry no
`## MODIFIED Requirements` block, which is the only thing this family reads.

Co-Authored-By: Claude Opus 5 <[email protected]>

* Review fixes: the shape mask was wrong twice, and two mutants were living in the gap

Combined review reproduced every gate and confirmed the trigger claim
independently (20,040 fuzzed rule texts, 0 unplaceable). It found two defects in
`_shape` and two surviving mutants.

B2 — THE MASK PAIRED A PROSE APOSTROPHE WITH A `repr`'s OPENING QUOTE. These
rule texts are fixed prose interleaved with `repr` spans, and one of the fixed
strings carries an apostrophe: `_unresolved_finding`'s "no active sibling's
addition:". A global `re.sub` matched from THAT apostrophe to the opening quote
of the next `repr`, masked the prose between them, and left the repr's own
content — the capability name — exposed. Two unresolved blocks differing only in
capability read as two shapes, so the family would report two remedies for one.
Fixed in the MASK, never in the prose: a left-to-right consumer where a quote
opens a span only at the start or after a non-alphanumeric, `_TITLE_REPR`'s two
alternatives being first-char-disjoint and an accepted span jumped past whole.
RED test added; the mutant that restores the global sub now dies.

B1 — THE GRAIN IS NOT "ONE FINDING PER REMEDY", AND THIS BUILD SAID IT WAS. A
rule text's UNQUOTED parts are shape-bearing under the ratified identity rule —
the promoted spec's path, the `[body]`/`[bullet]` kind list, a change-id list,
an unresolved block's `why` clause. Measured: dropping `carriage-ledger` on this
repository leaves SEVEN unplaced findings in SIX shapes, where ONE new map entry
would place all seven. This is NOT fixable here: masking the arm's whole
template would contradict the delta's third scenario, which pins "differ outside
their quoted spans and digit runs → TWO". So every claim to the contrary is
struck (module docstring, test docstrings, fixture README, spec.md US4,
tasks.md), the real grain is stated in their place, and a new test MEASURES it
on the real tree against an independently written mask — with the six named in
its docstring as the figure an amendment would move. The amendment is recorded
OPEN in plan.md § OPEN-1 and tasks.md for Brett's ruling.

N1 — TWO MUTANTS SURVIVED, AND ONE OF THEM WAS A LINE THAT COULD NOT FAIL. The
trailing `findings.sort(key=_report_order)` is DELETED: `runner.run_suite` sorts
the whole result by `Finding.sort_key` and `report.render` sorts again before
printing, so the order this family returned in reached no reader. A line no test
can fail is a line that will later be trusted for a guarantee it does not give.
The sort BEFORE the emit stays, because it decides which finding each drift
warning names — and it is now pinnable, because the fixture grew a second change
directory (`add-a-drift-case/`) whose path sorts first while its title sorts
last. Emission order and report order now DISAGREE on that tree, which is the
only condition under which "the first of that shape in report order" can be
falsified at all; the pin asserts the disagreement itself so it cannot silently
stop biting. Mutants M8 and M9 both die.

N2 the skipped-block docstring reads five zeros. N3 `evidence/scope-diff.md` is
re-run and its output pasted, with the stale 492-line figure disclosed rather
than edited. N4 the tree-count comment says 14 on disk, as a floor. N5 F2's
`CLASSIFIERS` gains a `drift` key — and the other five needed a guard, because a
drift finding QUOTES an arm's whole rule text and every unanchored probe would
otherwise match it; the coupling to `_DRIFT_RULE` is declared in a comment and
asserted by a test.

GATES. `pytest tests/doc-health`: 1230 passed (1215 baseline, +15). Mutation
round 2: 12 applied, 12 killed, 0 survivors. CI shape from a clean extraction:
the same seven history-dependent tests fail as at the branch point, 1199 -> 1214
is the same +15. `openspec validate --all --strict`: 78 passed, 0 failed.
Full-report movement diff: still exactly one line. `.github/` and `openspec/`
diffs: empty.

Co-Authored-By: Claude Opus 5 <[email protected]>

* Shape is the arm template now, so one drifted shape is one remedy again

Brett ruled 2026-08-28, verbatim: "Amend: shape = arm template, all
interpolations masked". The delta amendment is a parallel branch
(`change/amend-unplaced-shape-rule`); this is its realization in 026.

WHAT THE OLD RULE COST, MEASURED. Shape identity masked quoted spans and digit
runs only, so every UNQUOTED interpolation was shape-bearing: the promoted
spec's repo-relative path, the `[body]`/`[bullet]` unit-kind list, a change-id
list, an unresolved block's `why` clause. Dropping ONE class pattern on this
repository emitted SIX findings for SEVEN unplaced ones, where a single new map
entry would have placed all seven. Nine unplaced findings on `-two-writers`
became four. This feature shipped that faithfully, measured it, declined to
widen it unilaterally because the delta's third scenario pinned it, and put the
amendment up. All four figures now read ONE.

THE MECHANISM, DERIVED AND NOT GUESSED. Each arm's rule text now renders through
one registered `_ArmTemplate`, so the family's fixed prose has exactly one
definition and the arm that prints it cannot drift from the mask that reads it —
`test_the_arm_templates_are_the_only_place_the_prose_lives` forbids an inline
f-string coming back. `_shape` is then two steps whose ORDER is load-bearing:
mask every `repr`-emitted span with the B2-safe left-to-right consumer, then
match the registered templates first-match-wins, the shape BEING the template's
id. A text no template claims falls back to the old lexical mask rather than
being merged into a neighbouring template — fail-closed, constitution VII. No
field was added to `Finding`: the report grammar is shared by twenty-two
families and a local identity is not a reason to move it.

WHY MASKING COMES FIRST, AND WHY THAT TOOK TWO ATTEMPTS TO PIN. Requirement
titles come from the corpus, so a title may contain another arm's whole fixed
prose; matched raw, a carriage-ledger finding titled with the titles template's
prose resolves to `scenario-titles`. The mutation round found no pin for that
and then found the first pin built in the wrong DIRECTION — a titles finding
with a ledger-shaped title still answers `scenario-titles` by luck of the
registry order, so it passed over the mutant. The pin now runs the ordering
against the answer and carries a guard that fails if the order ever stops
putting the wrong template first.

FIGURES, before -> after, with the pattern dropped named for each (a different
drop exercises a different arm, so the rows are not comparable without it):
this repository / `carriage-ledger`, 7 unplaced, 6 -> 1; `-two-writers` /
`title-resolution`, 9 unplaced, 4 -> 1; `-markers` / `carriage-ledger`, 3
unplaced, 3 -> 1; `-unplaced` / `carriage-ledger`, 3 unplaced, 1 -> 1.

Every claim about the grain is rewritten to the new truth — module docstrings,
test docstrings, the fixture README, `spec.md` US4, `tasks.md`, and the F4
byte-level contract, which gains a § 5b stating the template registry and the
two-step mask. `plan.md` § OPEN-1 moves from OPEN to RULED AND IMPLEMENTED.

GATES. `pytest tests/doc-health`: 1236 passed (1215 baseline, +21). Mutation
round 3: 15 applied, 15 killed, 0 survivors. CI shape: the same seven
history-dependent tests fail in a clean extraction as at the branch point, 1199
-> 1220 is the same +21. `openspec validate --all --strict`: 78 passed, 0
failed. Full-report movement diff: still EXACTLY ONE LINE — the amendment
changes how unplaced findings group and there are none where the map is
complete, which is every run today. `.github/` and `openspec/` diffs: empty.

Co-Authored-By: Claude Opus 5 <[email protected]>

* The feature's own spec was still asserting the mask the amendment replaced

Re-check found this feature's Speckit artifacts still stating the SUPERSEDED
identity rule as normative while the module implemented the amended one — the
same defect class the family this feature extends exists to catch, in the
feature's own documents.

Rewritten to the amended rule, which landed on `main` as `6d100e51` / PR #461:
`spec.md` FR-006 (now naming every interpolated field, and gaining FR-006a for
the derive-from-templates clause and FR-006b for the fail-closed fallback), the
US4 independent test and its first two acceptance scenarios (now the amended
delta's "same template, different interpolations → ONE; different templates →
TWO"), and the "Rule shape" key entity (now the arm template, with "Arm
template" added beside it). `data-model.md` § 4 is rewritten as the template
registry plus the three-step mask, with the lexical rule kept only as step 3's
fallback. `research.md` R3 is marked SUPERSEDED with the ruling and the commit,
kept rather than deleted because it is the reasoning the amendment overturned
and because two of its findings survive it — the left-to-right consumer and the
two-placeholder rule, now living inside steps 1 and 3.

ONE ASSERTION ADDED, and it kills a mutant nothing else could see: a drift rule
text QUOTES a ledger rule text, and `_ArmTemplate`'s pattern carries `\Z` but no
`^` — it relies on `re.match`. Switching that one call to `re.search` finds the
ledger template's segments inside the quotation and files a drift finding under
`carriage-ledger`, the ledger template being earlier in the registry. The
shipping path never shapes a drift finding at all (`_drift_findings` makes one
pass and its own output is never fed back), so the registry's drift entry was
defensive AND untested; it is now reachable in a test, and mutant MF dies.

Nits: the fixture README's one-shape sentence now says "same arm template"
rather than the old mask; tasks T014/T023/T024 carry the amended wording where a
reader meets them rather than only in the far-away § RULED block; `\Z` is
commented as near-inert (four of six templates end in a field, so it bites only
on the two that end in prose) with the note that `re.match` is the anchor that
carries the weight; and the "only place the prose lives" test now states its
reach limit — it catches a REVERTED arm, not a brand-new inline one firing on a
corpus-absent state, and what covers that case is measured instead: a rebuild
with an arm's prose drifted from its template reds 24 tests.

Mutation round: 16 applied, 16 killed, 0 survivors.

Co-Authored-By: Claude Opus 5 <[email protected]>

* Re-measure every gate at the amendment's own commit, and write the PR body

The catch-up merge takes this branch's base to `6d100e51` — PR #461, the
amendment Brett ruled — so every figure this feature records was re-taken there
rather than carried over.

The merge also brought a new doc-health family onto `main`, which moves the raw
suite total and would make a bare before/after count unreadable. So the +21 is
read from the CI-SHAPE PAIR instead, where both sides are extractions of the
SAME base: 1229 -> 1250 passed, with the eleven history-dependent failures
compared by name and found IDENTICAL. Eleven rather than the earlier seven
because four of them belong to the new family; not one is this feature's.

Self-gate: the before figure re-taken from a clean extraction of `6d100e51`, the
after re-run on the merged branch, and the diff is still exactly the one line —
the fifth class row reading zero, over a full report, so the comparison still
covers every family rather than this one's block. `openspec validate --all
--strict` reads 76 items where it read 78, packets having archived on `main`
between the two runs. `.github/` and `openspec/` diffs against the new base are
still empty.

`pr-body.md` is written against these figures: the mechanism in three sentences,
the grain table before and after the amendment with the dropped pattern named
per row, the sixteen mutants and the four that survived a first attempt, the
amendment named as a landed precondition, and `Refs #357` — the packet archives
under its own later commit, so this PR closes nothing.

Co-Authored-By: Claude Opus 5 <[email protected]>

---------

Co-authored-by: brettheap <[email protected]>
Co-authored-by: Claude Opus 5 <[email protected]>
brettheap added a commit that referenced this pull request Aug 28, 2026
…ent #461; promoted as one ADDED requirement, 6 scenarios) (#469)

Archived on the merge-plus-green rule the packet's § 5.1 declared, and on TWO
merges rather than one because this packet was amended mid-flight. Both are
ancestors of origin/main, re-verified here with `git merge-base --is-ancestor`
rather than read off a pull-request page:

  PR #461 -> 6d100e5  the DELTA AMENDMENT, "a drift shape is the arm's template
                       with every interpolated field masked" (Brett, 2026-08-28,
                       verbatim "Amend: shape = arm template, all interpolations
                       masked"). It lands FIRST by construction — the
                       realization's spec cites the amended text.
  PR #466 -> db2442c  the realization, Speckit 026-unplaced-finding-drift: the
                       fifth FindingClass, its anchored pattern, the per-shape
                       emit through registered _ArmTemplates, four test files, a
                       behavioural fixture tree, and the amended byte-level
                       report contract.

GATE NUMBERS, base db2442c, before -> after the act:

  pytest tests/doc-health -q         1270 -> 1270 passed, 0 failed
  openspec validate --all --strict     76 ->   75 passed, 0 failed
                                     (24 active + 52 specs -> 23 + 52; -1
                                      exactly as promotion of one change
                                      predicts)
  doc-health --single-repo .         5 critical, 11 error, 41 warning, 11 info,
                                     0 new regressions — BYTE-IDENTICAL either
                                     side of the act
  ... --skip-family modified-block-currency
                                     5 critical, 11 error, 41 warning, 4 info

Movement +0 warning / +7 info in both readings, equal to the family's own
per-severity counts (--family modified-block-currency -> 0/0/0/7). The family's
report block reads scenario-title 0 / carriage ledger 7 / title resolution and
ordering 0 / marker defects 0 / unplaced-finding drift 0, and the residual row
does not render — the packet predicted the fifth class would move nothing, and
the only change in that section is the zero row. Zero findings name any path
under the packet, re-measuring § 3.4.

PER-REQUIREMENT PROMOTION, verified BEFORE archiving. The delta is ADDED-only:
one `## ` section header, no MODIFIED/REMOVED/RENAMED block anywhere, and its
one title collides with none of canon's 38.

  requirement                                     | before | delta | after
  ------------------------------------------------|--------|-------|-------
  "A modified-block-currency finding its own class |        |       |
   map cannot place is itself a finding" (ADDED)   | absent | 6 sc. | 6 sc.
  the other 38 requirements                        |   —    | none  | unchanged
  FILE                                             | 38 req,| —     | 39 req,
                                                   | 173 sc.|       | 179 sc.

+1 requirement, +6 scenarios. `git diff --stat openspec/specs/doc-health/spec.md`
= 73 insertions(+), 0 deletions(-). REMAINDER — the whole document minus the
appended requirement, each requirement running from its `### Requirement:` line
to the next or to EOF; every `### ` heading in this file is a requirement
heading (38 before, 39 after, 0 non-requirement). Slice construction: 139505 ==
139505 raw, 139503 == 139503 normalized. The mbc § 8.2 split/join construction:
139505 vs 139504 raw, 139503 == 139503 normalized — that precedent's own N2
artifact reproducing exactly, the join losing one newline only when the dropped
chunk is the file's LAST heading. Strongest reading, which only an append
admits: canon before is a strict byte PREFIX of canon after, 139505 -> 144975,
the whole difference being the 5470-byte appended chunk.

NO TEST FELL DUE, and that is a consequence of D1 rather than luck: an
ADDED-only packet drew no self-finding and is named by no self-gate subject, so
the F3 self-gate and F5's tests read the same corpus after the act as before.
Contrast add-modified-block-currency-check's archive, which re-aimed five tests
and retired one.

The whole report diff across the act is THREE lines and none is a finding:
canon words 218169 -> 219088 (+919), governance words 690954 -> 691873 (the same
+919 moving from active-change prose into promoted prose), canon share
31.6% -> 31.7%, and the promoted-specs row 160586 -> 161505.

RECORDS. Group 2's fifteen boxes are ticked against #466 with a dated discharge
pointer at the group head; EIGHT carry a RECONCILED clause rather than a silent
tick — § 2.4, § 2.6 and § 2.14 moved by the amendment, and § 2.3, § 2.7, § 2.8,
§ 2.10 and § 2.15 by defects in the packet that realization found (three-vs-four
test files, eight predicted reds that were five, the function rename the roster
did not ask for, F2's provenance checker that would not have covered the new
tree, the mutant no value comparison can kill, and an unforeseen allowlist pin).
§ 4 is left OPEN as authored — § 4.2's first nightly with this emit present is
the measurement no archive act can supply. § 1.2's veto flag stays open,
not-vetoed being neither vetoed nor ruled. `Status: ratified` is unchanged in the
archived proposal, and the three moved files are byte-identical to their active
originals.

add-modified-block-currency-check § 7.2's flip of the scenario-title arm to
`error` is untouched and still owed; _DRIFT_SEVERITY exists so that flip cannot
drag this class with it.

Refs #357

Co-authored-by: brettheap <[email protected]>
Co-authored-by: Claude Opus 5 <[email protected]>
@brettheap
brettheap deleted the change/amend-unplaced-shape-rule branch August 28, 2026 09:10
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