Skip to content

Promotion-fidelity reads live mains and presumes ratified-by-archiving (rulings Q1+Q2) - #320

Merged
brettheap merged 4 commits into
mainfrom
change/promotion-fidelity-basis-and-exemption
Aug 25, 2026
Merged

brettheap merged 4 commits into
mainfrom
change/promotion-fidelity-basis-and-exemption

Conversation

@brettheap

Copy link
Copy Markdown
Contributor

Realizes the two family rulings recorded at add-promotion-fidelity-check task 4.1 (PR #315):

  • Exemption relaxes to explicit-draft-only: archiving presumes ratification; only a header whose leading token declares draft-or-lower standing exempts (declared_standing() symmetric over annotations; the taxonomy partition asserted structurally). Measured old-vs-new on live mains: +54 requirements examined, +0 findings anywhere — the four un-exempted packets are exactly the ruled shapes (hermes-install's annotated-ratified + headerless, medx-roottruth's two headerless); C5's rule holds in another repo (an explicit draft stays exempt); openxFactory reads 0 findings under both spellings post-Apply add-workbench-branch-sessions' two unpromoted ratified deltas (promotion-fidelity 5.1) #316.
  • The nightly measures live mains for this family only: doc-health-reusable.yml (which lives HERE — the aggregation caller owns no run step, nothing owed there) gains a fetch-only step before the suite plus --promotion-fidelity-basis live-main on the reporting invocation; HEAD/index/worktree untouched so every other family reads the identical pinned tree; the report STATES the basis per repository and names an unreachable main FELL BACK rather than staying silent. Narrowness structural (grep-test-pinned to two files). Proven end-to-end against the real aggregation: 23 repos live-resolved, 10 named fallen back.
  • A real bug found in the doing: git ls-tree resolves against the prefix while git show <ref>:<path> reads from the root — pointed at a subdirectory the pair silently lists one subtree and reads another. Fixed with --full-name + :(top), pinned by a real-git test.
  • 7/7 mutations killed (one survivor re-pinned by call count); tasks/design/proposal updated as revisions so the first spelling and the measurement that retired it stay readable; 4.2 and the header discharges stay sequenced per the ruling.

Gates, exit codes direct: openspec validate --all --strict 75/75; tests/doc-health 802 (771 + 31); -k workbench 140; cross-suite doc_health importers 781; whole-repo doc-health byte-identical (4/8/75/4, ranked plans line-for-line).

🤖 Generated with Claude Code

brettheap and others added 3 commits August 24, 2026 22:40
…mains for this one family

Two rulings from task 4.1's four-question round (PR #315), realized.

The exemption asked the wrong question. "Checked only where the status reads
exactly `ratified`" was precisely narrow on openxFactory and a false-negative
channel everywhere else: an annotated ratification is not the string
`ratified`, and a packet with no header at all could buy silence by omitting
one. Four packets and 54 requirements across hermes-install and
medx-roottruth-install were exempt for a decision nobody took, and both
repositories reported zero findings at 57.8% and 0% coverage. It now presumes
archiving to be ratification and exempts only an explicitly declared
`draft`-or-lower standing, read from the header's leading token in both
directions so an annotation cannot change what a standing says. Measured: +54
requirements examined, +0 findings anywhere, openxFactory unmoved at two.

The basis asked the wrong tree. Against the aggregation's committed pins this
family's coverage collapsed and it could not see the #301 gap while the
codexFactory pin lagged behind the repository that had it. A promotion gap is
a fact about a repository's own main. So the reusable workflow fetches each
governed submodule's origin/main — a fetch moves no file, so every other
family still reads the pinned tree — and the reporting run takes
`--promotion-fidelity-basis live-main`. The narrowness is structural: only
this family's module and the runner that plumbs the flag can name the option,
and a test greps the package to keep it that way. The report states the basis
in the headline and per repository under the family's own heading, on clean
runs too, and names any repository whose live main it could not read as having
fallen back.

Found on the way: `git ls-tree` resolves and prints against the current prefix
while `git show <ref>:<path>` always reads from the tree root, so the untuned
pair lists one subtree and reads another. The fixture repositories live inside
this repository, and the first cut of the end-to-end test listed the fixture's
openspec and read openxFactory's, reporting a clean run for it.

Six mutations killed by test, including both directions of the presumption.

Co-Authored-By: Claude Fable 5 <[email protected]>
…tay open

The packet's own read-back for task 4.1's non-gate rulings. D2 is revised in
the proposal and D3 in the design, both marked as revisions rather than
rewritten, so the first spelling and the measurement that retired it are both
readable; D5 and D7 state the live-mains basis, its three safety properties,
and the three alternatives it rejected. Tasks 2.1 through 2.6 say what moved
in each file, 3.8 through 3.10 carry the evidence — the two un-exempted shapes
frozen as fixtures, the two-run disagreement that makes the basis load-bearing,
and the corpus-wide old-versus-new measurement across every repository this
session could reach.

Two numbers are left disagreeing on purpose. The ruling's record says 57
requirements were exempt-invisible; this implementation re-derives 54 from live
mains on 2026-08-24. The four packets are the same four. A re-derived count
that quietly overwrote the ruling's would leave nobody able to tell which run
either number came from.

4.2 and 4.3 stay open, and 4.1's own text is why: the gate ruling is
ENFORCING, SEQUENCED, behind the hermes-install and medx-roottruth header
discharges. 5.2 gains the reason the report contract's new basis note does not
reach `docs/doc-health.md` yet — that document is `Status: standard` and backed
by promoted canon, so the note rides this change's delta through the same door
the eighteenth family is still waiting at.

Co-Authored-By: Claude Fable 5 <[email protected]>
Copilot AI lite review requested due to automatic review settings August 25, 2026 02:48

@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

Implements the two task 4.1 rulings for the doc-health promotion-fidelity family: (1) narrow the exemption to explicit draft-or-lower only (archiving otherwise presumed ratified), and (2) make the nightly measure live origin/main for this family only, while keeping every other family on the pinned checkout, and ensuring the report explicitly states the basis used.

Changes:

  • Promotion-fidelity exemption now keys on declared standing’s leading token (explicit pre-ratification standings exempt; annotated/unknown/headerless/no-proposal are examined).
  • Adds a “live-main” measurement basis implemented via a non-mutating git fetch + ref-reading tree (ls-tree/show) and propagates a CLI flag through runner/workflow; report renders per-family basis notes.
  • Extends tests/fixtures to pin both the exemption change and the live-main basis behavior (including the ls-tree vs show prefix/root bug fix).

Reviewed changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/doc-health/test_workflow_contract.py Asserts workflow ordering and non-mutating fetch step; asserts flag only on reporting run.
tests/doc-health/test_promotion_fidelity.py Adds extensive regression tests for exemption presumption + live-main basis + report note rendering + CLI flag wiring.
tests/doc-health/fixtures/promotion-fidelity-presumption/gammaFactory/openspec/specs/runtime-foundation/spec.md Adds canon fixture used by presumption tests.
tests/doc-health/fixtures/promotion-fidelity-presumption/gammaFactory/openspec/changes/archive/2026-07-14-no-proposal-at-all/specs/runtime-foundation/spec.md Adds delta fixture for “no proposal” presumption case.
tests/doc-health/fixtures/promotion-fidelity-presumption/gammaFactory/openspec/changes/archive/2026-07-13-annotated-draft/specs/runtime-foundation/spec.md Adds delta fixture for annotated-draft exemption case.
tests/doc-health/fixtures/promotion-fidelity-presumption/gammaFactory/openspec/changes/archive/2026-07-13-annotated-draft/proposal.md Adds proposal fixture with annotated draft Status header.
tests/doc-health/fixtures/promotion-fidelity-presumption/gammaFactory/openspec/changes/archive/2026-07-12-explicit-draft/specs/runtime-foundation/spec.md Adds delta fixture for explicit-draft exemption case.
tests/doc-health/fixtures/promotion-fidelity-presumption/gammaFactory/openspec/changes/archive/2026-07-12-explicit-draft/proposal.md Adds proposal fixture with explicit draft Status header.
tests/doc-health/fixtures/promotion-fidelity-presumption/gammaFactory/openspec/changes/archive/2026-07-11-headerless-archive/specs/runtime-foundation/spec.md Adds delta fixture for headerless-archive presumption case.
tests/doc-health/fixtures/promotion-fidelity-presumption/gammaFactory/openspec/changes/archive/2026-07-11-headerless-archive/proposal.md Adds headerless proposal fixture text (no Status header).
tests/doc-health/fixtures/promotion-fidelity-presumption/gammaFactory/openspec/changes/archive/2026-07-10-annotated-ratification/specs/runtime-foundation/spec.md Adds delta fixture for annotated-ratified presumption case.
tests/doc-health/fixtures/promotion-fidelity-presumption/gammaFactory/openspec/changes/archive/2026-07-10-annotated-ratification/proposal.md Adds proposal fixture with annotated ratified Status header.
tests/doc-health/conftest.py Extends FakeGit to support ref resolution + ls-tree/show for live-main basis.
scripts/doc_health/runner.py Plumbs --promotion-fidelity-basis, collects per-family notes during run, and passes notes into report.render().
scripts/doc_health/report.py Adds optional per-family notes rendered under each family heading before findings/skips.
scripts/doc_health/promotion_fidelity.py Implements declared-standing exemption, live-main ref reading (WorkingTree/GitRefTree), and basis notes.
scripts/doc_health/families.py Introduces FAMILY_NOTES registry (currently promotion-fidelity basis notes).
scripts/doc_health/corpus.py Extends RealGit: ref-scoped first_commit_timestamp, resolve_ref, ls_tree_paths (:(top)+--full-name), show_blob.
scripts/doc_health/init.py Adds RunResult.notes to carry per-family note lines into report rendering.
openspec/changes/add-promotion-fidelity-check/tasks.md Updates task record with ruling realization evidence and sequencing notes.
openspec/changes/add-promotion-fidelity-check/specs/document-lifecycle/spec.md Updates governed requirement text to reflect presumed-ratified-by-archiving rule.
openspec/changes/add-promotion-fidelity-check/specs/doc-health/spec.md Specifies basis declaration requirements and exemption semantics for promotion-fidelity.
openspec/changes/add-promotion-fidelity-check/proposal.md Updates code_surface narrative and records the 4.1 rulings as non-veto items.
openspec/changes/add-promotion-fidelity-check/design.md Records revised exemption design rationale and live-main measurement basis design.
.github/workflows/doc-health-reusable.yml Adds non-mutating live-main fetch step and passes --promotion-fidelity-basis live-main to reporting run.

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

Comment on lines +136 to +144
pf_basis = getattr(args, "promotion_fidelity_basis",
promotion_fidelity.BASIS_PINNED)
if pf_basis != promotion_fidelity.BASIS_PINNED:
# In the headline, not only in the family's own section: a reader
# comparing two runs' finding counts must be told at the top that one
# family changed the tree it reads (task 4.1's ruling, PR #315).
deviations.append(
"promotion-fidelity measured against each repository's live "
"origin/main (every OTHER family measures the pinned checkout)")
Comment thread scripts/doc_health/runner.py Outdated
Comment on lines +226 to +229
# Notes describe the run a family ACTUALLY performed, so they are
# collected here — beside the call — rather than recomputed later
# from flags. A skipped family gets none: its Skip reason is what
# the report has to carry.
Comment on lines +1257 to +1258
SUBS=$(git config --file .gitmodules --get-regexp 'submodule\..*\.path' \
| awk '{print $2}' | grep -E '^(openxFactory|xFactories/)')
…happens; the fetch step keeps its non-fatal word.

`normalize_basis` is now the one choke point `runner.build_context`'s
headline deviation line and `promotion_fidelity.requested_basis`'s tree
choice both read through, so a typo'd or programmatic basis value can
no longer make the report claim live-main while the family measures
pinned — it aborts loudly instead. `run_suite`'s comment now says what
actually happens to a family that returns a Skip instance (it still
gets a note) versus one skipped by --skip-family (which alone gets
none). The live-main fetch step's SUBS=$(...) pipeline now tolerates
an empty match or a missing .gitmodules with `|| true`, so it exits 0
as its own "non-fatal by design" comment already promised, instead of
aborting under this shell's default -e -o pipefail.

Co-Authored-By: Claude Fable 5 <[email protected]>
Copilot AI review requested due to automatic review settings August 25, 2026 03:01
@brettheap
brettheap merged commit 055a514 into main Aug 25, 2026
2 of 3 checks passed
@brettheap
brettheap deleted the change/promotion-fidelity-basis-and-exemption branch August 25, 2026 03:01

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

Copilot reviewed 25 out of 25 changed files in this pull request and generated no new comments.

brettheap pushed a commit that referenced this pull request Aug 25, 2026
…igation is canon

The five realization merges are all on main and each was re-verified an
ancestor of it at this gate - PRs #310 73766b4, #315 1274b9b, #316 51a875a,
#320 055a514, #325 44505d1 - so the merge-plus-green rule the packet declared
is satisfied and the archive act is this separate later commit, following
govern-openspec-corpus-membership.

The gate halted twice before it ran. The first halt found this packet's own
doc-health delta restating one scenario of an eight-scenario MODIFIED
requirement, which would have destroyed the other seven on promotion. While
that was being repaired, main archived add-release-inventory-drift-check
(b03b999) - the same defect, found independently the same day and ruled on by
Brett, whose account now stands in canon as the CORRECTED 2026-08-25 paragraph.
That sibling's delta had been written on top of this change's text, so canon
moved: nineteen families, not eighteen, with this change's own amendments
already inside it. The branch was reset to the new origin/main and every
artefact re-derived against it rather than merged. The faithful MODIFIED block
is therefore current canon verbatim - SHA-256
57cfc188905dc9926ebb9a9570db98d5bd419184409a91b83e56045fba27bf0b, all eight
scenarios identical scenario-by-scenario and in canon's order. Archived as
drafted it would have destroyed the seven scenarios and regressed the
enumeration to eighteen, dropping release-inventory drift, its paragraph, its
AND bullet, and Brett's CORRECTED paragraph.

The act is verified by requirement map rather than by the CLI's summary:
doc-health 26 -> 28 requirements and 105 -> 116 scenarios; document-lifecycle
14 -> 15 and 63 -> 68. Nothing removed from either, all 26 and all 14
pre-existing requirements byte-for-byte identical across the act, both promoted
files pure additions with zero deletions.

Closing symmetry: the enforcing family over openxFactory at --fail-on error
reads 0 findings, exit 0, both before and after - the family that reports an
unarrived delta says nothing about the delta this act just landed - and the
packet's header still parses at its new archived path, Status: ratified with
the record-citing Ratified: line clearing approver and date inside the 15-line
window. Post-archive gates: openspec validate --all --strict 76 passed 0 failed
(one fewer active), pytest tests/doc-health 874 passed 1 failed (the enumerated
environment artifact, unmoved), pytest -k workbench 140 passed. The full
single-repo report's findings are byte-identical to the baseline and exactly
two per-stage numbers moved, both predicted: standard 10851 -> 11102 for
docs/doc-health.md's own new words, and promoted specs 121304 -> 123563 for the
census taking in what this act promoted.

Task 5.2 ticks with its three arrivals; task 5.5 records that promotion
fidelity is structurally blind to this damage class, because latest-writer-wins
makes a destroying delta look faithful the instant it lands - a named candidate
for a pre-archive restatement-completeness check, not built here.

Also named, not fixed, and owed to the codex-archive lane rather than to this
one: ideation/cross-reference.yaml pins source_revision f13a3b6, PR #322's
branch tip, which is not an ancestor of main. The merged commit is 4e57009.

Co-Authored-By: Claude Fable 5 <[email protected]>
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