fix(openspec): restore unfinished deferred changes - #404
Conversation
Restore four non-terminal changes from the completed archive, freeze overlapping ownership, and add a lifecycle gate that prevents deferred or unchecked changes from being newly archived.
|
Warning Review limit reached
Next review available in: 47 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (80)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Pass --type change from the PR review agent so a restored change can coexist with its canonical spec without producing an ambiguous validation command.
There was a problem hiding this comment.
Pull request overview
This PR is a historical/governance correction to the OpenSpec lifecycle. It restores four unfinished/deferred changes (rvt-ifc-usdc-lineage, cross-service-structured-log-baseline, align-frontend-design-system-reference, minio-folderview-and-baseline-disclosure) out of the completed archive and back into openspec/changes/, keeping each frozen (Status: deferred, non-canonical, non-owner). It also codifies the new rule in openspec/AGENTS.md, adds a verify-openspec-lifecycle.ps1 gate wired into the Agent Governance workflow, and updates the governance ledger/docs. The only executable logic is the new PowerShell verifier and the CI wiring; the bulk of the diff is restored spec/proposal/contract text and status-note edits.
Changes:
- Restore 4 deferred changes with "historical correction" notes and update
openspec/AGENTS.mddone-criteria so deferred stays inchanges/and only fully-completed/successor-covered changes may be archived. - Add
scripts/tests/verify-openspec-lifecycle.ps1(rejects deferred markers/unchecked tasks in newly archived changes, enforces WIP-over-budget additions must be deferred) and run it inagent-governance.ymlwith-BaseRef base.sha(+fetch-depth: 0). - Update cross-referencing status notes in related active changes,
docs/plans/NOW.md, and the structured-log contract doc; add corresponding assertions intest-agent-governance-check.ps1.
Reviewed changes
Copilot reviewed 22 out of 80 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/tests/verify-openspec-lifecycle.ps1 | New lifecycle gate; core reviewable logic (diff parsing, deferred/archive/WIP checks); lacks a paired unit test. |
| .github/workflows/agent-governance.yml | Adds fetch-depth: 0 and a step running the verifier with the PR base SHA. |
| scripts/tests/test-agent-governance-check.ps1 | Adds existence + content assertions for the verifier, workflow step, and AGENTS.md rules. |
| openspec/AGENTS.md | Adds MUST rules keeping deferred changes out of archive and restricting archival to completed/successor-covered changes. |
| openspec/changes/rvt-ifc-usdc-lineage/** (proposal, specs, contracts, examples) | Restored frozen change with historical-correction note and full contract/spec/example set. |
| openspec/changes/cross-service-structured-log-baseline/** | Restored deferred change (proposal/design/spec/.openspec.yaml) for runtime-evidence-only closeout. |
| openspec/changes/align-frontend-design-system-reference/** | Restored deferred change (proposal/design/tasks/specs) pending crosswalk with migrate-console. |
| openspec/changes/minio-folderview-and-baseline-disclosure/** | Restored deferred change (proposal/tasks/specs) for closeout reconciliation. |
| openspec/changes/migrate-console-to-hifi-design/, a4-semantic-search-model-qa/ | Status-note edits pointing at restored deferred changes instead of archive paths. |
| openspec/specs/minio-watch-auto-intake, minio-fileserver-source, governance-throughput-budget | Updated deferred-change cross-references to openspec/changes/ locations. |
| docs/plans/NOW.md | Ledger/DoD updates; new change-log row inserted out of date order. |
| docs/contracts/structured-log-schema.md | Reworded capability-spec pointer for the restored deferred change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| function Get-DiffTargetPaths { | ||
| param([Parameter(Mandatory = $true)][string] $Against) | ||
|
|
||
| # Compare the base commit directly with the current tree. This works both in | ||
| # CI (where the PR diff is committed) and during a local pre-commit check. | ||
| $lines = @(git diff --name-status -M $Against --) | ||
| if ($LASTEXITCODE -ne 0) { | ||
| throw "Unable to diff lifecycle state against $Against" | ||
| } | ||
|
|
||
| foreach ($line in $lines) { | ||
| if ([string]::IsNullOrWhiteSpace($line)) { continue } | ||
| $parts = @($line -split "`t") | ||
| if ($parts[0] -match '^R\d+$') { | ||
| if ($parts.Count -ge 3) { $parts[2] } | ||
| continue | ||
| } | ||
| if ($parts.Count -ge 2 -and $parts[0] -ne 'D') { $parts[1] } | ||
| } | ||
| } |
| | 2026-07-24 | 使用者改採嚴格 terminal rule:archive 僅限 completed/完整 successor;三個 7/22 deferred change 與 structured-log evidence 缺口 historical correction 恢復原 id,維持 frozen/non-owner。 | | ||
| | 2026-07-23 | #382/#383/#386 merged;#386 先收斂 scoped A4 visible caller compatibility,S4-B coordinator session search proxy、安全 transport、host-kit dual-namespace seam 與 cold-scan timeout regression 由 PR #384 交付(狀態以 GitHub machine truth 為準),S4-C/D 仍 pending。 | |
There was a problem hiding this comment.
💡 Codex Review
At this commit the production frontend still uses the existing edge-console.css/theme code, while the migration tasks remain open, so stating here that edge-console.css --ec-* has already been retired turns a future design target into completion evidence. Agents reading §08 before the actual CSS/TS migration lands will be pointed away from the still-live implementation instead of seeing an explicit implementation gap.
AGENTS.md reference: docs/AGENTS.md:L31-L33
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| $existedAtBase = $baseProposal.Count -gt 0 | ||
| if ($existedAtBase) { continue } |
There was a problem hiding this comment.
Fail thawed existing changes over the WIP limit
When a PR removes the Status: deferred marker from an existing openspec/changes/<id>/proposal.md while the repo is already over the non-deferred WIP budget, this check skips it just because the proposal file existed at the base ref. That means thawing align-frontend-design-system-reference or another restored deferred change would only emit the global warning and still pass CI, even though the lifecycle gate is meant to keep deferred changes non-owners until explicitly restarted under the budget. Compare the base proposal state rather than only path existence before continuing.
AGENTS.md reference: openspec/AGENTS.md:L29-L29
Useful? React with 👍 / 👎.
|
|
||
| > **Status: deferred 2026-07-24**:不計入 active WIP;code、contracts 與 canonical capability spec 已落地,只有 tasks 10.1–10.5 的真 4-service runtime evidence 尚未完成。`deepen-ifc-ready-conversion-pipeline` closeout 前不得為了 smoke 修改其 pipeline implementation。 | ||
|
|
||
| > **Historical correction 2026-07-24**:本 change 曾在缺少 runtime evidence 時被 archive;現依嚴格 terminal rule 恢復原 change id。它目前只允許 execution/evidence closeout:跑 IFC-ready → conversion → session → close、驗四個 service JSONL/trace/env redaction,並落 durable evidence。既有 delta 已同步至 `openspec/specs/cross-service-structured-log-baseline/`,**不得重新套用或回滾 canonical spec,也不得重做已落地 adapters/contracts**。 |
There was a problem hiding this comment.
Remove already-applied spec deltas from restored closeout
This restored change is marked as evidence-only and says its delta has already been synced to openspec/specs/cross-service-structured-log-baseline/, but the PR also restores the original specs/cross-service-structured-log-baseline/spec.md under openspec/changes/ with ## ADDED Requirements for the same canonical requirements. Any later strict validation/archive of this change will treat those files as an active delta again instead of a runtime-evidence closeout, risking duplicate or invalid spec application; keep the evidence tasks/proposal but remove or neutralize the already-applied spec delta.
AGENTS.md reference: openspec/AGENTS.md:L40-L40
Useful? React with 👍 / 👎.
| if ($parts.Count -ge 3) { $parts[2] } | ||
| continue | ||
| } | ||
| if ($parts.Count -ge 2 -and $parts[0] -ne 'D') { $parts[1] } |
There was a problem hiding this comment.
Preserve deleted active changes through archive checks
If a PR simply deletes openspec/changes/<id>/... instead of moving it through an archive/spec update, git diff --name-status reports only D records and this helper drops those paths entirely. That lets an active change disappear without the lifecycle gate checking for a completed archive, synced canonical spec, or deferred state; include deletions in the target set and fail when they are not paired with an expected archive closeout.
AGENTS.md reference: openspec/AGENTS.md:L28-L30
Useful? React with 👍 / 👎.
Apply the user-approved capacity change across the canonical throughput spec, NOW routing, lifecycle enforcement, and regression assertions without thawing deferred changes.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 68c034d439
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| IsDeferred = $content -match '(?m)^>\s*\*\*Status:\s*deferred\b' | ||
| HasCondition = $content -match '(重啟|解凍|thaw|closeout)' |
There was a problem hiding this comment.
Anchor deferred parsing to the proposal header
When a proposal merely quotes or mentions > **Status: deferred later in the body (or contains closeout somewhere unrelated), this scan marks the whole change as deferred, so it is omitted from WIP counting and duplicate-owner checks even though the repository rule requires the canonical deferred marker, reason, and restart condition at the top of proposal.md. Please inspect only the top status block before excluding a change from active ownership.
AGENTS.md reference: openspec/AGENTS.md:L29-L29
Useful? React with 👍 / 👎.
| IsDeferred = $content -match '(?m)^>\s*\*\*Status:\s*deferred\b' | ||
| HasCondition = $content -match '(重啟|解凍|thaw|closeout)' |
There was a problem hiding this comment.
Anchor deferred parsing to the proposal header
When a proposal merely quotes or mentions > **Status: deferred later in the body (or contains closeout somewhere unrelated), this scan marks the whole change as deferred, so it is omitted from WIP counting and duplicate-owner checks even though the repository rule requires the canonical deferred marker, reason, and restart condition at the top of proposal.md. Please inspect only the top status block before excluding a change from active ownership.
Useful? React with 👍 / 👎.
Summary
--type changewhen an active change and canonical spec share a name.AI Coding Governance
Frontend Verification
Not user-facing. The design-authority HTML edits only correct historical OpenSpec path/status references; no route, component, golden, manifest, or runtime behavior changed.
Deploy Path Verification
No runtime, Docker, Kit, viewer, port, environment, conversion service, or deploy script changes.
Validation
scripts/tests/verify-openspec-lifecycle.ps1 -RepoRoot . -BaseRef origin/main-> passed (non_deferred=5,deferred=4, canonical limit=6).scripts/tests/test-agent-governance-check.ps1-> passed.scripts/tests/test-pr-review-agent.ps1-> passed; duplicate change/spec name regression covered.npx --no-install openspec validate --all --strict-> 68 passed, 0 failed.scripts/tests/verify-design-system-reference.ps1 -RepoRoot .-> passed (13 screens, 26 golden files).scripts/tests/test-design-system-reference.ps1-> passed.git diff origin/main...HEAD --check-> passed.Known Risks
align-frontend-design-system-referenceconflicts withmigrate-console-to-hifi-design; a requirement-level successor crosswalk is mandatory before thaw.rvt-ifc-usdc-lineageoverlaps conversion, runtime lease, single-GPU session, cloud outbox, and frontend ownership; it must be sliced before implementation.