fix: enforce final archive confirmation#184
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe Classic archive lifecycle now stores machine-owned ChangesClassic archive confirmation
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Operator
participant CometState
participant ClassicArchive
participant ClassicState
Operator->>CometState: transition change archive-confirm
CometState->>ClassicState: store archive_confirmation=confirmed
Operator->>ClassicArchive: execute archive command
ClassicArchive->>ClassicState: validate confirmation
ClassicArchive->>ClassicState: apply archived transition
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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 |
Reviewer's GuideIntroduces a machine-owned archive_confirmation field and archive-confirm transition into the Classic state machine, wires it through CLI/state commands, resolver, runtime, and recovery flows, and enforces that both the archived transition and /comet-archive mutating work require a confirmed final approval, while updating docs, tests, benchmarks, and formatting accordingly. Sequence diagram for enforcing archive confirmation in /comet-archivesequenceDiagram
actor User
participant CometArchiveSkill as CometArchiveSkill
participant classicArchiveCommand as classicArchiveCommand
participant ClassicStateMachine as applyClassicTransition
User->>CometArchiveSkill: invoke /comet-archive
CometArchiveSkill->>classicArchiveCommand: classicArchiveCommand(args)
classicArchiveCommand->>classicArchiveCommand: validate runtime.run.pending
classicArchiveCommand->>classicArchiveCommand: check classic.archiveConfirmation
alt archiveConfirmation not confirmed and not recovering
classicArchiveCommand-->>User: ArchiveFailure (archive_confirmation not confirmed)
else archiveConfirmation confirmed or recovering
classicArchiveCommand->>ClassicStateMachine: applyClassicTransition(classic, archived)
ClassicStateMachine-->>classicArchiveCommand: classic.archived=true
classicArchiveCommand-->>User: archive completed
end
State diagram for Classic archive confirmation flowstateDiagram-v2
[*] --> build
build --> verify: verify-pass
verify --> archive: verify-pass
state archive {
[*] --> archive_pending
archive_pending --> archive_confirmed: archive-confirm
archive_pending --> verify: archive-reopen
archive_confirmed --> archived: archived
}
archived --> [*]
note "verify-pass: set phase=archive, archiveConfirmation=pending" as N1
note "archive-confirm: require verifyResult=pass, archived=false; set archiveConfirmation=confirmed" as N2
note "archive-reopen: require archived=false; set verifyResult=pending, phase=verify, verifiedAt=null, archiveConfirmation=null" as N3
note "archived: require verifyResult=pass and archiveConfirmation=confirmed; set archived=true" as N4
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@assets/skills-zh/comet-archive/SKILL.md`:
- Around line 41-54: 避免重复执行 archive-confirm:在用户选择“确认归档”后立即调用一次 transition
<change-name> archive-confirm,并记录或处理其失败结果;调整“执行归档”步骤,使其仅调用 COMET_ARCHIVE
归档脚本,不再重复执行该 transition。
In `@assets/skills/comet-archive/SKILL.md`:
- Around line 41-54: Remove the duplicate archive-confirm execution from Step 2.
Keep the transition triggered by the “Confirm archive” selection, and have Step
2 run only the archive script after that transition succeeds; update the
surrounding instructions and command example to avoid directing agents to invoke
archive-confirm twice.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 918ec38d-791b-4489-9182-07e1161c22ed
📒 Files selected for processing (23)
CHANGELOG.mdassets/skills-zh/comet-archive/SKILL.mdassets/skills-zh/comet/reference/comet-yaml-fields.mdassets/skills/comet-archive/SKILL.mdassets/skills/comet/reference/comet-yaml-fields.mdassets/skills/comet/scripts/comet-runtime.mjsdomains/comet-classic/classic-archive.tsdomains/comet-classic/classic-evidence.tsdomains/comet-classic/classic-resolver.tsdomains/comet-classic/classic-state-command.tsdomains/comet-classic/classic-state.tsdomains/comet-classic/classic-transitions.tsdomains/comet-classic/classic-validate-command.tsdomains/skill/managed-markdown.tsscripts/benchmark/classic-baseline-regression.mjstest/domains/comet-classic/classic-archive.test.tstest/domains/comet-classic/classic-contract.test.tstest/domains/comet-classic/classic-evidence.test.tstest/domains/comet-classic/classic-migrate.test.tstest/domains/comet-classic/classic-resolver.test.tstest/domains/comet-classic/classic-state.test.tstest/domains/comet-classic/comet-scripts-recovery.test.tstest/domains/comet-classic/comet-scripts.test.ts
|
LGTM, thanks for your contribution. |
* docs: add Comet ambient resume design * docs: add Comet ambient resume implementation plan * docs: fix ambient resume plan fixture * feat: add ambient resume probe logic * fix: align ambient resume probe with classic diagnostics * docs: mark ambient resume task 1 complete * feat: expose ambient resume in classic runtime * fix: harden ambient resume classic command tests * chore: keep ambient resume sdd reports untracked * docs: mark ambient resume task 2 complete * feat: add ambient resume CLI * fix: cover ambient resume CLI plumbing * docs: mark ambient resume task 3 complete * feat: add managed project instruction blocks * fix: harden managed markdown block merging * fix: preserve managed markdown line endings * docs: mark ambient resume task 4 complete * feat: inject ambient resume project instructions * fix: tighten ambient resume project instruction scope * fix: stabilize ambient resume json summaries * docs: mark ambient resume task 5 complete * docs: document ambient resume workflow * docs: refine ambient resume wording * fix: harden ambient resume probe * docs: clarify ambient resume recovery command * fix: resolve dashboard issue 170 * fix: clarify archived dashboard terminal state * fix: preserve existing skill dirs in symlink mode * fix: install openspec cli globally during init * fix: resolve archived dashboard superpowers artifacts * docs: add project installation registry design * docs: add project installation registry plan * feat: add project installation registry * fix: reject invalid project registry targets * docs: mark project registry task complete * feat: add project scope selection helper * docs: mark project scope helper task complete * feat: record project installs during init * docs: mark init registry task complete * feat: update all indexed projects * docs: mark update registry task complete * feat: uninstall all indexed projects * fix: keep forced project scope local * docs: mark uninstall registry task complete * docs: update changelog for project registry * fix: harden all-project registry operations * fix(registry): harden all-project update failures * fix: enforce final archive confirmation (#184) * fix: enforce final archive confirmation * chore: format managed markdown helper * fix: run archive confirmation once --------- Co-authored-by: chenqinggang <chenqinggang@ulearning.cn> * docs: add npm eval harness design * fix(eval): bundle npm eval harness * fix(eval): use bundled harness by default * docs: add npm eval harness plan * docs: add eval draft hash runtime design * fix(eval): resolve generated draft hashes * fix(eval): contextualize draft hash failures * fix(eval): prepare generated manifests at runtime * fix(eval): preserve primary manifest errors * test(eval): cover undefined primary failures * docs: add eval draft hash runtime plan * docs: add classic reliability CLI design * docs: add classic reliability CLI plan * fix(classic): preserve archive markdown formatting * docs: check off archive formatting task * feat(cli): expose stable Classic commands * docs: check off stable Classic CLI task * feat(classic): record command check evidence * fix(classic): validate stored command check cwd * fix(classic): ignore malformed command check data * docs: check off command evidence task * fix(classic): support recorded build checks * fix(classic): preserve verify command rejection * docs: check off Guard evidence task * feat(status): classify OpenSpec and Comet changes * docs: check off mixed status task * docs(zh): use stable Classic CLI commands * test(skill): align stable Classic commands * docs: check off Chinese Skill task * docs: document stable Classic command workflows * docs: classify Classic reliability changes * docs: check off Classic reliability implementation * fix(classic): keep status and evidence recording read-only * fix(classic): validate runtime runs without mutation * docs: complete Classic reliability plan * test(skill): format stable command assertions * docs: design Codex agents skills migration * docs: plan Codex agents skills migration * fix(codex): use agents skill discovery roots * test(codex): cover agents skill installation * fix(codex): migrate legacy skill installations * fix(codex): harden legacy skill migration * fix(codex): protect linked skill removals * test(codex): finalize agents skill migration * test(codex): clean remaining legacy skill fixtures * test(codex): use canonical plugin detection fixture * fix(codex): preserve configuration and shared skill roots * fix(codex): propagate cleanup failures * ci: align beta4 checks with current runtime * docs: complete classic transition reference * fix: address beta4 review findings * docs: design current change hook binding * docs: plan current change hook binding * feat(classic): persist current change selection * docs: keep guard fix in beta4 * feat(classic): expose current change commands * fix(classic): scope source guard to current change * docs(classic): bind phase skills to current change * fix(classic): preserve hook resolution type * docs(classic): rebind change after isolation * fix(classic): preserve guard recovery allowlists * docs: note current change guard fix * docs: add Comet documentation badge * docs: refine README badge layout * Revert "docs: refine README badge layout" This reverts commit 859b6d9. --------- Co-authored-by: chenqinggang001 <74290987+chenqinggang001@users.noreply.github.com> Co-authored-by: chenqinggang <chenqinggang@ulearning.cn>
Summary
archive_confirmationstate0.4.0-beta.4changelog entryWhy
The archive Skill paused for user confirmation, but the mutating archive command only checked the phase and verification result. A direct script invocation could therefore bypass the required final decision point. Recording approval through a machine-owned transition makes the decision auditable and enforces it at the command boundary.
Impact
Users must confirm archiving through
archive-confirmbefore Comet merges delta specs or moves a change. Reopening the archive phase clears the approval so stale confirmation cannot be reused, while already-started archive recovery remains resumable.Validation
pnpm format:checkpnpm lintpnpm buildpnpm test— 108 test files and 1112 tests passedSummary by Sourcery
Enforce a machine-owned archive confirmation state in the Classic workflow and require it before any mutating archive execution, while preserving archive recovery behavior.
New Features:
Bug Fixes:
Enhancements:
Documentation:
Tests:
Summary by CodeRabbit
New Features
Bug Fixes
Documentation