archive: `--yes` skips the incomplete-task stop, and the refusal tells callers to rerun with `--yes`

Aperta
#2,006 0 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
cli

Direzione di ricerca

Start in src/core/archive.ts at the incomplete-task handling around lines 1591-1619 and inspect rerunFlags() around lines 287-293. Reproduce the four command cases from the issue, then review src/core/github-copilot/cloud-agent.ts around line 115 for related guidance. Done means the chosen behavior is consistent in text and JSON modes, and fix text no longer treats --yes as permission to bypass incomplete tasks.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

design-review

Hey, guys, you are awesome for making openspec!

Summary

openspec archive <change> --yes archives a change whose tasks.md still has unchecked tasks, printing only a warning. With --json it prints no warning at all. When the CLI does refuse, its fix text tells the caller to rerun with --yes, so an agent that follows the fix text archives unfinished work.

Environment
  • @fission-ai/openspec 1.13.2 (the same on 1.13.1)
  • Node 22.22.2, Linux
  • The code is unchanged on main at d4e1c77ebae0bd96a7c649fa35edef997989450a
Reproduction
mkdir openspec-probe && cd openspec-probe
npm init -y > /dev/null && npm install @fission-ai/[email protected]

reset_change() {
  rm -rf openspec/changes
  mkdir -p openspec/specs openspec/changes/probe-unchecked-tasks
  printf '## Why\nprobe\n\n## What Changes\nprobe\n' > openspec/changes/probe-unchecked-tasks/proposal.md
  printf '## 1. Probe\n\n- [ ] 1.1 undone\n- [x] 1.2 done\n' > openspec/changes/probe-unchecked-tasks/tasks.md
}

reset_change; npx openspec archive probe-unchecked-tasks --skip-specs < /dev/null; echo "exit $?"
reset_change; npx openspec archive probe-unchecked-tasks --json --skip-specs; echo "exit $?"
reset_change; npx openspec archive probe-unchecked-tasks --yes --skip-specs; echo "exit $?"
reset_change; npx openspec archive probe-unchecked-tasks -y --json --skip-specs; echo "exit $?"
Run Exit Result
no flag, no stdin 1 Refuses: 1 incomplete task(s) found for change 'probe-unchecked-tasks', and no answer could be read from stdin. Fix: Complete the tasks or rerun with openspec archive probe-unchecked-tasks --skip-specs --yes
--json 1 Refuses with archive_tasks_incomplete. Fix: Complete the tasks or rerun with --yes.
--yes 0 Prints Warning: 1 incomplete task(s) found. Continuing due to --yes flag. and archives the change. The archived tasks.md still has - [ ] 1.1 undone.
-y --json 0 Archives the change. The JSON has no status entry, so no warning.
Where in the code
Why it matters

-y, --yes is documented as "Skip confirmation prompts". The other stops it skips are confirmations: applying spec updates, and archiving with --no-validate. Unchecked tasks are a different kind of stop, a check that the work is done. Coding agents run archive non-interactively and follow the fix text they get. The change is then archived with work undone, and without --skip-specs its deltas are merged into the main specs as well.

Proposed fix (open to other approaches)
  • --yes keeps skipping confirmation prompts, but no longer skips the incomplete-task stop.
  • A separate explicit flag, for example --allow-incomplete-tasks, archives past that stop in both text and JSON modes. Callers that archive incomplete changes on purpose keep a non-interactive way to do it.
  • The archive_tasks_incomplete fix text says to complete the tasks or pass the new flag, never --yes.
  • Under --json, archiving past the stop adds a warning entry to status, so the caller can see what was skipped.
  • Scripts that rely on --yes here would start failing. If that is too abrupt, one release could first warn when --yes alone skips the stop.
Questions
  • Is this a bug fix that can go straight to a PR, or does changing what --yes covers need an OpenSpec change proposal first?
  • Does this narrower fix fit, or would you rather fold it into #1652?
Related
  • #1652 describes the same gap and asks for configurable archive checks with --skip-checks. This issue asks for a narrower fix.
  • #1483 added the rerun advice so non-interactive callers know which flag to pass. For incomplete tasks, that advice skips the stop.
Lingua principale
TypeScript
Stelle
76k
Fork
5.2k
Merge medio
1g 5h
PR unite (30g)
58

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Fission-AI/OpenSpec

Tutte le issue di Fission-AI/OpenSpec

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.