@tacuchi/agent-workflow-cli 21.12.0 → 21.13.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/checkpoint/markdown.js +38 -2
- package/dist/application/checkpoint/markdown.js.map +1 -1
- package/dist/application/checkpoint-service.js +10 -3
- package/dist/application/checkpoint-service.js.map +1 -1
- package/dist/application/checkpoint-write-service.js +52 -27
- package/dist/application/checkpoint-write-service.js.map +1 -1
- package/dist/application/history-table.js +253 -56
- package/dist/application/history-table.js.map +1 -1
- package/dist/application/history-update-service.js +85 -14
- package/dist/application/history-update-service.js.map +1 -1
- package/dist/application/lifecycle-target.js +2 -2
- package/dist/application/lifecycle-target.js.map +1 -1
- package/dist/application/resume-service.js +2 -9
- package/dist/application/resume-service.js.map +1 -1
- package/dist/application/session-close-service.js +13 -2
- package/dist/application/session-close-service.js.map +1 -1
- package/dist/application/session-create-service.js +4 -25
- package/dist/application/session-create-service.js.map +1 -1
- package/dist/application/session-resolver.js +112 -15
- package/dist/application/session-resolver.js.map +1 -1
- package/dist/application/sessions-service.js +7 -6
- package/dist/application/sessions-service.js.map +1 -1
- package/dist/cli/commands/checkpoint-write.js +1 -0
- package/dist/cli/commands/checkpoint-write.js.map +1 -1
- package/dist/cli/commands/history-update.js +25 -4
- package/dist/cli/commands/history-update.js.map +1 -1
- package/dist/cli/commands/index.js +4 -0
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/session-close.js +12 -0
- package/dist/cli/commands/session-close.js.map +1 -1
- package/dist/cli/help-groups.js +4 -0
- package/dist/cli/help-groups.js.map +1 -1
- package/dist/cli/parser.js +5 -0
- package/dist/cli/parser.js.map +1 -1
- package/dist/domain/flow/authority.js +4 -0
- package/dist/domain/flow/authority.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// The history file path itself is resolved by callers via
|
|
2
2
|
// `PathsService.cwdHistoryFile()` and passed in.
|
|
3
3
|
import { join } from "node:path";
|
|
4
|
+
import { localDateIso } from "./dates.js";
|
|
4
5
|
// Slim 4-column table: `Sesión` (row key — the `NNN-<slug>-<flow>` folder
|
|
5
6
|
// identity), `Fecha`, `Estado`, `Refs`. The legacy `#`/`Flujo`/`Resumen`
|
|
6
7
|
// columns were derivable or dead ("#" = the Sesión prefix, "Flujo" always "—",
|
|
@@ -9,6 +10,18 @@ import { join } from "node:path";
|
|
|
9
10
|
const HISTORY_TEMPLATE = "# Session History\n\n" +
|
|
10
11
|
"| Sesión | Fecha | Estado | Refs |\n" +
|
|
11
12
|
"|--------|-------|--------|------|\n";
|
|
13
|
+
/** How many data cells a row of the current shape has. */
|
|
14
|
+
const SLIM_COLUMNS = 4;
|
|
15
|
+
/**
|
|
16
|
+
* Where a rewrite parks the bytes it cannot carry into the current shape.
|
|
17
|
+
*
|
|
18
|
+
* The slim table has no column for `Flujo` or `Resumen`, and the render of
|
|
19
|
+
* `HISTORY.md` is a frozen contract — so a legacy row whose dropped columns
|
|
20
|
+
* carried real prose has nowhere to go INSIDE the record. Copying the file
|
|
21
|
+
* verbatim beside it is the only preservation that changes not one emitted
|
|
22
|
+
* byte, and the name is its own explanation to whoever finds it.
|
|
23
|
+
*/
|
|
24
|
+
const LEGACY_SNAPSHOT = "HISTORY.legacy.md";
|
|
12
25
|
export async function ensureHistoryFile(fs, path) {
|
|
13
26
|
if (await fs.exists(path))
|
|
14
27
|
return;
|
|
@@ -35,6 +48,15 @@ function headerCells(text) {
|
|
|
35
48
|
function isLegacyHeader(cells) {
|
|
36
49
|
return cells.includes("#") || cells.includes("flujo") || cells.includes("resumen");
|
|
37
50
|
}
|
|
51
|
+
/** The data cells of a markdown row, with the outer pipes removed. */
|
|
52
|
+
function dataCells(line) {
|
|
53
|
+
const inner = line.trim().replace(/^\|/, "").replace(/\|$/, "");
|
|
54
|
+
return inner.split("|").map((c) => c.trim());
|
|
55
|
+
}
|
|
56
|
+
/** A cell nobody wrote anything into: the migration may drop it without loss. */
|
|
57
|
+
function isEmptyCell(value) {
|
|
58
|
+
return value === "" || value === "—" || value === "-";
|
|
59
|
+
}
|
|
38
60
|
/**
|
|
39
61
|
* Rewrite a legacy table (7-col `# | Flujo | Sesión | …` or 6-col without
|
|
40
62
|
* Flujo) into the slim 4-col shape, mapping every data row by header index:
|
|
@@ -48,22 +70,21 @@ function isLegacyHeader(cells) {
|
|
|
48
70
|
* separator row, or the Sesión column is missing) — the caller then leaves the
|
|
49
71
|
* file as-is and falls back to append-only. HISTORY.md is the workspace's
|
|
50
72
|
* durable git-tracked record: never rewrite what we cannot parse.
|
|
73
|
+
*
|
|
74
|
+
* `lossy` is the second half of that promise: the dropped columns are reported
|
|
75
|
+
* when they carried content, so the caller can preserve the previous bytes
|
|
76
|
+
* before the rewrite lands.
|
|
51
77
|
*/
|
|
52
78
|
function migrateLegacyTable(text, cells) {
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
const iSesion = idx("sesión") !== -1 ? idx("sesión") : idx("sesion");
|
|
56
|
-
const iFecha = idx("fecha");
|
|
57
|
-
const iEstado = idx("estado");
|
|
58
|
-
const iRefs = idx("refs");
|
|
59
|
-
if (iSesion === -1 && iCode === -1)
|
|
79
|
+
const columns = legacyColumns(cells);
|
|
80
|
+
if (columns === null)
|
|
60
81
|
return null; // no row key → unmappable
|
|
61
82
|
const out = [];
|
|
62
83
|
let headerDone = false;
|
|
63
84
|
let tableClosed = false;
|
|
85
|
+
let lossy = false;
|
|
64
86
|
for (const line of text.split("\n")) {
|
|
65
|
-
const
|
|
66
|
-
const isPipeLine = trimmed.startsWith("|");
|
|
87
|
+
const isPipeLine = line.trim().startsWith("|");
|
|
67
88
|
if (headerDone && !tableClosed && !isPipeLine) {
|
|
68
89
|
tableClosed = true; // the history table ended — everything below is verbatim
|
|
69
90
|
}
|
|
@@ -73,29 +94,59 @@ function migrateLegacyTable(text, cells) {
|
|
|
73
94
|
}
|
|
74
95
|
if (!headerDone) {
|
|
75
96
|
// Header + separator collapse into the slim template's pair.
|
|
76
|
-
if (
|
|
97
|
+
if (isSeparator(line)) {
|
|
77
98
|
headerDone = true;
|
|
78
99
|
out.push("| Sesión | Fecha | Estado | Refs |");
|
|
79
100
|
out.push("|--------|-------|--------|------|");
|
|
80
101
|
}
|
|
81
102
|
continue;
|
|
82
103
|
}
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
const sesion = cell(iSesion);
|
|
88
|
-
out.push(buildRow({
|
|
89
|
-
code: code || sesion,
|
|
90
|
-
sesionName: sesion || code,
|
|
91
|
-
date: cell(iFecha),
|
|
92
|
-
state: cell(iEstado),
|
|
93
|
-
refs: cell(iRefs) || "—",
|
|
94
|
-
}));
|
|
104
|
+
const mapped = migrateLegacyRow(line, columns);
|
|
105
|
+
if (mapped.lossy)
|
|
106
|
+
lossy = true;
|
|
107
|
+
out.push(mapped.row);
|
|
95
108
|
}
|
|
96
109
|
if (!headerDone)
|
|
97
110
|
return null; // separator never matched → do not touch the file
|
|
98
|
-
return out.join("\n");
|
|
111
|
+
return { text: out.join("\n"), lossy };
|
|
112
|
+
}
|
|
113
|
+
/** Where each legacy column sits, or `null` when the table carries no row key. */
|
|
114
|
+
function legacyColumns(cells) {
|
|
115
|
+
const idx = (name) => cells.indexOf(name);
|
|
116
|
+
const code = idx("#");
|
|
117
|
+
const sesion = idx("sesión") !== -1 ? idx("sesión") : idx("sesion");
|
|
118
|
+
if (sesion === -1 && code === -1)
|
|
119
|
+
return null;
|
|
120
|
+
return {
|
|
121
|
+
code,
|
|
122
|
+
sesion,
|
|
123
|
+
fecha: idx("fecha"),
|
|
124
|
+
estado: idx("estado"),
|
|
125
|
+
refs: idx("refs"),
|
|
126
|
+
flujo: idx("flujo"),
|
|
127
|
+
resumen: idx("resumen"),
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
function isSeparator(line) {
|
|
131
|
+
return /^\|[\s|:-]+\|?$/.test(line.trim());
|
|
132
|
+
}
|
|
133
|
+
/** One legacy row in the current shape, and whether mapping it dropped content. */
|
|
134
|
+
function migrateLegacyRow(line, columns) {
|
|
135
|
+
const parts = line.split("|").map((c) => c.trim());
|
|
136
|
+
// `| a | b |` splits into ["", "a", "b", ""] — data cells start at 1.
|
|
137
|
+
const cell = (i) => (i >= 0 ? (parts[i + 1] ?? "") : "");
|
|
138
|
+
const code = cell(columns.code);
|
|
139
|
+
const sesion = cell(columns.sesion);
|
|
140
|
+
return {
|
|
141
|
+
row: buildRow({
|
|
142
|
+
code: code || sesion,
|
|
143
|
+
sesionName: sesion || code,
|
|
144
|
+
date: cell(columns.fecha),
|
|
145
|
+
state: cell(columns.estado),
|
|
146
|
+
refs: cell(columns.refs) || "—",
|
|
147
|
+
}),
|
|
148
|
+
lossy: !isEmptyCell(cell(columns.flujo)) || !isEmptyCell(cell(columns.resumen)),
|
|
149
|
+
};
|
|
99
150
|
}
|
|
100
151
|
/**
|
|
101
152
|
* Highest session number the table has ever mentioned, or 0 when it mentions
|
|
@@ -134,46 +185,192 @@ export async function maxHistoryNumber(fs, historyFile) {
|
|
|
134
185
|
}
|
|
135
186
|
return max;
|
|
136
187
|
}
|
|
137
|
-
|
|
188
|
+
/**
|
|
189
|
+
* Every session the record remembers, whichever table shape holds it.
|
|
190
|
+
*
|
|
191
|
+
* Reading all the rows is not the same question as finding ONE of them, so it
|
|
192
|
+
* is not `findRow` — but it is the same table, so it goes through the same
|
|
193
|
+
* header mapping the migration uses: a legacy 7-column table answers here
|
|
194
|
+
* exactly as the slim one does, and no caller has to know which shape it got.
|
|
195
|
+
*
|
|
196
|
+
* Scoped to the FIRST table in the file, and for the same reason the rewrite is:
|
|
197
|
+
* a second markdown table further down is not the history.
|
|
198
|
+
*/
|
|
199
|
+
export function readHistoryRows(text) {
|
|
200
|
+
const columns = legacyColumns(headerCells(text));
|
|
201
|
+
if (columns === null)
|
|
202
|
+
return [];
|
|
203
|
+
const rows = [];
|
|
204
|
+
let headerSeen = false;
|
|
205
|
+
for (const line of text.split("\n")) {
|
|
206
|
+
if (!line.trim().startsWith("|")) {
|
|
207
|
+
if (headerSeen)
|
|
208
|
+
break;
|
|
209
|
+
continue;
|
|
210
|
+
}
|
|
211
|
+
if (isSeparator(line))
|
|
212
|
+
continue;
|
|
213
|
+
if (!headerSeen) {
|
|
214
|
+
headerSeen = true; // the header row itself carries no session
|
|
215
|
+
continue;
|
|
216
|
+
}
|
|
217
|
+
rows.push(rowFrom(line, columns));
|
|
218
|
+
}
|
|
219
|
+
return rows;
|
|
220
|
+
}
|
|
221
|
+
function rowFrom(line, columns) {
|
|
222
|
+
const parts = line.split("|").map((c) => c.trim());
|
|
223
|
+
// `| a | b |` splits into ["", "a", "b", ""] — data cells start at 1.
|
|
224
|
+
const cell = (i) => (i >= 0 ? (parts[i + 1] ?? "") : "");
|
|
225
|
+
const code = cell(columns.code);
|
|
226
|
+
const sesion = cell(columns.sesion);
|
|
227
|
+
return {
|
|
228
|
+
key: rowKey(code || sesion, sesion || code),
|
|
229
|
+
date: cell(columns.fecha),
|
|
230
|
+
state: cell(columns.estado),
|
|
231
|
+
refs: cell(columns.refs),
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
/** The numeric identity a row key or a `--code` carries; `null` when it has none. */
|
|
235
|
+
function identityNumber(value) {
|
|
236
|
+
const m = value.match(/^(?:session)?(\d+)(?:-|$)/);
|
|
237
|
+
return m?.[1] === undefined ? null : Number.parseInt(m[1], 10);
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Whether a row belongs to the session a caller named.
|
|
241
|
+
*
|
|
242
|
+
* Numeric identity first, and that is the whole point: one number is one
|
|
243
|
+
* session, so `047` names the same row as `047-algo-quick` AND as the legacy
|
|
244
|
+
* `session047-algo` — which is how closing a legacy folder used to APPEND a
|
|
245
|
+
* second row keyed differently instead of updating the one already there.
|
|
246
|
+
* Comparing as numbers rather than as strings keeps `100` off `1000-…`.
|
|
247
|
+
*/
|
|
248
|
+
function rowMatches(firstCell, code) {
|
|
249
|
+
if (firstCell === code)
|
|
250
|
+
return true;
|
|
251
|
+
const wanted = identityNumber(code);
|
|
252
|
+
if (wanted !== null) {
|
|
253
|
+
const found = identityNumber(firstCell);
|
|
254
|
+
return found !== null && found === wanted;
|
|
255
|
+
}
|
|
256
|
+
return firstCell.startsWith(`${code}-`);
|
|
257
|
+
}
|
|
258
|
+
function findRow(lines, code) {
|
|
259
|
+
for (let index = 0; index < lines.length; index += 1) {
|
|
260
|
+
const line = lines[index] ?? "";
|
|
261
|
+
if (!line.trim().startsWith("|"))
|
|
262
|
+
continue;
|
|
263
|
+
const cells = dataCells(line);
|
|
264
|
+
if (!rowMatches(cells[0] ?? "", code))
|
|
265
|
+
continue;
|
|
266
|
+
return { index, line, cells };
|
|
267
|
+
}
|
|
268
|
+
return null;
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* The row to write: what the caller named, over what the table already says.
|
|
272
|
+
*
|
|
273
|
+
* The merge is the point. `session-close` without `--refs` names no references,
|
|
274
|
+
* and a row rebuilt from the caller alone wrote "—" over the ones a human had
|
|
275
|
+
* put there — an update of the state silently deleting a cell nobody mentioned.
|
|
276
|
+
* A cell is only ever rewritten by somebody who named it.
|
|
277
|
+
*
|
|
278
|
+
* Defaults apply to a row being BORN, never to one being updated: a session with
|
|
279
|
+
* no declared date gets today (the day its record was written) once, and every
|
|
280
|
+
* later upsert preserves it instead of re-dating it.
|
|
281
|
+
*/
|
|
282
|
+
function mergeRow(row, existing) {
|
|
283
|
+
const previous = existing !== null && existing.cells.length === SLIM_COLUMNS ? existing.cells : [];
|
|
284
|
+
const key = row.sesionName !== undefined
|
|
285
|
+
? rowKey(row.code, row.sesionName)
|
|
286
|
+
: (previous[0] ?? rowKey(row.code, undefined));
|
|
287
|
+
return `| ${key} | ${row.date ?? previous[1] ?? localDateIso(new Date())} | ${row.state} | ${row.refs ?? previous[3] ?? "—"} |`;
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Put a new row INSIDE the table, right after its last row.
|
|
291
|
+
*
|
|
292
|
+
* Appending at the end of the FILE looked equivalent while HISTORY.md held
|
|
293
|
+
* nothing but its table; with any prose under it, every new session landed
|
|
294
|
+
* below that prose — orphan rows that still matched the row lookup, so the
|
|
295
|
+
* table stayed split in two forever. Falls back to the end of the file only
|
|
296
|
+
* when there is no table to insert into.
|
|
297
|
+
*/
|
|
298
|
+
function insertIntoTable(lines, newRow) {
|
|
299
|
+
const out = [...lines];
|
|
300
|
+
const separator = out.findIndex((line) => /^\|[\s|:-]+\|?$/.test(line.trim()));
|
|
301
|
+
if (separator === -1) {
|
|
302
|
+
const tail = out[out.length - 1] === "" ? out.length - 1 : out.length;
|
|
303
|
+
out.splice(tail, 0, newRow);
|
|
304
|
+
if (out[out.length - 1] !== "")
|
|
305
|
+
out.push("");
|
|
306
|
+
return out.join("\n");
|
|
307
|
+
}
|
|
308
|
+
let end = separator;
|
|
309
|
+
while (end + 1 < out.length && (out[end + 1] ?? "").trim().startsWith("|"))
|
|
310
|
+
end += 1;
|
|
311
|
+
out.splice(end + 1, 0, newRow);
|
|
312
|
+
return out.join("\n");
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* Copy the record's previous bytes beside it, once.
|
|
316
|
+
*
|
|
317
|
+
* Only the FIRST snapshot holds the shape the current one no longer has room
|
|
318
|
+
* for, so an existing one is never overwritten — a second lossy rewrite would
|
|
319
|
+
* otherwise replace the original columns with an already-slimmed copy.
|
|
320
|
+
*/
|
|
321
|
+
async function snapshotLegacy(fs, historyFile, previous) {
|
|
322
|
+
await fs.writeTextExclusive(join(historyFile, "..", LEGACY_SNAPSHOT), previous);
|
|
323
|
+
}
|
|
324
|
+
export async function upsertRow(fs, historyFile, row) {
|
|
325
|
+
// An empty code would make the identity match the separator row and rewrite
|
|
326
|
+
// the table's own header. Callers validate it upstream; this is the guard that
|
|
327
|
+
// says so instead of producing a corrupt file.
|
|
328
|
+
if (row.code.trim() === "")
|
|
329
|
+
throw new Error("upsertRow: code must not be empty");
|
|
138
330
|
await ensureHistoryFile(fs, historyFile);
|
|
139
|
-
|
|
140
|
-
|
|
331
|
+
const previous = await fs.readText(historyFile);
|
|
332
|
+
let text = previous;
|
|
141
333
|
let migrated = false;
|
|
334
|
+
let lossy = false;
|
|
335
|
+
const cells = headerCells(previous);
|
|
142
336
|
if (isLegacyHeader(cells)) {
|
|
143
|
-
const rewritten = migrateLegacyTable(
|
|
337
|
+
const rewritten = migrateLegacyTable(previous, cells);
|
|
338
|
+
// Unmappable legacy table (hand-edited, no separator): leave it verbatim and
|
|
339
|
+
// append below it — losing rows would be worse than a mixed-shape table.
|
|
144
340
|
if (rewritten !== null) {
|
|
145
|
-
text = rewritten;
|
|
341
|
+
text = rewritten.text;
|
|
146
342
|
migrated = true;
|
|
343
|
+
lossy = rewritten.lossy;
|
|
147
344
|
}
|
|
148
|
-
// Unmappable legacy table (hand-edited, no separator): leave it verbatim and
|
|
149
|
-
// append below it — losing rows would be worse than a mixed-shape table.
|
|
150
345
|
}
|
|
151
|
-
const
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
}
|
|
165
|
-
const updated = text.replace(rowRegex, newRow);
|
|
166
|
-
await fs.writeText(historyFile, updated);
|
|
167
|
-
return "updated";
|
|
346
|
+
const lines = text.split("\n");
|
|
347
|
+
const existing = findRow(lines, row.code);
|
|
348
|
+
const merged = mergeRow(row, existing);
|
|
349
|
+
if (existing === null) {
|
|
350
|
+
if (lossy)
|
|
351
|
+
await snapshotLegacy(fs, historyFile, previous);
|
|
352
|
+
await fs.writeText(historyFile, insertIntoTable(lines, merged));
|
|
353
|
+
return "added";
|
|
354
|
+
}
|
|
355
|
+
if (existing.line === merged) {
|
|
356
|
+
if (migrated)
|
|
357
|
+
await persistMigration(fs, historyFile, previous, text, lossy);
|
|
358
|
+
return "unchanged";
|
|
168
359
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
return
|
|
360
|
+
// A matched row of a foreign shape (a legacy table nobody could migrate) is
|
|
361
|
+
// about to be replaced by a slim one: whatever its extra columns held is not
|
|
362
|
+
// representable here either.
|
|
363
|
+
if (lossy || existing.cells.length !== SLIM_COLUMNS) {
|
|
364
|
+
await snapshotLegacy(fs, historyFile, previous);
|
|
365
|
+
}
|
|
366
|
+
lines[existing.index] = merged;
|
|
367
|
+
await fs.writeText(historyFile, lines.join("\n"));
|
|
368
|
+
return "updated";
|
|
369
|
+
}
|
|
370
|
+
/** The migration still has to hit disk when the upserted row itself did not change. */
|
|
371
|
+
async function persistMigration(fs, historyFile, previous, migrated, lossy) {
|
|
372
|
+
if (lossy)
|
|
373
|
+
await snapshotLegacy(fs, historyFile, previous);
|
|
374
|
+
await fs.writeText(historyFile, migrated);
|
|
178
375
|
}
|
|
179
376
|
//# sourceMappingURL=history-table.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history-table.js","sourceRoot":"","sources":["../../src/application/history-table.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,iDAAiD;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,0EAA0E;AAC1E,yEAAyE;AACzE,+EAA+E;AAC/E,8EAA8E;AAC9E,gCAAgC;AAChC,MAAM,gBAAgB,GACpB,uBAAuB;IACvB,sCAAsC;IACtC,sCAAsC,CAAC;AAIzC,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,EAAkB,EAAE,IAAY;IACtE,IAAI,MAAM,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC;QAAE,OAAO;IAClC,MAAM,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC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EACnB,QAAgB,EAChB,QAAgB,EAChB,KAAc;IAEd,IAAI,KAAK;QAAE,MAAM,cAAc,CAAC,EAAE,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC;IAC3D,MAAM,EAAE,CAAC,SAAS,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;AAC5C,CAAC"}
|
|
@@ -1,43 +1,114 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { buildRow, upsertRow } from "./history-table.js";
|
|
1
|
+
import { readHistoryRows, upsertRow } from "./history-table.js";
|
|
3
2
|
import { withCwdLock } from "./lock-service.js";
|
|
4
3
|
import { renderRefs } from "./render/history-row.js";
|
|
5
|
-
import { resolveSessionTarget } from "./session-resolver.js";
|
|
4
|
+
import { resolveSessionTarget, sessionNumericCode, sessionsSharingNumber, } from "./session-resolver.js";
|
|
6
5
|
export async function runHistoryUpdate(fs, paths, input) {
|
|
7
6
|
const validation = validate(input);
|
|
8
7
|
if (validation)
|
|
9
8
|
return validation;
|
|
10
9
|
const code = input.code ?? "";
|
|
11
|
-
// HISTORY is infrastructure
|
|
12
|
-
//
|
|
10
|
+
// HISTORY is infrastructure and never establishes a conversation association
|
|
11
|
+
// (`bind` off) — but it does need to know WHOSE row it is writing. An
|
|
12
|
+
// unresolved `--code 047` used to degrade the row key to `047` and invent a
|
|
13
|
+
// name from it, which rewrote the row of `047-algo-quick` — a different
|
|
14
|
+
// session — dropping its date and its references on the way.
|
|
15
|
+
//
|
|
16
|
+
// A live session answers that question; so does a row named whole, which is
|
|
17
|
+
// the only way left once the folder is gone. Anything else does not write.
|
|
13
18
|
const resolution = await resolveSessionTarget(fs, paths, { code, allowClosed: true });
|
|
19
|
+
if (resolution.outcome !== "resolved" && !(await namesAnExistingRow(fs, paths, code))) {
|
|
20
|
+
return { sessionError: resolution };
|
|
21
|
+
}
|
|
14
22
|
const session = resolution.outcome === "resolved" ? resolution.session : null;
|
|
15
|
-
|
|
23
|
+
// Asked here as well as inside the primitive, and on purpose: the primitive
|
|
24
|
+
// can only throw (its other caller holds the lock and reports the failure as
|
|
25
|
+
// its own), while a command has a result to return and a reader to inform.
|
|
26
|
+
const fields = historyFields(input, session, code);
|
|
27
|
+
const sharing = await sessionsSharingNumber(fs, paths, fields.code);
|
|
28
|
+
if (sharing.length > 1)
|
|
29
|
+
return { sessionError: sharedNumberError(fields.code, sharing) };
|
|
30
|
+
return withCwdLock(fs, paths, () => upsertHistoryRow(fs, paths, fields));
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Whether `code` is, verbatim, the key of a row the record already holds.
|
|
34
|
+
*
|
|
35
|
+
* A session's FOLDER can be gone while its row is not, and repairing that row is
|
|
36
|
+
* exactly what this command is for: the close path tells its caller to re-run it
|
|
37
|
+
* after a `history_error`, and `discard` retires folders by design. Refusing
|
|
38
|
+
* every unresolved identity froze those rows with no way back.
|
|
39
|
+
*
|
|
40
|
+
* The test is EXACT and nothing weaker. A bare `047` matching `047-algo-quick`
|
|
41
|
+
* is how an update used to rewrite another session's row, degrading its key and
|
|
42
|
+
* dropping its date and references on the way; and a key the row-writer would
|
|
43
|
+
* rename on its way through is not the key being repaired either. Reaching a row
|
|
44
|
+
* whose folder is gone costs naming it whole — which the caller can read off the
|
|
45
|
+
* record it is repairing.
|
|
46
|
+
*/
|
|
47
|
+
async function namesAnExistingRow(fs, paths, code) {
|
|
48
|
+
if (normalizeCode(code) !== code)
|
|
49
|
+
return false;
|
|
50
|
+
const historyFile = paths.cwdHistoryFile();
|
|
51
|
+
if (!(await fs.exists(historyFile)))
|
|
52
|
+
return false;
|
|
53
|
+
const rows = readHistoryRows(await fs.readText(historyFile));
|
|
54
|
+
return rows.some((row) => row.key === code);
|
|
55
|
+
}
|
|
56
|
+
/** The refusal a number two sessions answer to deserves, with both of them named. */
|
|
57
|
+
export function sharedNumberError(code, sharing) {
|
|
58
|
+
const folders = sharing.map((candidate) => candidate.folder);
|
|
59
|
+
return {
|
|
60
|
+
outcome: "error",
|
|
61
|
+
code: "SESSION_AMBIGUOUS",
|
|
62
|
+
message: `el número ${sessionNumericCode(code) ?? code} lo comparten ${sharing.length} carpetas y el registro se indexa por número: escribir la fila de una pisaría la de la otra`,
|
|
63
|
+
candidates: sharing,
|
|
64
|
+
action: `renombrá la carpeta legacy al modelo actual (\`NNN-<slug>\`) antes de registrar su fila: ${folders.join(", ")}`,
|
|
65
|
+
};
|
|
16
66
|
}
|
|
17
67
|
/**
|
|
18
68
|
* Upsert the HISTORY.md row WITHOUT acquiring the workspace lock — for callers
|
|
19
69
|
* that already hold it. `session-close` mutates the `.closed` marker, the
|
|
20
70
|
* bindings registry and this row inside ONE lock boundary; going through the
|
|
21
71
|
* public command instead would nest the acquisition.
|
|
72
|
+
*
|
|
73
|
+
* The shared-number guard lives HERE and not only in the command, because this
|
|
74
|
+
* is the primitive both write paths reach: a close whose number two folders
|
|
75
|
+
* answer to would otherwise rewrite the other session's row, and its caller
|
|
76
|
+
* reports the refusal as `history_error` instead of recording a lie.
|
|
22
77
|
*/
|
|
23
78
|
export async function upsertHistoryRow(fs, paths, fields) {
|
|
24
|
-
const
|
|
79
|
+
const sharing = await sessionsSharingNumber(fs, paths, fields.code);
|
|
80
|
+
if (sharing.length > 1)
|
|
81
|
+
throw new Error(sharedNumberError(fields.code, sharing).message);
|
|
82
|
+
const action = await upsertRow(fs, paths.cwdHistoryFile(), {
|
|
25
83
|
code: fields.code,
|
|
26
|
-
sesionName: fields.sesionName,
|
|
27
|
-
date: fields.date,
|
|
84
|
+
...(fields.sesionName !== undefined ? { sesionName: fields.sesionName } : {}),
|
|
85
|
+
...(fields.date !== undefined ? { date: fields.date } : {}),
|
|
28
86
|
state: fields.state,
|
|
29
|
-
|
|
30
|
-
|
|
87
|
+
// Rendered only when the caller named it: `renderRefs(undefined)` is "—",
|
|
88
|
+
// and writing that over references somebody put there by hand is the very
|
|
89
|
+
// deletion this merge exists to stop.
|
|
90
|
+
...(fields.refs !== undefined ? { refs: renderRefs(fields.refs) } : {}),
|
|
91
|
+
});
|
|
31
92
|
// `flow` stays in the output shape for consumer compat; sessions carry no
|
|
32
93
|
// flow segment anymore, so it is always null.
|
|
33
94
|
return { code: fields.code, flow: null, action, state: fields.state };
|
|
34
95
|
}
|
|
35
|
-
/**
|
|
96
|
+
/**
|
|
97
|
+
* Merge the caller's overrides with what the resolved session already knows.
|
|
98
|
+
*
|
|
99
|
+
* What neither of them knows stays UNSAID rather than being filled in here: a
|
|
100
|
+
* name derived from the code alone becomes a row key, and a date defaulted to
|
|
101
|
+
* today becomes the session's recorded date — both of them facts about the
|
|
102
|
+
* command that ran, not about the session. Downstream, an unsaid cell keeps
|
|
103
|
+
* whatever the record already holds.
|
|
104
|
+
*/
|
|
36
105
|
export function historyFields(input, session, code) {
|
|
106
|
+
const sesionName = input.sesionName || session?.name;
|
|
107
|
+
const date = input.date || session?.date;
|
|
37
108
|
return {
|
|
38
109
|
code: normalizeCode(code),
|
|
39
|
-
sesionName
|
|
40
|
-
date
|
|
110
|
+
...(sesionName !== undefined ? { sesionName } : {}),
|
|
111
|
+
...(date !== undefined ? { date } : {}),
|
|
41
112
|
state: input.state ?? "active",
|
|
42
113
|
...(input.refs !== undefined ? { refs: input.refs } : {}),
|
|
43
114
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history-update-service.js","sourceRoot":"","sources":["../../src/application/history-update-service.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"history-update-service.js","sourceRoot":"","sources":["../../src/application/history-update-service.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,eAAe,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACnF,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAIL,oBAAoB,EACpB,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AA0B/B,MAAM,CAAC,KAAK,UAA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C,IAAI,CAAC;QACzB,GAAG,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACnD,GAAG,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACvC,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,QAAQ;QAC9B,GAAG,CAAC,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC1D,CAAC;AACJ,CAAC;AAED,SAAS,QAAQ,CAAC,KAAyB;IACzC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK;QAAE,OAAO,EAAE,KAAK,EAAE,mCAAmC,EAAE,CAAC;IACvF,IAAI,KAAK,CAAC,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;QACzD,OAAO,EAAE,KAAK,EAAE,oCAAoC,EAAE,CAAC;IACzD,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,aAAa,CAAC,IAAY;IACjC,OAAO,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC/F,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { resolveSessionTarget, } from "./session-resolver.js";
|
|
2
|
-
export async function resolveLifecycleTarget(fs, paths, options) {
|
|
2
|
+
export async function resolveLifecycleTarget(fs, paths, options, binding) {
|
|
3
3
|
// `allowClosed` stays off: a lifecycle surface writes or restores state, and
|
|
4
4
|
// a closed line is not a valid destination for either.
|
|
5
5
|
const resolution = await resolveSessionTarget(fs, paths, {
|
|
6
6
|
...(options.code !== undefined ? { code: options.code } : {}),
|
|
7
7
|
...(options.contextId !== undefined ? { contextId: options.contextId } : {}),
|
|
8
|
-
bind:
|
|
8
|
+
bind: binding === "bind",
|
|
9
9
|
});
|
|
10
10
|
if (resolution.outcome === "resolved") {
|
|
11
11
|
return { outcome: "resolved", session: resolution.session };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lifecycle-target.js","sourceRoot":"","sources":["../../src/application/lifecycle-target.ts"],"names":[],"mappings":"AAEA,OAAO,EAIL,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"lifecycle-target.js","sourceRoot":"","sources":["../../src/application/lifecycle-target.ts"],"names":[],"mappings":"AAEA,OAAO,EAIL,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AA6C/B,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,EAAkB,EAClB,KAAmB,EACnB,OAAyB,EACzB,OAAyB;IAEzB,6EAA6E;IAC7E,uDAAuD;IACvD,MAAM,UAAU,GAAG,MAAM,oBAAoB,CAAC,EAAE,EAAE,KAAK,EAAE;QACvD,GAAG,CAAC,OAAO,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7D,GAAG,CAAC,OAAO,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC5E,IAAI,EAAE,OAAO,KAAK,MAAM;KACzB,CAAC,CAAC;IACH,IAAI,UAAU,CAAC,OAAO,KAAK,UAAU,EAAE,CAAC;QACtC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,CAAC,OAAO,EAAE,CAAC;IAC9D,CAAC;IACD,2EAA2E;IAC3E,2EAA2E;IAC3E,2EAA2E;IAC3E,2EAA2E;IAC3E,0EAA0E;IAC1E,wDAAwD;IACxD,IAAI,OAAO,CAAC,kBAAkB,KAAK,IAAI,IAAI,UAAU,CAAC,IAAI,KAAK,mBAAmB,EAAE,CAAC;QACnF,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;IACnD,CAAC;IACD,OAAO;QACL,OAAO,EAAE,UAAU;QACnB,MAAM,EAAE,UAAU,CAAC,OAAO;QAC1B,UAAU,EAAE,UAAU,CAAC,UAAU;QACjC,MAAM,EAAE,UAAU,CAAC,MAAM;KAC1B,CAAC;AACJ,CAAC;AAED,gFAAgF;AAChF,MAAM,UAAU,gBAAgB,CAC9B,MAAqE;IAErE,OAAO,MAAM,CAAC,OAAO,KAAK,SAAS;QACjC,CAAC,CAAC;YACE,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO;YAC5B,UAAU,EAAE,MAAM,CAAC,KAAK,CAAC,UAAU;YACnC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM;SAC5B;QACH,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;AACtF,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { projectRun } from "./flow/run-projection.js";
|
|
2
2
|
import { buildSessionNarrative } from "./session-narrative.js";
|
|
3
|
-
import { resolveSessionTarget } from "./session-resolver.js";
|
|
3
|
+
import { resolveSessionTarget, sessionReadRequest } from "./session-resolver.js";
|
|
4
4
|
import { buildWorklineIndex, } from "./workline-index-service.js";
|
|
5
5
|
export async function runResume(fs, env, paths, input = {}) {
|
|
6
6
|
const index = await buildWorklineIndex(fs, env, paths, {
|
|
@@ -46,14 +46,7 @@ function resumeTarget(index, target) {
|
|
|
46
46
|
return { status: "proposal", via: "explicit", proposal: first };
|
|
47
47
|
}
|
|
48
48
|
async function resumeSession(fs, paths, index, input) {
|
|
49
|
-
|
|
50
|
-
// the conversation→session association, and `resume` must not write.
|
|
51
|
-
const resolution = await resolveSessionTarget(fs, paths, {
|
|
52
|
-
...(input.code !== undefined ? { code: input.code } : {}),
|
|
53
|
-
...(input.contextId !== undefined ? { contextId: input.contextId } : {}),
|
|
54
|
-
allowClosed: true,
|
|
55
|
-
bind: false,
|
|
56
|
-
});
|
|
49
|
+
const resolution = await resolveSessionTarget(fs, paths, sessionReadRequest(input));
|
|
57
50
|
if (resolution.outcome !== "resolved") {
|
|
58
51
|
return {
|
|
59
52
|
status: "invalid_target",
|