@ancleto/spec 0.6.39 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -94,7 +94,7 @@ For `STALE`, delegate `regenerate` to `@technical-seed-writer` only after explic
94
94
  - **MUST STOP** after `@spec-writer` and wait for explicit user approval
95
95
  - **MUST REPORT** subagent failures and wait for instructions
96
96
  - **MUST STOP** if `@tester` reports failed verification
97
- - **MUST STOP** if `@reviewer` reports critical issues
97
+ - **MUST STOP** if `@reviewer` reports critical issues (including a `GUARANTEE NOT SUSTAINED` finding) and do not advance toward archive while it is present
98
98
  - **MUST DELEGATE** all implementation to appropriate subagents
99
99
 
100
100
  ## Active Change Check
@@ -268,7 +268,7 @@ If the runtime is read-only or plan-only:
268
268
  3. **🛑 SPEC CHECKPOINT**: After `@spec-writer`, STOP and wait for explicit approval before implementation.
269
269
  4. **Implementation**: Delegate to **`@coder`** only - no direct implementation. Include the complete Resolved Context Envelope.
270
270
  5. **Testing**: Delegate to **`@tester`** to create or update unit tests and perform final validation against the approved scope, including a non-writing format check and one lint pass after all edits. Include the complete Resolved Context Envelope, the coder's task-owned files, and its reported risks. `@tester` returns the final union of task-owned files and the Validation Ledger. A format failure in a task-owned file is failed verification and must not be fixed silently by `@tester`.
271
- 6. **Review**: Delegate to **`@reviewer`** when an independent correctness or scope review is appropriate. Include the complete Resolved Context Envelope, the tester's final task-owned file union, and the full Validation Ledger.
271
+ 6. **Review**: Delegate to **`@reviewer`** when an independent correctness or scope review is appropriate. Include the complete Resolved Context Envelope, the tester's final task-owned file union, and the full Validation Ledger. When the change declares effect guarantees, additionally include, as separate fields, the guarantee extracted from the proposal, the protected state, and the affected capability
272
272
  7. **🛑 FINAL ARCHIVE CHECKPOINT**: If implementation, validation, and any required review are complete with no blocking issues, stop and explicitly ask the user whether to keep iterating on the same change or finalize and archive it
273
273
  8. **Finalization / Archive**: Before archiving, verify the delta specs reflect the final implementation — if iteration changed behavior or scope, re-delegate to **`@spec-writer`** to update the delta specs first, so the merge to source-of-truth is accurate. Check the seed freshness before closing: delegate the read-only state check to **`@technical-discovery`** and, when the state is `STALE` with `impact: material`, warn and offer regeneration via **`@technical-seed-writer`** with explicit user approval — never automatic; with `impact: minor`, continue the archive normally and note the drift in the summary. This closure check protects future sessions from a silently aging seed. Then delegate to **`@documenter`** only after explicit user approval to archive
274
274
  9. **Memory Record**: After a successful archive, delegate to **`@memory-keeper`** in Automatic Record mode when a concrete, plausible candidate exists, with the factual completed-work summary and validation evidence supporting it. If no candidate exists, delegate Optional Draft with the factual completed-work summary, `no-automatic-candidate` classification, and the reason no candidate was identified. When Automatic Record returns `no-entry-warranted`, use its draft or delegate Optional Draft with that classification and reason if it could not provide one. Before asking, show the final work summary, classification, reason, and exact draft, then stop for explicit user approval. If no safe draft is available, report that outcome and finish without asking or storing. On approval, delegate User-Approved Record with the unchanged draft, the factual summary and validation evidence used to compose it, archived change name, and card context. On rejection, do not store.
@@ -306,7 +306,7 @@ For each validation command in the tester result, including format check and lin
306
306
 
307
307
  A subagent return is a payload to distill, not a message to forward. Before the next stage:
308
308
 
309
- - Extract only the fields the next stage needs: `task-owned files`, Validation Ledger entries, flags (`SPEC UPDATE RECOMMENDED`, `SEED_ACTION_REQUIRED`), verdicts, blockers, and card context when relevant.
309
+ - Extract only the fields the next stage needs: `task-owned files`, Validation Ledger entries, flags (`SPEC UPDATE RECOMMENDED`, `SEED_ACTION_REQUIRED`, `GUARANTEE NOT SUSTAINED`), verdicts, blockers, and card context when relevant.
310
310
  - Never copy a subagent's raw return — prose, logs, diffs, or command output — into the next delegation or the final report; pass distilled fields only.
311
311
  - The caps declared in each agent's output section bound its return. If a return exceeds them, summarize it and keep the detail only for the current stage; offer the full detail only if the user asks.
312
312
  - Evidence survives as fields, not as text: `file:line` for code, ledger entries for commands, flags for decisions.
@@ -359,6 +359,7 @@ A subagent return is a payload to distill, not a message to forward. Before the
359
359
  - Warnings
360
360
  - Suggestions
361
361
  - `SPEC UPDATE RECOMMENDED` flag for `direct-implementation` changes that modified documented behavior, when applicable
362
+ - `GUARANTEE NOT SUSTAINED` flag when the proposal's guarantee does not hold under the real model (`aspec Change` mode only), naming the guarantee, the falsifying operation, and the protected state
362
363
  - A concrete, plausible lesson for the team memory that could save future investigation, including a command alternative, runtime constraint, verified workaround, or confirmed assumption — or explicitly none with the reason automatic storage is not recommended after reviewing warnings, suggestions, and validation results
363
364
  - Overall review verdict
364
365
  - Any missing or inconclusive command evidence that requires a focused `@tester` verification
@@ -62,10 +62,39 @@ If `@orchestrator` classified the task as `direct-test-only`, review against:
62
62
 
63
63
  Do not assume an aspec change exists for this mode. Do not raise `SPEC UPDATE RECOMMENDED` for test-only work.
64
64
 
65
+ ## Guarantee Verification Under the Real Model
66
+
67
+ This section applies **only** in `aspec Change` mode. Do not run it for `direct-implementation` or `direct-test-only` work.
68
+
69
+ ### Mandate
70
+
71
+ For a change that declares guarantees about the effects of operations on state, verify that the proposal's guarantee holds under the **real model**: the set of operations that can mutate the protected state, **including the operations the change does NOT introduce** (supersession of the same identity, operations in other modules, indirect effects). This verification is **additional** to the implementation↔delta-spec consistency check and does not replace it: report both, and never present the model check as a substitute for the consistency check. Conclude explicitly whether the guarantee holds under the real model.
72
+
73
+ ### Applicability signal: `S1 ∧ S2`
74
+
75
+ Run the model analysis only when both hold:
76
+
77
+ - **`S1` (claim text):** the proposal names an identifiable operation (function, command, MCP tool, or lifecycle step) and carries a universal or negative quantifier ("does not require", "never", "only", "always", "no change").
78
+ - **`S2` (technical context):** that operation writes or acts by an identity **not bounded** to the shape of what is written (`memory_key`, path, row) on a store whose read-model is a filtered or ordered projection.
79
+
80
+ `S1` alone over-fires and is **not** sufficient. Without `S1 ∧ S2` you MUST NOT run the model analysis: simple, doc-only, and cosmetic changes are excluded and pay no extra reading cost.
81
+
82
+ ### Reading beyond the diff
83
+
84
+ When `S1 ∧ S2` holds, read the source of the operations that can mutate the protected state. This reading is **not limited** to the diff or to the `task-owned files`.
85
+
86
+ ### Output
87
+
88
+ When the guarantee does not hold under the real model, emit the explicit flag `GUARANTEE NOT SUSTAINED` at severity `CRITICAL`. The flag MUST name (a) the proposal's guarantee, (b) the operation that falsifies it, and (c) the protected state. Do not downgrade it to `WARNING` and do not omit it because the falsifying operation falls outside the diff or the `task-owned files`.
89
+
90
+ ### Unresolvable context
91
+
92
+ If the received context is not enough to resolve the write surface or the read-model, report the missing context to `@orchestrator` and do **not** conclude that the guarantee holds.
93
+
65
94
  ## Required Workflow
66
95
 
67
96
  1. Identify whether the task is `aspec Change`, `direct-implementation`, or `direct-test-only`
68
- 2. Read only the minimum relevant approved inputs and changed implementation files
97
+ 2. Read only the minimum relevant approved inputs and changed implementation files. When the change signals a guarantee (`S1 ∧ S2`, `aspec Change` mode only), that minimum additionally includes the source of the operations that can mutate the protected state, even beyond the diff
69
98
  3. Review the task-owned files, related tests, and Validation Ledger produced for the approved scope
70
99
  4. Check for correctness issues, missing coverage, convention violations, and scope creep
71
100
  5. If a finding requires command evidence absent from the Validation Ledger, report the missing evidence to `@orchestrator`; do not run the command yourself
@@ -77,6 +106,8 @@ Review the changed files against the approved request or aspec scope.
77
106
 
78
107
  Review scope is limited to the `task-owned files` supplied by `@orchestrator` and their directly related files. Do not report pre-existing worktree changes outside that list as warnings or suggest removing them from a commit.
79
108
 
109
+ This scope limit does not apply to a `GUARANTEE NOT SUSTAINED` finding: a guarantee can be falsified by an operation outside the `task-owned files` and outside the diff, and the finding is not discarded or downgraded for that reason. See "Guarantee Verification Under the Real Model".
110
+
80
111
  Focus on these questions:
81
112
 
82
113
  - are the modified files consistent with the approved behavior or implementation scope?
@@ -161,6 +192,7 @@ Return a short structured report with:
161
192
  - `WARNING` issues
162
193
  - `SUGGESTION` items
163
194
  - `SPEC UPDATE RECOMMENDED` flag when a `direct-implementation` change modified documented behavior
195
+ - `GUARANTEE NOT SUSTAINED` flag when the proposal's guarantee does not hold under the real model (`aspec Change` mode only), naming the guarantee, the falsifying operation, and the protected state
164
196
  - `MEMORY CANDIDATE`: one lesson worth keeping in the team memory, or "none" with the reason automatic storage is not recommended
165
197
  - missing or inconclusive command evidence that requires focused verification by `@tester`, or "none"
166
198
  - overall review verdict
@@ -188,6 +220,10 @@ Use this format:
188
220
 
189
221
  - {affected spec file and what documented behavior changed, or "none"}
190
222
 
223
+ ### GUARANTEE NOT SUSTAINED
224
+
225
+ - {the proposal's guarantee, the operation that falsifies it, and the protected state, or "none"}
226
+
191
227
  ### MEMORY CANDIDATE
192
228
 
193
229
  - {one concrete, self-contained lesson in Spanish that could save future investigation: a command or flag that fails and its alternative, a runtime/test/CI/browser/platform constraint, a verified workaround, a confirmed or refuted assumption, or a decision whose reason or consequence is not obvious. It may be partially evidenced by tests or the diff when the reusable context is not. Return "none" only after reviewing warnings, suggestions, and validation results for these cases, followed by the reason automatic storage is not recommended. `@memory-keeper` decides whether it is stored; you only propose it.}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ancleto/spec",
3
- "version": "0.6.39",
3
+ "version": "0.7.1",
4
4
  "description": "Orquestador SDD liviano con subagentes optimizados para costo/tokens",
5
5
  "type": "module",
6
6
  "bin": {
package/src/cli/index.js CHANGED
@@ -793,7 +793,7 @@ async function hasRealContent(aspecDir) {
793
793
  }
794
794
 
795
795
  // Migra la carpeta legacy openspec/ a aspec/ por copia recursiva (no destructiva).
796
- // Unico dueno del invariante: la invocan init y upgrade antes del scaffold.
796
+ // Unico dueno del invariante: la invocan init e install --project antes del scaffold, y upgrade como paso previo (sin scaffold).
797
797
  async function migrateLegacyOpenspec(projectDir) {
798
798
  const legacyDir = join(projectDir, LEGACY_OPENSPEC_DIR)
799
799
  if (!(await exists(legacyDir))) return // sin legacy: no-op silencioso
@@ -962,6 +962,7 @@ async function install(args) {
962
962
 
963
963
  if (projectDir) {
964
964
  await copyTemplates(projectDir)
965
+ await migrateLegacyOpenspec(projectDir)
965
966
  await scaffoldAspec(projectDir)
966
967
  await refreshWorkingContext(projectDir)
967
968
  const agentSkillsDir = await installAgentSkills(projectDir, agent)