@tacuchi/agent-workflow-cli 21.8.0 → 21.10.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.
Files changed (106) hide show
  1. package/dist/adapters/git-cli.js +217 -0
  2. package/dist/adapters/git-cli.js.map +1 -1
  3. package/dist/application/check-branch-service.js +48 -20
  4. package/dist/application/check-branch-service.js.map +1 -1
  5. package/dist/application/dev-only-services.js +53 -4
  6. package/dist/application/dev-only-services.js.map +1 -1
  7. package/dist/application/flow/advance.js +10 -3
  8. package/dist/application/flow/advance.js.map +1 -1
  9. package/dist/application/flow/flow-service.js +7 -0
  10. package/dist/application/flow/flow-service.js.map +1 -1
  11. package/dist/application/flow/internal-actions.js +74 -3
  12. package/dist/application/flow/internal-actions.js.map +1 -1
  13. package/dist/application/flow/internal-drive.js +1 -0
  14. package/dist/application/flow/internal-drive.js.map +1 -1
  15. package/dist/application/flow/run-projection.js +10 -4
  16. package/dist/application/flow/run-projection.js.map +1 -1
  17. package/dist/application/flow/submit.js +164 -15
  18. package/dist/application/flow/submit.js.map +1 -1
  19. package/dist/application/history-table.js +37 -0
  20. package/dist/application/history-table.js.map +1 -1
  21. package/dist/application/hook-branch-check.js +17 -0
  22. package/dist/application/hook-branch-check.js.map +1 -1
  23. package/dist/application/local-proposal.js +37 -0
  24. package/dist/application/local-proposal.js.map +1 -1
  25. package/dist/application/resume-service.js +1 -0
  26. package/dist/application/resume-service.js.map +1 -1
  27. package/dist/application/retirement/apply.js +448 -0
  28. package/dist/application/retirement/apply.js.map +1 -0
  29. package/dist/application/retirement/attribution.js +395 -0
  30. package/dist/application/retirement/attribution.js.map +1 -0
  31. package/dist/application/retirement/graph.js +196 -0
  32. package/dist/application/retirement/graph.js.map +1 -0
  33. package/dist/application/retirement/history-events.js +158 -0
  34. package/dist/application/retirement/history-events.js.map +1 -0
  35. package/dist/application/retirement/journal.js +113 -0
  36. package/dist/application/retirement/journal.js.map +1 -0
  37. package/dist/application/retirement/prepare.js +233 -0
  38. package/dist/application/retirement/prepare.js.map +1 -0
  39. package/dist/application/retirement/preview.js +101 -0
  40. package/dist/application/retirement/preview.js.map +1 -0
  41. package/dist/application/retirement/resolve.js +356 -0
  42. package/dist/application/retirement/resolve.js.map +1 -0
  43. package/dist/application/session-close-service.js +108 -14
  44. package/dist/application/session-close-service.js.map +1 -1
  45. package/dist/application/session-create-service.js +103 -12
  46. package/dist/application/session-create-service.js.map +1 -1
  47. package/dist/application/session-custody-recorder.js +137 -0
  48. package/dist/application/session-custody-recorder.js.map +1 -0
  49. package/dist/application/session-custody-service.js +171 -0
  50. package/dist/application/session-custody-service.js.map +1 -0
  51. package/dist/application/session-resolver.js +21 -0
  52. package/dist/application/session-resolver.js.map +1 -1
  53. package/dist/application/status-service.js +5 -0
  54. package/dist/application/status-service.js.map +1 -1
  55. package/dist/application/workline-index-service.js +31 -0
  56. package/dist/application/workline-index-service.js.map +1 -1
  57. package/dist/application/worktree-service.js +247 -34
  58. package/dist/application/worktree-service.js.map +1 -1
  59. package/dist/cli/commands/check-branch.js +9 -5
  60. package/dist/cli/commands/check-branch.js.map +1 -1
  61. package/dist/cli/commands/dev-only.js +21 -2
  62. package/dist/cli/commands/dev-only.js.map +1 -1
  63. package/dist/cli/commands/flow.js +6 -2
  64. package/dist/cli/commands/flow.js.map +1 -1
  65. package/dist/cli/commands/index.js +6 -0
  66. package/dist/cli/commands/index.js.map +1 -1
  67. package/dist/cli/commands/retirement.js +137 -0
  68. package/dist/cli/commands/retirement.js.map +1 -0
  69. package/dist/cli/commands/session-close.js +12 -1
  70. package/dist/cli/commands/session-close.js.map +1 -1
  71. package/dist/cli/commands/session-create.js +4 -1
  72. package/dist/cli/commands/session-create.js.map +1 -1
  73. package/dist/cli/commands/sources.js +8 -4
  74. package/dist/cli/commands/sources.js.map +1 -1
  75. package/dist/cli/commands/worktree.js +14 -7
  76. package/dist/cli/commands/worktree.js.map +1 -1
  77. package/dist/cli/help-groups.js +4 -0
  78. package/dist/cli/help-groups.js.map +1 -1
  79. package/dist/cli/parser.js +26 -0
  80. package/dist/cli/parser.js.map +1 -1
  81. package/dist/domain/flow/answer.js +72 -4
  82. package/dist/domain/flow/answer.js.map +1 -1
  83. package/dist/domain/flow/authority.js +219 -47
  84. package/dist/domain/flow/authority.js.map +1 -1
  85. package/dist/domain/flow/rules.js +8 -1
  86. package/dist/domain/flow/rules.js.map +1 -1
  87. package/dist/domain/flow/run-state.js +34 -1
  88. package/dist/domain/flow/run-state.js.map +1 -1
  89. package/dist/domain/reservation.js +33 -0
  90. package/dist/domain/reservation.js.map +1 -0
  91. package/dist/domain/retirement/proposal.js +83 -0
  92. package/dist/domain/retirement/proposal.js.map +1 -0
  93. package/dist/domain/retirement/selector.js +109 -0
  94. package/dist/domain/retirement/selector.js.map +1 -0
  95. package/dist/domain/session/custody.js +176 -0
  96. package/dist/domain/session/custody.js.map +1 -0
  97. package/dist/domain/workline-node.js +56 -0
  98. package/dist/domain/workline-node.js.map +1 -0
  99. package/package.json +1 -1
  100. package/skills/w/commands/discard.md +49 -0
  101. package/skills/w/commands/reset.md +50 -0
  102. package/skills/w/context/MANIFEST.json +147 -139
  103. package/skills/w/loops/CODE-POLICIES.md +9 -9
  104. package/skills/w/loops/plan-exec-loop/LOOP.md +23 -13
  105. package/skills/w/loops/plan-new-loop/LOOP.md +1 -1
  106. package/skills/w/modules/PLAN-INPUT.md +1 -1
@@ -327,6 +327,11 @@ function executionAnswer(body, input) {
327
327
  return { ok: false, failure: badResult("esta frontera no declara ninguna acción delegada") };
328
328
  }
329
329
  const outcome = body.outcome;
330
+ // Absent and out-of-vocabulary are DIFFERENT failures and no longer share a
331
+ // sentence. They used to, and the sentence described only the second one.
332
+ if (outcome === undefined) {
333
+ return { ok: false, failure: badResult(missingOutcome(body)) };
334
+ }
330
335
  if (typeof outcome !== "string" ||
331
336
  !CAPABILITY_OUTCOMES.includes(outcome)) {
332
337
  return {
@@ -358,10 +363,7 @@ function executionAnswer(body, input) {
358
363
  }
359
364
  const validations = readValidations(body.validations);
360
365
  if (validations === null) {
361
- return {
362
- ok: false,
363
- failure: badResult("'validations' tiene que ser la lista de ValidationOutcome del resultado"),
364
- };
366
+ return { ok: false, failure: badResult(badValidations(body.validations, action.evidence)) };
365
367
  }
366
368
  const effects = readLedger(body.effects);
367
369
  if (effects === null) {
@@ -386,6 +388,72 @@ function executionAnswer(body, input) {
386
388
  },
387
389
  };
388
390
  }
391
+ /**
392
+ * Why a result carries no `outcome`, said as the thing to fix.
393
+ *
394
+ * A missing field and a field outside the vocabulary answered the same sentence,
395
+ * and that sentence described only the second one. The cost was measured, not
396
+ * imagined: a host that had nested its whole result under `execution` read
397
+ * "'outcome' has to be one of …", corrected the VALUE exactly as instructed, kept
398
+ * the envelope, got the identical message back, and burned its remaining attempts
399
+ * before abandoning the session. A diagnostic that names the wrong field turns an
400
+ * obedient executor into a loop.
401
+ *
402
+ * The envelope is NAMED when one is really there rather than guessed from a list
403
+ * of likely words: any top-level value that is itself a record carrying `outcome`
404
+ * is the wrapper, whatever it was called. Wrapping is the natural wrong guess —
405
+ * the directive the reader just answered carries an `action.execution` object of
406
+ * its own — so pointing straight at it costs one line and saves the loop.
407
+ */
408
+ function missingOutcome(body) {
409
+ const wrapper = Object.entries(body).find(([, value]) => isRecord(value) && "outcome" in value)?.[0];
410
+ const where = wrapper === undefined
411
+ ? "el resultado no trae 'outcome'"
412
+ : `el resultado trae su 'outcome' anidado dentro de '${wrapper}'`;
413
+ return `${where}: los campos del resultado van en el nivel superior del JSON, no envueltos en otro objeto`;
414
+ }
415
+ /**
416
+ * Why the validations list was rejected — as the shape to send, not as a type name.
417
+ *
418
+ * The message this replaced said "'validations' has to be the list of
419
+ * ValidationOutcome of the result". `ValidationOutcome` is a TypeScript type: it
420
+ * appears in no document the caller can read, and the sentence never states the
421
+ * three keys or the ids the boundary demands. The cost was measured, and it is
422
+ * the largest this defect class has produced: one host opened ELEVEN throwaway
423
+ * sessions whose declared objective was "discover the contract of `aw flow
424
+ * submit`", all eleven stalling at the same boundary; a second host, independently
425
+ * and without seeing the first, made the same wrong guess. Both sent `name` where
426
+ * the parser wants `id` and `evidence` where it wants `detail` — not bad guesses
427
+ * so much as guesses with nothing to read.
428
+ *
429
+ * So the message names the shape, lists the evidence ids THIS boundary declared,
430
+ * and — the part that ends the loop — reports the keys the offending entry
431
+ * actually carries. "It does not bring 'id' (it brings: name, passed, evidence)"
432
+ * turns a search into a rename. Reporting the real keys instead of matching a
433
+ * table of likely aliases keeps it honest: it describes what arrived rather than
434
+ * guessing what was meant.
435
+ */
436
+ function badValidations(value, evidence) {
437
+ const pedidas = evidence.length > 0 ? ` (${evidence.join(", ")})` : "";
438
+ const shape = `una lista de objetos {id, passed, detail}, uno por cada evidencia que esta frontera pide${pedidas}`;
439
+ if (!Array.isArray(value))
440
+ return `'validations' tiene que ser ${shape}`;
441
+ for (const [index, entry] of value.entries()) {
442
+ if (!isRecord(entry))
443
+ return `la validación ${index + 1} no es un objeto; se espera ${shape}`;
444
+ const keys = Object.keys(entry);
445
+ const seen = keys.length > 0 ? ` (trae: ${keys.join(", ")})` : " (viene vacía)";
446
+ if (typeof entry.id !== "string")
447
+ return `la validación ${index + 1} no trae 'id'${seen}`;
448
+ if (typeof entry.passed !== "boolean") {
449
+ return `la validación '${entry.id}' no trae 'passed' booleano${seen}`;
450
+ }
451
+ if (entry.detail !== undefined && entry.detail !== null && typeof entry.detail !== "string") {
452
+ return `la validación '${entry.id}' trae un 'detail' que no es texto: ahí va la salida real del comando`;
453
+ }
454
+ }
455
+ return `'validations' tiene que ser ${shape}`;
456
+ }
389
457
  /** Which field of the invocation differs, in the order a reader would check them. */
390
458
  function invocationMismatch(sealed, ran) {
391
459
  if (sealed.program !== ran.program)
@@ -1 +1 @@
1
- {"version":3,"file":"answer.js","sourceRoot":"","sources":["../../../src/domain/flow/answer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAMH,OAAO,EAAE,sBAAsB,EAA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AAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,aAAa,CAAC,KAAc;IACnC,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC;AACnF,CAAC"}
@@ -39,6 +39,10 @@ export function proposalContractOf(decision) {
39
39
  export function publishApprovalOf(decision) {
40
40
  return decision.publishes?.approve ?? null;
41
41
  }
42
+ /** Whether this row's answer is what fixes the run's plan and its sources. */
43
+ export function scopesSources(decision) {
44
+ return decision.scopes_sources === true;
45
+ }
42
46
  /** Whose books this row's effects write: the run's own, or nobody's to assume. */
43
47
  export function custodyOf(decision) {
44
48
  return decision.custody ?? null;
@@ -58,10 +62,21 @@ export function effectsOf(decision) {
58
62
  *
59
63
  * Closed on purpose: an invocation that could interpolate arbitrary state would
60
64
  * be a template language, and a registry row would stop being readable as the
61
- * exact thing that runs. These two are what a session-scoped command needs — the
62
- * folder and its correlative — and both are facts the engine owns.
65
+ * exact thing that runs. These three are what a session-scoped command needs —
66
+ * the folder, its correlative and its slug — and all three are facts the engine
67
+ * owns, read off the session folder it already has.
68
+ *
69
+ * The slug joined the set for a defect the closed vocabulary is exactly what
70
+ * prevents. A row wrote its slug as `<slug>` — the metavariable the PROSE uses,
71
+ * copied into a machine-readable invocation. Angle brackets bind to nothing and
72
+ * the unbound-placeholder guard does not recognize them either, so the template
73
+ * travelled intact to whoever executes. The honest agent substituted it and its
74
+ * report no longer matched the sealed invocation; the literal one created a file
75
+ * named after the template. Documents and invocations do NOT share a notation:
76
+ * prose says `<slug>` to a reader, a row says `{slug}` to the engine, and only
77
+ * the second one fails closed when the run cannot supply it.
63
78
  */
64
- export const RUN_PLACEHOLDERS = ["{session}", "{code}"];
79
+ export const RUN_PLACEHOLDERS = ["{session}", "{code}", "{slug}"];
65
80
  /**
66
81
  * The Workline operations this CLI materializes inside its own process.
67
82
  *
@@ -88,6 +103,8 @@ export const INTERNAL_ACTION_OPERATIONS = [
88
103
  "session.artifacts",
89
104
  /** Close the session and upsert its HISTORY row. */
90
105
  "session.close",
106
+ /** Obtain the run's isolation unit on every source its scope declares. */
107
+ "worktree.ensure",
91
108
  /** Write the run's approved proposal, all of it or none of it. */
92
109
  "proposal.publish",
93
110
  ];
@@ -105,6 +122,11 @@ export const INTERNAL_OPERATION_EFFECTS = {
105
122
  "workspace.board": ["read_only"],
106
123
  "session.artifacts": ["read_only", "local_additive"],
107
124
  "session.close": ["read_only", "local_additive", "mutate_overwrite"],
125
+ // A unit is a new working tree on a new branch, inside the run's own namespace:
126
+ // it replaces nothing and it destroys nothing. That the CLI reaches git to make
127
+ // it is not what the class measures — `workspace.board` already reads git the
128
+ // same way and is `read_only`.
129
+ "worktree.ensure": ["local_additive"],
108
130
  // Creating and replacing, both real — and which of the two happens is decided
109
131
  // by the proposal, not by the row: what the row declares here is the ceiling.
110
132
  "proposal.publish": ["local_additive", "mutate_overwrite"],
@@ -1265,11 +1287,38 @@ export const FLOW_DECISIONS = [
1265
1287
  {
1266
1288
  id: "plan-new.numbering",
1267
1289
  scope: "plan-new",
1268
- title: "asignar el correlativo del documento del plan",
1290
+ title: "reclamar para esta corrida el correlativo del documento del plan",
1269
1291
  authority: "cli",
1270
1292
  ownership: "cli-owned",
1271
- document: PLAN_NEW_LOOP,
1293
+ // The numbering contract is `PLAN-INPUT` § *Numbering* and the loop says so
1294
+ // itself ("Naming follows PLAN-INPUT"): the invocation lives there once, and
1295
+ // this row cites the document that actually rules it.
1296
+ document: PLAN_INPUT,
1272
1297
  attribution: "aw next-number docs/plans --claim",
1298
+ // The row used to be attribution and nothing else: no effect, no evidence, no
1299
+ // result. So the number was "assigned" by whoever narrated it, and the engine
1300
+ // credited a transition that had never touched the workspace — which is also
1301
+ // why nothing downstream could tell this run's slot from a stranger's file.
1302
+ // The claim is a WRITE and now travels as one, with the slot it produced as
1303
+ // the evidence.
1304
+ effects: ["local_additive"],
1305
+ action: {
1306
+ invocation: {
1307
+ program: "aw",
1308
+ args: ["next-number", "docs/plans", "--claim", "plan-{slug}.md", "--code", "{code}"],
1309
+ target: ".",
1310
+ input: null,
1311
+ },
1312
+ execution: {
1313
+ kind: "external",
1314
+ reason: "la reserva la materializa el comando bajo el candado del workspace y devuelve su claimed_path: el motor nombra el reclamo pero no lo mintea",
1315
+ },
1316
+ evidence: ["plan.numero-reclamado"],
1317
+ // Asking again returns the SAME slot: the claim recognizes a reservation this
1318
+ // session already holds under this name instead of minting a second one.
1319
+ idempotent: true,
1320
+ recovery: "volvé a correr el reclamo con el mismo --claim y el mismo --code: devuelve la reserva que ya tenés. Sin claimed_path no hay slot que completar, y sin --code la reserva es de nadie y el guardado la rechazará",
1321
+ },
1273
1322
  },
1274
1323
  {
1275
1324
  id: "plan-new.phase-shaping",
@@ -1792,29 +1841,89 @@ export const FLOW_DECISIONS = [
1792
1841
  document: "modules/DESIGN-REFERENCES.md",
1793
1842
  attribution: "`aw designs --plan`",
1794
1843
  },
1844
+ {
1845
+ id: "plan-exec.source-scope",
1846
+ scope: "plan-exec",
1847
+ title: "fijar el plan de la corrida y las fuentes exactas que va a editar",
1848
+ authority: "agent",
1849
+ ownership: "cli-owned",
1850
+ document: CODE_POLICIES_MD,
1851
+ attribution: PLAN_ATTRIBUTION,
1852
+ // Which sources a plan touches is read off the plan, and the engine never read
1853
+ // one — so this is judgment, and it is the only thing here that is. What the
1854
+ // answer hands over is CHECKED before it is persisted: an alias the WORKSPACE
1855
+ // block does not declare, or one the plan never names, is refused. That is the
1856
+ // half a rule can hold; the other half is why the row exists at all.
1857
+ //
1858
+ // It carries no signals on purpose. A vocabulary would be a verdict over a
1859
+ // fixed taxonomy, and the aliases of a workspace are not one.
1860
+ scopes_sources: true,
1861
+ },
1862
+ {
1863
+ id: "plan-exec.unit-acquisition",
1864
+ scope: "plan-exec",
1865
+ title: "adquirir la unidad de aislamiento de cada fuente del scope antes de editar",
1866
+ authority: "cli",
1867
+ ownership: "cli-owned",
1868
+ document: CODE_POLICIES_MD,
1869
+ attribution: PLAN_ATTRIBUTION,
1870
+ effects: ["local_additive"],
1871
+ // BEFORE `plan-exec.implementation`, and the position is the whole rule: the
1872
+ // policy says a loop that edits code edits inside its unit, and a unit obtained
1873
+ // after the first write would be an isolation nobody was ever isolated by.
1874
+ //
1875
+ // Idempotent because the underlying service is: a unit that already exists is
1876
+ // returned as it is, which is what makes resuming reuse the same tree instead
1877
+ // of cutting a second one — and what makes the effect true on re-entry, since
1878
+ // the tree IS there however it got there.
1879
+ action: {
1880
+ invocation: {
1881
+ program: "aw",
1882
+ args: ["worktree", "ensure", "--code", "{code}"],
1883
+ target: ".",
1884
+ input: null,
1885
+ },
1886
+ execution: { kind: "internal", operation: "worktree.ensure" },
1887
+ evidence: ["plan.unidades-adquiridas"],
1888
+ idempotent: true,
1889
+ recovery: "adquirí una unidad por alias del scope con 'aw worktree ensure --source <alias> --code <NNN>'; si la rama está tomada por otro árbol, es otro flujo el que la tiene y hay que cerrarlo o liberarla, nunca forzarla",
1890
+ },
1891
+ },
1795
1892
  {
1796
1893
  id: "plan-exec.branch-precondition",
1797
1894
  scope: "plan-exec",
1798
- title: "verificar la rama de cada fuente afectada antes del batch",
1895
+ title: "verificar la rama y el árbol de la unidad de cada fuente antes del batch",
1799
1896
  authority: "cli",
1800
1897
  ownership: "cli-owned",
1801
1898
  document: CODE_POLICIES_MD,
1802
1899
  attribution: PLAN_ATTRIBUTION,
1803
- // "Before editing… verify EVERY current branch" — every, so the read has to
1804
- // cover every declared source. `aw check-branch` cannot: without --source it
1805
- // resolves no target and answers `match: true` unconditionally, which would
1806
- // credit "branch verified" against a command that checked nothing. The real
1807
- // walk is what surfaced that. `aw sources` enriches each declared source with
1808
- // its current branch, the expected one and whether they match.
1900
+ // "Before editing… verify EVERY current branch" — every, y bajo aislamiento la
1901
+ // rama que importa es la de la UNIDAD, no la del checkout compartido. Leía
1902
+ // `aw sources --verbose`, que informa el checkout: con dos corridas sobre el
1903
+ // mismo source esa lectura da verde en la rama de trabajo de alguien más y
1904
+ // acredita "rama verificada" contra un árbol que este flujo no edita.
1905
+ //
1906
+ // `aw worktree list --code` es la lectura ligada a la sesión: sólo las unidades
1907
+ // de esta corrida, cada una con su path, su rama `aw/<sesión>`, su estado sucio
1908
+ // y su HEAD. Una fuente del scope sin unidad no aparece, y esa ausencia es
1909
+ // exactamente lo que deja la frontera pendiente.
1910
+ //
1911
+ // (`aw check-branch` sigue sin poder servir acá: sin --source no resuelve
1912
+ // ningún target y contesta `match: true` incondicional.)
1809
1913
  action: {
1810
- invocation: { program: "aw", args: ["sources", "--verbose"], target: ".", input: null },
1914
+ invocation: {
1915
+ program: "aw",
1916
+ args: ["worktree", "list", "--code", "{code}"],
1917
+ target: ".",
1918
+ input: null,
1919
+ },
1811
1920
  execution: {
1812
1921
  kind: "external",
1813
- reason: "la rama esperada de cada fuente es un veredicto sobre git, y un workspace sin fuentes declaradas no lo tiene",
1922
+ reason: "la unidad esperada de cada fuente es un veredicto sobre git, y una corrida sin unidades todavía no lo tiene",
1814
1923
  },
1815
1924
  evidence: ["plan.rama-verificada"],
1816
1925
  idempotent: true,
1817
- recovery: "resolvé la rama de la fuente que no coincide y volvé a leer las fuentes: nunca limpies ni cambies de rama sin confirmación",
1926
+ recovery: "a la fuente del scope que no tiene su unidad, dásela con 'aw worktree ensure --source <alias> --code <NNN>' y volvé a leer; nunca limpies ni cambies de rama sin confirmación",
1818
1927
  },
1819
1928
  },
1820
1929
  {
@@ -1997,9 +2106,9 @@ export const FLOW_DECISIONS = [
1997
2106
  attribution: PLAN_ATTRIBUTION,
1998
2107
  // BEFORE Git, and the real walk is what proved it: the registry had inherited
1999
2108
  // an order where the plan was committed and only then validated and stamped.
2000
- // Both documents say the opposite — "last Batch also runs final validation
2001
- // before Git", and "mark plan done, then commit once per affected source", so
2002
- // that the status write rides in the same commit instead of orphaning it.
2109
+ // The document says the opposite — "last Batch also runs final validation
2110
+ // before Git" and that half has not moved. What moved is where the `done`
2111
+ // seal sits relative to Git: see `plan-exec.unit-integration`.
2003
2112
  // The convergence gate of PLAN-exec. The board is what distinguishes the three
2004
2113
  // states this rule turns on — every phase green with no closure reads
2005
2114
  // `final_validation_pending`, and a deferred check keeps its phase blocked —
@@ -2057,67 +2166,122 @@ export const FLOW_DECISIONS = [
2057
2166
  ],
2058
2167
  },
2059
2168
  {
2060
- id: "plan-exec.plan-done",
2169
+ id: "plan-exec.commit-execution",
2061
2170
  scope: "plan-exec",
2062
- title: "escribir el estado done del plan con su línea de cierre",
2171
+ title: "crear un commit por fuente afectada y dejar cada árbol limpio o reconocido",
2063
2172
  authority: "cli",
2064
2173
  ownership: "cli-owned",
2065
- document: PLAN_EXEC_LOOP,
2174
+ document: CODE_POLICIES_MD,
2066
2175
  attribution: PLAN_ATTRIBUTION,
2067
- effects: ["mutate_overwrite"],
2068
- // The done seal is the last progress mark of the flow's own document: run
2069
- // custody — its condition and the board's reading are the guards that count.
2070
- custody: "run",
2176
+ effects: ["execute", "local_additive"],
2071
2177
  condition: {
2072
2178
  threshold: {
2073
2179
  observed: "plan-exec.pending-effects",
2074
- of: ["plan.plan-closable"],
2180
+ of: ["plan.commit-pending"],
2075
2181
  min: 1,
2076
2182
  },
2077
- otherwise: "al plan le quedan fases sin validar: sellarlo acá sería marcarlo done desde los contadores",
2183
+ otherwise: "ninguna fuente afectada quedó con cambios sin commitear: no hay commit que crear",
2078
2184
  },
2185
+ // Approving is not committing: the human approval above already carries the
2186
+ // grant over this row's exact seal, and what applies the transition is still
2187
+ // the real git state coming back — which is also the between-unit precondition
2188
+ // the policy demands ("each working tree clean or explicitly acknowledged").
2189
+ //
2190
+ // Read off the UNITS for the same reason the branch precondition is: a commit
2191
+ // lands in the unit's branch, and `aw sources --verbose` would report the
2192
+ // shared checkout — clean, because nothing was ever written there — so a batch
2193
+ // that committed nothing at all could still come back green.
2079
2194
  action: {
2080
- invocation: { program: "aw", args: ["status", "--json"], target: ".", input: null },
2195
+ invocation: {
2196
+ program: "aw",
2197
+ args: ["worktree", "list", "--code", "{code}"],
2198
+ target: ".",
2199
+ input: null,
2200
+ },
2081
2201
  execution: {
2082
2202
  kind: "external",
2083
- reason: "sellar el done reescribe el plan-doc, y este motor no lo edita",
2203
+ reason: "crear un commit es un efecto sobre git que este ejecutor no aplica",
2084
2204
  },
2085
- evidence: ["plan.estado-done-sellado"],
2205
+ evidence: ["plan.commits-por-fuente"],
2206
+ idempotent: false,
2207
+ recovery: "una fuente que quedó con cambios sin commitear deja el batch SIN commitear: registralo así en CHECKPOINT y BACKLOG en vez de commitear a medias",
2208
+ },
2209
+ },
2210
+ {
2211
+ id: "plan-exec.unit-integration",
2212
+ scope: "plan-exec",
2213
+ title: "integrar cada unidad de la sesión en la rama de trabajo de su fuente",
2214
+ authority: "cli",
2215
+ ownership: "cli-owned",
2216
+ document: PLAN_EXEC_LOOP,
2217
+ attribution: PLAN_ATTRIBUTION,
2218
+ // The two classes a merge really applies: it runs git, and it moves files in
2219
+ // a checkout that already had contents. No `custody: "run"` — this is the one
2220
+ // row of the journey whose effect lands OUTSIDE the run's own ledger, on the
2221
+ // branch everybody else reads, so it stops to be authorized. That stop is not
2222
+ // the commit approval asked twice: approving the commits of a batch decides
2223
+ // what gets recorded in the run's own unit, and this decides that it lands on
2224
+ // the shared branch. Two decisions, and only the second can conflict.
2225
+ effects: ["execute", "mutate_overwrite"],
2226
+ // Why this row exists at all, and why HERE. A run that isolates its writing
2227
+ // ends holding commits that live on `aw/<session>` and nowhere else: without
2228
+ // this transition the journey reported "finished" over work no branch anybody
2229
+ // reads contains. It sits AFTER the commit because a merge of uncommitted work
2230
+ // has no losing side to report, and BEFORE the `done` seal because sealing a
2231
+ // plan whose result is still only in a unit would make `done` true of nothing.
2232
+ //
2233
+ // Delegated, not internal, although this CLI owns the service: a merge into
2234
+ // the source's working branch writes on somebody else's books, and its failure
2235
+ // mode — a conflict — opens a journey (`aw fix-git`) that is a person's, not
2236
+ // this executor's. What comes back is the command's own per-unit report.
2237
+ action: {
2238
+ invocation: {
2239
+ program: "aw",
2240
+ args: ["worktree", "integrate", "--code", "{code}"],
2241
+ target: ".",
2242
+ input: null,
2243
+ },
2244
+ execution: {
2245
+ kind: "external",
2246
+ reason: "un merge sobre la rama compartida es un efecto que este ejecutor no aplica",
2247
+ },
2248
+ evidence: ["plan.unidades-integradas"],
2249
+ // Re-entrant on purpose: this is the transition a conflict comes BACK to.
2250
+ // Integrating an already-integrated session is a no-op that reports the same
2251
+ // thing, which is what lets the recovery end where it started.
2086
2252
  idempotent: true,
2087
- recovery: "escribí '> Estado: done' y su '> Cierre:' en la línea de abajo y volvé a devolver la lectura; si el tablero no lo lee cerrado, la transición sigue pendiente",
2253
+ recovery: "una unidad en conflicto conserva su merge y sus commits: resolvé con 'aw fix-git --path <fuente>' (prepare apply → commit --confirm) y volvé a correr la integración; la transición sigue pendiente mientras la sesión conserve una unidad",
2088
2254
  },
2089
2255
  },
2090
2256
  {
2091
- id: "plan-exec.commit-execution",
2257
+ id: "plan-exec.plan-done",
2092
2258
  scope: "plan-exec",
2093
- title: "crear un commit por fuente afectada y dejar cada árbol limpio o reconocido",
2259
+ title: "escribir el estado done del plan con su línea de cierre",
2094
2260
  authority: "cli",
2095
2261
  ownership: "cli-owned",
2096
- document: CODE_POLICIES_MD,
2262
+ document: PLAN_EXEC_LOOP,
2097
2263
  attribution: PLAN_ATTRIBUTION,
2098
- effects: ["execute", "local_additive"],
2264
+ effects: ["mutate_overwrite"],
2265
+ // The done seal is the last progress mark of the flow's own document: run
2266
+ // custody — its condition and the board's reading are the guards that count.
2267
+ custody: "run",
2099
2268
  condition: {
2100
2269
  threshold: {
2101
2270
  observed: "plan-exec.pending-effects",
2102
- of: ["plan.commit-pending"],
2271
+ of: ["plan.plan-closable"],
2103
2272
  min: 1,
2104
2273
  },
2105
- otherwise: "ninguna fuente afectada quedó con cambios sin commitear: no hay commit que crear",
2274
+ otherwise: "al plan le quedan fases sin validar: sellarlo acá sería marcarlo done desde los contadores",
2106
2275
  },
2107
- // Approving is not committing: the human approval above already carries the
2108
- // grant over this row's exact seal, and what applies the transition is still
2109
- // the sources' real git state coming back — which is also the between-unit
2110
- // precondition the policy demands ("each working tree clean or explicitly
2111
- // acknowledged").
2112
2276
  action: {
2113
- invocation: { program: "aw", args: ["sources", "--verbose"], target: ".", input: null },
2277
+ invocation: { program: "aw", args: ["status", "--json"], target: ".", input: null },
2114
2278
  execution: {
2115
2279
  kind: "external",
2116
- reason: "crear un commit es un efecto sobre git que este ejecutor no aplica",
2280
+ reason: "sellar el done reescribe el plan-doc, y este motor no lo edita",
2117
2281
  },
2118
- evidence: ["plan.commits-por-fuente"],
2119
- idempotent: false,
2120
- recovery: "una fuente que quedó con cambios sin commitear deja el batch SIN commitear: registralo así en CHECKPOINT y BACKLOG en vez de commitear a medias",
2282
+ evidence: ["plan.estado-done-sellado"],
2283
+ idempotent: true,
2284
+ recovery: "escribí '> Estado: done' y su '> Cierre:' en la línea de abajo y volvé a devolver la lectura; si el tablero no lo lee cerrado, la transición sigue pendiente",
2121
2285
  },
2122
2286
  },
2123
2287
  // ── Transversal commands (universe = the command registry) ────────────────
@@ -2474,6 +2638,14 @@ export const COMMAND_EXCLUSIONS = [
2474
2638
  command: "spec-new",
2475
2639
  reason: "comando `/w:` de una sola pasada que no abre loop: sin corrida que dirigir, su gate de división lo aplica el propio comando con la regla de modules/SPLIT-GATE.md, que por eso conserva su enunciado",
2476
2640
  },
2641
+ {
2642
+ command: "discard",
2643
+ reason: "comando transversal de retiro: no abre WorklineFlow ni sesión a propósito, porque puede terminar borrando la sesión que lo dirigiera. Su autoridad es su propio contrato: `prepare` read-only y `apply` con el digest exacto, recomputado bajo el lock del workspace",
2644
+ },
2645
+ {
2646
+ command: "reset",
2647
+ reason: "comando transversal de retiro: mismo contrato que `discard` en modo restauración, sin corrida propia por la misma razón — la sesión que vuelve atrás es la que se retira",
2648
+ },
2477
2649
  { command: "sessions", reason: "listado read-only del inventario de sesiones" },
2478
2650
  { command: "session-artifacts", reason: "inspección read-only de lo que guarda una sesión" },
2479
2651
  { command: "checkpoint-read", reason: "lectura del CHECKPOINT sin decidir continuación" },