Skip to content

Propose harden-ideation-readiness-check: the bootstrap-clusters proof reads a foreign checkout, and skips its own assertion - #372

Merged
brettheap merged 3 commits into
mainfrom
change/harden-ideation-readiness-check
Aug 26, 2026
Merged

brettheap merged 3 commits into
mainfrom
change/harden-ideation-readiness-check

Conversation

@brettheap

Copy link
Copy Markdown
Contributor

Proposal only. No code is changed by this PR — it carries the packet, the measurement and the plan; tasks.md holds the implementation. Do not merge until the packet is admitted (see "For your ruling" below).

Packet: openspec/changes/harden-ideation-readiness-check/ — proposal, design, tasks, and a doc-health delta of three ADDED requirements, nine scenarios, none MODIFIED.

The two defect classes (all measured 2026-08-26 against origin/main at 31c931fa)

tests/doc-health/test_ideation_readiness.py::test_derivation_reproduces_the_real_bootstrap_clusters is the proof that the readiness lane's cluster derivation still reproduces the landed ideation-cross-reference index. It carries two independent defects: one makes it red on a healthy repository, the other makes it green by never running.

A — location hazard. _openxfactory_root() (:28) walks UP from REPO_ROOT to the first ancestor holding openxFactory/ideation/cross-reference.yaml. Inside the aggregation workspace exactly one directory satisfies that condition, so the answer is always the shared checkout /home/brett/projects/xFactory/openxFactory, whatever repository the run was launched against. For the shared checkout itself it is right by coincidence; for every agent worktree it silently proves a verdict about another session's working tree.

It fired the same morning: the shared checkout held an uncommitted edit bumping generation.source_revision without regenerating the body — 67 listed clusters against 253 that derive from the corpus at the revision it now claims. Every worktree on the machine went red; every isolated clone passed at every revision. The checker shares the hazard: find_index_validator() (scripts/doc_health/ideation_readiness.py:682-692) carries the identical walk and was measured returning the shared checkout's validator from a scratch worktree.

B — silent zero coverage. main's index pins f13a3b6007736292e1e157febef1ac733e534de9. git branch -a --contains returns nothing, merge-base --is-ancestor f13a3b60 origin/main is false, and git ls-remote origin | grep -c f13a3b60 is 0. git archive fails and the test turns that into pytest.skip, so the assertion below has never been evaluated in a fresh clone.

A scratch git clone --bare --no-local proves it end to end: rev-parse --is-shallow-repository → false, cat-file cannot find the object, git archive f13a3b60 ideation → rc 128. So the skip's stated reason — "shallow clone?" — is false in the one environment where it fires, since pytest-suite.yml checks out at fetch-depth: 0. Locally the object survives only as a leftover fetch; git gc --prune flips this test pass → skip with no tracked file changing.

How the pin got there: the index was regenerated on codex/brainstorm-packet-migration at 1f852a5f, correctly pinning that branch's then-HEAD da9bf3b7. The branch landed squashed as 4e57009c ("Migrate brainstorms into three-tier packets (#322)", single parent 700c1a19). Diffing branch tip against the landed index yields exactly one changed line — the pin, moved by hand from da9bf3b7 to the branch tip f13a3b60, while the body stayed as generated. The squash then made both unreachable.

The four things proposed

  1. Root resolution prefers the repository under test. It is tried first; an explicit argument, OPENXFACTORY_ROOT, then the ancestor walk serve as declared fallbacks, and any fallback taken must be named in the run's output. This extends a pattern the module already carries at :1067 for the renderer and that tests/ideation-dashboard/test_doxbench_contracts.py already pins — not a new mechanism.
  2. The comparison reads the index from committed state (git show <ref>:ideation/cross-reference.yaml at HEAD of the repository under test), with the corpus still read at the index's own pin. Both sides become revision-addressed, so no concurrent edit anywhere on the machine can red or green the verdict. The design records the two rejected alternatives (working tree plus a clean-tree requirement; reading at the pinned revision itself — circular).
  3. An unresolvable pin fails on a complete clone, and is skipped only where history is genuinely truncated — discriminated by asking rev-parse --is-shallow-repository and cat-file -e <rev>^{commit} rather than by conjecture, with the reason naming the condition observed.
  4. The current defect instance is repaired in the same change, because (3) turns today's silent skip into a red and the change would otherwise land red on its own gate. It is a ONE-LINE re-pin to 4e57009c; no regeneration is owed, because the derivation reproduces the committed 290-entry skeleton exactly at da9bf3b7, at 4e57009c, and at origin/main alike.

Explicitly out of scope

The governance rule that an index pin must be re-derived when a branch lands rebased or squashed is a separate future packet and is deliberately NOT proposed here. This change makes the consequence loud and repairs the one live instance; it does not state the process obligation, which reaches beyond this surface (it would bind every generator recording a source_revision, and it interacts with the house rule against squash merges — 4e57009c is itself a squash). Named in the proposal's § Named follow-ups and tasks.md § 5.2.

Also named and not closed: whether the three duplicated _openxfactory_root() spellings should collapse into one fixture (§ 5.1), and git_generation() pinning HEAD regardless of working-tree cleanliness (§ 5.3).

Validation

  • OPENSPEC_TELEMETRY=0 openspec validate harden-ideation-readiness-check --strict → Change 'harden-ideation-readiness-check' is valid
  • OPENSPEC_TELEMETRY=0 openspec validate --all --strict → 77 passed, 0 failed
  • python3 -m pytest tests/doc-health -q → 1 failed, 895 passed, identical to the baseline taken on origin/main before any edit. The single failure is test_derivation_reproduces_the_real_bootstrap_clusters — defect A in flight, not caused by this branch, which changes no code.
  • No uppercase POST substring in the authored prose (staging-workbench trap).
  • Listed in the README's OpenSpec Records "Active changes" block.

For your ruling

  • ADMISSION (tasks.md § 1). The packet is Status: draft and UNADMITTED. No approval act exists, so .openspec.yaml declares kind: ad_hoc with a durable id and reason but carries deliberately blank approved_by/approved_on rather than fabricated provenance — the refusal openxFactory PR Sweep the proposal-origin errors: one derivable, two a STOP #344 already made once. proposal-origin will report two ad-hoc origin lacks required ERRORS against this packet in the nightly run until it is admitted; admission is a two-field edit plus a Status: move.
  • Q1 — keep the narrowed skip for truncated clones, or delete the skip entirely? Recommendation: keep.
  • Q2 — re-pin to 4e57009c (the commit that landed the index) or regenerate at current main? Both yield an identical body. Recommendation: 4e57009c.
  • Q3 — should the three duplicated resolver helpers collapse into one shared fixture? No recommendation offered.
  • Four orchestrator decisions are flagged for veto in the proposal's § Orchestrator decisions.

🤖 Generated with Claude Code

Raise harden-ideation-readiness-check: three ADDED `doc-health` requirements,
nine scenarios, over two independent defects found in one test on 2026-08-26.

A. LOCATION HAZARD. `test_derivation_reproduces_the_real_bootstrap_clusters`
resolves its subject by walking UP from the repository under test to the first
ancestor holding `openxFactory/ideation/cross-reference.yaml`. Inside this
workspace exactly one directory satisfies that, so the answer is always the
shared checkout, whatever repository the run was launched against. Every agent
worktree therefore proves a verdict about another session's working tree. It
fired: an uncommitted pin bump in the shared checkout (67 listed clusters
against 253 derived) reddened every worktree while every isolated clone passed
at every revision. The checker's own `find_index_validator()` carries the
identical walk and was measured resolving the shared checkout's validator.

B. SILENT ZERO COVERAGE. `main`'s index pins `f13a3b60`, reachable from no ref
local or remote — the branch that generated it landed squashed as `4e57009c`,
and diffing branch tip against landed index shows exactly one changed line, a
hand-bumped pin. The test converts the unresolvable pin into `pytest.skip`, so
the assertion has never executed in a fresh clone; a scratch `--no-local` clone
reports `is-shallow-repository` false, cannot `cat-file` the object, and
returns 128 from `git archive`. The skip's stated reason ("shallow clone?") is
false exactly where it fires, since `pytest-suite.yml` uses `fetch-depth: 0`.

The requirements: resolve the repository under test before any other checkout
and announce a fallback rather than substituting silently; read the index from
COMMITTED state so no concurrent edit anywhere can move the verdict; and fail —
never skip — on an unresolvable pin in a complete clone, keeping the skip only
for a genuinely truncated history and naming which condition was observed. The
one-line re-pin to `4e57009c` rides this change because requirement 3 would
otherwise land it red on its own gate; the derivation reproduces the committed
290-entry body at `da9bf3b7`, `4e57009c` and `origin/main` alike, so no
regeneration is owed.

Explicitly deferred to its own packet: the governance rule that an index pin
must be re-derived when a branch lands rewritten.

`Status: draft` and UNADMITTED. No approval act exists, so `.openspec.yaml`
declares `kind: ad_hoc` with a durable id and reason but deliberately blank
`approved_by`/`approved_on` rather than fabricated provenance; `proposal-origin`
will report two errors against the packet until it is admitted.

Validation: `openspec validate harden-ideation-readiness-check --strict` and
`--all --strict` both green (77 passed, 0 failed). `pytest tests/doc-health`:
1 failed, 895 passed — identical to the baseline on `origin/main` at
`31c931fa`, the single failure being defect A in flight. No code is changed by
this commit.

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

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

… not one

Self-review correction, found by checking the claim rather than trusting it.
`tasks.md` § 3.4 said `ideation/cross-reference.md` does not carry the
`source_revision` and could be left untouched by the re-pin. It does carry it,
at line 9 — `- Source revision: \`f13a3b60...\`` — so re-pinning the yaml alone
would leave the two artifacts disagreeing about the same fact.

§ 3.4 now says regenerate the md through
`scripts/render-ideation-cross-reference.py`, with the pin line as the only
line expected to move and any other movement treated as a finding about the
repair. The proposal's § Impact names both artifacts.

`openspec validate harden-ideation-readiness-check --strict` and
`--all --strict` re-run green (77 passed, 0 failed). No delta text changed.

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

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 adds a new OpenSpec proposal packet (harden-ideation-readiness-check) describing measured defects in the ideation readiness derivation proof and outlining a plan to harden it (no runtime code changes yet; implementation is deferred to tasks.md).

Changes:

  • Add a new OpenSpec change packet with proposal, design notes, task plan, and a doc-health spec delta describing three added requirements.
  • Register the new packet in the README “Active changes” index.
  • Add a machine-readable .openspec.yaml origin declaration for the packet (currently intentionally incomplete pending admission).

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
README.md Adds the new change packet to the “Active changes” index with context and status.
openspec/changes/harden-ideation-readiness-check/.openspec.yaml Declares the packet metadata and origin block.
openspec/changes/harden-ideation-readiness-check/proposal.md Records the measured defects, scope, decisions, and open questions.
openspec/changes/harden-ideation-readiness-check/design.md Captures the key design decisions and rejected alternatives.
openspec/changes/harden-ideation-readiness-check/tasks.md Provides the dependency-ordered implementation and verification plan.
openspec/changes/harden-ideation-readiness-check/specs/doc-health/spec.md Defines the doc-health requirements/scenarios added by the proposal.

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

still reproduces the landed `ideation-cross-reference` index. It needs two
things from a checkout — the index and the corpus the index pins — and today
it finds them by walking UP from its own location to the first ancestor
holding a `openxFactory/ideation/cross-reference.yaml`. In the aggregation
Comment on lines +26 to +42
Authored in openxFactory because `doc-health` is an openxFactory
capability and the verification being hardened is its own.
approved_by: ""
approved_on: ""
approval_pending: >-
DELIBERATELY BLANK, NOT OVERLOOKED. The promoted `document-lifecycle`
origin requirement demands explicit approval provenance for an ad-hoc
origin, and the authoring session has none to record: this packet was
raised by a delegated session from a triage record, and no approval act
for it exists. Fabricating one is the failure this repository has already
refused once — openxFactory PR #344 stopped rather than declare an origin
it could not support, and `create-medxchart-overlay-boundary` carries the
shape of the admission that later closed it. Until Brett admits this
packet, `proposal-origin` will report `ad-hoc origin lacks required` for
both fields, which is the honest signal and is recorded as `tasks.md`
§ 1.1. Admission fills the two fields above and moves `proposal.md`'s
`Status:` from `draft`; nothing else in the packet depends on it.
Copilot AI review requested due to automatic review settings August 26, 2026 04: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.

Pull request overview

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

Suppressed comments (1)

openspec/changes/harden-ideation-readiness-check/specs/doc-health/spec.md:14

  • Grammar: use “an” or omit the article before an inline-code path. “holding a openxFactory/...” reads awkwardly in the requirement rationale.
holding a `openxFactory/ideation/cross-reference.yaml`. In the aggregation

…lears it

Admit harden-ideation-readiness-check. Discharges tasks.md § 1.1 and § 1.2
exactly as they were written the day before.

The packet was raised with `approved_by` / `approved_on` DELIBERATELY BLANK,
because no approval act existed and the promoted origin requirement is
satisfied by a real approver or not at all. Brett ruled on 2026-08-26 against
§ Open Questions Q0, while the packet stood at PR #372, and the ruling reached
the authoring session the same day.

`.openspec.yaml`: `approved_by` records Brett and the admission ruling of
2026-08-26; `approved_on: 2026-08-26`. The `approval_pending` key that
explained the blank pair is resolved into an `approval_note` that keeps the
history legible rather than erasing it. No verbatim wording of the ruling
reached the authoring session, so none is quoted anywhere in the packet —
approver, date and record are stated instead, which is what the origin
requirement asks for.

`proposal.md`: `Status: draft` -> `Status: ratified`, with a single
record-citing `Ratified:` line clearing that spelling's three-way floor on all
three axes — approver (`by Brett`), date (`2026-08-26`), and a resolvable
record path. Q0 records the ruling in place rather than being deleted, and the
§ Orchestrator decisions preamble is corrected with its original sentence kept
as history.

WHAT THE ADMISSION DOES NOT COVER, stated in all four files: Q1 (whether the
narrowed skip survives), Q2 (the re-pin target) and Q3 (whether the three
resolver helpers collapse) remain OPEN, and the four decisions in
§ Orchestrator decisions remain flagged for veto and uncovered by this
citation. tasks.md § 1.3 stays unchecked.

The README's active-changes entry asserted `Status: draft` and UNADMITTED and
predicted the two errors; it is corrected in the same commit, because leaving
it would make the README false about a fact the packet now records otherwise.

Measured, scoped to the family, before and after the edit — a pre-admission
`.openspec.yaml` restored into place for the first run and restored back:

  proposal-origin, before: errors=2, warnings=0
    ad-hoc origin lacks required `approved_by`
    ad-hoc origin lacks required `approved_on`
  proposal-origin, after:  errors=0, warnings=0

Exactly the two findings Q0 predicted, exactly cleared, with no other
proposal-origin finding moving. `openspec validate
harden-ideation-readiness-check --strict` and `--all --strict` both green
(77 passed, 0 failed). Still no code changed by this packet.

Co-Authored-By: Claude Fable 5 <[email protected]>
Copilot AI review requested due to automatic review settings August 26, 2026 05:37

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 6 out of 6 changed files in this pull request and generated 2 comments.

Comment on lines +26 to +30
- [x] 1.2 **DONE 2026-08-26.** `.openspec.yaml` `approved_by` records Brett
and the admission ruling of 2026-08-26; `approved_on` is `2026-08-26`;
the `approval_pending` key that explained the blank pair is resolved
into an `approval_note` that keeps the history legible rather than
erasing it. `proposal.md`'s `Status:` moved `draft` → `ratified` with a
Comment on lines +3 to +7
target_release: implemented — the openxFactory main line. This surface cuts NO contract bundle: no schema under `contracts/schemas/` moves, no digest set changes, and no release tag is owed. The archive gate is therefore merge-plus-green on main, plus one piece of evidence the code alone cannot give — the index repair in `tasks.md` § 3, because requirement 3 turns today's silent skip into a red and the change would otherwise land red on its own gate. Concretely: `python3 -m pytest tests/doc-health` green, `OPENSPEC_TELEMETRY=0 openspec validate --all --strict` green, and a scratch-clone run of the readiness proof that PASSES rather than skips — which is the first time any fresh clone will have executed this test's assertion at all. The change ships ACTIVE and archives only after that.
Status: ratified
Ratified: 2026-08-26 by Brett — admission ruling given against this packet's § Open Questions Q0 while it stood at PR #372, and relayed to the authoring session the same day. The ruling is recorded question by question at openspec/changes/harden-ideation-readiness-check/proposal.md § Open Questions Q0, which is this file, and discharged at openspec/changes/harden-ideation-readiness-check/tasks.md § 1. THE CITATION COVERS THE ADMISSION OF THIS PACKET AND NOTHING ELSE: Q1, Q2 and Q3 remain open, and the four decisions in § Orchestrator decisions were taken by the authoring session, are NOT covered by this citation, and stay flagged for veto there. No approving OpenSpec change exists to name, so this cites the record in the spelling `sanction-ratified-record-spelling` sanctioned for exactly that case, and it clears that spelling's three-way floor on all three axes rather than on the one it needs: approver (`by Brett`), date (`2026-08-26`), and a resolvable record path. No verbatim wording of the ruling reached the authoring session, so none is quoted.
Proposed: 2026-08-26
Origin: The 2026-08-26 triage of a red `tests/doc-health` suite in an agent worktree. The red was not caused by the branch under test; chasing it found two independent defects in one test, and the second of them had been hiding an assertion that has never run in continuous integration.
@brettheap
brettheap merged commit 23be099 into main Aug 26, 2026
3 of 5 checks passed
@brettheap
brettheap deleted the change/harden-ideation-readiness-check branch August 26, 2026 06:21
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