@ancleto/spec 0.6.23 → 0.6.25

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.
package/README.md CHANGED
@@ -228,6 +228,8 @@ Cada entrada tiene un `scope`: `project` (default, entra en `<ProjectMemoryRules
228
228
 
229
229
  > El mismo motor se puede consultar a mano desde la terminal: `ancleto memory context --scope project`. El archivo `.ancleto/working-context.md` que lee el orquestador se regenera solo en `init`, `install --project` y `upgrade`.
230
230
 
231
+ **Dos memorias, sin mezcla.** La memoria **del repositorio** (esta, `.ancleto/memory.db`) guarda reglas y decisiones del proyecto y se comparte con el equipo. Si el runtime expone además una memoria **del agente** (por ejemplo engram, habilitable con `--with-engram`), esa guarda notas de sesión, no del repo. **Una entrada vive en una sola**: si un futuro agente del equipo debería encontrarla, va al repo.
232
+
231
233
  ---
232
234
 
233
235
  ## Comandos del ciclo SDD en tu IDE
package/agents/coder.md CHANGED
@@ -151,6 +151,8 @@ After implementation, return a short structured summary including:
151
151
  - whether escalation was required due to broader-than-approved impact
152
152
  - blockers, conflicts, or escalations if any
153
153
 
154
+ **Output cap**: summary max 12 lines. At most 5 risky edges or test scenarios; offer the rest on request. Reference code as `file:line` instead of pasting code or logs.
155
+
154
156
  ## Important
155
157
 
156
158
  - Do NOT add features not defined in the approved request or aspec change
@@ -93,6 +93,8 @@ Return the card as structured context for the orchestrator:
93
93
 
94
94
  The command already replaces HTML markup with whitespace and unwraps long lines; if any markup survives, replace it with whitespace rather than dropping it.
95
95
 
96
+ **Output cap**: 3 lines plus the card payload — the description and acceptance criteria are the only unbounded fields and must stay complete; no commentary, analysis, or implementation advice.
97
+
96
98
  ## Failure handling
97
99
 
98
100
  - If no work item reference was provided, report "no work item to resolve" and fetch nothing.
@@ -147,6 +147,8 @@ After completing the finalization step, return a short structured summary includ
147
147
  - whether the original active change directory was fully removed (`Change Archive` mode)
148
148
  - any blockers or missing inputs
149
149
 
150
+ **Output cap**: summary max 10 lines; spec, archive, and artifact lists as paths only — never restate spec content.
151
+
150
152
  ## Important
151
153
 
152
154
  - Do not invent additional documentation requirements
@@ -20,6 +20,8 @@ You are the single owner of the repository's memory (`.ancleto/memory.db`, SQLit
20
20
 
21
21
  The memory is shared across sessions: what you write, someone else recalls months later, in another change, without today's context. A wrong or noisy entry is worse than no entry, because it is retrieved as precedent.
22
22
 
23
+ **Boundary:** the repository memory (yours) is distinct from any *agent/session* memory service the runtime may expose (e.g. engram). Repo rules and decisions live here, never duplicated there; transient, personal session notes belong to that other service, not here. When in doubt, it goes here — this is the one that outlives the repo and is shared with the team. The frontier is documented for projects in `AGENTS.md`.
24
+
23
25
  ## Rule vs Decision
24
26
 
25
27
  Classify every candidate BEFORE choosing the tool:
@@ -137,6 +139,8 @@ Whoever recalls this in six months has no session to attach it to, so it reads a
137
139
  - User-Approved Record: the tool used, `memory_key`, the exact approved `content` as stored, and whether it superseded a previous entry
138
140
  - Any failure of the memory engine, reported plainly so `@orchestrator` can continue without memory
139
141
 
142
+ **Output cap**: max 6 lines; the stored entry is the only unbounded field — everything else is one line.
143
+
140
144
  ## Important
141
145
 
142
146
  - You never modify code, specs, or repository state.
@@ -291,6 +291,17 @@ Before advancing to the next stage, verify that each subagent returned a usable
291
291
 
292
292
  For each validation command in the tester result, including format check and lint, preserve a Validation Ledger entry with: command, outcome (`passed`, `task-regression`, `pre-existing-unrelated`, or `inconclusive`), and related files when it failed. Pass it unchanged to `@reviewer`. A confirmed `pre-existing-unrelated` result is reported once in the final status as a non-blocking residual limitation; do not stop, re-run it, or request a correction unless a later relevant change invalidates that classification.
293
293
 
294
+ ### Handling subagent returns
295
+
296
+ A subagent return is a payload to distill, not a message to forward. Before the next stage:
297
+
298
+ - 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.
299
+ - 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.
300
+ - 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.
301
+ - Evidence survives as fields, not as text: `file:line` for code, ledger entries for commands, flags for decisions.
302
+
303
+ **Output cap**: the final report to the user max 15 lines — status, changed paths, validation result, blockers; never paste subagent returns, logs, or diffs.
304
+
294
305
  ### Expected output from `@context-resolver`
295
306
 
296
307
  - The resolved card: id, title, work item type, and project
@@ -165,6 +165,8 @@ Return a short structured report with:
165
165
  - missing or inconclusive command evidence that requires focused verification by `@tester`, or "none"
166
166
  - overall review verdict
167
167
 
168
+ **Output cap**: at most 5 findings per severity (`CRITICAL`, `WARNING`, `SUGGESTION`); if more exist, keep the 5 highest-impact and state the count of the rest, offering detail on request. `Summary` max 5 lines. Cite `file:line`; never paste diffs or code.
169
+
168
170
  Use this format:
169
171
 
170
172
  ```md
@@ -96,6 +96,8 @@ After writing the artifacts, respond with a short structured summary including:
96
96
  - short scope summary
97
97
  - open questions, assumptions, or risks
98
98
 
99
+ **Output cap**: summary max 10 lines; at most 5 open questions, assumptions, or risks combined (offer the rest on request); paths only — never restate artifact content.
100
+
99
101
  ## Important
100
102
 
101
103
  - Prefer the smallest correct aspec change that captures the intended behavior
@@ -132,3 +132,5 @@ When you were delegated, do not address the developer as if they had called you:
132
132
  include the required `SEED_ACTION_REQUIRED` marker.
133
133
  - When mentioning credentials, name the variable, key, or file and **never** reproduce its value.
134
134
  - Be concise: orientation the caller can act on, not an inventory.
135
+
136
+ **Output cap**: prose max 15 lines; required state or check reports are payload and stay complete; cite paths instead of pasting content.
@@ -49,8 +49,13 @@ action was explicitly requested, run `ancleto discovery --check` once and read i
49
49
  `config.outputDir`, including `units/_map.md`. Use the same pack for any optional dossier.
50
50
  4. Run `ancleto discovery --check` once to validate the written seed. This is state-only: do
51
51
  not generate another pack after it.
52
- 5. Return the output directory, files created or updated, the single pack path, final state,
53
- and any evidence limitations recorded in `unknowns.md`.
52
+ 5. Return the result as specified in `## Output`.
54
53
 
55
54
  If the pack fails, writing fails, or the final state is not usable, report the exact blocker;
56
55
  do not claim the seed was generated.
56
+
57
+ ## Output
58
+
59
+ - The output directory, the files created or updated, the single pack path, the final state, and any evidence limitations recorded in `unknowns.md`.
60
+
61
+ **Output cap**: max 8 lines — paths only; never paste file contents or the pack.
package/agents/tester.md CHANGED
@@ -167,6 +167,8 @@ After validation, return a short structured summary including:
167
167
  - failed verification items, if any
168
168
  - untested gaps or assumptions, if any
169
169
 
170
+ **Output cap**: Validation Ledger entries are one line each — never paste command output; collapse repeated `passed` runs of the same command into one line with a count; keep at most 15 lines, preserving every failure and every task-owned test result. Summary max 10 lines; offer full detail on request.
171
+
170
172
  ## Important
171
173
 
172
174
  - Prefer the smallest useful test change that validates the approved behavior
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ancleto/spec",
3
- "version": "0.6.23",
3
+ "version": "0.6.25",
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
@@ -352,15 +352,40 @@ function mergeLocked(source, local, filename) {
352
352
  let result = local
353
353
  for (const [name, sourceBlock] of blocks) {
354
354
  const replaced = replaceLockedBlock(result, name, sourceBlock)
355
- if (replaced === null) {
355
+ if (replaced !== null) {
356
+ result = replaced
357
+ continue
358
+ }
359
+ // Si el nombre del bloque aparece igual en el archivo (p. ej. tag de cierre faltante),
360
+ // esta mal formado: se avisa y NO se toca, para no duplicar contenido.
361
+ const nameSeen = new RegExp(`<!--\\s*LOCKED:\\s*${escapeRe(name)}\\s*-->`).test(result)
362
+ if (nameSeen) {
356
363
  console.warn(`ancleto: no se pudo actualizar el bloque LOCKED "${name}" en ${filename} (tags ausentes o mal formados)`)
364
+ continue
365
+ }
366
+ // El bloque es nuevo (feature agregada al template): se inserta sin tocar el resto.
367
+ const anchor = findInsertAnchor(result, source, name)
368
+ if (anchor === null) {
369
+ console.warn(`ancleto: no se pudo insertar el bloque LOCKED "${name}" en ${filename}`)
357
370
  } else {
358
- result = replaced
371
+ result = result.slice(0, anchor) + sourceBlock + '\n\n' + result.slice(anchor)
359
372
  }
360
373
  }
361
374
  return result
362
375
  }
363
376
 
377
+ // Punto de insercion para un bloque LOCKED nuevo: justo antes del bloque LOCKED
378
+ // que lo sigue en el template, o al final del archivo si es el ultimo.
379
+ function findInsertAnchor(local, source, name) {
380
+ const order = [...extractLockedBlocks(source).keys()]
381
+ const nextInSource = order[order.indexOf(name) + 1]
382
+ if (nextInSource && extractLockedBlocks(local).has(nextInSource)) {
383
+ const at = local.search(new RegExp(`<!--\\s*LOCKED:\\s*${escapeRe(nextInSource)}\\s*-->`))
384
+ if (at >= 0) return at
385
+ }
386
+ return local.length
387
+ }
388
+
364
389
  async function copyTemplates(projectDir) {
365
390
  const dest = join(projectDir, '.opencode')
366
391
  await copyAssets(dest)
@@ -50,6 +50,22 @@ conflicto, prevalece el diseño vigente.
50
50
  - Si la memoria contradice el estado actual del código o los guardrails de este archivo,
51
51
  reportá la discrepancia en lugar de aplicarla a ciegas.
52
52
 
53
+ <!-- LOCKED: memory-boundary -->
54
+ ### Frontera: memoria del repo vs memoria del agente
55
+
56
+ Hay **dos memorias distintas** y no se mezclan:
57
+
58
+ | Memoria | Qué guarda | Dónde vive | Herramientas |
59
+ |---|---|---|---|
60
+ | **Del repositorio** | Reglas y decisiones **del proyecto**: convenciones, contratos, por qué se eligió algo | `.ancleto/memory.db` (versionable con el equipo) | `searchMemory`, `recordRule`, `recordDecision` |
61
+ | **Del agente** (si está habilitada) | Notas **de sesión/agente**: observaciones transitorias, contexto entre compactaciones | Servicio externo del agente | Las de ese servicio (p. ej. engram) |
62
+
63
+ Regla: **una entrada vive en una sola memoria, nunca en ambas.** Si es una decisión o regla
64
+ que un futuro agente del equipo debería encontrar → memoria del repo. Si es una nota personal
65
+ de la sesión → memoria del agente. Ante la duda, va al repo: es la que sobrevive al repo y se
66
+ comparte.
67
+ <!-- /LOCKED: memory-boundary -->
68
+
53
69
  ## Flujo Spec-Driven (aspec)
54
70
 
55
71
  - **Cambios con scope incierto / arquitectura**: Crear artifacts en `aspec/changes/<name>/`.