Skip to content

fix(openspec): rebind the architecture-contracts subject to its squashed commit - #466

Closed
monkey1sai wants to merge 1 commit into
mainfrom
fix/openspec-ledger-squash-subject
Closed

monkey1sai wants to merge 1 commit into
mainfrom
fix/openspec-ledger-squash-subject

Conversation

@monkey1sai

Copy link
Copy Markdown
Owner

What

One-line data correction in openspec/lifecycle-ledger.json.

The row introduce-executable-architecture-contracts records
subject_commit = 9f4a470bf96de2ef7d605c2e593bfae6ff96147b, which is PR #464's
pre-squash branch head. This repo squash-merges, so what landed on main is
c5b9089ebf11eabe9979b8eb717270c7c7a7308e; 9f4a470 lives only on the PR ref
and can never be an ancestor of main.

Rebound to c5b9089…, which is also the last commit touching
openspec/changes/introduce-executable-architecture-contracts/, so the
reconciled snapshot is clean — the property the assertion actually checks.

Why it matters now

Every open PR is red on Agent Governance:

not ok - current ledger keeps reconciled source snapshots clean
  code:  subject_not_ancestor
  error: 'Lifecycle row subject must be an ancestor of the checked-out HEAD.'

The gate runs on pull_request only, so main carries the broken row silently
and it surfaces on every PR opened against it rather than on the merge that
introduced it.

Generalisable lesson

A branch SHA is not a durable subject under squash-merge. Any lifecycle row
written before its own PR merges has this failure mode.

Item Result
Change lane F
Behavior contract changed no
Linked issue none - unblocks CI on every open PR (observed on #459)
Requirement source existing contract: docs/agents/ (openspec lifecycle ledger machine-truth invariant)
CODEOWNERS / owner review requested
GitNexus evidence not needed: single JSON data value, no code symbol touched
Browser E2E evidence not user-facing
Agent workflow changed? no
Required checks expected CI / Agent Governance / PR Metadata Contract
Item Result
Affects runtime / docker / Kit / viewer / ports / env? no
Canonical deploy path updated? not needed
New root script added? no
Deploy dry-run command not applicable: no deploy path touched
Full deploy tested not applicable
Verify command node --test scripts/tests/test-openspec-machine-truth.mjs
Frontend URL verified not applicable

Verification run in this session (worktree at the corrected content):
node --test scripts/tests/test-openspec-machine-truth.mjs goes from
# pass 23 / # fail 1 to # pass 24 / # fail 0.

…hed commit

Every open PR is red on `Agent Governance` with

  not ok - current ledger keeps reconciled source snapshots clean
  code: subject_not_ancestor
  'Lifecycle row subject must be an ancestor of the checked-out HEAD.'

The row `introduce-executable-architecture-contracts` records
subject_commit 9f4a470, which is PR #464's pre-squash BRANCH head. The repo
squash-merges, so what actually landed on main is c5b9089 and 9f4a470 exists
only on the PR ref - it can never be an ancestor of main. A branch SHA is not a
durable subject under squash-merge.

Rebound to c5b9089, the squashed commit on
main, which is also the last commit touching
openspec/changes/introduce-executable-architecture-contracts/ - so the
reconciled snapshot is clean, which is what the assertion checks.

Note the gate only runs on pull_request, so main carries this silently and it
surfaces on every PR opened against it rather than on the merge that caused it.

Verified: node --test scripts/tests/test-openspec-machine-truth.mjs
goes from 23 pass / 1 fail to 24 pass / 0 fail.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GV5yjuGdAgJ9PYPRam6biV
Copilot AI review requested due to automatic review settings August 3, 2026 03:59
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

💤 Files selected but had no reviewable changes (1)
  • openspec/lifecycle-ledger.json
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: de720be4-90f7-4b7e-9967-e53261b8f7a7

📥 Commits

Reviewing files that changed from the base of the PR and between e3664b1 and d2af60a.

📒 Files selected for processing (1)
  • openspec/lifecycle-ledger.json

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@monkey1sai

Copy link
Copy Markdown
Owner Author

Superseded by #465, which landed the identical correction (subject_commit rebound to c5b9089ebf11eabe9979b8eb717270c7c7a7308e) before this one was reviewed. Same diagnosis, same value - closing as duplicate rather than resolving the conflict.

Leaving the generalisable note here since it cost two PRs to find: a branch SHA is not a durable subject under squash-merge, so any lifecycle row written before its own PR merges has this failure mode. And because Agent Governance runs on pull_request only, main carries such a row silently while every PR opened against it goes red.

@monkey1sai monkey1sai closed this Aug 3, 2026
@monkey1sai
monkey1sai deleted the fix/openspec-ledger-squash-subject branch August 3, 2026 04:01

Copilot AI 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.

Pull request overview

This PR is a one-value data correction in openspec/lifecycle-ledger.json. The row for introduce-executable-architecture-contracts recorded subject_commit = 9f4a470…, the pre-squash branch head of PR #464. Because the repo squash-merges, that SHA is unreachable from main and can never be an ancestor of HEAD, so the Agent Governance gate (assertRowSubjectAncestor → subject_not_ancestor) turned every open PR red. The value is rebound to c5b9089…, the actual squash-merge commit of #464.

I confirmed via the GitHub API that c5b9089ebf11eabe9979b8eb717270c7c7a7308e:

  • is the landed squash-merge commit of #464 on main (hence an ancestor of HEAD),
  • modifies the change's OpenSpec directory (design.md, spec.md, tasks.md), and
  • is the most recent commit touching that change's tasks.md, so its diff-to-HEAD leaves the change's owned source clean — precisely the "reconciled source snapshots clean" property asserted in verify-openspec-machine-truth.mjs / openspec-machine-truth.mjs.

The value is a valid lowercase 40-hex SHA, only line 1395 changes, JSON validity is preserved, the row status stays active (so no NOW.md/lifecycle-state update is required), and task_ledger is untouched.

Changes:

  • Rebind introduce-executable-architecture-contracts.subject_commit from the pre-squash head 9f4a470… to the landed squash commit c5b9089….

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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