@mmnto/cli 1.114.0 → 1.116.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 (101) hide show
  1. package/dist/commands/doctor-compliance.test.js +17 -0
  2. package/dist/commands/doctor-compliance.test.js.map +1 -1
  3. package/dist/commands/doctor-seat-identity.d.ts +87 -0
  4. package/dist/commands/doctor-seat-identity.d.ts.map +1 -0
  5. package/dist/commands/doctor-seat-identity.js +427 -0
  6. package/dist/commands/doctor-seat-identity.js.map +1 -0
  7. package/dist/commands/doctor-seat-identity.test.d.ts +13 -0
  8. package/dist/commands/doctor-seat-identity.test.d.ts.map +1 -0
  9. package/dist/commands/doctor-seat-identity.test.js +390 -0
  10. package/dist/commands/doctor-seat-identity.test.js.map +1 -0
  11. package/dist/commands/doctor.d.ts.map +1 -1
  12. package/dist/commands/doctor.js +3 -0
  13. package/dist/commands/doctor.js.map +1 -1
  14. package/dist/commands/doctor.test.js +1 -0
  15. package/dist/commands/doctor.test.js.map +1 -1
  16. package/dist/commands/ecl-gc.d.ts.map +1 -1
  17. package/dist/commands/ecl-gc.js +18 -7
  18. package/dist/commands/ecl-gc.js.map +1 -1
  19. package/dist/commands/ecl-gc.test.js +63 -1
  20. package/dist/commands/ecl-gc.test.js.map +1 -1
  21. package/dist/commands/eject.d.ts +62 -3
  22. package/dist/commands/eject.d.ts.map +1 -1
  23. package/dist/commands/eject.js +382 -47
  24. package/dist/commands/eject.js.map +1 -1
  25. package/dist/commands/eject.test.js +557 -7
  26. package/dist/commands/eject.test.js.map +1 -1
  27. package/dist/commands/gemini-beforetool-contract.test.d.ts +2 -0
  28. package/dist/commands/gemini-beforetool-contract.test.d.ts.map +1 -0
  29. package/dist/commands/gemini-beforetool-contract.test.js +106 -0
  30. package/dist/commands/gemini-beforetool-contract.test.js.map +1 -0
  31. package/dist/commands/gemini-sessionstart-contract.test.d.ts +2 -0
  32. package/dist/commands/gemini-sessionstart-contract.test.d.ts.map +1 -0
  33. package/dist/commands/gemini-sessionstart-contract.test.js +199 -0
  34. package/dist/commands/gemini-sessionstart-contract.test.js.map +1 -0
  35. package/dist/commands/init-templates.d.ts +4 -4
  36. package/dist/commands/init-templates.d.ts.map +1 -1
  37. package/dist/commands/init-templates.js +279 -16
  38. package/dist/commands/init-templates.js.map +1 -1
  39. package/dist/commands/init.test.js +25 -7
  40. package/dist/commands/init.test.js.map +1 -1
  41. package/dist/commands/install-hooks-exit-contract.test.js +5 -0
  42. package/dist/commands/install-hooks-exit-contract.test.js.map +1 -1
  43. package/dist/commands/mail-degraded-e4.test.js +126 -0
  44. package/dist/commands/mail-degraded-e4.test.js.map +1 -1
  45. package/dist/commands/mail.d.ts +19 -1
  46. package/dist/commands/mail.d.ts.map +1 -1
  47. package/dist/commands/mail.js +195 -30
  48. package/dist/commands/mail.js.map +1 -1
  49. package/dist/commands/mail.test.js +291 -3
  50. package/dist/commands/mail.test.js.map +1 -1
  51. package/dist/commands/orient.d.ts.map +1 -1
  52. package/dist/commands/orient.js +82 -0
  53. package/dist/commands/orient.js.map +1 -1
  54. package/dist/commands/orient.test.js +144 -1
  55. package/dist/commands/orient.test.js.map +1 -1
  56. package/dist/commands/retrospect.d.ts.map +1 -1
  57. package/dist/commands/retrospect.js +7 -3
  58. package/dist/commands/retrospect.js.map +1 -1
  59. package/dist/commands/seat-cli-wiring.test.d.ts +20 -0
  60. package/dist/commands/seat-cli-wiring.test.d.ts.map +1 -0
  61. package/dist/commands/seat-cli-wiring.test.js +147 -0
  62. package/dist/commands/seat-cli-wiring.test.js.map +1 -0
  63. package/dist/commands/seat-poll-chain.test.d.ts +13 -0
  64. package/dist/commands/seat-poll-chain.test.d.ts.map +1 -0
  65. package/dist/commands/seat-poll-chain.test.js +103 -0
  66. package/dist/commands/seat-poll-chain.test.js.map +1 -0
  67. package/dist/commands/seat.d.ts +92 -0
  68. package/dist/commands/seat.d.ts.map +1 -0
  69. package/dist/commands/seat.js +649 -0
  70. package/dist/commands/seat.js.map +1 -0
  71. package/dist/commands/seat.test.d.ts +19 -0
  72. package/dist/commands/seat.test.d.ts.map +1 -0
  73. package/dist/commands/seat.test.js +532 -0
  74. package/dist/commands/seat.test.js.map +1 -0
  75. package/dist/commands/sessionstart-manifest-contract.test.d.ts +2 -0
  76. package/dist/commands/sessionstart-manifest-contract.test.d.ts.map +1 -0
  77. package/dist/commands/sessionstart-manifest-contract.test.js +186 -0
  78. package/dist/commands/sessionstart-manifest-contract.test.js.map +1 -0
  79. package/dist/commands/triage-pr.d.ts.map +1 -1
  80. package/dist/commands/triage-pr.js +2 -0
  81. package/dist/commands/triage-pr.js.map +1 -1
  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 +71 -0
  89. package/dist/index.js.map +1 -1
  90. package/dist/parsers/bot-review-parser.d.ts +8 -1
  91. package/dist/parsers/bot-review-parser.d.ts.map +1 -1
  92. package/dist/parsers/bot-review-parser.js +21 -1
  93. package/dist/parsers/bot-review-parser.js.map +1 -1
  94. package/dist/parsers/bot-review-parser.test.js +23 -0
  95. package/dist/parsers/bot-review-parser.test.js.map +1 -1
  96. package/dist/parsers/triage-severity-mapper.d.ts.map +1 -1
  97. package/dist/parsers/triage-severity-mapper.js +32 -1
  98. package/dist/parsers/triage-severity-mapper.js.map +1 -1
  99. package/dist/parsers/triage-severity-mapper.test.js +57 -0
  100. package/dist/parsers/triage-severity-mapper.test.js.map +1 -1
  101. package/package.json +2 -2
@@ -0,0 +1,147 @@
1
+ /**
2
+ * Command-surface (Commander parser) tests for the `totem seat` wiring
3
+ * (mmnto-ai/totem#2511 slice 2).
4
+ *
5
+ * `index.ts` builds its `program` at module scope and auto-runs `parseAsync` on
6
+ * import, so it cannot be imported without executing the CLI against the test
7
+ * runner's argv. This therefore tests a hand-maintained MIRROR of the
8
+ * registration (`buildSeatProgram` below), not `index.ts` itself — the same
9
+ * structural limit `mail-cli-wiring.test.ts` documents. What it verifies is
10
+ * Commander's parsing of the mirrored shape: group-only `seat` with four
11
+ * subcommands, the `--reactivate` / `--reason` flags, and the
12
+ * `optsWithGlobals()` read that keeps `totem seat list --json` and
13
+ * `totem --json seat list` in agreement (the mmnto-ai/totem#2097 parent/child
14
+ * option collision). A drift between index.ts and this mirror is NOT caught
15
+ * here; the verb→poll behavior is covered in-repo by `seat.test.ts` +
16
+ * `seat-poll-chain.test.ts`, and built-binary runs accompany the change's
17
+ * review round. Parser-level only: no real fs, no core import.
18
+ */
19
+ import { Command } from 'commander';
20
+ import { describe, expect, it, vi } from 'vitest';
21
+ /** Mirror of the `seat` group registration in index.ts. */
22
+ function buildSeatProgram(handlers) {
23
+ const program = new Command();
24
+ program.exitOverride(); // throw on parse error instead of process.exit
25
+ // The program-level `--json` is what makes the collision reachable.
26
+ program.option('--json', 'Output structured JSON to stdout');
27
+ const seatCmd = program.command('seat');
28
+ seatCmd
29
+ .command('add <seat-id>')
30
+ .option('--reactivate', 'Transition an existing SUSPENDED seat back to active')
31
+ .action((seatId, opts) => {
32
+ handlers.seatAdd(seatId, opts);
33
+ });
34
+ seatCmd
35
+ .command('suspend <seat-id>')
36
+ .option('--reason <text>', 'Recorded ruling for the suspension')
37
+ .action((seatId, opts) => {
38
+ handlers.seatSuspend(seatId, opts);
39
+ });
40
+ seatCmd
41
+ .command('remove <seat-id>')
42
+ .option('--reason <text>', 'Recorded ruling for the retirement')
43
+ .action((seatId, opts) => {
44
+ handlers.seatRemove(seatId, opts);
45
+ });
46
+ seatCmd
47
+ .command('list')
48
+ .option('--json', 'Emit the full seat-status array as JSON on stdout')
49
+ .action((_opts, cmd) => {
50
+ // EXACT read from index.ts: optsWithGlobals merges the parent scope so a
51
+ // post-subcommand `--json` (which lands on program.opts()) still arrives.
52
+ const { json } = cmd.optsWithGlobals();
53
+ handlers.seatList({ json });
54
+ });
55
+ return program;
56
+ }
57
+ function handlers() {
58
+ const seatAdd = vi.fn();
59
+ const seatSuspend = vi.fn();
60
+ const seatRemove = vi.fn();
61
+ const seatList = vi.fn();
62
+ return {
63
+ seatAdd,
64
+ seatSuspend,
65
+ seatRemove,
66
+ seatList,
67
+ calls: { seatAdd, seatSuspend, seatRemove, seatList },
68
+ };
69
+ }
70
+ describe('seat CLI command-surface (Commander wiring, mmnto-ai/totem#2511)', () => {
71
+ it('add <seat-id> dispatches the positional with no --reactivate by default', () => {
72
+ const h = handlers();
73
+ buildSeatProgram(h).parse(['node', 'totem', 'seat', 'add', 'totem-kimi']);
74
+ expect(h.calls['seatAdd']).toHaveBeenCalledTimes(1);
75
+ expect(h.calls['seatAdd'].mock.calls[0][0]).toBe('totem-kimi');
76
+ expect(h.calls['seatAdd'].mock.calls[0][1].reactivate).toBe(undefined);
77
+ expect(h.calls['seatSuspend']).not.toHaveBeenCalled();
78
+ });
79
+ it('add --reactivate parses to reactivate: true', () => {
80
+ const h = handlers();
81
+ buildSeatProgram(h).parse(['node', 'totem', 'seat', 'add', 'totem-kimi', '--reactivate']);
82
+ expect(h.calls['seatAdd'].mock.calls[0][1].reactivate).toBe(true);
83
+ });
84
+ it('suspend <seat-id> --reason carries the text through verbatim', () => {
85
+ const h = handlers();
86
+ buildSeatProgram(h).parse([
87
+ 'node',
88
+ 'totem',
89
+ 'seat',
90
+ 'suspend',
91
+ 'totem-kimi',
92
+ '--reason',
93
+ 'operator ruling 2026-08-11',
94
+ ]);
95
+ expect(h.calls['seatSuspend'].mock.calls[0][0]).toBe('totem-kimi');
96
+ expect(h.calls['seatSuspend'].mock.calls[0][1].reason).toBe('operator ruling 2026-08-11');
97
+ });
98
+ it('suspend without --reason leaves reason undefined (the encouragement path)', () => {
99
+ const h = handlers();
100
+ buildSeatProgram(h).parse(['node', 'totem', 'seat', 'suspend', 'totem-kimi']);
101
+ expect(h.calls['seatSuspend'].mock.calls[0][1].reason).toBe(undefined);
102
+ });
103
+ it('remove <seat-id> --reason dispatches to the retirement verb, not suspend', () => {
104
+ const h = handlers();
105
+ buildSeatProgram(h).parse([
106
+ 'node',
107
+ 'totem',
108
+ 'seat',
109
+ 'remove',
110
+ 'totem-kimi',
111
+ '--reason',
112
+ 'stream closed',
113
+ ]);
114
+ expect(h.calls['seatRemove'].mock.calls[0][0]).toBe('totem-kimi');
115
+ expect(h.calls['seatRemove'].mock.calls[0][1].reason).toBe('stream closed');
116
+ expect(h.calls['seatSuspend']).not.toHaveBeenCalled();
117
+ });
118
+ it('list --json (flag AFTER the subcommand) arrives via optsWithGlobals', () => {
119
+ const h = handlers();
120
+ buildSeatProgram(h).parse(['node', 'totem', 'seat', 'list', '--json']);
121
+ expect(h.calls['seatList'].mock.calls[0][0].json).toBe(true);
122
+ });
123
+ it('totem --json seat list (flag BEFORE the subcommand) agrees — the #2097 collision', () => {
124
+ const h = handlers();
125
+ buildSeatProgram(h).parse(['node', 'totem', '--json', 'seat', 'list']);
126
+ expect(h.calls['seatList'].mock.calls[0][0].json).toBe(true);
127
+ });
128
+ it('list without --json leaves json undefined (human table path)', () => {
129
+ const h = handlers();
130
+ buildSeatProgram(h).parse(['node', 'totem', 'seat', 'list']);
131
+ expect(h.calls['seatList'].mock.calls[0][0].json).toBe(undefined);
132
+ });
133
+ it('group-only registration rejects an unknown seat verb instead of silently no-op-ing', () => {
134
+ const h = handlers();
135
+ const program = buildSeatProgram(h);
136
+ expect(() => program.parse(['node', 'totem', 'seat', 'frobnicate'])).toThrow();
137
+ expect(h.calls['seatAdd']).not.toHaveBeenCalled();
138
+ expect(h.calls['seatList']).not.toHaveBeenCalled();
139
+ });
140
+ it('add requires the seat-id positional', () => {
141
+ const h = handlers();
142
+ const program = buildSeatProgram(h);
143
+ expect(() => program.parse(['node', 'totem', 'seat', 'add'])).toThrow();
144
+ expect(h.calls['seatAdd']).not.toHaveBeenCalled();
145
+ });
146
+ });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,CAAC,CAAC;IAC9F,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oFAAoF,EAAE,GAAG,EAAE;QAC5F,MAAM,CAAC,GAAG,QAAQ,EAAE,CAAC;QACrB,MAAM,OAAO,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;QACpC,MAAM,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;QAC/E,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;QAClD,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;IACrD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qCAAqC,EAAE,GAAG,EAAE;QAC7C,MAAM,CAAC,GAAG,QAAQ,EAAE,CAAC;QACrB,MAAM,OAAO,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;QACpC,MAAM,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;QACxE,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;IACpD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,13 @@
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
+ export {};
13
+ //# sourceMappingURL=seat-poll-chain.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"seat-poll-chain.test.d.ts","sourceRoot":"","sources":["../../src/commands/seat-poll-chain.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG"}
@@ -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,EAAE,gBAAgB,EAAE,GAAG,MAAM,IAAI,MAAM,EAAE,EAAE,CAAC;AACxD,MAAM,KAAK,GAAG,0CAA0C,CAAC;AACzD,MAAM,QAAQ,GAAG,qCAAqC,CAAC;AAEvD,IAAI,SAAS,GAAG,EAAE,CAAC;AACnB,IAAI,IAAI,GAAG,EAAE,CAAC;AACd,IAAI,SAAsC,CAAC;AAE3C,UAAU,CAAC,GAAG,EAAE;IACd,SAAS,GAAG,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC,WA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C,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"}