@ancleto/spec 0.6.34 → 0.6.35
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 +4 -0
- package/agents/orchestrator.md +1 -1
- package/agents/technical-discovery.md +1 -1
- package/agents/technical-seed-writer.md +4 -4
- package/package.json +1 -1
- package/skills/ancleto-technical-discovery/references/generation-pipeline.md +6 -1
- package/skills/ancleto-technical-discovery/references/validation-checklist.md +1 -0
- package/src/cli/index.js +28 -1
package/README.md
CHANGED
|
@@ -222,6 +222,10 @@ Se guarda en `.ancletorc` → `discovery.exclude` y se preserva en `update`/`upg
|
|
|
222
222
|
|
|
223
223
|
La excepción: si el agente detecta un **hueco concreto** (info que el seed debería tener y no tiene, como una paleta nueva sin unidad), puede ofrecer regenerar aunque el `impact` sea `minor` — siempre con tu aprobación. Nunca regenera solo.
|
|
224
224
|
|
|
225
|
+
### Regeneración parcial
|
|
226
|
+
|
|
227
|
+
`--check` también devuelve `affectedDocs`: los documentos del seed cuyas áreas cambiaron. Cuando aprobás una regeneración sobre un reporte `minor`, el seed-writer **reescribe solo esos documentos** y deja el resto intacto (un solo pack igual, pero sin reescribir los 8 documentos + dossiers). El mapeo vive en `seed-map.json` dentro del directorio del seed y lo mantiene la skill al generar; sin ese archivo el chequeo degrada a lista vacía y la regeneración es completa.
|
|
228
|
+
|
|
225
229
|
---
|
|
226
230
|
|
|
227
231
|
## Uso rápido
|
package/agents/orchestrator.md
CHANGED
|
@@ -71,7 +71,7 @@ The orchestrator never executes `ancleto discovery --check`. When the technical
|
|
|
71
71
|
|
|
72
72
|
For `MISSING` and `PARTIAL`, never generate automatically. Ask for explicit user approval before invoking `@technical-seed-writer`. If approved, pass the complete check report returned by `@technical-discovery` and the action `generate` or `complete`. If declined, continue only when the request can be handled safely without broad repository context; otherwise report the limitation and stop.
|
|
73
73
|
|
|
74
|
-
For `STALE`, delegate `regenerate` to `@technical-seed-writer` only after explicit user approval. When `impact` is `minor`, keep working from the seed and mention the drift in the summary. A concrete gap found while working — needed info the seed does not cover — may justify offering regeneration even with `minor` impact, always with approval.
|
|
74
|
+
For `STALE`, delegate `regenerate` to `@technical-seed-writer` only after explicit user approval. When `impact` is `minor`, keep working from the seed and mention the drift in the summary. A concrete gap found while working — needed info the seed does not cover — may justify offering regeneration even with `minor` impact, always with approval. When the report lists `affectedDocs`, pass them so an approved regeneration stays scoped to those documents.
|
|
75
75
|
|
|
76
76
|
`@technical-discovery` owns read-only repository orientation and seed-state inspection. `@technical-seed-writer` owns all seed generation, completion, and regeneration. Never substitute an unavailable seed with a manual repository scan.
|
|
77
77
|
|
|
@@ -127,7 +127,7 @@ When you were delegated, do not address the developer as if they had called you:
|
|
|
127
127
|
- **Answer in Spanish.** Paths, file names, and identifiers stay as they are.
|
|
128
128
|
- Cite the paths that support each claim.
|
|
129
129
|
- State which source you used and whether seed inspection was required.
|
|
130
|
-
- When seed inspection was required, return the resolved state with its `impact`, and the complete unchanged check report if a seed action is needed.
|
|
130
|
+
- When seed inspection was required, return the resolved state with its `impact` and `affectedDocs`, and the complete unchanged check report if a seed action is needed.
|
|
131
131
|
- Declare — when they apply — the stale nodes, any direct code read, and any gap left by the budget.
|
|
132
132
|
- If the seed state prevented the answer, state that no repository sweep was performed and
|
|
133
133
|
include the required `SEED_ACTION_REQUIRED` marker.
|
|
@@ -45,11 +45,11 @@ action was explicitly requested, run `ancleto discovery --check` once and read i
|
|
|
45
45
|
1. For `READY`, do not rewrite the seed; report that it is already available.
|
|
46
46
|
2. For `MISSING`, `PARTIAL`, or an accepted `STALE` regeneration, execute the skill's single global Repomix command exactly once. It must use the resolved `config.exclude` values and
|
|
47
47
|
must not run `--include`, an uncompressed preliminary pack, or another compressed pack.
|
|
48
|
-
3. Read that pack and
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
3. Read that pack and write the seed documents under `config.outputDir`, including `units/_map.md`. When the passed report has `impact: minor` with a non-empty `affectedDocs` list, rewrite ONLY those documents and leave every other seed document untouched. Otherwise (full regeneration), write every required seed document. Use the same pack for any optional dossier.
|
|
49
|
+
4. Write `seed-map.json` in `config.outputDir` mapping every seed document to the source areas it draws evidence from. Areas are first-level directories (or root file names), the same convention the CLI uses. Example: `{ "version": 1, "generatedAt": "...", "docs": { "overview.md": ["src", "package.json"] } }`.
|
|
50
|
+
5. Run `ancleto discovery --check` once to validate the written seed. This is state-only: do
|
|
51
51
|
not generate another pack after it.
|
|
52
|
-
|
|
52
|
+
6. Return the result as specified in `## Output`.
|
|
53
53
|
|
|
54
54
|
If the pack fails, writing fails, or the final state is not usable, report the exact blocker;
|
|
55
55
|
do not claim the seed was generated.
|
package/package.json
CHANGED
|
@@ -51,6 +51,11 @@ do not split it or create child documents.
|
|
|
51
51
|
|
|
52
52
|
Run `ancleto discovery --check` once more and apply `validation-checklist.md`. This is a
|
|
53
53
|
state-only validation; it must not be followed by another Repomix command. For stale nodes,
|
|
54
|
-
regenerate only the affected documents using one new global generation on a later request
|
|
54
|
+
regenerate only the affected documents using one new global generation on a later request:
|
|
55
|
+
when the check report lists `affectedDocs`, those are the only documents to rewrite.
|
|
55
56
|
If a unit has no dossier, update its row in `units/_map.md` and only the root documents whose
|
|
56
57
|
content changed.
|
|
58
|
+
|
|
59
|
+
After any generation, write `seed-map.json` in `config.outputDir` mapping every seed document
|
|
60
|
+
to the source areas (first-level directories or root file names) it draws evidence from, so a
|
|
61
|
+
later `--check` can scope the next regeneration.
|
|
@@ -9,4 +9,5 @@
|
|
|
9
9
|
- [ ] `decisions.md` concentrates rules, risks, and coupling without duplicating the overview.
|
|
10
10
|
- [ ] `inventory.md` declares directories or globs, not file lists.
|
|
11
11
|
- [ ] `unknowns.md` records what could not be verified.
|
|
12
|
+
- [ ] `seed-map.json` exists and maps each seed document to its source areas.
|
|
12
13
|
- [ ] No secret values are present.
|
package/src/cli/index.js
CHANGED
|
@@ -1207,6 +1207,28 @@ function computeImpact(stored, sources, fileHashes) {
|
|
|
1207
1207
|
return { impact, changedAreas: [...changedAreas].sort(), materialReasons, notes }
|
|
1208
1208
|
}
|
|
1209
1209
|
|
|
1210
|
+
// seed-map.json lo escribe la skill al generar: cada documento → areas de
|
|
1211
|
+
// primer nivel (o archivos raiz) de las que saco evidencia. Misma convencion que areaOf.
|
|
1212
|
+
async function readSeedMap(outputDir) {
|
|
1213
|
+
try {
|
|
1214
|
+
const raw = await readFile(join(outputDir, 'seed-map.json'), 'utf8')
|
|
1215
|
+
const parsed = JSON.parse(raw.replace(/^\uFEFF/, ''))
|
|
1216
|
+
if (!parsed || typeof parsed.docs !== 'object' || parsed.docs === null) return null
|
|
1217
|
+
return parsed.docs
|
|
1218
|
+
} catch {
|
|
1219
|
+
return null
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1223
|
+
function affectedDocsFor(seedMap, changedAreas) {
|
|
1224
|
+
if (!seedMap || !changedAreas.length) return []
|
|
1225
|
+
const out = new Set()
|
|
1226
|
+
for (const [doc, areas] of Object.entries(seedMap)) {
|
|
1227
|
+
if (Array.isArray(areas) && areas.some((a) => changedAreas.includes(a))) out.add(doc)
|
|
1228
|
+
}
|
|
1229
|
+
return [...out].sort()
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1210
1232
|
function statePath(outputDir) {
|
|
1211
1233
|
return join(outputDir, '.discovery-state.json')
|
|
1212
1234
|
}
|
|
@@ -1229,7 +1251,7 @@ async function checkDiscovery() {
|
|
|
1229
1251
|
const { outputDir } = config
|
|
1230
1252
|
const tier = readProjectTier(process.cwd())
|
|
1231
1253
|
const present = await presentDocs(outputDir)
|
|
1232
|
-
let state, action, message, missingDocs, impact = 'none', changedAreas = [], materialReasons = [], notes = []
|
|
1254
|
+
let state, action, message, missingDocs, impact = 'none', changedAreas = [], materialReasons = [], notes = [], affectedDocs = [], seedMapPresent = false
|
|
1233
1255
|
if (present.length === 0) {
|
|
1234
1256
|
state = 'MISSING'
|
|
1235
1257
|
action = 'generate'
|
|
@@ -1265,6 +1287,9 @@ async function checkDiscovery() {
|
|
|
1265
1287
|
changedAreas = diff.changedAreas
|
|
1266
1288
|
materialReasons = diff.materialReasons
|
|
1267
1289
|
notes = diff.notes
|
|
1290
|
+
const seedMap = await readSeedMap(outputDir)
|
|
1291
|
+
seedMapPresent = seedMap !== null
|
|
1292
|
+
affectedDocs = affectedDocsFor(seedMap, changedAreas)
|
|
1268
1293
|
state = 'STALE'
|
|
1269
1294
|
if (impact === 'material') {
|
|
1270
1295
|
action = 'regenerate'
|
|
@@ -1286,6 +1311,8 @@ async function checkDiscovery() {
|
|
|
1286
1311
|
changedAreas,
|
|
1287
1312
|
materialReasons,
|
|
1288
1313
|
notes,
|
|
1314
|
+
affectedDocs,
|
|
1315
|
+
seedMapPresent,
|
|
1289
1316
|
config: {
|
|
1290
1317
|
outputDir,
|
|
1291
1318
|
exclude: config.exclude,
|