@tacuchi/agent-workflow-cli 21.14.0 → 21.16.0
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/dist/application/export-service.js +183 -19
- package/dist/application/export-service.js.map +1 -1
- package/dist/application/parsers/project-block.js +164 -54
- package/dist/application/parsers/project-block.js.map +1 -1
- package/dist/application/project-md-upsert-service.js +153 -46
- package/dist/application/project-md-upsert-service.js.map +1 -1
- package/dist/application/render/project-block.js +37 -16
- package/dist/application/render/project-block.js.map +1 -1
- package/dist/application/retirement/graph.js +12 -2
- package/dist/application/retirement/graph.js.map +1 -1
- package/dist/application/retirement/prepare.js +21 -2
- package/dist/application/retirement/prepare.js.map +1 -1
- package/dist/application/retirement/preview.js +32 -0
- package/dist/application/retirement/preview.js.map +1 -1
- package/dist/application/retirement/resolve.js +4 -4
- package/dist/application/retirement/resolve.js.map +1 -1
- package/dist/application/semantic-operation/protocol.js +54 -4
- package/dist/application/semantic-operation/protocol.js.map +1 -1
- package/dist/application/session-create-service.js +94 -4
- package/dist/application/session-create-service.js.map +1 -1
- package/dist/application/workspace-init-service.js +43 -27
- package/dist/application/workspace-init-service.js.map +1 -1
- package/dist/cli/commands/export.js +78 -4
- package/dist/cli/commands/export.js.map +1 -1
- package/dist/cli/commands/retirement.js +10 -1
- package/dist/cli/commands/retirement.js.map +1 -1
- package/dist/cli/commands/session-create.js +1 -1
- package/dist/cli/commands/session-create.js.map +1 -1
- package/dist/cli/commands/workspace-init.js +12 -0
- package/dist/cli/commands/workspace-init.js.map +1 -1
- package/dist/domain/retirement/proposal.js +1 -0
- package/dist/domain/retirement/proposal.js.map +1 -1
- package/package.json +1 -1
- package/skills/w/commands/export-diagrams.md +1 -1
- package/skills/w/commands/export-manuals.md +1 -1
- package/skills/w/commands/export-reports.md +1 -1
- package/skills/w/commands/export-scripts.md +1 -1
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { localDateIso } from "./dates.js";
|
|
2
2
|
import { runNextNumber } from "./dev-only-services.js";
|
|
3
|
+
import { resolveDocsCanon } from "./docs-canon-service.js";
|
|
3
4
|
import { withCwdLock } from "./lock-service.js";
|
|
4
5
|
import { runReleaseData } from "./release-data-service.js";
|
|
5
|
-
import { approvalDigest, buildSemanticRequest, parseSemanticResponse, } from "./semantic-operation/protocol.js";
|
|
6
|
+
import { approvalDigest, buildSemanticRequest, parseSemanticResponse, readEnvelopeScope, } from "./semantic-operation/protocol.js";
|
|
6
7
|
import { publishArtifacts } from "./semantic-operation/publish.js";
|
|
8
|
+
export const EXPORT_CATEGORIES = [
|
|
9
|
+
"diagrams",
|
|
10
|
+
"manuals",
|
|
11
|
+
"reports",
|
|
12
|
+
"scripts",
|
|
13
|
+
];
|
|
7
14
|
const POLICIES = {
|
|
8
15
|
diagrams: {
|
|
9
16
|
dir: "docs/diagrams",
|
|
@@ -18,8 +25,8 @@ const POLICIES = {
|
|
|
18
25
|
required: ["README.md"],
|
|
19
26
|
extensions: [".md"],
|
|
20
27
|
// The only file an export may replace, and only with an explicit approval.
|
|
21
|
-
overwritable: "
|
|
22
|
-
contract: "Un dossier con README.md obligatorio y los manuales en Markdown. Podés incluir
|
|
28
|
+
overwritable: "INDEX.md",
|
|
29
|
+
contract: "Un dossier con README.md obligatorio y los manuales en Markdown. Podés incluir el INDEX.md de la categoría para actualizar el índice: es el ÚNICO archivo sobrescribible y exige aprobación explícita.",
|
|
23
30
|
},
|
|
24
31
|
reports: {
|
|
25
32
|
dir: "docs/reports",
|
|
@@ -33,14 +40,34 @@ const POLICIES = {
|
|
|
33
40
|
shape: "dossier",
|
|
34
41
|
required: ["00-ROLLBACK.sql", "README.md"],
|
|
35
42
|
extensions: [".sql", ".md"],
|
|
36
|
-
|
|
43
|
+
// The net-final-state doctrine travels HERE, in the contract the composer
|
|
44
|
+
// must obey, and not in the `skills/w` bundle: the bundle's context budget
|
|
45
|
+
// is a frozen gate with 121 B of headroom and this is ~700 B, so shipping it
|
|
46
|
+
// there would mean cutting live doctrine to pay for it. The contract reaches
|
|
47
|
+
// the same reader at the exact moment the bundle is being written, and its
|
|
48
|
+
// bytes are request bytes, which no frozen gate prices.
|
|
49
|
+
contract: "Un dossier con 00-ROLLBACK.sql y README.md obligatorios, más los forwards NN-<nombre>.sql numerados de forma continua desde 01. El CLI NUNCA ejecuta SQL. El bundle publica el ESTADO FINAL NETO de la secuencia, no una réplica por sesión: lo que nace y muere dentro de la secuencia se omite; lo migrado va directo a su forma final; lo que el contexto declara retirado se omite aunque ningún script lo elimine. 00-ROLLBACK.sql invierte ese ESTADO FINAL en orden seguro para las dependencias, no el reverso literal de los forwards. Reconciliá contra el código además de las sesiones y la base. Excluí identidades concretas y semillas de prueba; conservá funciones reutilizables, tablas maestras y el registro de menú/rol.",
|
|
37
50
|
},
|
|
38
51
|
};
|
|
39
52
|
const LIMITS = { max_artifacts: 64, max_artifact_bytes: 512 * 1024 };
|
|
40
53
|
const FORWARD_RE = /^(\d{2})-[^/]+\.sql$/;
|
|
41
54
|
// ── prepare ──────────────────────────────────────────────────────────────────
|
|
42
|
-
export async function prepareExport(fs, env, paths, category, selection = {}
|
|
43
|
-
|
|
55
|
+
export async function prepareExport(fs, env, paths, category, selection = {},
|
|
56
|
+
// Injected so the midnight boundary is testable: a preparation that outlives
|
|
57
|
+
// the day used to rename its own destination on the next stage.
|
|
58
|
+
now = () => new Date()) {
|
|
59
|
+
const canon = await resolveDocsCanon(fs, paths, EXPORT_CATEGORIES);
|
|
60
|
+
if (!canon.ok) {
|
|
61
|
+
return {
|
|
62
|
+
ok: false,
|
|
63
|
+
failure: {
|
|
64
|
+
code: "EXPORT_DESTINATION_INVALID",
|
|
65
|
+
message: canon.error,
|
|
66
|
+
action: "corregí la tabla [docs] de skills.toml, o quitala para usar el destino por defecto",
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
const policy = resolvePolicy(category, canon.canon[category]);
|
|
44
71
|
const corpus = await readCorpus(fs, env, paths, selection);
|
|
45
72
|
if ("error" in corpus) {
|
|
46
73
|
return {
|
|
@@ -62,33 +89,72 @@ export async function prepareExport(fs, env, paths, category, selection = {}) {
|
|
|
62
89
|
},
|
|
63
90
|
};
|
|
64
91
|
}
|
|
65
|
-
|
|
66
|
-
|
|
92
|
+
// Pinned when the answer echoed them, derived only on a first preparation:
|
|
93
|
+
// re-deriving either at `validate` renames the very unit the answer wrote to,
|
|
94
|
+
// and neither is workspace state that a stale check should be defending.
|
|
95
|
+
const next = selection.next ??
|
|
96
|
+
(await runNextNumber(fs, env, paths, { directory: policy.dir, dryRun: true })).next;
|
|
97
|
+
const date = selection.date ?? localDateIso(now());
|
|
98
|
+
// Rejected HERE and not only when the envelope comes back: `prepare` used to
|
|
99
|
+
// accept any string, mint `…-export-manuals-lunes` and let the composer be
|
|
100
|
+
// blamed at `validate` for a scope it had copied verbatim, exactly as asked.
|
|
101
|
+
// The invocation that supplied it is the one that can fix it.
|
|
102
|
+
if (!DATE_RE.test(date)) {
|
|
103
|
+
return {
|
|
104
|
+
ok: false,
|
|
105
|
+
failure: {
|
|
106
|
+
code: "EXPORT_SCOPE_INVALID",
|
|
107
|
+
message: `--date '${date}' no tiene la forma YYYY-MM-DD`,
|
|
108
|
+
action: "repetí la invocación con una fecha YYYY-MM-DD, o sin --date para usar la de hoy",
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
}
|
|
67
112
|
const unit = policy.shape === "dossier" ? `${policy.dir}/${next}-export-${category}-${date}` : policy.dir;
|
|
113
|
+
const scope = {
|
|
114
|
+
...(selection.sessions !== undefined ? { sessions: selection.sessions } : {}),
|
|
115
|
+
...(selection.since !== undefined ? { since: selection.since } : {}),
|
|
116
|
+
...(selection.source !== undefined ? { source: selection.source } : {}),
|
|
117
|
+
date,
|
|
118
|
+
next,
|
|
119
|
+
};
|
|
68
120
|
const inventory = {
|
|
69
121
|
category,
|
|
70
122
|
destination: unit,
|
|
71
123
|
shape: policy.shape,
|
|
72
124
|
required: policy.required,
|
|
73
125
|
extensions: policy.extensions,
|
|
74
|
-
overwritable: policy.overwritable
|
|
126
|
+
overwritable: policy.overwritable,
|
|
75
127
|
sessions: corpus.sessions,
|
|
76
128
|
date,
|
|
77
129
|
};
|
|
78
130
|
const readSet = corpus.sessions.map((s) => s.path ?? s.folder);
|
|
79
131
|
const request = buildSemanticRequest({
|
|
80
132
|
operation: `export-${category}`,
|
|
81
|
-
//
|
|
82
|
-
//
|
|
83
|
-
|
|
84
|
-
|
|
133
|
+
// What the seal defends is workspace state: the corpus the scope covers (a
|
|
134
|
+
// session appearing or closing changes what the dossier should have
|
|
135
|
+
// contained) and the folder this workspace publishes to. The scope rides
|
|
136
|
+
// along so an altered echo cannot pass as the original one.
|
|
137
|
+
inputs: { corpus: corpus.sessions, dir: policy.dir, scope },
|
|
138
|
+
sealed: "el corpus de sesiones del alcance o el destino declarado de la categoría",
|
|
139
|
+
scope,
|
|
140
|
+
contract: `${policy.contract} Respondé artifacts con paths dentro de ${unit}${policy.overwritable === null ? "" : ` (o exactamente ${policy.overwritable})`}. El NNN es consultivo: el CLI reasigna el número dentro del lock. Copiá 'scope' TAL CUAL en tu respuesta: validate y apply lo leen en vez de re-derivarlo.`,
|
|
85
141
|
inventory,
|
|
86
|
-
allowedDestinations: [unit, ...(policy.overwritable ? [
|
|
142
|
+
allowedDestinations: [unit, ...(policy.overwritable === null ? [] : [policy.overwritable])],
|
|
87
143
|
limits: LIMITS,
|
|
88
144
|
readSet,
|
|
89
145
|
readSetBytes: readSet.length,
|
|
90
146
|
});
|
|
91
|
-
return { ok: true, value: { category, request, next, unit } };
|
|
147
|
+
return { ok: true, value: { category, request, dir: policy.dir, scope, next, unit } };
|
|
148
|
+
}
|
|
149
|
+
/** The category's policy with the folder this workspace actually publishes to. */
|
|
150
|
+
function resolvePolicy(category, dir) {
|
|
151
|
+
const { overwritable, ...base } = POLICIES[category];
|
|
152
|
+
const resolved = dir ?? base.dir;
|
|
153
|
+
return {
|
|
154
|
+
...base,
|
|
155
|
+
dir: resolved,
|
|
156
|
+
overwritable: overwritable === undefined ? null : `${resolved}/${overwritable}`,
|
|
157
|
+
};
|
|
92
158
|
}
|
|
93
159
|
async function readCorpus(fs, env, paths, selection) {
|
|
94
160
|
const input = {
|
|
@@ -105,16 +171,107 @@ async function readCorpus(fs, env, paths, selection) {
|
|
|
105
171
|
return { error: data.error };
|
|
106
172
|
return { sessions: data.sessions };
|
|
107
173
|
}
|
|
174
|
+
// ── the scope, travelling between stages ─────────────────────────────────────
|
|
175
|
+
const DATE_RE = /^\d{4}-\d{2}-\d{2}$/;
|
|
176
|
+
const NEXT_RE = /^\d{3,}$/;
|
|
177
|
+
/**
|
|
178
|
+
* The scope an answer echoes back, so `validate` and `apply` rebuild the
|
|
179
|
+
* preparation the answer was written against.
|
|
180
|
+
*
|
|
181
|
+
* Three outcomes and no fourth: a scope that is there and well formed, no scope
|
|
182
|
+
* at all (an answer written before this field existed — the invocation's own
|
|
183
|
+
* flags still decide, exactly as they did), and a scope that is there but
|
|
184
|
+
* malformed, which is a rejection. Reading a broken echo as "no echo" would
|
|
185
|
+
* quietly export a different corpus than the one that was approved.
|
|
186
|
+
*/
|
|
187
|
+
export function readExportScope(raw) {
|
|
188
|
+
const echoed = readEnvelopeScope(raw);
|
|
189
|
+
if (echoed === undefined || echoed === null)
|
|
190
|
+
return { ok: true, value: null };
|
|
191
|
+
if (typeof echoed !== "object" || Array.isArray(echoed))
|
|
192
|
+
return malformedScope("no es un objeto");
|
|
193
|
+
const scope = echoed;
|
|
194
|
+
const why = scopeShapeError(scope);
|
|
195
|
+
if (why !== null)
|
|
196
|
+
return malformedScope(why);
|
|
197
|
+
return {
|
|
198
|
+
ok: true,
|
|
199
|
+
value: {
|
|
200
|
+
...(scope.sessions !== undefined ? { sessions: scope.sessions } : {}),
|
|
201
|
+
...(scope.since !== undefined ? { since: scope.since } : {}),
|
|
202
|
+
...(scope.source !== undefined ? { source: scope.source } : {}),
|
|
203
|
+
date: scope.date,
|
|
204
|
+
next: scope.next,
|
|
205
|
+
},
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
/** Why this echo is not the scope `prepare` emitted, or `null` when it is. */
|
|
209
|
+
function scopeShapeError(scope) {
|
|
210
|
+
if (typeof scope.date !== "string" || !DATE_RE.test(scope.date)) {
|
|
211
|
+
return "'date' tiene que ser YYYY-MM-DD";
|
|
212
|
+
}
|
|
213
|
+
if (typeof scope.next !== "string" || !NEXT_RE.test(scope.next)) {
|
|
214
|
+
return "'next' tiene que ser el correlativo de 3 dígitos";
|
|
215
|
+
}
|
|
216
|
+
if (scope.sessions !== undefined && !isStringArray(scope.sessions)) {
|
|
217
|
+
return "'sessions' tiene que ser una lista de códigos de texto";
|
|
218
|
+
}
|
|
219
|
+
for (const key of ["since", "source"]) {
|
|
220
|
+
if (scope[key] !== undefined && typeof scope[key] !== "string") {
|
|
221
|
+
return `'${key}' tiene que ser texto`;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
return null;
|
|
225
|
+
}
|
|
226
|
+
function isStringArray(value) {
|
|
227
|
+
return Array.isArray(value) && value.every((item) => typeof item === "string");
|
|
228
|
+
}
|
|
229
|
+
function malformedScope(why) {
|
|
230
|
+
return {
|
|
231
|
+
ok: false,
|
|
232
|
+
failure: {
|
|
233
|
+
code: "SEMANTIC_RESPONSE_INVALID",
|
|
234
|
+
message: `el 'scope' del sobre no tiene la forma que prepare emitió: ${why}`,
|
|
235
|
+
action: "copiá el 'scope' del request TAL CUAL, sin reescribirlo",
|
|
236
|
+
},
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Scope flags the invocation repeated that CONTRADICT the echoed scope.
|
|
241
|
+
*
|
|
242
|
+
* Repeating them is still supported and still works — that is what every
|
|
243
|
+
* existing invocation does. Repeating them with a different value is not the
|
|
244
|
+
* same thing: one of the two answers is not the one the proposal was written
|
|
245
|
+
* against, and picking either in silence hides which.
|
|
246
|
+
*/
|
|
247
|
+
export function conflictingScopeFlags(echoed, flags) {
|
|
248
|
+
const same = (a, b) => (a ?? []).join(",") === (b ?? []).join(",");
|
|
249
|
+
const conflicts = [];
|
|
250
|
+
if (flags.sessions !== undefined && !same(flags.sessions, echoed.sessions)) {
|
|
251
|
+
conflicts.push("--sessions");
|
|
252
|
+
}
|
|
253
|
+
for (const [flag, key] of [
|
|
254
|
+
["--since", "since"],
|
|
255
|
+
["--source", "source"],
|
|
256
|
+
["--date", "date"],
|
|
257
|
+
]) {
|
|
258
|
+
if (flags[key] !== undefined && flags[key] !== echoed[key])
|
|
259
|
+
conflicts.push(flag);
|
|
260
|
+
}
|
|
261
|
+
return conflicts;
|
|
262
|
+
}
|
|
108
263
|
// ── validate ─────────────────────────────────────────────────────────────────
|
|
109
264
|
export function validateExport(raw, prepared) {
|
|
110
265
|
const parsed = parseSemanticResponse(raw, prepared.request);
|
|
111
266
|
if (!parsed.ok)
|
|
112
267
|
return parsed;
|
|
113
|
-
|
|
268
|
+
// From what was prepared, never from the policy table: the folder is the
|
|
269
|
+
// workspace's, and re-reading it here would let the two stages disagree.
|
|
270
|
+
const policy = resolvePolicy(prepared.category, prepared.dir);
|
|
114
271
|
const artifacts = parsed.value.artifacts ?? [];
|
|
115
272
|
const inUnit = artifacts.filter((a) => a.path !== policy.overwritable);
|
|
116
273
|
const overwrites = artifacts.some((a) => a.path === policy.overwritable)
|
|
117
|
-
?
|
|
274
|
+
? policy.overwritable
|
|
118
275
|
: null;
|
|
119
276
|
const shape = checkShape(inUnit, policy, prepared.unit);
|
|
120
277
|
if (shape !== null)
|
|
@@ -199,7 +356,7 @@ export async function applyExport(fs, env, paths, input) {
|
|
|
199
356
|
const parsed = parseSemanticResponse(input.raw, input.prepared.request);
|
|
200
357
|
if (!parsed.ok)
|
|
201
358
|
return parsed;
|
|
202
|
-
const policy =
|
|
359
|
+
const policy = resolvePolicy(input.prepared.category, input.prepared.dir);
|
|
203
360
|
const result = await withCwdLock(fs, paths, async () => {
|
|
204
361
|
const minted = (await runNextNumber(fs, env, paths, { directory: policy.dir })).next;
|
|
205
362
|
const artifacts = (parsed.value.artifacts ?? []).map((artifact) => renumber(artifact, input.prepared, minted, policy));
|
|
@@ -234,7 +391,14 @@ function renumber(artifact, prepared, minted, policy) {
|
|
|
234
391
|
const name = artifact.path.slice(policy.dir.length + 1).replace(/^\d{3}-/, "");
|
|
235
392
|
return { path: `${policy.dir}/${minted}-${name}`, content: artifact.content };
|
|
236
393
|
}
|
|
237
|
-
|
|
394
|
+
// The number to move is the UNIT's own, which is its LAST segment — never the
|
|
395
|
+
// first `/NNN-` of the path. Since the category's folder became configurable,
|
|
396
|
+
// a canon that is itself numbered (`docs/003-manuales`) would eat the
|
|
397
|
+
// replacement: the export would be approved into `docs/003-manuales/…` and
|
|
398
|
+
// written into `docs/001-manuales/…`, a folder outside `allowed_destinations`
|
|
399
|
+
// that nothing downstream re-checks.
|
|
400
|
+
const unitName = prepared.unit.slice(policy.dir.length + 1).replace(/^\d{3}-/, `${minted}-`);
|
|
401
|
+
const unit = `${policy.dir}/${unitName}`;
|
|
238
402
|
return {
|
|
239
403
|
path: `${unit}/${artifact.path.slice(prepared.unit.length + 1)}`,
|
|
240
404
|
content: artifact.content,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"export-service.js","sourceRoot":"","sources":["../../src/application/export-service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAyB,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAClF,OAAO,EAKL,cAAc,EACd,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AA8BnE,MAAM,QAAQ,GAA2C;IACvD,QAAQ,EAAE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AC;IAChF,CAAC;IACD,8EAA8E;IAC9E,8EAA8E;IAC9E,sEAAsE;IACtE,2EAA2E;IAC3E,8EAA8E;IAC9E,qCAAqC;IACrC,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,MAAM,GAAG,CAAC,CAAC;IAC7F,MAAM,IAAI,GAAG,GAAG,MAAM,CAAC,GAAG,IAAI,QAAQ,EAAE,CAAC;IACzC,OAAO;QACL,IAAI,EAAE,GAAG,IAAI,IAAI,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE;QAChE,OAAO,EAAE,QAAQ,CAAC,OAAO;KAC1B,CAAC;AACJ,CAAC;AAED,SAAS,MAAM,CAAC,OAAe;IAC7B,OAAO;QACL,IAAI,EAAE,sBAAsB;QAC5B,OAAO;QACP,MAAM,EAAE,kEAAkE;KAC3E,CAAC;AACJ,CAAC"}
|
|
@@ -6,7 +6,7 @@ import { parseMdSection } from "../markdown.js";
|
|
|
6
6
|
* the read loop previously pasted per service.
|
|
7
7
|
*/
|
|
8
8
|
export async function readWorkspaceBlock(fs, dir, markers, accept = () => true) {
|
|
9
|
-
for (const name of
|
|
9
|
+
for (const name of BLOCK_MIRROR_FILES) {
|
|
10
10
|
const path = join(dir, name);
|
|
11
11
|
if (!(await fs.exists(path)))
|
|
12
12
|
continue;
|
|
@@ -16,10 +16,22 @@ export async function readWorkspaceBlock(fs, dir, markers, accept = () => true)
|
|
|
16
16
|
}
|
|
17
17
|
return null;
|
|
18
18
|
}
|
|
19
|
+
/** The block is written to both files at once; a reader takes the first that has it. */
|
|
20
|
+
export const BLOCK_MIRROR_FILES = ["CLAUDE.md", "AGENTS.md"];
|
|
19
21
|
export const LEGACY_QTC_MARKERS = {
|
|
20
22
|
start: "<!-- QTC-PROJECT-START -->",
|
|
21
23
|
end: "<!-- QTC-PROJECT-END -->",
|
|
22
24
|
};
|
|
25
|
+
/**
|
|
26
|
+
* Lines the render emits by itself when a section has no data. They belong to
|
|
27
|
+
* the CLI, never to a person: preserving one would duplicate it on the next
|
|
28
|
+
* write (the render re-emits it AND the carried copy would come back too).
|
|
29
|
+
*/
|
|
30
|
+
export const BLOCK_PLACEHOLDER_PROYECTO = "_Describe el proyecto aquí: qué es y por qué existe._";
|
|
31
|
+
export const BLOCK_PLACEHOLDER_FUENTES = "_Sin fuentes declaradas. Edita manualmente o usa `project-md-upsert --init`._";
|
|
32
|
+
export const BLOCK_PLACEHOLDER_STACK = "_Stack sin detectar._";
|
|
33
|
+
/** Emitted by the pre-TypeScript generator for an undetectable stack. */
|
|
34
|
+
const LEGACY_STACK_PLACEHOLDER = "Edita manualmente si aplica.";
|
|
23
35
|
const STACK_KEY_MAP = {
|
|
24
36
|
lenguaje: "language",
|
|
25
37
|
framework: "framework",
|
|
@@ -50,24 +62,77 @@ function parseWithMarkers(text, markers) {
|
|
|
50
62
|
const statusText = parseMdSection(inner, "Status") ?? "";
|
|
51
63
|
const fuentes = parseFuentesTable(fuentesText);
|
|
52
64
|
const stack = parseStackList(stackText);
|
|
53
|
-
|
|
54
|
-
|
|
65
|
+
// Aliases first: a Status entry is a branch because it names a DECLARED
|
|
66
|
+
// source, not because of where it sits (see `readNestedRecord`).
|
|
67
|
+
const status = parseStatusBlock(statusText, new Set(fuentes.fuentes.map((f) => f.alias)));
|
|
68
|
+
const block = {
|
|
55
69
|
proyecto: stripLegacyModeLine(proyectoText),
|
|
56
|
-
fuentes,
|
|
57
|
-
stack,
|
|
70
|
+
fuentes: fuentes.fuentes,
|
|
71
|
+
stack: stack.stack,
|
|
58
72
|
default_branches: status.defaultBranches,
|
|
59
73
|
working_branches: status.workingBranches,
|
|
60
74
|
qa_branches: status.qaBranches,
|
|
61
75
|
last_activity: status.lastActivity,
|
|
62
76
|
};
|
|
77
|
+
const preserved = [
|
|
78
|
+
...fuentes.preserved,
|
|
79
|
+
...stack.preserved,
|
|
80
|
+
...status.preserved,
|
|
81
|
+
...foreignSections(inner),
|
|
82
|
+
];
|
|
83
|
+
if (preserved.length > 0)
|
|
84
|
+
block.preserved_lines = preserved;
|
|
85
|
+
if (status.dropped.length > 0)
|
|
86
|
+
block.dropped_lines = status.dropped;
|
|
87
|
+
return block;
|
|
88
|
+
}
|
|
89
|
+
/** The four `##` sections this block owns; anything else under a heading is somebody else's. */
|
|
90
|
+
const OWNED_SECTIONS = new Set(["proyecto", "fuentes", "stack", "status"]);
|
|
91
|
+
/**
|
|
92
|
+
* Whole sections the block does not own, heading included.
|
|
93
|
+
*
|
|
94
|
+
* The four owned ones are read BY NAME, so a `## Notas` a person adds was never
|
|
95
|
+
* seen by the parser and never came back — the silent loss this parser exists to
|
|
96
|
+
* stop, arriving through the one shape Markdown makes most natural. They are
|
|
97
|
+
* re-emitted last, after everything the CLI owns, because their original order
|
|
98
|
+
* relative to generated sections is not something a rewrite can honour.
|
|
99
|
+
*/
|
|
100
|
+
function foreignSections(inner) {
|
|
101
|
+
const kept = [];
|
|
102
|
+
let foreign = false;
|
|
103
|
+
for (const raw of inner.split("\n")) {
|
|
104
|
+
const heading = /^##\s+(.+)$/.exec(raw.trim());
|
|
105
|
+
if (heading !== null) {
|
|
106
|
+
foreign = !OWNED_SECTIONS.has((heading[1] ?? "").trim().toLowerCase());
|
|
107
|
+
}
|
|
108
|
+
if (!foreign)
|
|
109
|
+
continue;
|
|
110
|
+
if (raw.trim().length === 0 && kept.length === 0)
|
|
111
|
+
continue;
|
|
112
|
+
kept.push({ slot: "trailing", text: trimTrailing(raw) });
|
|
113
|
+
}
|
|
114
|
+
while (kept.length > 0 && (kept[kept.length - 1]?.text ?? "").length === 0)
|
|
115
|
+
kept.pop();
|
|
116
|
+
return kept;
|
|
117
|
+
}
|
|
118
|
+
/** Trailing blanks carry nothing and would churn the rewrite; indentation is content. */
|
|
119
|
+
function trimTrailing(raw) {
|
|
120
|
+
return raw.replace(/\s+$/, "");
|
|
63
121
|
}
|
|
64
122
|
function parseFuentesTable(text) {
|
|
65
123
|
const fuentes = [];
|
|
124
|
+
const preserved = [];
|
|
66
125
|
let header = null;
|
|
67
126
|
for (const raw of text.split("\n")) {
|
|
68
127
|
const line = raw.trim();
|
|
69
|
-
if (
|
|
128
|
+
if (line.length === 0)
|
|
70
129
|
continue;
|
|
130
|
+
if (!line.startsWith("|")) {
|
|
131
|
+
if (line !== BLOCK_PLACEHOLDER_FUENTES) {
|
|
132
|
+
preserved.push({ slot: "fuentes", text: trimTrailing(raw) });
|
|
133
|
+
}
|
|
134
|
+
continue;
|
|
135
|
+
}
|
|
71
136
|
const cells = line
|
|
72
137
|
.replace(/^\|/, "")
|
|
73
138
|
.replace(/\|$/, "")
|
|
@@ -80,13 +145,14 @@ function parseFuentesTable(text) {
|
|
|
80
145
|
header = cells.map((c) => c.toLowerCase());
|
|
81
146
|
continue;
|
|
82
147
|
}
|
|
83
|
-
if (cells.length < 3)
|
|
84
|
-
continue;
|
|
85
148
|
const alias = cells[0];
|
|
86
149
|
const path = cells[1];
|
|
87
150
|
const mainBranch = cells[2];
|
|
88
|
-
if (alias === undefined || path === undefined)
|
|
151
|
+
if (cells.length < 3 || alias === undefined || path === undefined) {
|
|
152
|
+
// A row the table shape cannot read: keep it rather than swallow it.
|
|
153
|
+
preserved.push({ slot: "fuentes", text: trimTrailing(raw) });
|
|
89
154
|
continue;
|
|
155
|
+
}
|
|
90
156
|
fuentes.push({
|
|
91
157
|
alias,
|
|
92
158
|
path,
|
|
@@ -94,94 +160,138 @@ function parseFuentesTable(text) {
|
|
|
94
160
|
main_branch: mainBranch !== undefined && mainBranch.length > 0 ? mainBranch : null,
|
|
95
161
|
});
|
|
96
162
|
}
|
|
97
|
-
return fuentes;
|
|
163
|
+
return { fuentes, preserved };
|
|
98
164
|
}
|
|
99
165
|
function parseStackList(text) {
|
|
100
166
|
const stack = {};
|
|
167
|
+
const preserved = [];
|
|
101
168
|
for (const raw of text.split("\n")) {
|
|
102
169
|
const line = raw.trim();
|
|
170
|
+
if (line.length === 0)
|
|
171
|
+
continue;
|
|
172
|
+
if (line === BLOCK_PLACEHOLDER_STACK || line === LEGACY_STACK_PLACEHOLDER)
|
|
173
|
+
continue;
|
|
103
174
|
const m = line.match(/^[-*]\s+(Lenguaje|Framework|BD|Build):\s*(.+)$/i);
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
175
|
+
const key = m?.[1] ? STACK_KEY_MAP[m[1].toLowerCase()] : undefined;
|
|
176
|
+
if (key && m?.[2]) {
|
|
177
|
+
stack[key] = m[2].trim();
|
|
178
|
+
continue;
|
|
109
179
|
}
|
|
180
|
+
preserved.push({ slot: "stack", text: trimTrailing(raw) });
|
|
110
181
|
}
|
|
111
|
-
return stack;
|
|
182
|
+
return { stack, preserved };
|
|
112
183
|
}
|
|
113
184
|
const DEFAULT_BRANCH_KEYS = new Set(["principal", "desarrollo", "qa"]);
|
|
114
|
-
|
|
185
|
+
/**
|
|
186
|
+
* Read `## Status`. Every line falls in exactly one of three buckets and none of
|
|
187
|
+
* them vanishes: a recognized entry (parsed), a CLI record the block can no
|
|
188
|
+
* longer honour (dropped, and declared by the caller), or anything else — kept
|
|
189
|
+
* verbatim at the slot it was found in.
|
|
190
|
+
*/
|
|
191
|
+
function parseStatusBlock(text, knownAliases) {
|
|
115
192
|
const defaultBranches = {};
|
|
116
193
|
const workingBranches = {};
|
|
117
194
|
const qaBranches = {};
|
|
195
|
+
const preserved = [];
|
|
196
|
+
const dropped = [];
|
|
118
197
|
let lastActivity = null;
|
|
119
198
|
let section = "none";
|
|
199
|
+
let slot = "status:start";
|
|
120
200
|
for (const raw of text.split("\n")) {
|
|
121
201
|
const stripped = raw.trim();
|
|
202
|
+
if (stripped.length === 0)
|
|
203
|
+
continue;
|
|
122
204
|
const transition = transitionSection(stripped);
|
|
123
205
|
if (transition.handled) {
|
|
124
206
|
section = transition.next;
|
|
207
|
+
slot = transition.slot;
|
|
125
208
|
if (transition.lastActivity !== undefined) {
|
|
126
209
|
lastActivity = transition.lastActivity;
|
|
127
210
|
}
|
|
128
211
|
continue;
|
|
129
212
|
}
|
|
130
|
-
|
|
213
|
+
const record = readNestedRecord(raw, stripped);
|
|
214
|
+
if (record === null || section === "none") {
|
|
215
|
+
preserved.push({ slot, text: trimTrailing(raw) });
|
|
131
216
|
continue;
|
|
132
|
-
const entry = stripped.slice(2).trim();
|
|
133
|
-
if (section === "defaults") {
|
|
134
|
-
addDefaultBranch(defaultBranches, entry);
|
|
135
|
-
}
|
|
136
|
-
else if (section === "working") {
|
|
137
|
-
addWorkingBranch(workingBranches, entry);
|
|
138
|
-
}
|
|
139
|
-
else if (section === "qa") {
|
|
140
|
-
addWorkingBranch(qaBranches, entry);
|
|
141
217
|
}
|
|
218
|
+
const out = { defaultBranches, workingBranches, qaBranches };
|
|
219
|
+
if (acceptRecord(section, record, out, knownAliases))
|
|
220
|
+
continue;
|
|
221
|
+
// Shape matched but the block cannot honour the key. Indentation decides
|
|
222
|
+
// WHERE it goes, and only here: an indented entry is one this CLI wrote, so
|
|
223
|
+
// a key nobody declares anymore is its own residue — pruned, and declared.
|
|
224
|
+
// A flush-left one is somebody's note that happens to read like `- k: v`,
|
|
225
|
+
// and deleting it is the very loss this parser exists to stop.
|
|
226
|
+
if (/^\s/.test(raw))
|
|
227
|
+
dropped.push(trimTrailing(raw));
|
|
228
|
+
else
|
|
229
|
+
preserved.push({ slot, text: trimTrailing(raw) });
|
|
142
230
|
}
|
|
143
|
-
return { defaultBranches, workingBranches, qaBranches, lastActivity };
|
|
231
|
+
return { defaultBranches, workingBranches, qaBranches, lastActivity, preserved, dropped };
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* A `- key: value` entry — the shape the render emits for its own records.
|
|
235
|
+
*
|
|
236
|
+
* Position is NOT the signature: that is how a note written after the branch
|
|
237
|
+
* header used to be adopted as a working branch and re-emitted nested under it,
|
|
238
|
+
* perpetuating itself from the first re-run. What identifies a record is its
|
|
239
|
+
* SHAPE plus a key the block already declares (`acceptRecord`).
|
|
240
|
+
*
|
|
241
|
+
* Indentation is deliberately NOT required. The render indents its own entries,
|
|
242
|
+
* but a block hand-edited or written by an older CLI carries them flush left,
|
|
243
|
+
* and demanding the indent would be the positional rule coming back in through
|
|
244
|
+
* another door: those branches would stop being branches, and four consumers
|
|
245
|
+
* read them.
|
|
246
|
+
*/
|
|
247
|
+
function readNestedRecord(_raw, stripped) {
|
|
248
|
+
if (!stripped.startsWith("- "))
|
|
249
|
+
return null;
|
|
250
|
+
const entry = stripped.slice(2).trim();
|
|
251
|
+
const colon = entry.indexOf(":");
|
|
252
|
+
if (colon <= 0)
|
|
253
|
+
return null;
|
|
254
|
+
const key = entry.slice(0, colon).trim();
|
|
255
|
+
const value = entry.slice(colon + 1).trim();
|
|
256
|
+
if (!key || !value)
|
|
257
|
+
return null;
|
|
258
|
+
return { key, value };
|
|
259
|
+
}
|
|
260
|
+
/** True when the record was stored; false when the block cannot honour it. */
|
|
261
|
+
function acceptRecord(section, record, out, knownAliases) {
|
|
262
|
+
if (section === "defaults") {
|
|
263
|
+
const role = record.key.toLowerCase();
|
|
264
|
+
if (!DEFAULT_BRANCH_KEYS.has(role))
|
|
265
|
+
return false;
|
|
266
|
+
out.defaultBranches[role] = record.value;
|
|
267
|
+
return true;
|
|
268
|
+
}
|
|
269
|
+
if (!knownAliases.has(record.key))
|
|
270
|
+
return false;
|
|
271
|
+
const target = section === "working" ? out.workingBranches : out.qaBranches;
|
|
272
|
+
target[record.key] = record.value;
|
|
273
|
+
return true;
|
|
144
274
|
}
|
|
145
275
|
function transitionSection(stripped) {
|
|
146
276
|
if (stripped.startsWith("- Ramas por defecto:"))
|
|
147
|
-
return { handled: true, next: "defaults" };
|
|
277
|
+
return { handled: true, next: "defaults", slot: "status:defaults" };
|
|
148
278
|
if (stripped.startsWith("- Ramas de trabajo actuales:"))
|
|
149
|
-
return { handled: true, next: "working" };
|
|
279
|
+
return { handled: true, next: "working", slot: "status:working" };
|
|
150
280
|
if (stripped.startsWith("- Ramas QA actuales:"))
|
|
151
|
-
return { handled: true, next: "qa" };
|
|
281
|
+
return { handled: true, next: "qa", slot: "status:qa" };
|
|
152
282
|
if (stripped.startsWith("- Última actividad:")) {
|
|
153
283
|
const idx = stripped.indexOf(":");
|
|
154
284
|
return {
|
|
155
285
|
handled: true,
|
|
156
286
|
next: "none",
|
|
287
|
+
slot: "status:activity",
|
|
157
288
|
lastActivity: idx >= 0 ? stripped.slice(idx + 1).trim() : null,
|
|
158
289
|
};
|
|
159
290
|
}
|
|
160
291
|
if (stripped.startsWith("- Histórico") || stripped.startsWith("- Historico")) {
|
|
161
|
-
return { handled: true, next: "none" };
|
|
162
|
-
}
|
|
163
|
-
return { handled: false, next: "none" };
|
|
164
|
-
}
|
|
165
|
-
/** `principal: main` → `{ principal: "main" }`. Unknown roles are ignored. */
|
|
166
|
-
function addDefaultBranch(out, entry) {
|
|
167
|
-
const colon = entry.indexOf(":");
|
|
168
|
-
if (colon <= 0)
|
|
169
|
-
return;
|
|
170
|
-
const role = entry.slice(0, colon).trim().toLowerCase();
|
|
171
|
-
const branch = entry.slice(colon + 1).trim();
|
|
172
|
-
if (!branch || !DEFAULT_BRANCH_KEYS.has(role))
|
|
173
|
-
return;
|
|
174
|
-
out[role] = branch;
|
|
175
|
-
}
|
|
176
|
-
function addWorkingBranch(out, entry) {
|
|
177
|
-
const colon = entry.indexOf(":");
|
|
178
|
-
if (colon <= 0)
|
|
179
|
-
return;
|
|
180
|
-
const alias = entry.slice(0, colon).trim();
|
|
181
|
-
const branch = entry.slice(colon + 1).trim();
|
|
182
|
-
if (alias && branch) {
|
|
183
|
-
out[alias] = branch;
|
|
292
|
+
return { handled: true, next: "none", slot: "status:historico" };
|
|
184
293
|
}
|
|
294
|
+
return { handled: false, next: "none", slot: "status:start" };
|
|
185
295
|
}
|
|
186
296
|
/**
|
|
187
297
|
* Drop any legacy `Mode:` line from the Proyecto text. The project/hub mode
|