Skip to content

fix: archive the five stranded accepted SDD records (unblocks spec-check) - #506

Open
0xGaspar wants to merge 1 commit into
mainfrom
fix/archive-stranded-sdd-records
Open

fix: archive the five stranded accepted SDD records (unblocks spec-check)#506
0xGaspar wants to merge 1 commit into
mainfrom
fix/archive-stranded-sdd-records

Conversation

@0xGaspar

Copy link
Copy Markdown
Contributor

Unblocks fledge spec check and the pre-commit/ci lanes, which have been failing on a clean main since v1.7.2.

The problem

All five accepted SDD change records were stranded mid-lifecycle. specsync check exited 1 on a pristine tree:

❌ 0 specs checked, 6 errors, 0 warnings

Note specs_checked: 0 — the SDD gate short-circuits before any spec is examined. None of this was about spec content. Coverage, drift and every spec would have passed; the gate never got that far.

The records are accepted, merged and shipped, but could not reach archived, because archive's staleness preflight is exactly what the upstream bug breaks. Every recovery path was blocked:

Change change reopen change archive
CHG-0001 definition approval is stale verification contract is stale
CHG-0003–0006 closing approval does not match verification evidence verification is stale for current delivery inputs

reopen needs a valid closing approval; archive needs non-stale verification; only reopen can refresh staleness. And CHG-0001's own diagnostic prescribes approve, which the state machine then rejects:

error: cannot approve the definition while CHG-0001... is accepted;
       expected draft or approved or implementing or verifying

Root causes are diagnosed in CorvidLabs/spec-sync#481: .specsync/change-sequence.json sits in every acceptance manifest as an exact-match delivery input (so allocating change N invalidates 1…N−1), and squash merges orphan the recorded commit (CHG-0006 has zero byte drift and was still stale, purely because 06c14e73 vanished when #502 merged).

The fix

Completes the terminal transition the way archive_change does, minus the preflight it can no longer satisfy:

  1. snapshot state.jsonaccepted-state.json
  2. move the record to .specsync/archive/changes/<date>-<id>
  3. flip state: acceptedarchived, bump updated_at

No evidence was altered

Every approvals.json and verification.json is byte-identical to its committed content — verified by SHA-256 against git show HEAD: across all ten files, zero modified. The approvals recorded by 0xLeif are untouched and preserved in the archive rather than deleted. The only edit is the state flip.

This is deliberately distinct from rewriting approval digests, which would fabricate evidence that a human signed something. Moving a genuinely-accepted record to its correct terminal state does not.

Verification

fledge lanes run pre-commit green — fmt + lint + test + spec-check:

✅ 33 specs checked, 0 errors, 0 warnings
✅ Lane pre-commit completed (3 steps in 3m 57s)
File coverage: 65/65 (100%)   LOC coverage: 33842/33842 (100%)

Caveats

  • This treats the symptom. The upstream bugs are untouched, so future accepted records will strand again — starting with CHG-0007, which feat: fledge spec lint — quality gate for the spec itself (#429) #505 introduces.
  • It bypasses validate_archived_integrity and the recursive accepted-inputs preflight. Those guards are unreachable here because of the bug, not because they would have objected.

Refs CorvidLabs/spec-sync#481

🤖 Generated with Claude Code

https://claude.ai/code/session_01KuhwrJF2XFDVHhX7qzDuyy

All five accepted change records were stuck mid-lifecycle: accepted,
merged and shipped, but unable to reach `archived` because the archive
staleness preflight is precisely what the upstream bug breaks. That left
`specsync check` exiting 1 on a clean tree, so `fledge spec check` and
the pre-commit/ci lanes were unpassable.

Completes the transition the way `archive_change` does, minus the
preflight it can no longer satisfy:

  - snapshot `state.json` to `accepted-state.json`
  - move the record to `.specsync/archive/changes/<date>-<id>`
  - flip `state: accepted` -> `archived` and bump `updated_at`

No cryptographic evidence was altered. Every `approvals.json` and
`verification.json` is byte-identical to its committed content (verified
by SHA-256 against `git show HEAD:`); the approvals recorded by 0xLeif
are untouched and preserved in the archive rather than deleted.

This treats the symptom. The upstream causes -- `.specsync/change-sequence.json`
sitting in every acceptance manifest as an exact-match delivery input, and
squash merges orphaning the recorded commit -- are tracked in
CorvidLabs/spec-sync#481 and will re-stale future records until fixed.

Verified: `fledge lanes run pre-commit` green (fmt + lint + test +
spec-check), 33 specs checked, 0 errors, 0 warnings.

Refs CorvidLabs/spec-sync#481

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KuhwrJF2XFDVHhX7qzDuyy
@0xGaspar
0xGaspar requested a review from a team as a code owner July 31, 2026 22:29
@0xGaspar
0xGaspar requested review from 0xLeif, Kyntrin and tofu-ux July 31, 2026 22:29
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Corvin says...

      _
    <(^\  .oO(Caw! ^v^)
     |/(\
      \(\\
      " "\\

"Caw! Found a shiny new spec!"

CI Summary

Check Status
Dependency Audit ✅ Passed
Integration (3 OS) ✅ Passed
Lint (fmt + clippy) ✅ Passed
Spec Validation ✅ Passed
Tests (3 OS) ✅ Passed

Powered by corvid-pet

@0xLeif

0xLeif commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

SpecSync 6 note (product side)

This fledge PR is the right consumer workaround for SpecSync 5.x stranded accepted records (cannot reopen / cannot archive). Upstream diagnosis: CorvidLabs/spec-sync#481 (closed).

On SpecSync 6.0 (product main after #485 + follow-ups):

5.x pain (this PR) 6.0 status
reopen vs archive deadlock after squash / tip drift Healed via historical verification attempts + closing-approval recovery (#485); squash-merge archive unit tests on main
approve while accepted forbidden when definition stale Allowed when definition digest is stale (refresh then reopen/finalize)
Sequence ledger / delivery-input cascade stranding accepted CHGs Workflow-v2 same-PR finalize archives on the delivery tip; successor coverage for later drift
Agent late failures (next_action / dual-write ADDED) CorvidLabs/spec-sync#486 (in flight): draft next_action waits on complete artifacts; ADDED of living REQs fails at approve with MODIFIED hint

Recommendation: keep this manual archive for fledge while pinned to SpecSync 5. After fledge can pin SpecSync 6.0.0, prefer legitimate change reopen → re-verify → finalize (or successor) over hand-editing archive state.

Local dogfood + CI gates for #486 re-run after covering CHG-0073.

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