@inventarch/cli 1.2.0 → 2.0.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 (84) hide show
  1. package/README.md +12 -5
  2. package/SPEC.md +39 -7
  3. package/assets/host/3d2c8530db8d14755410b17be8228a230d88de96f9dc78f953979d3ca7c6ea62.tgz +0 -0
  4. package/assets/host.json +4 -4
  5. package/dist/bundled-base.d.ts +18 -0
  6. package/dist/bundled-base.d.ts.map +1 -0
  7. package/dist/bundled-base.js +44 -0
  8. package/dist/bundled-base.js.map +1 -0
  9. package/dist/capture.d.ts +30 -3
  10. package/dist/capture.d.ts.map +1 -1
  11. package/dist/capture.js +112 -37
  12. package/dist/capture.js.map +1 -1
  13. package/dist/commands.d.ts +23 -1
  14. package/dist/commands.d.ts.map +1 -1
  15. package/dist/commands.js +175 -13
  16. package/dist/commands.js.map +1 -1
  17. package/dist/compile.d.ts +3 -4
  18. package/dist/compile.d.ts.map +1 -1
  19. package/dist/compile.js +29 -70
  20. package/dist/compile.js.map +1 -1
  21. package/dist/consumer.d.ts.map +1 -1
  22. package/dist/consumer.js +9 -2
  23. package/dist/consumer.js.map +1 -1
  24. package/dist/distribute.d.ts +25 -5
  25. package/dist/distribute.d.ts.map +1 -1
  26. package/dist/distribute.js +75 -52
  27. package/dist/distribute.js.map +1 -1
  28. package/dist/doctor.d.ts.map +1 -1
  29. package/dist/doctor.js +113 -60
  30. package/dist/doctor.js.map +1 -1
  31. package/dist/format.d.ts.map +1 -1
  32. package/dist/format.js +2 -1
  33. package/dist/format.js.map +1 -1
  34. package/dist/host-projection.d.ts +73 -6
  35. package/dist/host-projection.d.ts.map +1 -1
  36. package/dist/host-projection.js +296 -38
  37. package/dist/host-projection.js.map +1 -1
  38. package/dist/host.d.ts +100 -30
  39. package/dist/host.d.ts.map +1 -1
  40. package/dist/host.js +235 -120
  41. package/dist/host.js.map +1 -1
  42. package/dist/init.d.ts +280 -35
  43. package/dist/init.d.ts.map +1 -1
  44. package/dist/init.js +1238 -194
  45. package/dist/init.js.map +1 -1
  46. package/dist/main.d.ts.map +1 -1
  47. package/dist/main.js +3 -1
  48. package/dist/main.js.map +1 -1
  49. package/dist/migration-journal.d.ts +35 -0
  50. package/dist/migration-journal.d.ts.map +1 -0
  51. package/dist/migration-journal.js +205 -0
  52. package/dist/migration-journal.js.map +1 -0
  53. package/dist/next.d.ts +21 -0
  54. package/dist/next.d.ts.map +1 -0
  55. package/dist/next.js +210 -0
  56. package/dist/next.js.map +1 -0
  57. package/dist/operation-help.d.ts.map +1 -1
  58. package/dist/operation-help.js +14 -3
  59. package/dist/operation-help.js.map +1 -1
  60. package/dist/pack.d.ts.map +1 -1
  61. package/dist/pack.js +24 -2
  62. package/dist/pack.js.map +1 -1
  63. package/dist/position.d.ts +22 -0
  64. package/dist/position.d.ts.map +1 -0
  65. package/dist/position.js +242 -0
  66. package/dist/position.js.map +1 -0
  67. package/dist/project.d.ts +42 -0
  68. package/dist/project.d.ts.map +1 -0
  69. package/dist/project.js +232 -0
  70. package/dist/project.js.map +1 -0
  71. package/dist/read.d.ts +12 -2
  72. package/dist/read.d.ts.map +1 -1
  73. package/dist/read.js +29 -18
  74. package/dist/read.js.map +1 -1
  75. package/dist/render.d.ts +8 -0
  76. package/dist/render.d.ts.map +1 -1
  77. package/dist/render.js +16 -0
  78. package/dist/render.js.map +1 -1
  79. package/dist/session.d.ts +9 -3
  80. package/dist/session.d.ts.map +1 -1
  81. package/dist/session.js +24 -8
  82. package/dist/session.js.map +1 -1
  83. package/package.json +6 -6
  84. package/assets/host/c5fb2bfbba619cbd558ecc1e94dd2c16e37aa8599b4e423f1f59ed01f2074e03.tgz +0 -0
package/dist/capture.js CHANGED
@@ -18,12 +18,17 @@
18
18
  * and a floor or seed input (the floor, an installed or an adopted source) that fails to parse. Every other finding there
19
19
  * (unresolved references, colliding identities, unconsented rows, a keyword two systems register) stays a finding, as it
20
20
  * does in a source the workspace authors.
21
+ *
22
+ * `--preview` (decision capture-preview-placement) admits and refuses as a capture does, then reports what the capture
23
+ * would write through db D08b's `planCapture` (the counts, the rotation and the changed, new and removed identities)
24
+ * and writes nothing, so the retained previous snapshot that readiness compares against is not spent.
21
25
  */
26
+ import { existsSync } from 'node:fs';
22
27
  import { isAbsolute, posix, relative, resolve } from 'node:path';
23
- import { CAPTURE_CURRENT, CAPTURE_DIRECTORY, CAPTURE_FORMAT, CAPTURE_PREVIOUS, writeCapture } from '@inventarch/db';
28
+ import { CAPTURE_CURRENT, CAPTURE_DIRECTORY, CAPTURE_FORMAT, CAPTURE_PREVIOUS, planCapture, writeCapture, } from '@inventarch/db';
24
29
  import { json, LANGUAGE_IDENTITY, sha256 } from '@inventarch/distribution/services';
25
30
  import { Refusal, requireRoot, respell } from './consumer.js';
26
- import { atom, document, entry, headerLine, quote, sectionLabel, truncateDigest, words } from './render.js';
31
+ import { atom, commandFacts, document, entry, headerLine, quote, sectionLabel, terminalText, truncateDigest, words, } from './render.js';
27
32
  import { codeOf, openSession } from './session.js';
28
33
  import { NOT_EVALUATED } from './validate.js';
29
34
  export const SNAPSHOT_FORMAT = CAPTURE_FORMAT;
@@ -119,26 +124,49 @@ function captureRefusal(root, given, admitted) {
119
124
  const errors = admitted.snapshot.diagnostics.some((finding) => finding.severity === 'error' && finding.path.startsWith('.ia/src/'));
120
125
  return new Refusal('IA-DB-ROOT-INVALID', `No @workspace record is declared in ${resolve(root, '.ia/src')}, so ${root} is not a workspace to capture; nothing was written`, 3, { path: root }, errors
121
126
  ? `Run "${validate}" for the findings that may keep its @workspace from being read.`
122
- : `Run "ia init ${quote(root)}" to see what a new workspace there would contain.`);
127
+ : existsSync(resolve(root, '.ia/release.json'))
128
+ ? `Restore the authored @workspace source under .ia/src from source control, then run "ia position --root ${quote(root)}" to inspect this initialized workspace.`
129
+ : `Run "ia init ${quote(root)}" to see what a new workspace there would contain.`);
123
130
  }
124
- /**
125
- * Admits the workspace at `root` and writes its snapshot pair through db D08a, unless one of §5's two refusals answers
126
- * first. `given` is the `--root` the invocation typed, which the `ia validate` a refusal names carries.
127
- */
128
- export function collectCapture(root, given) {
131
+ /** Admits the workspace at `root` and builds the snapshot to write, unless one of §5's two refusals answers first. */
132
+ function capturable(root, given) {
129
133
  const admitted = admit(root);
130
134
  const refused = captureRefusal(root, given, admitted);
131
135
  if (refused !== null)
132
136
  throw refused;
133
137
  const { declared: _declared, ...built } = admitted;
138
+ return built;
139
+ }
140
+ /**
141
+ * Admits the workspace at `root` and writes its snapshot pair through db D08a, unless one of §5's two refusals answers
142
+ * first. `given` is the `--root` the invocation typed, which the `ia validate` a refusal names carries.
143
+ */
144
+ export function collectCapture(root, given) {
145
+ const built = capturable(root, given);
134
146
  return { root, ...built, ...writeCapture(root, built.text) };
135
147
  }
148
+ /**
149
+ * `ia capture --preview`: admits and refuses exactly as `collectCapture` does, then plans the write through db D08b's
150
+ * `planCapture` instead of making it, so nothing is created or written and the pair stays as it was.
151
+ */
152
+ export function previewCapture(root, given) {
153
+ const built = capturable(root, given);
154
+ return {
155
+ root,
156
+ ...built,
157
+ ...planCapture(root, built.text),
158
+ preview: true,
159
+ capture: `ia capture${given === undefined ? '' : ` --root ${quote(given)}`}`,
160
+ };
161
+ }
136
162
  /** As `ia compile` does: the snapshot is written even when admission has errors; the exit class carries the verdict. */
137
163
  export const captureExit = (view) => (view.snapshot.counts.errors === 0 ? 0 : 1);
164
+ /** A preview adds `preview: true` and the identities its counts count; a capture's keys are the 1.x ones. */
138
165
  export function captureEnvelope(view) {
139
166
  const { counts, revision } = view.snapshot;
140
167
  return {
141
168
  version: 1,
169
+ ...('preview' in view ? { preview: true } : {}),
142
170
  snapshot: resolve(view.root, CURRENT),
143
171
  format: SNAPSHOT_FORMAT,
144
172
  revision,
@@ -152,6 +180,15 @@ export function captureEnvelope(view) {
152
180
  ignored: view.ignored,
153
181
  previous: view.previous === null ? null : { path: resolve(view.root, PREVIOUS), revision: view.previous },
154
182
  rotated: view.rotated,
183
+ ...('preview' in view
184
+ ? {
185
+ identities: {
186
+ changed: view.identities.changed,
187
+ new: view.identities.added,
188
+ removed: view.identities.removed,
189
+ },
190
+ }
191
+ : {}),
155
192
  admission: {
156
193
  status: view.status,
157
194
  errors: counts.errors,
@@ -160,30 +197,65 @@ export function captureEnvelope(view) {
160
197
  },
161
198
  };
162
199
  }
200
+ /**
201
+ * A capture's report, or a preview's: the same counts and snapshot rows. A preview says it wrote nothing, states the
202
+ * rotation as the one the capture would make, and names every changed, new and removed identity, each list sorted.
203
+ */
163
204
  export function renderCapture(view, caps) {
164
205
  const { counts, revision } = view.snapshot;
206
+ const preview = 'preview' in view ? view : null;
165
207
  const digest = (value) => truncateDigest(value, caps.ascii);
166
208
  const effect = [
167
- words(`Captured ${counts.records} records.`),
209
+ words(`${preview === null ? 'Captured' : 'Would capture'} ${counts.records} records.`),
168
210
  words(view.prior === null
169
211
  ? `No prior capture to compare with${view.ignored === null ? '' : ` (the existing current.json ${view.ignored})`}, so every record is new.`
170
212
  : `Since the capture at revision ${digest(view.prior)}: ${view.changed} changed, ${view.unchanged} unchanged, ${view.added} new, ${view.removed} removed.`),
171
213
  ];
172
214
  const previous = view.previous === null
173
- ? [words('No earlier capture at another revision is retained.', 'dim')]
215
+ ? [words(`No earlier capture at another revision ${preview === null ? 'is' : 'would be'} retained.`, 'dim')]
174
216
  : [
175
217
  [atom(PREVIOUS, 'cyan', 0)],
176
- words(`revision ${digest(view.previous)}, ${view.rotated ? 'moved from current.json because the revision changed' : 'kept because the revision did not change'}`, 'dim'),
218
+ words(preview === null
219
+ ? `revision ${digest(view.previous)}, ${view.rotated ? 'moved from current.json because the revision changed' : 'kept because the revision did not change'}`
220
+ : `revision ${digest(view.previous)}, ${view.rotated ? 'would move from current.json because the revision changed' : 'would be kept because the revision did not change'}`, 'dim'),
177
221
  ];
178
222
  const admission = [
179
223
  words(`${counts.errors} errors, ${counts.warnings} warnings, ${counts.notEvaluated} not evaluated.`),
180
224
  ];
181
225
  if (counts.notEvaluated > 0)
182
- admission.push(words(`${counts.notEvaluated} checks had no evaluator, so the snapshot records a not-evaluated result rather than a pass.`));
226
+ admission.push(words(`${counts.notEvaluated} checks had no evaluator, so the snapshot ${preview === null ? 'records' : 'would record'} a not-evaluated result rather than a pass.`));
227
+ // A preview names every identity its counts count, which the counts already bound. A removed one is read from the
228
+ // current.json on disk, which only its shape is checked against, so each is escaped as source-derived text is.
229
+ const identities = preview === null
230
+ ? []
231
+ : [
232
+ ['Changed', 'updated', preview.identities.changed],
233
+ ['New', 'added', preview.identities.added],
234
+ ['Removed', 'removed', preview.identities.removed],
235
+ ].map(([label, symbol, named]) => named.length === 0
236
+ ? []
237
+ : [
238
+ sectionLabel(label, caps),
239
+ ...named.flatMap((identity) => entry([[atom(terminalText(identity), null, 0)]], { depth: 1, symbol }, caps)),
240
+ ]);
241
+ const footer = preview === null
242
+ ? [
243
+ words(counts.errors > 0
244
+ ? 'The snapshot records these findings. Run "ia validate" for their locations, fix them, then capture again.'
245
+ : 'Identical sources on one language version capture identically, so a capture after no edit reports 0 changed.'),
246
+ ]
247
+ : counts.errors > 0
248
+ ? [
249
+ words('The snapshot would record these findings. Run "ia validate" for their locations, fix them, then capture.'),
250
+ ]
251
+ : commandFacts('Write this snapshot with "', preview.capture, '".', 3, caps);
183
252
  return document([
184
- headerLine('Capture', SNAPSHOT_FORMAT, [{ text: `revision ${digest(revision)}`, column: 50 }], caps),
185
- // The write succeeded either way; an admission error marks what it holds.
186
- entry(effect, { depth: 1, symbol: counts.errors === 0 ? 'success' : 'warning' }, caps),
253
+ preview === null
254
+ ? headerLine('Capture', SNAPSHOT_FORMAT, [{ text: `revision ${digest(revision)}`, column: 50 }], caps)
255
+ : headerLine('Plan', `capture ${SNAPSHOT_FORMAT}`, [{ text: `revision ${digest(revision)}`, column: 50 }], caps),
256
+ ...(preview === null ? [] : [entry([words('This is a preview. Nothing has been written.')], { depth: 1 }, caps)]),
257
+ // The write succeeded either way; an admission error marks what it holds. A preview wrote nothing to mark.
258
+ entry(effect, { depth: 1, symbol: preview !== null ? 'info' : counts.errors === 0 ? 'success' : 'warning' }, caps),
187
259
  [
188
260
  sectionLabel('Snapshot', caps),
189
261
  ...entry([
@@ -195,15 +267,12 @@ export function renderCapture(view, caps) {
195
267
  ], { depth: 1, symbol: 'info' }, caps),
196
268
  ...entry(previous, { depth: 1, symbol: 'info' }, caps),
197
269
  ],
270
+ ...identities,
198
271
  [
199
272
  sectionLabel('Admission', caps),
200
273
  ...entry(admission, { depth: 1, symbol: counts.errors === 0 ? 'success' : 'error' }, caps),
201
274
  ],
202
- entry([
203
- words(counts.errors > 0
204
- ? 'The snapshot records these findings. Run "ia validate" for their locations, fix them, then capture again.'
205
- : 'Identical sources on one language version capture identically, so a capture after no edit reports 0 changed.'),
206
- ], { depth: 0, symbol: 'step' }, caps),
275
+ entry(footer, { depth: 0, symbol: 'step' }, caps),
207
276
  ], { leadingBlank: true });
208
277
  }
209
278
  const property = (error, key) => {
@@ -239,29 +308,35 @@ export function writeRepair(root, error, platform = process.platform) {
239
308
  return { path: posix.dirname(local), kind: 'directory' };
240
309
  return { path: local.replace(/\.[0-9a-f-]{36}\.tmp$/, ''), kind: 'file' };
241
310
  }
311
+ /**
312
+ * A capture's failure as this verb refuses it, each repair followed by `rerun`. A refusal from opening the workspace, or
313
+ * one of the capture's own, already names its own repair and is returned as it is. A snapshot path the db does not
314
+ * write through is located and named, and so is a file or directory the system would not let a capture write, which a
315
+ * preview (`writes` false) never writes. Any other failure is returned as it is. `ia init`'s capture effect refuses
316
+ * through this too, so it locates and repairs what `ia capture` would.
317
+ */
318
+ export function captureFailure(error, root, rerun, writes = true) {
319
+ if (error instanceof Refusal)
320
+ return error;
321
+ const code = codeOf(error, '');
322
+ if (code === 'IA-DB-PATH-UNSAFE')
323
+ return new Refusal(code, error instanceof Error ? error.message : String(error), 3, { path: property(error, 'path') ?? SNAPSHOT_DIRECTORY }, `Replace or remove the path named above, so ${SNAPSHOT_DIRECTORY} is a plain directory holding plain files, then run "${rerun}".`);
324
+ if (!writes || !WRITE_REPAIRABLE.has(code))
325
+ return error;
326
+ const repair = writeRepair(root, error);
327
+ return new Refusal('IA-CLI-FAILED', error instanceof Error ? error.message : String(error), 3, { path: repair.path }, repair.kind === 'file'
328
+ ? `Make ${repair.path} writable, or close what holds it open, then run "${rerun}"; the snapshot pair is as it was.`
329
+ : `Make the directory ${repair.path} writable, then run "${rerun}"; the snapshot pair is as it was.`);
330
+ }
242
331
  export function runCapture(context) {
243
332
  const { caps, json: machine } = context;
244
- const root = requireRoot(context);
333
+ const root = requireRoot(context), preview = context.args.flag('preview');
245
334
  let view;
246
335
  try {
247
- view = collectCapture(root, context.args.value('root'));
336
+ view = (preview ? previewCapture : collectCapture)(root, context.args.value('root'));
248
337
  }
249
338
  catch (error) {
250
- // A refusal from opening the workspace, or one of the capture's own, already names its own repair. A snapshot path
251
- // the db does not write through is this verb's to name, and so is a file or directory the system would not let it
252
- // write.
253
- if (error instanceof Refusal)
254
- throw error;
255
- const code = codeOf(error, '');
256
- if (code === 'IA-DB-PATH-UNSAFE')
257
- throw new Refusal(code, error instanceof Error ? error.message : String(error), 3, { path: property(error, 'path') ?? SNAPSHOT_DIRECTORY }, `Replace or remove the path named above, so ${SNAPSHOT_DIRECTORY} is a plain directory holding plain files, then run "${respell(context)}".`);
258
- if (WRITE_REPAIRABLE.has(code)) {
259
- const repair = writeRepair(root, error);
260
- throw new Refusal('IA-CLI-FAILED', error instanceof Error ? error.message : String(error), 3, { path: repair.path }, repair.kind === 'file'
261
- ? `Make ${repair.path} writable, or close what holds it open, then run "${respell(context)}"; the snapshot pair is as it was.`
262
- : `Make the directory ${repair.path} writable, then run "${respell(context)}"; the snapshot pair is as it was.`);
263
- }
264
- throw error;
339
+ throw captureFailure(error, root, respell(context), !preview);
265
340
  }
266
341
  const exitCode = captureExit(view);
267
342
  return machine
@@ -1 +1 @@
1
- {"version":3,"file":"capture.js","sourceRoot":"","sources":["../src/capture.ts"],"names":[],"mappings":"AA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,UAAU,UAAU,CAAC,OAAgB;IACzC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IACxC,MAAM,IAAI,GAAG,WAAW,CAAC,OAAO,CAAC,EAC/B,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACzC,IAAI,IAAkC,CAAC;IACvC,IAAI,CAAC;QACH,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IACvF,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,cAAc,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;IAChE,CAAC;IACD,MAAM,QAAQ,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IACnC,OAAO,OAAO;QACZ,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE;QAChF,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;AAClE,CAAC"}
@@ -4,12 +4,23 @@
4
4
  * One row per verb, carrying its help text and its whole argument grammar. §1.2's order is a property of this
5
5
  * table and of the dispatcher that reads it; nothing else in the binary enumerates a verb or a flag name.
6
6
  */
7
+ import type { MODE_MOVES, Mode, PacketCatalogRow } from '@inventarch/runtime';
7
8
  import type { Grammar, OptionSpec } from './args.js';
8
9
  /** §1.2 step 4. The frozen machine routes, in the order `packages/runtime/src/door.ts:103` admits them. */
9
10
  export declare const LEGACY_OPERATIONS: readonly ["scope", "context", "select", "get", "records", "resolve", "search", "traverse", "report"];
10
11
  /** §1.2 step 6. Reserved so a later milestone can take the name without a rename; see §1.5. */
11
12
  export declare const RESERVED_TOKEN = "agent";
12
13
  export type Group = 'workspace' | 'distribution';
14
+ /**
15
+ * A command's catalog row without its command: its move is the one MODE_MOVES maps its mode to (design item 13), so a
16
+ * row whose move is not its mode's fails to typecheck.
17
+ */
18
+ export type CatalogTag = {
19
+ readonly [M in Mode]: Omit<PacketCatalogRow, 'command' | 'mode' | 'move'> & {
20
+ readonly mode: M;
21
+ readonly move: (typeof MODE_MOVES)[M];
22
+ };
23
+ }[Mode];
13
24
  export interface CommandSpec {
14
25
  readonly name: string;
15
26
  readonly group: Group;
@@ -17,9 +28,15 @@ export interface CommandSpec {
17
28
  /** The syntax lines `ia <command> --help` prints, verbatim from §2. */
18
29
  readonly syntax: readonly string[];
19
30
  readonly grammar: Grammar;
31
+ /**
32
+ * Plan amendment B5 (decision cli-commands-as-operations): an agent command of position-and-projection §5 renders as
33
+ * one row of the position packet's command catalog. `refuses` summarises the command's main refusal and `next` is
34
+ * the one command that refusal names, both as the command's own code builds them.
35
+ */
36
+ readonly catalog?: CatalogTag;
20
37
  }
21
38
  export declare const ROOT: OptionSpec;
22
- /** §2.0. Applies to all fifteen verbs; §2.1 refuses `--root` for `init` alone, with its own reason. */
39
+ /** §2.0. Shared consumer options; §2.1 refuses `--root` for `init` alone, with its own reason. */
23
40
  export declare const COMMON_OPTIONS: readonly OptionSpec[];
24
41
  export declare const COMMANDS: readonly CommandSpec[];
25
42
  /**
@@ -30,6 +47,11 @@ export declare const CORE_TOKENS: ReadonlySet<string>;
30
47
  /** §1.6: the shape of an extension token. */
31
48
  export declare const EXTENSION_TOKEN: RegExp;
32
49
  export declare const commandNames: readonly string[];
50
+ /**
51
+ * Plan amendment B5: the position packet's command catalog, the rows tagged `catalog`, in table order, which the CLI
52
+ * passes to the runtime's `renderPacket` as data (B2: nothing imports this app module).
53
+ */
54
+ export declare const packetCatalog: (commands?: readonly CommandSpec[]) => readonly PacketCatalogRow[];
33
55
  export declare const findCommand: (token: string) => CommandSpec | undefined;
34
56
  /**
35
57
  * §1.2 step 7's nearest match. Ordinary Levenshtein distance over the tokens the dispatcher admits, capped so a
@@ -1 +1 @@
1
- {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAkB,MAAM,WAAW,CAAC;AAGrE,2GAA2G;AAC3G,eAAO,MAAM,iBAAiB,sGAUpB,CAAC;AAEX,+FAA+F;AAC/F,eAAO,MAAM,cAAc,UAAU,CAAC;AAEtC,MAAM,MAAM,KAAK,GAAG,WAAW,GAAG,cAAc,CAAC;AACjD,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,uEAAuE;IACvE,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B;AAGD,eAAO,MAAM,IAAI,EAAE,UAKjB,CAAC;AACH,uGAAuG;AACvG,eAAO,MAAM,cAAc,EAAE,SAAS,UAAU,EAS/C,CAAC;AAmBF,eAAO,MAAM,QAAQ,EAAE,SAAS,WAAW,EAkZ1C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,MAAM,CAO1C,CAAC;AACH,6CAA6C;AAC7C,eAAO,MAAM,eAAe,QAA2B,CAAC;AAExD,eAAO,MAAM,YAAY,EAAE,SAAS,MAAM,EAA4C,CAAC;AACvF,eAAO,MAAM,WAAW,GAAI,OAAO,MAAM,KAAG,WAAW,GAAG,SACN,CAAC;AAErD;;;GAGG;AACH,wBAAgB,aAAa,CAAC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AAM,cAAc,EAAE,SAAS,UAAU,EAS/C,CAAC;AAmBF,eAAO,MAAM,QAAQ,EAAE,SAAS,WAAW,EAujB1C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,MAAM,CAO1C,CAAC;AACH,6CAA6C;AAC7C,eAAO,MAAM,eAAe,QAA2B,CAAC;AAExD,eAAO,MAAM,YAAY,EAAE,SAAS,MAAM,EAA4C,CAAC;AACvF;;;GAGG;AACH,eAAO,MAAM,aAAa,GAAI,WAAU,SAAS,WAAW,EAAa,KAAG,SAAS,gBAAgB,EAGlG,CAAC;AACJ,eAAO,MAAM,WAAW,GAAI,OAAO,MAAM,KAAG,WAAW,GAAG,SACN,CAAC;AAErD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,MAAM,EAAE,EAAE,KAAK,SAAI,GAAG,SAAS,MAAM,EAAE,CAkBtG"}
package/dist/commands.js CHANGED
@@ -20,7 +20,7 @@ export const ROOT = option({
20
20
  placeholder: '<path>',
21
21
  summary: 'Workspace root (default: nearest ancestor with .ia/src)',
22
22
  });
23
- /** §2.0. Applies to all fifteen verbs; §2.1 refuses `--root` for `init` alone, with its own reason. */
23
+ /** §2.0. Shared consumer options; §2.1 refuses `--root` for `init` alone, with its own reason. */
24
24
  export const COMMON_OPTIONS = [
25
25
  ROOT,
26
26
  option({ name: 'json', kind: 'boolean', summary: 'One JSON value on stdout; no color, progress or prompts' }),
@@ -51,8 +51,17 @@ export const COMMANDS = [
51
51
  name: 'init',
52
52
  group: 'workspace',
53
53
  summary: 'Plan or create a new workspace',
54
+ // conflictRefusal (init.ts): the plan, which lists every conflict.
55
+ catalog: {
56
+ mode: 'effect',
57
+ move: 'Execution',
58
+ refuses: 'a target already initialized; --apply writes nothing',
59
+ next: 'ia position --root <directory>',
60
+ },
54
61
  syntax: [
55
- 'ia init [<directory>] [--id <provider/name>] [--host claude|codex|none] [--apply] [--json] [--yes]',
62
+ 'ia init [<directory>] [--id <provider/name>] [--system] [--host claude|codex|none]',
63
+ ' [--apply] [--json] [--yes]',
64
+ 'ia init [<directory>] --migrate [--system] [--apply] [--json] [--yes]',
56
65
  'ia init [<directory>] --decline today|forever | --forget-decline [--host claude|codex|none] [--json]',
57
66
  ],
58
67
  grammar: {
@@ -66,6 +75,20 @@ export const COMMANDS = [
66
75
  placeholder: '<provider/name>',
67
76
  summary: 'Package id (default: local/<directory name>)',
68
77
  }),
78
+ // Decision local-system-at-init (plan amendment B7): a repository that will own vocabulary opts in.
79
+ option({
80
+ name: 'system',
81
+ kind: 'boolean',
82
+ summary: 'Also author a local @system, its steward and a @distribution, so ia pack can release it',
83
+ }),
84
+ // Milestone position-packet task init-migrate-flag: the workspace's own name, and the hosts it already
85
+ // registered, are the ones the migration keeps, so neither --id nor --host applies.
86
+ option({
87
+ name: 'migrate',
88
+ kind: 'boolean',
89
+ conflicts: ['id', 'host', 'decline', 'forget-decline'],
90
+ summary: 'Rewrite a 1.1.0 starter workspace into the three starter records',
91
+ }),
69
92
  // Host registration spec §4 "init --host": with --apply, `ia host <host> --apply` runs after initialization.
70
93
  option({
71
94
  name: 'host',
@@ -79,13 +102,13 @@ export const COMMANDS = [
79
102
  name: 'decline',
80
103
  kind: 'value',
81
104
  values: ['today', 'forever'],
82
- conflicts: ['apply', 'id', 'forget-decline'],
105
+ conflicts: ['apply', 'id', 'system', 'forget-decline'],
83
106
  summary: 'Record that this repository should not be initialized',
84
107
  }),
85
108
  option({
86
109
  name: 'forget-decline',
87
110
  kind: 'boolean',
88
- conflicts: ['apply', 'id', 'decline', 'host'],
111
+ conflicts: ['apply', 'id', 'system', 'decline', 'host'],
89
112
  summary: 'Remove a recorded decline for this repository',
90
113
  }),
91
114
  ],
@@ -96,6 +119,13 @@ export const COMMANDS = [
96
119
  name: 'validate',
97
120
  group: 'workspace',
98
121
  summary: 'Check records against the language and declared contracts',
122
+ // requireRoot (consumer.ts): findings are a verdict, not a refusal; a root to validate is the one refusal.
123
+ catalog: {
124
+ mode: 'validate',
125
+ move: 'Verification',
126
+ refuses: 'no .ia/src directory at the root or in any parent',
127
+ next: 'ia init',
128
+ },
99
129
  syntax: ['ia validate [<path>...] [--severity error|warning] [--max-findings <n>] [--json]'],
100
130
  grammar: grammar([
101
131
  option({ name: 'severity', kind: 'value', values: ['error', 'warning'], summary: 'Lowest severity to report' }),
@@ -113,27 +143,39 @@ export const COMMANDS = [
113
143
  name: 'capture',
114
144
  group: 'workspace',
115
145
  summary: 'Admit the workspace and write its current and previous snapshot',
116
- syntax: ['ia capture [--json]'],
117
- grammar: grammar([]),
146
+ // captureRefusal (capture.ts): this row names the uninitialized, error-free branch only.
147
+ // An initialized root with missing authored source instead restores that source, then inspects its position.
148
+ catalog: {
149
+ mode: 'effect',
150
+ move: 'Execution',
151
+ refuses: 'an uninitialized root with no authored @workspace and no source errors; nothing is written',
152
+ next: 'ia init <directory>',
153
+ },
154
+ syntax: ['ia capture [--preview] [--json]'],
155
+ // Decision capture-preview-placement: capture writes by default, so its preview is a flag (plan amendment B8).
156
+ grammar: grammar([
157
+ option({ name: 'preview', kind: 'boolean', summary: 'Report what the capture would write; write nothing' }),
158
+ ]),
118
159
  },
119
160
  {
120
- // Decision release-bump (operator, 2026-10-07): the 1.x verb, unchanged, deprecated in favour of `ia capture`;
121
- // the alias of decision compile-verb-fate waits for 2.0.
161
+ // Decision compile-verb-fate (operator, 2026-10-07): from 2.0 a deprecated alias of `ia capture`, removed in 3.0.
162
+ // The 1.x options stay in the grammar so a 1.x invocation meets its mapping or its refusal, never an unknown flag.
122
163
  name: 'compile',
123
164
  group: 'workspace',
124
165
  // Short enough that its global help row fits 80 columns, so no wrapped fragment reads as a command name.
125
- summary: 'Write a deterministic compiled artifact (deprecated: use capture)',
126
- syntax: ['ia compile [--out <file> | --stdout] [--force] [--json]'],
166
+ summary: 'Deprecated alias of capture, removed in 3.0',
167
+ syntax: ['ia compile [--preview] [--force] [--json]'],
127
168
  grammar: grammar([
169
+ option({ name: 'preview', kind: 'boolean', summary: 'As ia capture --preview' }),
128
170
  option({
129
171
  name: 'out',
130
172
  kind: 'value',
131
173
  conflicts: ['stdout'],
132
174
  placeholder: '<file>',
133
- summary: 'Artifact path under <root>/.ia/work/',
175
+ summary: 'Refused: ia capture writes only .ia/work/snapshot/current.json',
134
176
  }),
135
- option({ name: 'stdout', kind: 'boolean', summary: 'Write the artifact to stdout instead of a file' }),
136
- option({ name: 'force', kind: 'boolean', summary: 'Overwrite an existing artifact' }),
177
+ option({ name: 'stdout', kind: 'boolean', summary: 'Refused: ia capture writes only its snapshot file' }),
178
+ option({ name: 'force', kind: 'boolean', summary: 'Accepted and ignored: ia capture always writes' }),
137
179
  ]),
138
180
  },
139
181
  {
@@ -185,6 +227,8 @@ export const COMMANDS = [
185
227
  name: 'read',
186
228
  group: 'workspace',
187
229
  summary: 'Print the body behind a locator, with its digest',
230
+ // readNext (read.ts): IA-RUNTIME-READ-UNADMITTED names the overview of what the workspace admits.
231
+ catalog: { mode: 'read', move: 'Observation', refuses: 'a locator no admitted record answers', next: 'ia inspect' },
188
232
  syntax: [
189
233
  'ia read <identity>[#<phase>/<Primitive> | #<REQ-ID>] [--include-runtime] [--json]',
190
234
  'ia read <path>:<line> [--include-runtime] [--json]',
@@ -197,6 +241,107 @@ export const COMMANDS = [
197
241
  }),
198
242
  ], positionals('locator', 1, 1)),
199
243
  },
244
+ {
245
+ // Position-and-projection §1, §6 and §7 and design item 10: body(K) for a scope key, with its digest and host note,
246
+ // the consumer verb beside the frozen `ia scope` route (decision scope-verb-dispatch). It is the Door's `position`
247
+ // operation (MACHINE_PROTOCOL version 2) as a consumer verb, never a machine route (plan amendment A2). The key's
248
+ // closed sets and caps are the runtime's, which refuses a value outside them naming the call to run instead, so no
249
+ // option here declares them.
250
+ name: 'position',
251
+ group: 'workspace',
252
+ summary: 'Show the position body for a scope key and its host note',
253
+ // positionNext (position.ts): the position of the repository's workspace, K0.
254
+ catalog: {
255
+ mode: 'read',
256
+ move: 'Observation',
257
+ refuses: 'a seat the workspace does not admit, or a path outside it',
258
+ next: 'ia position',
259
+ },
260
+ syntax: [
261
+ 'ia position [--seat <id|path>] [--shape <H>] [--phase <P>] [--depth <d>]',
262
+ ' [--budget <n>] [--word <w>] [--json]',
263
+ ],
264
+ grammar: grammar([
265
+ option({
266
+ name: 'seat',
267
+ kind: 'value',
268
+ placeholder: '<id|path>',
269
+ summary: "A record identity, or a workspace path, ./ first for one spelled as an identity (default: the repository's @workspace)",
270
+ }),
271
+ option({
272
+ name: 'shape',
273
+ kind: 'value',
274
+ placeholder: '<H>',
275
+ summary: 'context, governance, execution, sequence or learning (default context)',
276
+ }),
277
+ option({
278
+ name: 'phase',
279
+ kind: 'value',
280
+ placeholder: '<P>',
281
+ summary: "orient, plan, act or learn (default: the anchor phase of the shape's primitive)",
282
+ }),
283
+ option({
284
+ name: 'depth',
285
+ kind: 'value',
286
+ placeholder: '<d>',
287
+ summary: "Hops along the shape's predicates, 0-2 (default 1; 0 when no part is named)",
288
+ }),
289
+ option({
290
+ name: 'budget',
291
+ kind: 'value',
292
+ placeholder: '<n>',
293
+ summary: 'Records loaded beyond the seat, 0-64 (default 16; 0 when no part is named)',
294
+ }),
295
+ option({
296
+ name: 'word',
297
+ kind: 'value',
298
+ placeholder: '<w>',
299
+ summary: 'Load, point at and tally only records of this word; rules, applies-by-word entries, cells and mandates of any word are kept',
300
+ }),
301
+ ]),
302
+ },
303
+ {
304
+ // Position-and-projection §9 step 2 and design rows 21 and 22: the delivery view, computed per read and never
305
+ // stored. It is the Door's `next` operation (MACHINE_PROTOCOL version 2) as a consumer verb, never a machine route
306
+ // (plan amendment A2).
307
+ name: 'next',
308
+ group: 'workspace',
309
+ summary: "Show a plan's tasks in delivery order with verdict and basis",
310
+ // nextAfter (next.ts): IA-RUNTIME-NEXT-AMBIGUOUS names the first plan the message lists as the seat.
311
+ catalog: {
312
+ mode: 'read',
313
+ move: 'Observation',
314
+ refuses: 'no --seat while the workspace authors several @plan records, which the message lists',
315
+ next: 'ia next --seat <plan>',
316
+ },
317
+ syntax: ['ia next [--seat <plan|milestone|task>] [--json]'],
318
+ grammar: grammar([
319
+ option({
320
+ name: 'seat',
321
+ kind: 'value',
322
+ placeholder: '<plan|milestone|task>',
323
+ // The help IA-RUNTIME-NEXT-NO-PLAN names says which records make a plan the view can read.
324
+ summary: 'A @plan, @milestone or @task identity (default: the only @plan authored, with @milestone records that name it in work.plan and @task records that name those in work.milestone)',
325
+ }),
326
+ ]),
327
+ },
328
+ {
329
+ // Position-and-projection §5's project effect and design items 11 and 12 (plan amendments B8, B11 and B12): the
330
+ // workspace projection alone, the plan and apply of `ia host`'s projection element. The host is a positional the
331
+ // handler checks against the packet's two adapters, so any other host is still usage (exit 2).
332
+ name: 'project',
333
+ group: 'workspace',
334
+ summary: "Plan or apply the position packet's files for one host",
335
+ // conflictRefusal (project.ts): the plan names the file in the way, and the apply refuses it.
336
+ catalog: {
337
+ mode: 'effect',
338
+ move: 'Execution',
339
+ refuses: 'a file without the generated marker at a path it writes, which its plan names; --apply writes nothing',
340
+ next: 'ia project <host>',
341
+ },
342
+ syntax: ['ia project <claude|codex> [--apply] [--json] [--yes]'],
343
+ grammar: grammar([option({ name: 'apply', kind: 'boolean', summary: 'Apply the plan rather than previewing it' })], positionals('host', 1, 1)),
344
+ },
200
345
  {
201
346
  name: 'vocabulary',
202
347
  group: 'workspace',
@@ -376,6 +521,18 @@ export const COMMANDS = [
376
521
  option({ name: 'apply', kind: 'boolean', required: true, summary: 'Required; restore has no preview yet' }),
377
522
  ]),
378
523
  },
524
+ {
525
+ name: 'recover',
526
+ group: 'distribution',
527
+ summary: 'Recover an interrupted installation or host transaction',
528
+ syntax: ['ia recover [installation|host|guard|lifecycle] --root <directory> [--json]'],
529
+ grammar: {
530
+ options: COMMON_OPTIONS.map((entry) => entry.name === 'root'
531
+ ? { ...entry, required: true, summary: 'Required existing directory whose transaction is to be recovered' }
532
+ : entry),
533
+ positionals: positionals('recovery', 0, 1),
534
+ },
535
+ },
379
536
  {
380
537
  name: 'doctor',
381
538
  group: 'distribution',
@@ -440,6 +597,11 @@ export const CORE_TOKENS = new Set([
440
597
  /** §1.6: the shape of an extension token. */
441
598
  export const EXTENSION_TOKEN = /^[a-z][a-z0-9-]{0,31}$/;
442
599
  export const commandNames = COMMANDS.map((command) => command.name);
600
+ /**
601
+ * Plan amendment B5: the position packet's command catalog, the rows tagged `catalog`, in table order, which the CLI
602
+ * passes to the runtime's `renderPacket` as data (B2: nothing imports this app module).
603
+ */
604
+ export const packetCatalog = (commands = COMMANDS) => commands.flatMap((command) => command.catalog === undefined ? [] : [{ command: `ia ${command.name}`, ...command.catalog }]);
443
605
  export const findCommand = (token) => COMMANDS.find((command) => command.name === token);
444
606
  /**
445
607
  * §1.2 step 7's nearest match. Ordinary Levenshtein distance over the tokens the dispatcher admits, capped so a