@mmnto/cli 1.113.1 → 1.115.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 (90) hide show
  1. package/dist/commands/doctor-seat-identity.d.ts +71 -0
  2. package/dist/commands/doctor-seat-identity.d.ts.map +1 -0
  3. package/dist/commands/doctor-seat-identity.js +352 -0
  4. package/dist/commands/doctor-seat-identity.js.map +1 -0
  5. package/dist/commands/doctor-seat-identity.test.d.ts +13 -0
  6. package/dist/commands/doctor-seat-identity.test.d.ts.map +1 -0
  7. package/dist/commands/doctor-seat-identity.test.js +230 -0
  8. package/dist/commands/doctor-seat-identity.test.js.map +1 -0
  9. package/dist/commands/doctor.d.ts.map +1 -1
  10. package/dist/commands/doctor.js +3 -0
  11. package/dist/commands/doctor.js.map +1 -1
  12. package/dist/commands/doctor.test.js +1 -0
  13. package/dist/commands/doctor.test.js.map +1 -1
  14. package/dist/commands/ecl-gc.d.ts.map +1 -1
  15. package/dist/commands/ecl-gc.js +18 -7
  16. package/dist/commands/ecl-gc.js.map +1 -1
  17. package/dist/commands/ecl-gc.test.js +63 -1
  18. package/dist/commands/ecl-gc.test.js.map +1 -1
  19. package/dist/commands/eject.d.ts +62 -3
  20. package/dist/commands/eject.d.ts.map +1 -1
  21. package/dist/commands/eject.js +382 -47
  22. package/dist/commands/eject.js.map +1 -1
  23. package/dist/commands/eject.test.js +557 -7
  24. package/dist/commands/eject.test.js.map +1 -1
  25. package/dist/commands/gemini-beforetool-contract.test.d.ts +2 -0
  26. package/dist/commands/gemini-beforetool-contract.test.d.ts.map +1 -0
  27. package/dist/commands/gemini-beforetool-contract.test.js +106 -0
  28. package/dist/commands/gemini-beforetool-contract.test.js.map +1 -0
  29. package/dist/commands/gemini-sessionstart-contract.test.d.ts +2 -0
  30. package/dist/commands/gemini-sessionstart-contract.test.d.ts.map +1 -0
  31. package/dist/commands/gemini-sessionstart-contract.test.js +184 -0
  32. package/dist/commands/gemini-sessionstart-contract.test.js.map +1 -0
  33. package/dist/commands/init-templates.d.ts +6 -6
  34. package/dist/commands/init-templates.d.ts.map +1 -1
  35. package/dist/commands/init-templates.js +271 -19
  36. package/dist/commands/init-templates.js.map +1 -1
  37. package/dist/commands/init.d.ts +40 -4
  38. package/dist/commands/init.d.ts.map +1 -1
  39. package/dist/commands/init.js +357 -32
  40. package/dist/commands/init.js.map +1 -1
  41. package/dist/commands/init.test.js +546 -10
  42. package/dist/commands/init.test.js.map +1 -1
  43. package/dist/commands/install-hooks-exit-contract.test.js +5 -0
  44. package/dist/commands/install-hooks-exit-contract.test.js.map +1 -1
  45. package/dist/commands/install-hooks.d.ts +26 -8
  46. package/dist/commands/install-hooks.d.ts.map +1 -1
  47. package/dist/commands/install-hooks.js +51 -6
  48. package/dist/commands/install-hooks.js.map +1 -1
  49. package/dist/commands/mail-degraded-e4.test.js +126 -0
  50. package/dist/commands/mail-degraded-e4.test.js.map +1 -1
  51. package/dist/commands/mail.d.ts +19 -1
  52. package/dist/commands/mail.d.ts.map +1 -1
  53. package/dist/commands/mail.js +195 -30
  54. package/dist/commands/mail.js.map +1 -1
  55. package/dist/commands/mail.test.js +291 -3
  56. package/dist/commands/mail.test.js.map +1 -1
  57. package/dist/commands/orient.d.ts.map +1 -1
  58. package/dist/commands/orient.js +82 -0
  59. package/dist/commands/orient.js.map +1 -1
  60. package/dist/commands/orient.test.js +144 -1
  61. package/dist/commands/orient.test.js.map +1 -1
  62. package/dist/commands/seat-cli-wiring.test.d.ts +20 -0
  63. package/dist/commands/seat-cli-wiring.test.d.ts.map +1 -0
  64. package/dist/commands/seat-cli-wiring.test.js +147 -0
  65. package/dist/commands/seat-cli-wiring.test.js.map +1 -0
  66. package/dist/commands/seat-poll-chain.test.d.ts +13 -0
  67. package/dist/commands/seat-poll-chain.test.d.ts.map +1 -0
  68. package/dist/commands/seat-poll-chain.test.js +103 -0
  69. package/dist/commands/seat-poll-chain.test.js.map +1 -0
  70. package/dist/commands/seat.d.ts +92 -0
  71. package/dist/commands/seat.d.ts.map +1 -0
  72. package/dist/commands/seat.js +649 -0
  73. package/dist/commands/seat.js.map +1 -0
  74. package/dist/commands/seat.test.d.ts +19 -0
  75. package/dist/commands/seat.test.d.ts.map +1 -0
  76. package/dist/commands/seat.test.js +532 -0
  77. package/dist/commands/seat.test.js.map +1 -0
  78. package/dist/commands/sessionstart-manifest-contract.test.d.ts +2 -0
  79. package/dist/commands/sessionstart-manifest-contract.test.d.ts.map +1 -0
  80. package/dist/commands/sessionstart-manifest-contract.test.js +176 -0
  81. package/dist/commands/sessionstart-manifest-contract.test.js.map +1 -0
  82. package/dist/hooks/__tests__/auto-context.test.js +20 -0
  83. package/dist/hooks/__tests__/auto-context.test.js.map +1 -1
  84. package/dist/hooks/auto-context.d.ts +19 -0
  85. package/dist/hooks/auto-context.d.ts.map +1 -1
  86. package/dist/hooks/auto-context.js +22 -4
  87. package/dist/hooks/auto-context.js.map +1 -1
  88. package/dist/index.js +73 -0
  89. package/dist/index.js.map +1 -1
  90. package/package.json +2 -2
@@ -0,0 +1,103 @@
1
+ /**
2
+ * Induced lifecycle CHAIN tests (mmnto-ai/totem#2511, fold — falsification
3
+ * finding 3): the REAL seat verbs chained into the REAL `pollMail`, so the
4
+ * verb→poll coupling is exercised end-to-end rather than each half against
5
+ * hand-written fixtures. The charter's fixture-ts-HOSTED induced run cannot
6
+ * execute in this repo's CI (the fixture repo is not vendored); this in-repo
7
+ * chain carries the same assertions — add → poll visibility · suspend →
8
+ * denominator exclusion measured through the poll · remove → retired with
9
+ * retention intact — and the manual built-CLI receipt against a fixture-ts
10
+ * copy is recorded on the PR.
11
+ */
12
+ import * as fs from 'node:fs';
13
+ import * as os from 'node:os';
14
+ import * as path from 'node:path';
15
+ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
16
+ import { SEAT_LIFECYCLE_FILENAME } from '@mmnto/totem';
17
+ import { pollMail } from './mail.js';
18
+ import { seatAddCommand, seatRemoveCommand, seatSuspendCommand } from './seat.js';
19
+ const NOW = '2026-08-11T09:00:00.000Z';
20
+ const SEAT_A = 'chain-claude';
21
+ const SEAT_B = 'chain-kimi';
22
+ const ENV = { TOTEM_SELF_AGENT: `${SEAT_A},${SEAT_B}` };
23
+ const BCAST = '2026-08-11T0930Z-broadcast-chain-note.md';
24
+ const DIRECTED = '2026-08-11T0931Z-chain-kimi-task.md';
25
+ let workspace = '';
26
+ let repo = '';
27
+ let stdoutSpy;
28
+ beforeEach(() => {
29
+ workspace = fs.realpathSync(fs.mkdtempSync(path.join(os.tmpdir(), 'chain-')));
30
+ repo = path.join(workspace, 'totem');
31
+ fs.mkdirSync(path.join(repo, '.totem', 'orchestration'), { recursive: true });
32
+ stdoutSpy = vi.spyOn(process.stdout, 'write').mockImplementation(() => true);
33
+ });
34
+ afterEach(() => {
35
+ stdoutSpy.mockRestore();
36
+ fs.rmSync(workspace, { recursive: true, force: true });
37
+ });
38
+ function writePeerOutbox(name, to) {
39
+ const outbox = path.join(workspace, 'totem-strategy', '.totem', 'orchestration', 'strategy-claude', 'outbox');
40
+ fs.mkdirSync(outbox, { recursive: true });
41
+ fs.writeFileSync(path.join(outbox, name), `---\nfrom: strategy-claude\nto: ${to}\ndate: 2026-08-11T0930Z\nsubject: chain\n---\nbody\n`, 'utf-8');
42
+ }
43
+ function writeBroadcastMark(seat, name) {
44
+ const dir = path.join(repo, '.totem', 'orchestration', seat, 'processed', '_broadcast');
45
+ fs.mkdirSync(dir, { recursive: true });
46
+ fs.writeFileSync(path.join(dir, name), '---\nto: broadcast\n---\n', 'utf-8');
47
+ }
48
+ function poll() {
49
+ return pollMail({ repoRoot: repo, workspace, env: ENV });
50
+ }
51
+ describe('seat verbs chained into pollMail (mmnto-ai/totem#2511 induced chain)', () => {
52
+ it('add → poll visibility: a verb-created seat receives directed and broadcast mail', async () => {
53
+ await seatAddCommand(SEAT_A, { cwdForTest: repo, envForTest: {}, nowForTest: NOW });
54
+ await seatAddCommand(SEAT_B, { cwdForTest: repo, envForTest: {}, nowForTest: NOW });
55
+ writePeerOutbox(DIRECTED, SEAT_B);
56
+ writePeerOutbox(BCAST, 'broadcast');
57
+ const result = poll();
58
+ expect(result.mail.map((m) => m.file).sort()).toEqual([BCAST, DIRECTED].sort());
59
+ expect(result.warnings).toEqual([]);
60
+ expect(result.notices).toEqual([]);
61
+ });
62
+ it('suspend → denominator exclusion measured THROUGH the poll: the active seat’s mark alone closes the broadcast; the held directed mail surfaces with the notice', async () => {
63
+ await seatAddCommand(SEAT_A, { cwdForTest: repo, envForTest: {}, nowForTest: NOW });
64
+ await seatAddCommand(SEAT_B, { cwdForTest: repo, envForTest: {}, nowForTest: NOW });
65
+ writePeerOutbox(DIRECTED, SEAT_B);
66
+ writePeerOutbox(BCAST, 'broadcast');
67
+ // Positive control BEFORE the transition: with both seats active, one mark
68
+ // does NOT close the broadcast (required = 2) — so the closure below is a
69
+ // measured consequence of the verb, not of the fixture.
70
+ writeBroadcastMark(SEAT_A, BCAST);
71
+ expect(poll().mail.map((m) => m.file)).toContain(BCAST);
72
+ await seatSuspendCommand(SEAT_B, {
73
+ cwdForTest: repo,
74
+ envForTest: {},
75
+ nowForTest: NOW,
76
+ reason: 'chain drill',
77
+ });
78
+ const after = poll();
79
+ // Broadcast: required dropped to the ONE active seat, whose mark exists.
80
+ expect(after.mail.map((m) => m.file)).toEqual([DIRECTED]);
81
+ // Held directed mail surfaces, annotated on the non-gating channel.
82
+ expect(after.warnings).toEqual([]);
83
+ expect(after.notices.some((n) => n.includes('suspended seat'))).toBe(true);
84
+ });
85
+ it('remove → retired with retention intact: dirs, outbox marks, and held mail all survive; the poll names the retired addressee', async () => {
86
+ await seatAddCommand(SEAT_A, { cwdForTest: repo, envForTest: {}, nowForTest: NOW });
87
+ await seatAddCommand(SEAT_B, { cwdForTest: repo, envForTest: {}, nowForTest: NOW });
88
+ writePeerOutbox(DIRECTED, SEAT_B);
89
+ writeBroadcastMark(SEAT_B, BCAST);
90
+ await seatRemoveCommand(SEAT_B, { cwdForTest: repo, envForTest: {}, nowForTest: NOW });
91
+ const marker = JSON.parse(fs.readFileSync(path.join(repo, '.totem', 'orchestration', SEAT_B, SEAT_LIFECYCLE_FILENAME), 'utf-8'));
92
+ expect(marker['state']).toBe('retired');
93
+ // Retention: the seat's dirs and marks are untouched by the verb.
94
+ expect(fs.existsSync(path.join(repo, '.totem', 'orchestration', SEAT_B, 'processed', '_broadcast'))).toBe(true);
95
+ expect(fs.existsSync(path.join(repo, '.totem', 'orchestration', SEAT_B, 'outbox'))).toBe(true);
96
+ const after = poll();
97
+ // Held mail still surfaces (obligation held), named as retired-addressed.
98
+ expect(after.mail.map((m) => m.file)).toEqual([DIRECTED]);
99
+ expect(after.notices.some((n) => n.includes('addressed to retired seat'))).toBe(true);
100
+ expect(after.warnings).toEqual([]);
101
+ });
102
+ });
103
+ //# sourceMappingURL=seat-poll-chain.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"seat-poll-chain.test.js","sourceRoot":"","sources":["../../src/commands/seat-poll-chain.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAEzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAEvD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAElF,MAAM,GAAG,GAAG,0BAA0B,CAAC;AACvC,MAAM,MAAM,GAAG,cAAc,CAAC;AAC9B,MAAM,MAAM,GAAG,YAAY,CAAC;AAC5B,MAAM,GAAG,GAAG,EA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E;QAClE,MAAM,CACJ,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC,CAC7F,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACb,MAAM,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAE/F,MAAM,KAAK,GAAG,IAAI,EAAE,CAAC;QACrB,0EAA0E;QAC1E,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC1D,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,2BAA2B,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACtF,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,92 @@
1
+ /**
2
+ * `totem seat add | suspend | remove | list` — the declared seat-lifecycle
3
+ * verbs (mmnto-ai/totem#2511 slice 2).
4
+ *
5
+ * Seat EXISTENCE stays dir-derived (the mmnto-ai/totem#2141 dirs-union
6
+ * invariant): these verbs do not mint a second registration surface. What they
7
+ * add is the DECLARED half — an `active | suspended | retired` marker written
8
+ * by an operator word, which downstream consumers (broadcast denominators,
9
+ * annotations, the totem-status#127 session projection) read. Session state
10
+ * (`LIVE/IDLE/FAULTED`) is a different axis and never appears here.
11
+ *
12
+ * Two disciplines run through every verb:
13
+ * - **Emit, never apply.** A seat's birth and retirement touch surfaces this
14
+ * binary cannot reach honestly — vendor hook files (mmnto-ai/totem#2612 is
15
+ * the live tracked-file-mutation bug class), `totem-status`'s
16
+ * `agentHomeMap`, the mmnto-ai/totem-strategy#611-frozen `eclCohortRepos`,
17
+ * four prose copies of the signoff seat table, the strategy-owned parity
18
+ * manifest. Every one of them is printed as a checklist line and NONE of
19
+ * them is written.
20
+ * - **Nothing is deleted.** `seat remove` writes a `retired` tombstone and
21
+ * leaves the outbox, processed marks, and journals exactly where they are;
22
+ * retention policy is mmnto-ai/totem#2518's lane. Lifecycle transitions
23
+ * also never discharge an obligation — that is an explicit disposition
24
+ * with provenance (mmnto-ai/totem-status#127).
25
+ *
26
+ * All human output goes to STDOUT as one stream. The product of these verbs is
27
+ * a report an operator acts on and pipes (`totem seat add x > wiring.txt`), so
28
+ * splitting it across stdout/stderr would hand over a checklist with holes in
29
+ * it. Failures still travel as `TotemError` to the index.ts error boundary,
30
+ * which prints them on stderr and sets a non-zero exit.
31
+ *
32
+ * The marker schema lives in core (`seat-lifecycle.ts`) and is never redefined
33
+ * here: this layer composes markers and hands them to `writeSeatLifecycle`.
34
+ */
35
+ interface SeatCommandSeams {
36
+ /** Test seam — production callers use `process.cwd()`. */
37
+ cwdForTest?: string;
38
+ /** Test seam — production callers use `process.env`. */
39
+ envForTest?: NodeJS.ProcessEnv;
40
+ /** Test seam — pins the marker's `since`. */
41
+ nowForTest?: string;
42
+ }
43
+ export interface SeatAddOptions extends SeatCommandSeams {
44
+ /** Transition an existing SUSPENDED seat back to `active`. Nothing else. */
45
+ reactivate?: boolean;
46
+ }
47
+ export interface SeatSuspendOptions extends SeatCommandSeams {
48
+ /** The operator's recorded ruling — the §6.6 audit trail when present. */
49
+ reason?: string;
50
+ }
51
+ export interface SeatRemoveOptions extends SeatCommandSeams {
52
+ reason?: string;
53
+ }
54
+ export interface SeatListOptions extends SeatCommandSeams {
55
+ json?: boolean;
56
+ }
57
+ /**
58
+ * Register a seat: three coordination subdirs, an `active` marker, and — only
59
+ * where a `config.json` already exists — the `host_agents` append. Then emit
60
+ * the birth checklist for everything this binary cannot reach.
61
+ *
62
+ * An existing seat is a hard error, not an overwrite: `--reactivate` is the
63
+ * only way back in, and it moves ONLY `suspended → active`. A `retired` seat
64
+ * is never resurrected here — retirement was an operator word, so resurrection
65
+ * must be one too (the Phase-4 gate ruling, OQ1).
66
+ */
67
+ export declare function seatAddCommand(seatId: string, options?: SeatAddOptions): Promise<void>;
68
+ /**
69
+ * Declare a seat suspended: it leaves broadcast required-sets and round
70
+ * denominators, while its directed mail keeps surfacing (the gate ruling, OQ4
71
+ * — suspension excludes a seat from the count, it never hides its mail).
72
+ *
73
+ * Already-suspended is a no-op success with no rewrite: re-running the verb
74
+ * must not overwrite the ORIGINAL `since`, which is the audit trail's anchor.
75
+ */
76
+ export declare function seatSuspendCommand(seatId: string, options?: SeatSuspendOptions): Promise<void>;
77
+ /**
78
+ * Declare a seat retired. Nothing is deleted — the marker is a durable
79
+ * tombstone and retention policy is mmnto-ai/totem#2518's lane — and no
80
+ * obligation is discharged. The residual foreign surfaces are emitted as a
81
+ * deregistration checklist, never applied.
82
+ */
83
+ export declare function seatRemoveCommand(seatId: string, options?: SeatRemoveOptions): Promise<void>;
84
+ /**
85
+ * Read-only accounting: every registered seat (the dirs ARE the roster) with
86
+ * its declared lifecycle, derived at read time and never cached. Degraded
87
+ * marker reads appear as warnings BELOW the table — a seat with an unusable
88
+ * marker still renders as `active`, because fail-open is the read contract.
89
+ */
90
+ export declare function seatListCommand(options?: SeatListOptions): Promise<void>;
91
+ export {};
92
+ //# sourceMappingURL=seat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"seat.d.ts","sourceRoot":"","sources":["../../src/commands/seat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AA4CH,UAAU,gBAAgB;IACxB,0DAA0D;IAC1D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wDAAwD;IACxD,UAAU,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IAC/B,6CAA6C;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,cAAe,SAAQ,gBAAgB;IACtD,4EAA4E;IAC5E,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,kBAAmB,SAAQ,gBAAgB;IAC1D,0EAA0E;IAC1E,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,iBAAkB,SAAQ,gBAAgB;IACzD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,eAAgB,SAAQ,gBAAgB;IACvD,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAkXD;;;;;;;;;GASG;AACH,wBAAsB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAuLhG;AAID;;;;;;;GAOG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,IAAI,CAAC,CAyDf;AAID;;;;;GAKG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC,IAAI,CAAC,CA0Df;AAQD;;;;;GAKG;AACH,wBAAsB,eAAe,CAAC,OAAO,GAAE,eAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAmDlF"}