@mmnto/cli 1.119.0 → 1.120.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/gemini-sessionstart-contract.test.js +50 -0
- package/dist/commands/gemini-sessionstart-contract.test.js.map +1 -1
- package/dist/commands/init-templates.d.ts +2 -2
- package/dist/commands/init-templates.d.ts.map +1 -1
- package/dist/commands/init-templates.js +102 -16
- package/dist/commands/init-templates.js.map +1 -1
- package/dist/commands/init.test.js +136 -12
- package/dist/commands/init.test.js.map +1 -1
- package/dist/commands/install-hooks.d.ts.map +1 -1
- package/dist/commands/install-hooks.js +26 -4
- package/dist/commands/install-hooks.js.map +1 -1
- package/dist/commands/install-hooks.test.js +66 -12
- package/dist/commands/install-hooks.test.js.map +1 -1
- package/dist/commands/rule.test.js +30 -0
- package/dist/commands/rule.test.js.map +1 -1
- package/package.json +2 -2
|
@@ -195,5 +195,55 @@ describe('rendered SessionStart.cjs — refresh-gh armed path stays out of the d
|
|
|
195
195
|
const envelope = JSON.parse(run.stdout);
|
|
196
196
|
expect(envelope.hookSpecificOutput.additionalContext).toMatch(/shim-out describe/);
|
|
197
197
|
}, TEST_TIMEOUT_MS);
|
|
198
|
+
// The armed leg now spawns TWO verbs from the one gate — refresh-gh plus the
|
|
199
|
+
// slice-two refresh-obligation-store (mmnto-ai/totem-status#127, sibling of
|
|
200
|
+
// mmnto-ai/totem#2556). Both must fire, and neither may reach the decision
|
|
201
|
+
// channel. POSIX-only: on win32 the extension-less spawn cannot resolve a
|
|
202
|
+
// `.cmd` shim, so the children never run there (see the sibling test above,
|
|
203
|
+
// which pins the spawn-reject-quiet branch on that platform).
|
|
204
|
+
it.skipIf(process.platform === 'win32')('arms BOTH refresh verbs from the one gate, with stdout still exactly one JSON payload', async () => {
|
|
205
|
+
fs.mkdirSync(path.join(tmpDir, '.git'));
|
|
206
|
+
const shimDir = path.join(tmpDir, 'shim');
|
|
207
|
+
writeTotemShim(shimDir);
|
|
208
|
+
const verbsPath = path.join(tmpDir, 'verbs.log');
|
|
209
|
+
const statusSh = path.join(shimDir, 'totem-status');
|
|
210
|
+
// APPEND: the two detached children land in whatever order they finish.
|
|
211
|
+
fs.writeFileSync(statusSh, `#!/bin/sh\necho "$1" >> "${verbsPath}"\necho STATUS-NOISE-OUT\necho STATUS-NOISE-ERR 1>&2\n`, 'utf-8');
|
|
212
|
+
fs.chmodSync(statusSh, 0o755);
|
|
213
|
+
const run = spawnSync(process.execPath, [hookPath], {
|
|
214
|
+
cwd: tmpDir,
|
|
215
|
+
encoding: 'utf-8',
|
|
216
|
+
timeout: SPAWN_TIMEOUT_MS,
|
|
217
|
+
input: '',
|
|
218
|
+
env: { ...process.env, PATH: shimDir, Path: shimDir },
|
|
219
|
+
});
|
|
220
|
+
if (run.error)
|
|
221
|
+
throw run.error;
|
|
222
|
+
expect(run.status).toBe(0);
|
|
223
|
+
expect(run.stdout).not.toContain('STATUS-NOISE');
|
|
224
|
+
const envelope = JSON.parse(run.stdout);
|
|
225
|
+
expect(envelope.hookSpecificOutput.hookEventName).toBe('SessionStart');
|
|
226
|
+
const readVerbs = () => {
|
|
227
|
+
try {
|
|
228
|
+
if (!fs.existsSync(verbsPath))
|
|
229
|
+
return [];
|
|
230
|
+
return fs
|
|
231
|
+
.readFileSync(verbsPath, 'utf-8')
|
|
232
|
+
.split('\n')
|
|
233
|
+
.map((line) => line.trim())
|
|
234
|
+
.filter((line) => line.length > 0)
|
|
235
|
+
.sort();
|
|
236
|
+
// totem-context: intentional [] on a read race (file mid-write) — the poll loop retries
|
|
237
|
+
}
|
|
238
|
+
catch {
|
|
239
|
+
return [];
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
const deadline = Date.now() + 5000;
|
|
243
|
+
while (Date.now() < deadline && readVerbs().length < 2) {
|
|
244
|
+
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
245
|
+
}
|
|
246
|
+
expect(readVerbs()).toEqual(['refresh-gh', 'refresh-obligation-store']);
|
|
247
|
+
}, TEST_TIMEOUT_MS);
|
|
198
248
|
});
|
|
199
249
|
//# sourceMappingURL=gemini-sessionstart-contract.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gemini-sessionstart-contract.test.js","sourceRoot":"","sources":["../../src/commands/gemini-sessionstart-contract.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,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,MAAM,QAAQ,CAAC;AAErE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAErF,MAAM,gBAAgB,GAAG,MAAM,CAAC;AAChC,MAAM,eAAe,GAAG,MAAM,CAAC;AAO/B;iEACiE;AACjE,SAAS,cAAc,CAAC,GAAW;IACjC,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACvC,EAAE,CAAC,aAAa,CACd,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,WAAW,CAAC,EAC3B,4DAA4D,EAC5D,OAAO,CACR,CAAC;IACF,MAAM,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IACnC,EAAE,CAAC,aAAa,CAAC,EAAE,EAAE,0DAA0D,EAAE,OAAO,CAAC,CAAC;IAC1F,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;AAC1B,CAAC;AAED,QAAQ,CAAC,4EAA4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AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -54,7 +54,7 @@ export declare const BARE_REF_REGEX_SOURCE = "(?<!\\b[\\w-]+/[\\w-]+)#(\\d+)(?![
|
|
|
54
54
|
* both templates start with it, so the constant stays the single source of truth.
|
|
55
55
|
*/
|
|
56
56
|
export declare const SESSION_START_MARKER = "// [totem] auto-generated";
|
|
57
|
-
export declare const GEMINI_SESSION_START = "// [totem] auto-generated \u2014 Gemini CLI SessionStart hook\n// Runs `totem describe` at the start of every Gemini CLI session to emit\n// the project-orientation banner (\"[Describe] Project: ... Lessons: N\n// Targets: N Hooks: ...\"). Matches the family-canonical pattern used by\n// totem-strategy, totem-substrate, arhgap11, and totem-status, and\n// matches the Claude-side SessionStart hook scaffolded by this same init\n// pass (mmnto-ai/totem#1884).\nconst { spawnSync } = require('child_process');\n\n// totem-status refresh-gh \u2014 GH-federation snapshot refresh (mmnto-ai/totem-status#127\n// C3 residual; tracking mmnto-ai/totem#2556). Spawn-and-forget, detached+unref, and\n// fired BEFORE the synchronous describe/orient briefings so it overlaps them: session\n// start must never block on it (mmnto-ai/totem#2059 measured ~3s of synchronous gh\n// calls here). The verb's exit-0-or-nothing contract (single-flight, atomic rename,\n// no-clobber when gh is missing) makes blind firing safe. ENOENT = the sidecar is not\n// adopted in this repo (the common non-cohort case) \u2014 zero noise; any other spawn\n// failure keeps a non-fatal stderr breadcrumb.\n// PRIMARY checkout only (.git must be a DIRECTORY): in a linked worktree .git is a\n// pointer FILE, and a detached child inheriting the worktree cwd holds a Windows\n// directory lock that breaks worktree removal; the primary's hooks + the daemon\n// cover the workspace-level snapshot (single-flight makes extra fires redundant).\n// A non-git cwd has no refresh moment at all. The stat is cwd-anchored, not a\n// walk-up: both host runtimes launch session hooks with cwd = project root, so a\n// subdirectory cwd (which would skip) does not occur in practice \u2014 and adding a\n// git walk would cost a synchronous process on the very path this block keeps free.\ntry {\n const nodePath = require('path');\n const { statSync } = require('fs');\n let primaryCheckout = false;\n try {\n primaryCheckout = statSync(nodePath.join(process.cwd(), '.git')).isDirectory();\n } catch {\n // not a git checkout (or .git unreadable) \u2014 no refresh moment here\n }\n if (primaryCheckout) {\n const { spawn } = require('child_process');\n // Observability leg (mmnto-ai/totem#2570, routed from the status seat's\n // 2026-08-03 silent no-write): under stdio:'ignore' plus the verb's\n // exit-0-or-nothing contract, a reaped or dying child leaves NO trace\n // (Windows detached is not job-object breakaway \u2014 a hook-harness\n // tree-kill takes the child mid-run). Each firing stamps a workspace-root\n // log and hands the child the same fd, so the verb's own success line\n // lands after the stamp; a stamp with nothing after it means the child\n // never finished. Log failures degrade to the previous blind firing \u2014\n // the stamp must never block or break the spawn.\n const { openSync, closeSync, appendFileSync, existsSync, writeFileSync } = require('fs');\n // REPO-LOCAL log, inside .git (falsification round: the primary-checkout\n // gate just proved .git is a directory; never tracked, dies with the\n // clone, writable wherever git itself writes, and per-repo so concurrent\n // firings from sibling repos never interleave). A workspace-parent path\n // would grow an un-gitignorable file OUTSIDE the repo tree for every\n // consumer of these published templates \u2014 including non-adopters, whose\n // ENOENT firing still stamps.\n const logPath = nodePath.join(process.cwd(), '.git', 'totem-status-refresh-hook.log');\n // Control characters are scrubbed from path-derived fields before they\n // reach the log (terminal-injection guideline: a crafted checkout path\n // must not forge stamp lines or inject terminal controls).\n const scrub = (v) => String(v).replace(/[\\x00-\\x1f\\x7f]/g, '?');\n let stdio = 'ignore';\n let logFd = null;\n try {\n try {\n // 1 MiB self-cap: the log truncates rather than growing forever.\n if (statSync(logPath).size > 1048576) writeFileSync(logPath, '');\n } catch {\n // no log yet \u2014 nothing to cap\n }\n appendFileSync(logPath, '[' + new Date().toISOString() + '] gemini spawn cwd=' + scrub(process.cwd()) + ' path-has-go-bin=' + /go[\\\\/]bin/i.test(process.env.PATH || '') + ' cwd-shadow-exe=' + existsSync(nodePath.join(process.cwd(), 'totem-status.exe')) + '\\n');\n logFd = openSync(logPath, 'a');\n stdio = ['ignore', logFd, logFd];\n } catch {\n // log unavailable \u2014 refresh still fires blind, as before\n }\n const refresh = spawn('totem-status', ['refresh-gh'], {\n detached: true,\n stdio,\n });\n refresh.on('error', (err) => {\n try {\n appendFileSync(logPath, '[' + new Date().toISOString() + '] gemini spawn-error code=' + ((err && err.code) || 'unknown') + '\\n');\n } catch {\n // log write failed \u2014 fall through to the stderr breadcrumb\n }\n if (err && err.code === 'ENOENT') return;\n process.stderr.write('[SessionStart] totem-status refresh-gh spawn failed (non-fatal): ' + (err instanceof Error ? err.message : String(err)) + '\\n');\n });\n refresh.unref();\n // The child holds its own copy of the fd from spawn time; release the parent's.\n if (logFd !== null) {\n try {\n closeSync(logFd);\n } catch {\n // nothing to release\n }\n }\n }\n} catch (err) {\n process.stderr.write('[SessionStart] totem-status refresh-gh unavailable (non-fatal): ' + (err instanceof Error ? err.message : String(err)) + '\\n');\n}\n\n// \u2500\u2500\u2500 A.3.a: mint session ID + log session_start event \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n// New with mmnto-ai/totem#2468: this template never took over the A.3.a duty\n// its Claude sibling carries, so Gemini-seat sessions had no session UUID and\n// no session_start denominator row \u2014 the selection-manifest join key and the\n// recorded-absence contract both need them. Same shape as the Claude template.\n// Fire-and-forget: a ledger failure must NOT block the briefing.\nlet mintedSessionId = null;\ntry {\n const nodePath = require('path');\n const { mkdirSync, writeFileSync, appendFileSync } = require('fs');\n const { randomUUID } = require('crypto');\n const ledgerDir = nodePath.join(process.cwd(), '.totem', 'ledger');\n mkdirSync(ledgerDir, { recursive: true });\n mintedSessionId = randomUUID();\n writeFileSync(nodePath.join(ledgerDir, '.session-id'), mintedSessionId, 'utf-8');\n const selfAgentEntry = (process.env.TOTEM_SELF_AGENT || '')\n .split(',')\n .map((s) => s.trim())\n .find((s) => s.length > 0);\n const event = {\n timestamp: new Date().toISOString(),\n type: 'session_start',\n activity_name: 'SessionStart',\n source: 'bot',\n ...(selfAgentEntry ? { agent_source: selfAgentEntry } : {}),\n justification: '',\n session_id: mintedSessionId,\n };\n appendFileSync(nodePath.join(ledgerDir, 'events.ndjson'), JSON.stringify(event) + '\\n', 'utf-8');\n} catch (err) {\n process.stderr.write(\n '[SessionStart] session-start telemetry unavailable (non-fatal): ' +\n (err instanceof Error ? err.message : String(err)) +\n '\\n',\n );\n}\n\n// Interactive Gemini ingests SessionStart CONTEXT only from the\n// hookSpecificOutput.additionalContext envelope \u2014 plain exit-0 stdout wraps as\n// systemMessage, which the interactive startup consumer never injects, so the\n// briefing was absent from model context in the primary dev flow even once\n// registered (mmnto-ai/totem#2613; leg-verified against @google/gemini-cli\n// 0.54.4). systemMessage rides alongside the envelope for the human surfaces:\n// interactive startup and /clear render it as a UI info item and -p echoes it\n// to stderr \u2014 so the briefing is VISIBLE to the human on those surfaces and\n// injected as context for the model (one payload, both audiences).\n// The Totem CLI writes its banner and diagnostics to STDERR, so capture takes\n// BOTH streams \u2014 the same seam the Claude-side template documents; a\n// stdout-only capture silently drops the describe leg (mmnto-ai/totem#2613\n// falsification round). A leg failure carries any partial stdout plus the\n// fail-soft note; exit is ALWAYS 0 (never blocks boot).\n// Per-leg 20s budgets cut the measured worst-case process exit from 60s to\n// 40s against Gemini's 60s DEFAULT_HOOK_TIMEOUT (which tree-kills at expiry;\n// no descendant inherits this hook's own streams).\nlet briefing = '';\ntry {\n const describeRun = spawnSync('totem describe', {\n shell: true,\n timeout: 20000,\n encoding: 'utf-8',\n stdio: ['ignore', 'pipe', 'pipe'],\n });\n // spawnSync sets .error (it does NOT throw) on spawn-level failure/timeout.\n briefing += describeRun.stdout || '';\n if (describeRun.error || describeRun.status !== 0) {\n const reason = describeRun.error\n ? (describeRun.error.message || String(describeRun.error))\n : ((describeRun.stderr || '').trim() || 'totem describe exited ' + describeRun.status);\n briefing += '[Totem] Briefing unavailable: ' + reason + '\\n';\n } else {\n briefing += describeRun.stderr || '';\n }\n} catch (err) {\n // Belt for a genuinely throwing spawnSync: same fail-soft note.\n briefing += '[Totem] Briefing unavailable: ' + (err instanceof Error ? err.message : String(err)) + '\\n';\n}\n\n// Selection-manifest block boundary (mmnto-ai/totem#2468): everything in\n// `briefing` up to here is the describe leg \u2014 including its fail-soft note,\n// which IS injected payload when it fires.\nconst describeBriefingEnd = briefing.length;\n\n// totem orient --session \u2014 live derived in-flight state, ADDITIVE to describe\n// (mmnto-ai/totem#2044 PR-3). Own try/catch; orient --session is itself boot-safe.\ntry {\n const orientRun = spawnSync('totem orient --session', {\n shell: true,\n timeout: 20000,\n encoding: 'utf-8',\n stdio: ['ignore', 'pipe', 'pipe'],\n });\n briefing += orientRun.stdout || '';\n if (orientRun.error || orientRun.status !== 0) {\n const orientReason = orientRun.error\n ? (orientRun.error.message || String(orientRun.error))\n : ((orientRun.stderr || '').trim() || 'totem orient exited ' + orientRun.status);\n // Boot-safe: orient is additive to describe; a failure never blocks session\n // start. The note rides the briefing (both keys) so the model and the human\n // both see the orient gap \u2014 a stderr-only note is invisible to the model\n // (CR round on this PR); the parent-stderr breadcrumb stays for hook\n // diagnostics.\n briefing += '[Totem] Orient briefing unavailable: ' + orientReason + '\\n';\n process.stderr.write('[SessionStart] orient briefing unavailable (non-fatal): ' + orientReason + '\\n');\n } else {\n briefing += orientRun.stderr || '';\n }\n} catch (err) {\n const orientMsg = err instanceof Error ? err.message : String(err);\n briefing += '[Totem] Orient briefing unavailable: ' + orientMsg + '\\n';\n process.stderr.write('[SessionStart] orient briefing unavailable (non-fatal): ' + orientMsg + '\\n');\n}\n\n// \u2500\u2500\u2500 selection manifest (mmnto-ai/totem#2468 M1) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n// Inline append mirroring the A.3.a write above \u2014 this rendered hook runs\n// standalone in consumer repos with no access to @mmnto/totem's writer. The\n// row shape is BOUND to SelectionManifestRowSchema (strict): change both in\n// the same PR; the template contract test parses this row with the real\n// schema. A zero-byte block never becomes a candidate (nothing was injected).\ntry {\n const nodePath = require('path');\n const { appendFileSync } = require('fs');\n const { createHash } = require('crypto');\n const measure = (id, content, reason) => {\n const bytes = Buffer.byteLength(content, 'utf-8');\n return {\n id,\n disposition: 'selected',\n reason,\n bytes,\n approxTokens: Math.ceil(bytes / 4),\n fingerprint: createHash('sha256').update(content, 'utf-8').digest('hex').slice(0, 16),\n };\n };\n const selfAgent = (process.env.TOTEM_SELF_AGENT || '')\n .split(',')\n .map((s) => s.trim())\n .find((s) => s.length > 0);\n const row = {\n schemaVersion: 1,\n timestamp: new Date().toISOString(),\n emitter: 'session-start',\n ...(mintedSessionId ? { session_id: mintedSessionId } : {}),\n ...(selfAgent ? { agent_source: selfAgent } : {}),\n // mmnto-ai/totem#2629: provenance disclosed on every row (ruled item 1).\n // Self-minted row \u2014 the minting seat IS this process's env read, so the\n // core conflict probe is structurally inapplicable; only the two-value\n // provenance enum rides. Mirrors senseAgentAttribution's biconditional.\n agent_source_provenance: selfAgent ? 'env' : 'absent',\n context: { template: 'gemini-managed' },\n universe: 'managed-template blocks: describe + orient --session',\n costBasis: { bytes: 'utf8-length', approxTokens: 'ceil(bytes/4) approximation' },\n candidates: [\n measure('describe', briefing.slice(0, describeBriefingEnd), 'always-injected briefing'),\n measure('orient:session-block', briefing.slice(describeBriefingEnd), 'always-injected briefing'),\n ].filter((c) => c.bytes > 0),\n warnings: [],\n };\n appendFileSync(\n nodePath.join(process.cwd(), '.totem', 'ledger', 'selection-manifests.ndjson'),\n JSON.stringify(row) + '\\n',\n 'utf-8',\n );\n} catch (err) {\n process.stderr.write(\n '[SessionStart] selection manifest unavailable (non-fatal): ' +\n (err instanceof Error ? err.message : String(err)) +\n '\\n',\n );\n}\n\nprocess.stdout.write(JSON.stringify({\n systemMessage: briefing,\n hookSpecificOutput: { hookEventName: 'SessionStart', additionalContext: briefing },\n}) + '\\n');\n// [totem] end auto-generated\n";
|
|
57
|
+
export declare const GEMINI_SESSION_START = "// [totem] auto-generated \u2014 Gemini CLI SessionStart hook\n// Runs `totem describe` at the start of every Gemini CLI session to emit\n// the project-orientation banner (\"[Describe] Project: ... Lessons: N\n// Targets: N Hooks: ...\"). Matches the family-canonical pattern used by\n// totem-strategy, totem-substrate, arhgap11, and totem-status, and\n// matches the Claude-side SessionStart hook scaffolded by this same init\n// pass (mmnto-ai/totem#1884).\nconst { spawnSync } = require('child_process');\n\n// totem-status refresh-gh \u2014 GH-federation snapshot refresh (mmnto-ai/totem-status#127\n// C3 residual; tracking mmnto-ai/totem#2556). Spawn-and-forget, detached+unref, and\n// fired BEFORE the synchronous describe/orient briefings so it overlaps them: session\n// start must never block on it (mmnto-ai/totem#2059 measured ~3s of synchronous gh\n// calls here). The verb's exit-0-or-nothing contract (single-flight, atomic rename,\n// no-clobber when gh is missing) makes blind firing safe. ENOENT = the sidecar is not\n// adopted in this repo (the common non-cohort case) \u2014 zero noise; any other spawn\n// failure keeps a non-fatal stderr breadcrumb.\n// A SECOND verb rides this same block: `totem-status refresh-obligation-store`\n// (mmnto-ai/totem-status#127 slice-two residual, sibling of mmnto-ai/totem#2556)\n// writes the durable obligation store beside the GH snapshot, so it gets the same\n// session-start moment. Same primary-checkout gate, same detached+unref spawn, same\n// inherited log fd, same ENOENT-silent arm \u2014 and each firing stamps its own `verb=`\n// field, so the log records WHICH verbs fired and in what order. That does NOT\n// restore the #2570 per-child reap discriminator: both stamps are written\n// back-to-back before either child writes, and child output carries no verb tag\n// and arrives in nondeterministic order, so a silent tail attributes only to the\n// LAST verb stamped. Reopen when the sidecar tags its own output. Blind firing\n// stays safe here too: that verb is in-process single-flight only, so it races the\n// daemon exactly the way its manual invocation already does.\n// PRIMARY checkout only (.git must be a DIRECTORY): in a linked worktree .git is a\n// pointer FILE, and a detached child inheriting the worktree cwd holds a Windows\n// directory lock that breaks worktree removal; the primary's hooks + the daemon\n// cover the workspace-level snapshot (single-flight makes extra fires redundant).\n// A non-git cwd has no refresh moment at all. The stat is cwd-anchored, not a\n// walk-up: both host runtimes launch session hooks with cwd = project root, so a\n// subdirectory cwd (which would skip) does not occur in practice \u2014 and adding a\n// git walk would cost a synchronous process on the very path this block keeps free.\ntry {\n const nodePath = require('path');\n const { statSync } = require('fs');\n let primaryCheckout = false;\n try {\n primaryCheckout = statSync(nodePath.join(process.cwd(), '.git')).isDirectory();\n } catch {\n // not a git checkout (or .git unreadable) \u2014 no refresh moment here\n }\n if (primaryCheckout) {\n const { spawn } = require('child_process');\n // Observability leg (mmnto-ai/totem#2570, routed from the status seat's\n // 2026-08-03 silent no-write): under stdio:'ignore' plus the verb's\n // exit-0-or-nothing contract, a reaped or dying child leaves NO trace\n // (Windows detached is not job-object breakaway \u2014 a hook-harness\n // tree-kill takes the child mid-run). Each firing stamps a workspace-root\n // log and hands the children the same fd, so their output lands after the\n // stamps. Measured caveat now that TWO verbs share one fd: both stamps are\n // written back-to-back before either child writes, and the children's\n // output is unlabelled and interleaves nondeterministically \u2014 so a silent\n // tail no longer discriminates per child; it attributes only to the LAST\n // verb stamped. The stamps still record which verbs fired, and in what\n // order. Log failures degrade to the previous blind firing \u2014 the stamp\n // must never block or break the spawn.\n const { openSync, closeSync, appendFileSync, existsSync, writeFileSync } = require('fs');\n // REPO-LOCAL log, inside .git (falsification round: the primary-checkout\n // gate just proved .git is a directory; never tracked, dies with the\n // clone, writable wherever git itself writes, and per-repo so concurrent\n // firings from sibling repos never interleave). A workspace-parent path\n // would grow an un-gitignorable file OUTSIDE the repo tree for every\n // consumer of these published templates \u2014 including non-adopters, whose\n // ENOENT firing still stamps.\n const logPath = nodePath.join(process.cwd(), '.git', 'totem-status-refresh-hook.log');\n // Control characters are scrubbed from path-derived fields before they\n // reach the log (terminal-injection guideline: a crafted checkout path\n // must not forge stamp lines or inject terminal controls).\n const scrub = (v) => String(v).replace(/[\\x00-\\x1f\\x7f]/g, '?');\n let stdio = 'ignore';\n let logFd = null;\n try {\n try {\n // 1 MiB self-cap: the log truncates rather than growing forever.\n if (statSync(logPath).size > 1048576) writeFileSync(logPath, '');\n } catch {\n // no log yet \u2014 nothing to cap\n }\n appendFileSync(logPath, '[' + new Date().toISOString() + '] gemini spawn cwd=' + scrub(process.cwd()) + ' path-has-go-bin=' + /go[\\\\/]bin/i.test(process.env.PATH || '') + ' cwd-shadow-exe=' + existsSync(nodePath.join(process.cwd(), 'totem-status.exe')) + ' verb=refresh-gh\\n');\n logFd = openSync(logPath, 'a');\n stdio = ['ignore', logFd, logFd];\n } catch {\n // log unavailable \u2014 refresh still fires blind, as before\n }\n const refresh = spawn('totem-status', ['refresh-gh'], {\n detached: true,\n stdio,\n });\n refresh.on('error', (err) => {\n try {\n appendFileSync(logPath, '[' + new Date().toISOString() + '] gemini spawn-error code=' + ((err && err.code) || 'unknown') + ' verb=refresh-gh\\n');\n } catch {\n // log write failed \u2014 fall through to the stderr breadcrumb\n }\n if (err && err.code === 'ENOENT') return;\n process.stderr.write('[SessionStart] totem-status refresh-gh spawn failed (non-fatal): ' + (err instanceof Error ? err.message : String(err)) + '\\n');\n });\n refresh.unref();\n // Second verb, same gate and same log fd (see the banner above). Written out\n // rather than looped so the spawn, the stamp, and the breadcrumb each carry a\n // literal verb \u2014 a reader of the generated hook (or of the log) never has to\n // resolve a variable to know which refresh fired.\n try {\n appendFileSync(logPath, '[' + new Date().toISOString() + '] gemini spawn cwd=' + scrub(process.cwd()) + ' path-has-go-bin=' + /go[\\\\/]bin/i.test(process.env.PATH || '') + ' cwd-shadow-exe=' + existsSync(nodePath.join(process.cwd(), 'totem-status.exe')) + ' verb=refresh-obligation-store\\n');\n } catch {\n // log unavailable \u2014 this verb still fires blind, exactly as the first does\n }\n const refreshStore = spawn('totem-status', ['refresh-obligation-store'], {\n detached: true,\n stdio,\n });\n refreshStore.on('error', (err) => {\n try {\n appendFileSync(logPath, '[' + new Date().toISOString() + '] gemini spawn-error code=' + ((err && err.code) || 'unknown') + ' verb=refresh-obligation-store\\n');\n } catch {\n // log write failed \u2014 fall through to the stderr breadcrumb\n }\n if (err && err.code === 'ENOENT') return;\n process.stderr.write('[SessionStart] totem-status refresh-obligation-store spawn failed (non-fatal): ' + (err instanceof Error ? err.message : String(err)) + '\\n');\n });\n refreshStore.unref();\n // Each child holds its own copy of the fd from spawn time; release the parent's\n // once BOTH are away (an early close would hand the second spawn an EBADF).\n if (logFd !== null) {\n try {\n closeSync(logFd);\n } catch {\n // nothing to release\n }\n }\n }\n} catch (err) {\n // Block-level breadcrumb: this catch covers the whole gated block, so neither\n // verb fired \u2014 it names the SIDECAR, not one verb. The per-spawn breadcrumbs\n // inside still name their own verb.\n process.stderr.write('[SessionStart] totem-status sidecar refresh unavailable (non-fatal): ' + (err instanceof Error ? err.message : String(err)) + '\\n');\n}\n\n// \u2500\u2500\u2500 A.3.a: mint session ID + log session_start event \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n// New with mmnto-ai/totem#2468: this template never took over the A.3.a duty\n// its Claude sibling carries, so Gemini-seat sessions had no session UUID and\n// no session_start denominator row \u2014 the selection-manifest join key and the\n// recorded-absence contract both need them. Same shape as the Claude template.\n// Fire-and-forget: a ledger failure must NOT block the briefing.\nlet mintedSessionId = null;\ntry {\n const nodePath = require('path');\n const { mkdirSync, writeFileSync, appendFileSync } = require('fs');\n const { randomUUID } = require('crypto');\n const ledgerDir = nodePath.join(process.cwd(), '.totem', 'ledger');\n mkdirSync(ledgerDir, { recursive: true });\n mintedSessionId = randomUUID();\n writeFileSync(nodePath.join(ledgerDir, '.session-id'), mintedSessionId, 'utf-8');\n const selfAgentEntry = (process.env.TOTEM_SELF_AGENT || '')\n .split(',')\n .map((s) => s.trim())\n .find((s) => s.length > 0);\n const event = {\n timestamp: new Date().toISOString(),\n type: 'session_start',\n activity_name: 'SessionStart',\n source: 'bot',\n ...(selfAgentEntry ? { agent_source: selfAgentEntry } : {}),\n justification: '',\n session_id: mintedSessionId,\n };\n appendFileSync(nodePath.join(ledgerDir, 'events.ndjson'), JSON.stringify(event) + '\\n', 'utf-8');\n} catch (err) {\n process.stderr.write(\n '[SessionStart] session-start telemetry unavailable (non-fatal): ' +\n (err instanceof Error ? err.message : String(err)) +\n '\\n',\n );\n}\n\n// Interactive Gemini ingests SessionStart CONTEXT only from the\n// hookSpecificOutput.additionalContext envelope \u2014 plain exit-0 stdout wraps as\n// systemMessage, which the interactive startup consumer never injects, so the\n// briefing was absent from model context in the primary dev flow even once\n// registered (mmnto-ai/totem#2613; leg-verified against @google/gemini-cli\n// 0.54.4). systemMessage rides alongside the envelope for the human surfaces:\n// interactive startup and /clear render it as a UI info item and -p echoes it\n// to stderr \u2014 so the briefing is VISIBLE to the human on those surfaces and\n// injected as context for the model (one payload, both audiences).\n// The Totem CLI writes its banner and diagnostics to STDERR, so capture takes\n// BOTH streams \u2014 the same seam the Claude-side template documents; a\n// stdout-only capture silently drops the describe leg (mmnto-ai/totem#2613\n// falsification round). A leg failure carries any partial stdout plus the\n// fail-soft note; exit is ALWAYS 0 (never blocks boot).\n// Per-leg 20s budgets cut the measured worst-case process exit from 60s to\n// 40s against Gemini's 60s DEFAULT_HOOK_TIMEOUT (which tree-kills at expiry;\n// no descendant inherits this hook's own streams).\nlet briefing = '';\ntry {\n const describeRun = spawnSync('totem describe', {\n shell: true,\n timeout: 20000,\n encoding: 'utf-8',\n stdio: ['ignore', 'pipe', 'pipe'],\n });\n // spawnSync sets .error (it does NOT throw) on spawn-level failure/timeout.\n briefing += describeRun.stdout || '';\n if (describeRun.error || describeRun.status !== 0) {\n const reason = describeRun.error\n ? (describeRun.error.message || String(describeRun.error))\n : ((describeRun.stderr || '').trim() || 'totem describe exited ' + describeRun.status);\n briefing += '[Totem] Briefing unavailable: ' + reason + '\\n';\n } else {\n briefing += describeRun.stderr || '';\n }\n} catch (err) {\n // Belt for a genuinely throwing spawnSync: same fail-soft note.\n briefing += '[Totem] Briefing unavailable: ' + (err instanceof Error ? err.message : String(err)) + '\\n';\n}\n\n// Selection-manifest block boundary (mmnto-ai/totem#2468): everything in\n// `briefing` up to here is the describe leg \u2014 including its fail-soft note,\n// which IS injected payload when it fires.\nconst describeBriefingEnd = briefing.length;\n\n// totem orient --session \u2014 live derived in-flight state, ADDITIVE to describe\n// (mmnto-ai/totem#2044 PR-3). Own try/catch; orient --session is itself boot-safe.\ntry {\n const orientRun = spawnSync('totem orient --session', {\n shell: true,\n timeout: 20000,\n encoding: 'utf-8',\n stdio: ['ignore', 'pipe', 'pipe'],\n });\n briefing += orientRun.stdout || '';\n if (orientRun.error || orientRun.status !== 0) {\n const orientReason = orientRun.error\n ? (orientRun.error.message || String(orientRun.error))\n : ((orientRun.stderr || '').trim() || 'totem orient exited ' + orientRun.status);\n // Boot-safe: orient is additive to describe; a failure never blocks session\n // start. The note rides the briefing (both keys) so the model and the human\n // both see the orient gap \u2014 a stderr-only note is invisible to the model\n // (CR round on this PR); the parent-stderr breadcrumb stays for hook\n // diagnostics.\n briefing += '[Totem] Orient briefing unavailable: ' + orientReason + '\\n';\n process.stderr.write('[SessionStart] orient briefing unavailable (non-fatal): ' + orientReason + '\\n');\n } else {\n briefing += orientRun.stderr || '';\n }\n} catch (err) {\n const orientMsg = err instanceof Error ? err.message : String(err);\n briefing += '[Totem] Orient briefing unavailable: ' + orientMsg + '\\n';\n process.stderr.write('[SessionStart] orient briefing unavailable (non-fatal): ' + orientMsg + '\\n');\n}\n\n// \u2500\u2500\u2500 selection manifest (mmnto-ai/totem#2468 M1) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n// Inline append mirroring the A.3.a write above \u2014 this rendered hook runs\n// standalone in consumer repos with no access to @mmnto/totem's writer. The\n// row shape is BOUND to SelectionManifestRowSchema (strict): change both in\n// the same PR; the template contract test parses this row with the real\n// schema. A zero-byte block never becomes a candidate (nothing was injected).\ntry {\n const nodePath = require('path');\n const { appendFileSync } = require('fs');\n const { createHash } = require('crypto');\n const measure = (id, content, reason) => {\n const bytes = Buffer.byteLength(content, 'utf-8');\n return {\n id,\n disposition: 'selected',\n reason,\n bytes,\n approxTokens: Math.ceil(bytes / 4),\n fingerprint: createHash('sha256').update(content, 'utf-8').digest('hex').slice(0, 16),\n };\n };\n const selfAgent = (process.env.TOTEM_SELF_AGENT || '')\n .split(',')\n .map((s) => s.trim())\n .find((s) => s.length > 0);\n const row = {\n schemaVersion: 1,\n timestamp: new Date().toISOString(),\n emitter: 'session-start',\n ...(mintedSessionId ? { session_id: mintedSessionId } : {}),\n ...(selfAgent ? { agent_source: selfAgent } : {}),\n // mmnto-ai/totem#2629: provenance disclosed on every row (ruled item 1).\n // Self-minted row \u2014 the minting seat IS this process's env read, so the\n // core conflict probe is structurally inapplicable; only the two-value\n // provenance enum rides. Mirrors senseAgentAttribution's biconditional.\n agent_source_provenance: selfAgent ? 'env' : 'absent',\n context: { template: 'gemini-managed' },\n universe: 'managed-template blocks: describe + orient --session',\n costBasis: { bytes: 'utf8-length', approxTokens: 'ceil(bytes/4) approximation' },\n candidates: [\n measure('describe', briefing.slice(0, describeBriefingEnd), 'always-injected briefing'),\n measure('orient:session-block', briefing.slice(describeBriefingEnd), 'always-injected briefing'),\n ].filter((c) => c.bytes > 0),\n warnings: [],\n };\n appendFileSync(\n nodePath.join(process.cwd(), '.totem', 'ledger', 'selection-manifests.ndjson'),\n JSON.stringify(row) + '\\n',\n 'utf-8',\n );\n} catch (err) {\n process.stderr.write(\n '[SessionStart] selection manifest unavailable (non-fatal): ' +\n (err instanceof Error ? err.message : String(err)) +\n '\\n',\n );\n}\n\nprocess.stdout.write(JSON.stringify({\n systemMessage: briefing,\n hookSpecificOutput: { hookEventName: 'SessionStart', additionalContext: briefing },\n}) + '\\n');\n// [totem] end auto-generated\n";
|
|
58
58
|
export declare const GEMINI_BEFORE_TOOL: string;
|
|
59
59
|
export declare const GEMINI_SKILL = "<!-- [totem] auto-generated \u2014 Totem Architect skill -->\n# Totem Architect\n\nBefore designing, planning, or implementing features, query the project's memory index for relevant context:\n\n1. Use the `search_knowledge` MCP tool with a query describing what you're about to build.\n2. Review returned lessons, specs, and code patterns before writing any code.\n3. If you discover a trap or architectural constraint, factor it into your design.\n\nThis ensures you build on existing knowledge rather than repeating past mistakes.\n";
|
|
60
60
|
export declare const CLAUDE_SHIELD_GATE = "// [totem] auto-generated \u2014 Claude Code review gate hook\n// Intercepts git push/commit to run `totem review` before proceeding.\nconst { execSync } = require('child_process');\n\nconst input = process.env.TOOL_INPUT || '';\nif (/\bgits+(push|commit)\b/.test(input)) {\n try {\n execSync('totem lint', { encoding: 'utf-8', timeout: 60000, stdio: 'inherit' });\n } catch (err) {\n process.exit(1);\n }\n}\n";
|
|
@@ -73,7 +73,7 @@ export declare const CLAUDE_PREWRITESHIELD_ENTRY: {
|
|
|
73
73
|
command: string;
|
|
74
74
|
}[];
|
|
75
75
|
};
|
|
76
|
-
export declare const CLAUDE_SESSION_START = "// [totem] auto-generated \u2014 Claude Code SessionStart hook\n// Runs `@mmnto/cli describe` at the start of every Claude Code session.\n// Mirrors `.gemini/hooks/SessionStart.cjs`. `.cjs` extension because\n// package.json may have \"type\": \"module\" \u2014 Claude Code execs hooks via\n// plain `node`, which would otherwise treat `.js` as ESM.\n//\n// A.3.a: mints a session UUID, persists to .totem/ledger/.session-id,\n// and appends a `session_start` event to .totem/ledger/events.ndjson\n// BEFORE running `totem describe`. Subsequent MCP calls within the\n// session correlate via session_id (ADR-029 \u00A7 Session Heuristic).\n// Fire-and-forget: any ledger failure must NOT block the briefing.\nconst { spawnSync } = require('child_process');\nconst { existsSync, mkdirSync, writeFileSync, appendFileSync } = require('fs');\nconst { randomUUID } = require('crypto');\nconst { join } = require('path');\n\n// \u2500\u2500\u2500 A.3.a: mint session ID + log session_start event \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n// Hoisted so the selection-manifest row below (mmnto-ai/totem#2468) can carry\n// the same session UUID as its join key.\nlet mintedSessionId = null;\ntry {\n const ledgerDir = join(process.cwd(), '.totem', 'ledger');\n mkdirSync(ledgerDir, { recursive: true });\n const sessionId = randomUUID();\n mintedSessionId = sessionId;\n writeFileSync(join(ledgerDir, '.session-id'), sessionId, 'utf-8');\n // Amended ADR-078 (2026-07-15): agent_source is the env-carried seat-id\n // (TOTEM_SELF_AGENT, first non-empty comma entry), never a vendor class\n // ('claude' has no reverse projection to a seat). Omitted entirely when\n // the env var is absent: stamp absence, never guess (Tenet 4). The parse\n // deliberately mirrors deriveSearchLogAttribution (packages/mcp/src/\n // search-log.ts) and parseEnvAgentList (packages/core/src/\n // orchestration-resolver.ts) \u2014 inlined because this rendered .cjs hook\n // runs standalone in consumer repos with no access to those modules; if\n // the shared parse semantics change, change this template in the same PR.\n const selfAgent = (process.env.TOTEM_SELF_AGENT || '')\n .split(',')\n .map((s) => s.trim())\n .find((s) => s.length > 0);\n const event = {\n timestamp: new Date().toISOString(),\n type: 'session_start',\n activity_name: 'SessionStart',\n source: 'bot',\n ...(selfAgent ? { agent_source: selfAgent } : {}),\n justification: '',\n session_id: sessionId,\n };\n appendFileSync(join(ledgerDir, 'events.ndjson'), JSON.stringify(event) + '\\n', 'utf-8');\n} catch (err) {\n // Fire-and-forget; ledger failures must not block the briefing. A lightweight\n // stderr breadcrumb makes hook misconfigurations diagnosable in consumer repos\n // (CR R1 catch \u2014 empty catch suppresses all signal). stderr (not stdout) so\n // the briefing path remains clean for Claude's prompt context.\n process.stderr.write(\n '[SessionStart] Session-start telemetry unavailable (non-fatal): ' +\n (err instanceof Error ? err.message : String(err)) +\n '\\n',\n );\n}\n\n// \u2500\u2500\u2500 totem-status refresh-gh \u2014 GH-federation snapshot refresh \u2500\u2500\u2500\n// (mmnto-ai/totem-status#127 C3 residual; tracking mmnto-ai/totem#2556.)\n// Spawn-and-forget, detached+unref, fired BEFORE the synchronous describe/orient\n// briefings so it overlaps them: session start must never block on it\n// (mmnto-ai/totem#2059 measured ~3s of synchronous gh calls here). The verb's\n// exit-0-or-nothing contract (single-flight, atomic rename, no-clobber when gh\n// is missing) makes blind firing safe. ENOENT = the sidecar is not adopted in\n// this repo (the common non-cohort case) \u2014 zero noise; any other spawn failure\n// keeps a non-fatal stderr breadcrumb.\n// PRIMARY checkout only (.git must be a DIRECTORY): in a linked worktree .git is a\n// pointer FILE, and a detached child inheriting the worktree cwd holds a Windows\n// directory lock that breaks worktree removal; the primary's hooks + the daemon\n// cover the workspace-level snapshot (single-flight makes extra fires redundant).\n// A non-git cwd has no refresh moment at all. The stat is cwd-anchored, not a\n// walk-up: both host runtimes launch session hooks with cwd = project root, so a\n// subdirectory cwd (which would skip) does not occur in practice \u2014 and adding a\n// git walk would cost a synchronous process on the very path this block keeps free.\ntry {\n const nodePath = require('path');\n const { statSync } = require('fs');\n let primaryCheckout = false;\n try {\n primaryCheckout = statSync(nodePath.join(process.cwd(), '.git')).isDirectory();\n } catch {\n // not a git checkout (or .git unreadable) \u2014 no refresh moment here\n }\n if (primaryCheckout) {\n const { spawn } = require('child_process');\n // Observability leg (mmnto-ai/totem#2570, routed from the status seat's\n // 2026-08-03 silent no-write): under stdio:'ignore' plus the verb's\n // exit-0-or-nothing contract, a reaped or dying child leaves NO trace\n // (Windows detached is not job-object breakaway \u2014 a hook-harness\n // tree-kill takes the child mid-run). Each firing stamps a workspace-root\n // log and hands the child the same fd, so the verb's own success line\n // lands after the stamp; a stamp with nothing after it means the child\n // never finished. Log failures degrade to the previous blind firing \u2014\n // the stamp must never block or break the spawn.\n const { openSync, closeSync, appendFileSync, existsSync, writeFileSync } = require('fs');\n // REPO-LOCAL log, inside .git (falsification round: the primary-checkout\n // gate just proved .git is a directory; never tracked, dies with the\n // clone, writable wherever git itself writes, and per-repo so concurrent\n // firings from sibling repos never interleave). A workspace-parent path\n // would grow an un-gitignorable file OUTSIDE the repo tree for every\n // consumer of these published templates \u2014 including non-adopters, whose\n // ENOENT firing still stamps.\n const logPath = nodePath.join(process.cwd(), '.git', 'totem-status-refresh-hook.log');\n // Control characters are scrubbed from path-derived fields before they\n // reach the log (terminal-injection guideline: a crafted checkout path\n // must not forge stamp lines or inject terminal controls).\n const scrub = (v) => String(v).replace(/[\\x00-\\x1f\\x7f]/g, '?');\n let stdio = 'ignore';\n let logFd = null;\n try {\n try {\n // 1 MiB self-cap: the log truncates rather than growing forever.\n if (statSync(logPath).size > 1048576) writeFileSync(logPath, '');\n } catch {\n // no log yet \u2014 nothing to cap\n }\n appendFileSync(logPath, '[' + new Date().toISOString() + '] claude spawn cwd=' + scrub(process.cwd()) + ' path-has-go-bin=' + /go[\\\\/]bin/i.test(process.env.PATH || '') + ' cwd-shadow-exe=' + existsSync(nodePath.join(process.cwd(), 'totem-status.exe')) + '\\n');\n logFd = openSync(logPath, 'a');\n stdio = ['ignore', logFd, logFd];\n } catch {\n // log unavailable \u2014 refresh still fires blind, as before\n }\n const refresh = spawn('totem-status', ['refresh-gh'], {\n detached: true,\n stdio,\n });\n refresh.on('error', (err) => {\n try {\n appendFileSync(logPath, '[' + new Date().toISOString() + '] claude spawn-error code=' + ((err && err.code) || 'unknown') + '\\n');\n } catch {\n // log write failed \u2014 fall through to the stderr breadcrumb\n }\n if (err && err.code === 'ENOENT') return;\n process.stderr.write('[SessionStart] totem-status refresh-gh spawn failed (non-fatal): ' + (err instanceof Error ? err.message : String(err)) + '\\n');\n });\n refresh.unref();\n // The child holds its own copy of the fd from spawn time; release the parent's.\n if (logFd !== null) {\n try {\n closeSync(logFd);\n } catch {\n // nothing to release\n }\n }\n }\n} catch (err) {\n process.stderr.write('[SessionStart] totem-status refresh-gh unavailable (non-fatal): ' + (err instanceof Error ? err.message : String(err)) + '\\n');\n}\n\n// \u2500\u2500\u2500 totem describe briefing (existing behavior) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n// Captured (mmnto-ai/totem#2468): the injected block is the selection-manifest\n// candidate below \u2014 the not-installed notice is a notice, not a briefing.\nlet describeText = '';\ntry {\n const cliPath = join(process.cwd(), 'node_modules', '@mmnto', 'cli', 'dist', 'index.js');\n if (existsSync(cliPath)) {\n const result = spawnSync(process.execPath, [cliPath, 'describe'], {\n encoding: 'utf-8',\n timeout: 30000,\n });\n if (result.error) {\n throw result.error;\n }\n // Totem CLI writes diagnostic output to stderr; route to stdout so the\n // session-start context lands in Claude's prompt rather than user-visible noise.\n describeText = (result.stdout || '') + (result.stderr || '');\n process.stdout.write(describeText);\n } else {\n process.stdout.write(\n '[Totem] @mmnto/cli not installed. Run `pnpm install` (or your package manager equivalent) to enable session-start orientation.\\n',\n );\n }\n} catch (err) {\n process.stdout.write(\n '[Totem] Briefing unavailable: ' +\n (err instanceof Error ? err.message : String(err)) +\n '\\n',\n );\n}\n\n// \u2500\u2500\u2500 totem orient --session \u2014 live derived in-flight state (mmnto-ai/totem#2044 PR-3) \u2500\u2500\n// ADDITIVE to describe (Tenet 13: describe = static identity sensor \u2014 scope/tier/\n// counts; orient = live in-flight sensor \u2014 open PRs/issues/board/freeze). Append,\n// never replace. Its OWN try/catch so an orient failure never disturbs the describe\n// briefing or the boot; `orient --session` is itself boot-safe (emits nothing when\n// nothing is high-signal, never exits non-zero, degrades to honest \"could not derive\").\nlet orientText = '';\ntry {\n const orientCliPath = join(process.cwd(), 'node_modules', '@mmnto', 'cli', 'dist', 'index.js');\n if (existsSync(orientCliPath)) {\n const orientResult = spawnSync(process.execPath, [orientCliPath, 'orient', '--session'], {\n encoding: 'utf-8',\n timeout: 30000,\n });\n // spawnSync sets .error (it does NOT throw) on a spawn-level failure; re-throw so\n // it surfaces through the catch breadcrumb below rather than writing '' silently.\n if (orientResult.error) {\n throw orientResult.error;\n }\n orientText = (orientResult.stdout || '') + (orientResult.stderr || '');\n process.stdout.write(orientText);\n }\n} catch (err) {\n // Boot-safe: orient is additive to describe (already emitted), so a failure never\n // blocks session start \u2014 but surface a NON-fatal breadcrumb to stderr (not stdout,\n // to keep the prompt clean) for debuggability rather than swallowing silently.\n process.stderr.write(\n '[SessionStart] orient briefing unavailable (non-fatal): ' +\n (err instanceof Error ? err.message : String(err)) +\n '\\n',\n );\n}\n\n// \u2500\u2500\u2500 selection manifest (mmnto-ai/totem#2468 M1) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n// Inline append mirroring the session_start write above \u2014 this rendered hook\n// runs standalone in consumer repos with no access to @mmnto/totem's writer.\n// The row shape is BOUND to SelectionManifestRowSchema (strict): change both\n// in the same PR; the template contract test parses this row with the real\n// schema. A zero-byte block never becomes a candidate (nothing was injected).\ntry {\n const { createHash } = require('crypto');\n const measure = (id, content, reason) => {\n const bytes = Buffer.byteLength(content, 'utf-8');\n return {\n id,\n disposition: 'selected',\n reason,\n bytes,\n approxTokens: Math.ceil(bytes / 4),\n fingerprint: createHash('sha256').update(content, 'utf-8').digest('hex').slice(0, 16),\n };\n };\n const selfAgent = (process.env.TOTEM_SELF_AGENT || '')\n .split(',')\n .map((s) => s.trim())\n .find((s) => s.length > 0);\n const row = {\n schemaVersion: 1,\n timestamp: new Date().toISOString(),\n emitter: 'session-start',\n ...(mintedSessionId ? { session_id: mintedSessionId } : {}),\n ...(selfAgent ? { agent_source: selfAgent } : {}),\n // mmnto-ai/totem#2629: provenance disclosed on every row (ruled item 1).\n // Self-minted row \u2014 the minting seat IS this process's env read, so the\n // core conflict probe is structurally inapplicable; only the two-value\n // provenance enum rides. Mirrors senseAgentAttribution's biconditional.\n agent_source_provenance: selfAgent ? 'env' : 'absent',\n context: { template: 'claude-managed' },\n universe: 'managed-template blocks: describe + orient --session',\n costBasis: { bytes: 'utf8-length', approxTokens: 'ceil(bytes/4) approximation' },\n candidates: [\n measure('describe', describeText, 'always-injected briefing'),\n measure('orient:session-block', orientText, 'always-injected briefing'),\n ].filter((c) => c.bytes > 0),\n warnings: [],\n };\n appendFileSync(\n join(process.cwd(), '.totem', 'ledger', 'selection-manifests.ndjson'),\n JSON.stringify(row) + '\\n',\n 'utf-8',\n );\n} catch (err) {\n process.stderr.write(\n '[SessionStart] selection manifest unavailable (non-fatal): ' +\n (err instanceof Error ? err.message : String(err)) +\n '\\n',\n );\n}\n// [totem] end auto-generated\n";
|
|
76
|
+
export declare const CLAUDE_SESSION_START = "// [totem] auto-generated \u2014 Claude Code SessionStart hook\n// Runs `@mmnto/cli describe` at the start of every Claude Code session.\n// Mirrors `.gemini/hooks/SessionStart.cjs`. `.cjs` extension because\n// package.json may have \"type\": \"module\" \u2014 Claude Code execs hooks via\n// plain `node`, which would otherwise treat `.js` as ESM.\n//\n// A.3.a: mints a session UUID, persists to .totem/ledger/.session-id,\n// and appends a `session_start` event to .totem/ledger/events.ndjson\n// BEFORE running `totem describe`. Subsequent MCP calls within the\n// session correlate via session_id (ADR-029 \u00A7 Session Heuristic).\n// Fire-and-forget: any ledger failure must NOT block the briefing.\nconst { spawnSync } = require('child_process');\nconst { existsSync, mkdirSync, writeFileSync, appendFileSync } = require('fs');\nconst { randomUUID } = require('crypto');\nconst { join } = require('path');\n\n// \u2500\u2500\u2500 A.3.a: mint session ID + log session_start event \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n// Hoisted so the selection-manifest row below (mmnto-ai/totem#2468) can carry\n// the same session UUID as its join key.\nlet mintedSessionId = null;\ntry {\n const ledgerDir = join(process.cwd(), '.totem', 'ledger');\n mkdirSync(ledgerDir, { recursive: true });\n const sessionId = randomUUID();\n mintedSessionId = sessionId;\n writeFileSync(join(ledgerDir, '.session-id'), sessionId, 'utf-8');\n // Amended ADR-078 (2026-07-15): agent_source is the env-carried seat-id\n // (TOTEM_SELF_AGENT, first non-empty comma entry), never a vendor class\n // ('claude' has no reverse projection to a seat). Omitted entirely when\n // the env var is absent: stamp absence, never guess (Tenet 4). The parse\n // deliberately mirrors deriveSearchLogAttribution (packages/mcp/src/\n // search-log.ts) and parseEnvAgentList (packages/core/src/\n // orchestration-resolver.ts) \u2014 inlined because this rendered .cjs hook\n // runs standalone in consumer repos with no access to those modules; if\n // the shared parse semantics change, change this template in the same PR.\n const selfAgent = (process.env.TOTEM_SELF_AGENT || '')\n .split(',')\n .map((s) => s.trim())\n .find((s) => s.length > 0);\n const event = {\n timestamp: new Date().toISOString(),\n type: 'session_start',\n activity_name: 'SessionStart',\n source: 'bot',\n ...(selfAgent ? { agent_source: selfAgent } : {}),\n justification: '',\n session_id: sessionId,\n };\n appendFileSync(join(ledgerDir, 'events.ndjson'), JSON.stringify(event) + '\\n', 'utf-8');\n} catch (err) {\n // Fire-and-forget; ledger failures must not block the briefing. A lightweight\n // stderr breadcrumb makes hook misconfigurations diagnosable in consumer repos\n // (CR R1 catch \u2014 empty catch suppresses all signal). stderr (not stdout) so\n // the briefing path remains clean for Claude's prompt context.\n process.stderr.write(\n '[SessionStart] Session-start telemetry unavailable (non-fatal): ' +\n (err instanceof Error ? err.message : String(err)) +\n '\\n',\n );\n}\n\n// \u2500\u2500\u2500 totem-status refresh-gh \u2014 GH-federation snapshot refresh \u2500\u2500\u2500\n// (mmnto-ai/totem-status#127 C3 residual; tracking mmnto-ai/totem#2556.)\n// Spawn-and-forget, detached+unref, fired BEFORE the synchronous describe/orient\n// briefings so it overlaps them: session start must never block on it\n// (mmnto-ai/totem#2059 measured ~3s of synchronous gh calls here). The verb's\n// exit-0-or-nothing contract (single-flight, atomic rename, no-clobber when gh\n// is missing) makes blind firing safe. ENOENT = the sidecar is not adopted in\n// this repo (the common non-cohort case) \u2014 zero noise; any other spawn failure\n// keeps a non-fatal stderr breadcrumb.\n// A SECOND verb rides this same block: `totem-status refresh-obligation-store`\n// (mmnto-ai/totem-status#127 slice-two residual, sibling of mmnto-ai/totem#2556)\n// writes the durable obligation store beside the GH snapshot, so it gets the same\n// session-start moment. Same primary-checkout gate, same detached+unref spawn, same\n// inherited log fd, same ENOENT-silent arm \u2014 and each firing stamps its own `verb=`\n// field, so the log records WHICH verbs fired and in what order. That does NOT\n// restore the #2570 per-child reap discriminator: both stamps are written\n// back-to-back before either child writes, and child output carries no verb tag\n// and arrives in nondeterministic order, so a silent tail attributes only to the\n// LAST verb stamped. Reopen when the sidecar tags its own output. Blind firing\n// stays safe here too: that verb is in-process single-flight only, so it races the\n// daemon exactly the way its manual invocation already does.\n// PRIMARY checkout only (.git must be a DIRECTORY): in a linked worktree .git is a\n// pointer FILE, and a detached child inheriting the worktree cwd holds a Windows\n// directory lock that breaks worktree removal; the primary's hooks + the daemon\n// cover the workspace-level snapshot (single-flight makes extra fires redundant).\n// A non-git cwd has no refresh moment at all. The stat is cwd-anchored, not a\n// walk-up: both host runtimes launch session hooks with cwd = project root, so a\n// subdirectory cwd (which would skip) does not occur in practice \u2014 and adding a\n// git walk would cost a synchronous process on the very path this block keeps free.\ntry {\n const nodePath = require('path');\n const { statSync } = require('fs');\n let primaryCheckout = false;\n try {\n primaryCheckout = statSync(nodePath.join(process.cwd(), '.git')).isDirectory();\n } catch {\n // not a git checkout (or .git unreadable) \u2014 no refresh moment here\n }\n if (primaryCheckout) {\n const { spawn } = require('child_process');\n // Observability leg (mmnto-ai/totem#2570, routed from the status seat's\n // 2026-08-03 silent no-write): under stdio:'ignore' plus the verb's\n // exit-0-or-nothing contract, a reaped or dying child leaves NO trace\n // (Windows detached is not job-object breakaway \u2014 a hook-harness\n // tree-kill takes the child mid-run). Each firing stamps a workspace-root\n // log and hands the children the same fd, so their output lands after the\n // stamps. Measured caveat now that TWO verbs share one fd: both stamps are\n // written back-to-back before either child writes, and the children's\n // output is unlabelled and interleaves nondeterministically \u2014 so a silent\n // tail no longer discriminates per child; it attributes only to the LAST\n // verb stamped. The stamps still record which verbs fired, and in what\n // order. Log failures degrade to the previous blind firing \u2014 the stamp\n // must never block or break the spawn.\n const { openSync, closeSync, appendFileSync, existsSync, writeFileSync } = require('fs');\n // REPO-LOCAL log, inside .git (falsification round: the primary-checkout\n // gate just proved .git is a directory; never tracked, dies with the\n // clone, writable wherever git itself writes, and per-repo so concurrent\n // firings from sibling repos never interleave). A workspace-parent path\n // would grow an un-gitignorable file OUTSIDE the repo tree for every\n // consumer of these published templates \u2014 including non-adopters, whose\n // ENOENT firing still stamps.\n const logPath = nodePath.join(process.cwd(), '.git', 'totem-status-refresh-hook.log');\n // Control characters are scrubbed from path-derived fields before they\n // reach the log (terminal-injection guideline: a crafted checkout path\n // must not forge stamp lines or inject terminal controls).\n const scrub = (v) => String(v).replace(/[\\x00-\\x1f\\x7f]/g, '?');\n let stdio = 'ignore';\n let logFd = null;\n try {\n try {\n // 1 MiB self-cap: the log truncates rather than growing forever.\n if (statSync(logPath).size > 1048576) writeFileSync(logPath, '');\n } catch {\n // no log yet \u2014 nothing to cap\n }\n appendFileSync(logPath, '[' + new Date().toISOString() + '] claude spawn cwd=' + scrub(process.cwd()) + ' path-has-go-bin=' + /go[\\\\/]bin/i.test(process.env.PATH || '') + ' cwd-shadow-exe=' + existsSync(nodePath.join(process.cwd(), 'totem-status.exe')) + ' verb=refresh-gh\\n');\n logFd = openSync(logPath, 'a');\n stdio = ['ignore', logFd, logFd];\n } catch {\n // log unavailable \u2014 refresh still fires blind, as before\n }\n const refresh = spawn('totem-status', ['refresh-gh'], {\n detached: true,\n stdio,\n });\n refresh.on('error', (err) => {\n try {\n appendFileSync(logPath, '[' + new Date().toISOString() + '] claude spawn-error code=' + ((err && err.code) || 'unknown') + ' verb=refresh-gh\\n');\n } catch {\n // log write failed \u2014 fall through to the stderr breadcrumb\n }\n if (err && err.code === 'ENOENT') return;\n process.stderr.write('[SessionStart] totem-status refresh-gh spawn failed (non-fatal): ' + (err instanceof Error ? err.message : String(err)) + '\\n');\n });\n refresh.unref();\n // Second verb, same gate and same log fd (see the banner above). Written out\n // rather than looped so the spawn, the stamp, and the breadcrumb each carry a\n // literal verb \u2014 a reader of the generated hook (or of the log) never has to\n // resolve a variable to know which refresh fired.\n try {\n appendFileSync(logPath, '[' + new Date().toISOString() + '] claude spawn cwd=' + scrub(process.cwd()) + ' path-has-go-bin=' + /go[\\\\/]bin/i.test(process.env.PATH || '') + ' cwd-shadow-exe=' + existsSync(nodePath.join(process.cwd(), 'totem-status.exe')) + ' verb=refresh-obligation-store\\n');\n } catch {\n // log unavailable \u2014 this verb still fires blind, exactly as the first does\n }\n const refreshStore = spawn('totem-status', ['refresh-obligation-store'], {\n detached: true,\n stdio,\n });\n refreshStore.on('error', (err) => {\n try {\n appendFileSync(logPath, '[' + new Date().toISOString() + '] claude spawn-error code=' + ((err && err.code) || 'unknown') + ' verb=refresh-obligation-store\\n');\n } catch {\n // log write failed \u2014 fall through to the stderr breadcrumb\n }\n if (err && err.code === 'ENOENT') return;\n process.stderr.write('[SessionStart] totem-status refresh-obligation-store spawn failed (non-fatal): ' + (err instanceof Error ? err.message : String(err)) + '\\n');\n });\n refreshStore.unref();\n // Each child holds its own copy of the fd from spawn time; release the parent's\n // once BOTH are away (an early close would hand the second spawn an EBADF).\n if (logFd !== null) {\n try {\n closeSync(logFd);\n } catch {\n // nothing to release\n }\n }\n }\n} catch (err) {\n // Block-level breadcrumb: this catch covers the whole gated block, so neither\n // verb fired \u2014 it names the SIDECAR, not one verb. The per-spawn breadcrumbs\n // inside still name their own verb.\n process.stderr.write('[SessionStart] totem-status sidecar refresh unavailable (non-fatal): ' + (err instanceof Error ? err.message : String(err)) + '\\n');\n}\n\n// \u2500\u2500\u2500 totem describe briefing (existing behavior) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n// Captured (mmnto-ai/totem#2468): the injected block is the selection-manifest\n// candidate below \u2014 the not-installed notice is a notice, not a briefing.\nlet describeText = '';\ntry {\n const cliPath = join(process.cwd(), 'node_modules', '@mmnto', 'cli', 'dist', 'index.js');\n if (existsSync(cliPath)) {\n const result = spawnSync(process.execPath, [cliPath, 'describe'], {\n encoding: 'utf-8',\n timeout: 30000,\n });\n if (result.error) {\n throw result.error;\n }\n // Totem CLI writes diagnostic output to stderr; route to stdout so the\n // session-start context lands in Claude's prompt rather than user-visible noise.\n describeText = (result.stdout || '') + (result.stderr || '');\n process.stdout.write(describeText);\n } else {\n process.stdout.write(\n '[Totem] @mmnto/cli not installed. Run `pnpm install` (or your package manager equivalent) to enable session-start orientation.\\n',\n );\n }\n} catch (err) {\n process.stdout.write(\n '[Totem] Briefing unavailable: ' +\n (err instanceof Error ? err.message : String(err)) +\n '\\n',\n );\n}\n\n// \u2500\u2500\u2500 totem orient --session \u2014 live derived in-flight state (mmnto-ai/totem#2044 PR-3) \u2500\u2500\n// ADDITIVE to describe (Tenet 13: describe = static identity sensor \u2014 scope/tier/\n// counts; orient = live in-flight sensor \u2014 open PRs/issues/board/freeze). Append,\n// never replace. Its OWN try/catch so an orient failure never disturbs the describe\n// briefing or the boot; `orient --session` is itself boot-safe (emits nothing when\n// nothing is high-signal, never exits non-zero, degrades to honest \"could not derive\").\nlet orientText = '';\ntry {\n const orientCliPath = join(process.cwd(), 'node_modules', '@mmnto', 'cli', 'dist', 'index.js');\n if (existsSync(orientCliPath)) {\n const orientResult = spawnSync(process.execPath, [orientCliPath, 'orient', '--session'], {\n encoding: 'utf-8',\n timeout: 30000,\n });\n // spawnSync sets .error (it does NOT throw) on a spawn-level failure; re-throw so\n // it surfaces through the catch breadcrumb below rather than writing '' silently.\n if (orientResult.error) {\n throw orientResult.error;\n }\n orientText = (orientResult.stdout || '') + (orientResult.stderr || '');\n process.stdout.write(orientText);\n }\n} catch (err) {\n // Boot-safe: orient is additive to describe (already emitted), so a failure never\n // blocks session start \u2014 but surface a NON-fatal breadcrumb to stderr (not stdout,\n // to keep the prompt clean) for debuggability rather than swallowing silently.\n process.stderr.write(\n '[SessionStart] orient briefing unavailable (non-fatal): ' +\n (err instanceof Error ? err.message : String(err)) +\n '\\n',\n );\n}\n\n// \u2500\u2500\u2500 selection manifest (mmnto-ai/totem#2468 M1) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n// Inline append mirroring the session_start write above \u2014 this rendered hook\n// runs standalone in consumer repos with no access to @mmnto/totem's writer.\n// The row shape is BOUND to SelectionManifestRowSchema (strict): change both\n// in the same PR; the template contract test parses this row with the real\n// schema. A zero-byte block never becomes a candidate (nothing was injected).\ntry {\n const { createHash } = require('crypto');\n const measure = (id, content, reason) => {\n const bytes = Buffer.byteLength(content, 'utf-8');\n return {\n id,\n disposition: 'selected',\n reason,\n bytes,\n approxTokens: Math.ceil(bytes / 4),\n fingerprint: createHash('sha256').update(content, 'utf-8').digest('hex').slice(0, 16),\n };\n };\n const selfAgent = (process.env.TOTEM_SELF_AGENT || '')\n .split(',')\n .map((s) => s.trim())\n .find((s) => s.length > 0);\n const row = {\n schemaVersion: 1,\n timestamp: new Date().toISOString(),\n emitter: 'session-start',\n ...(mintedSessionId ? { session_id: mintedSessionId } : {}),\n ...(selfAgent ? { agent_source: selfAgent } : {}),\n // mmnto-ai/totem#2629: provenance disclosed on every row (ruled item 1).\n // Self-minted row \u2014 the minting seat IS this process's env read, so the\n // core conflict probe is structurally inapplicable; only the two-value\n // provenance enum rides. Mirrors senseAgentAttribution's biconditional.\n agent_source_provenance: selfAgent ? 'env' : 'absent',\n context: { template: 'claude-managed' },\n universe: 'managed-template blocks: describe + orient --session',\n costBasis: { bytes: 'utf8-length', approxTokens: 'ceil(bytes/4) approximation' },\n candidates: [\n measure('describe', describeText, 'always-injected briefing'),\n measure('orient:session-block', orientText, 'always-injected briefing'),\n ].filter((c) => c.bytes > 0),\n warnings: [],\n };\n appendFileSync(\n join(process.cwd(), '.totem', 'ledger', 'selection-manifests.ndjson'),\n JSON.stringify(row) + '\\n',\n 'utf-8',\n );\n} catch (err) {\n process.stderr.write(\n '[SessionStart] selection manifest unavailable (non-fatal): ' +\n (err instanceof Error ? err.message : String(err)) +\n '\\n',\n );\n}\n// [totem] end auto-generated\n";
|
|
77
77
|
export declare const CLAUDE_SESSION_START_ENTRY: {
|
|
78
78
|
hooks: {
|
|
79
79
|
type: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-templates.d.ts","sourceRoot":"","sources":["../../src/commands/init-templates.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAA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C,OAAO,EAAE,YAAY,EAAE,EACvB,aAAa,EAAE,aAAa,EAC5B,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,MAAM,CAAC,CAIjB;AAED;;GAEG;AACH,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,YAAY,EAAE,EACvB,aAAa,EAAE,aAAa,EAC5B,GAAG,EAAE,MAAM,GACV,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CAkBhD"}
|
|
@@ -168,6 +168,18 @@ const { spawnSync } = require('child_process');
|
|
|
168
168
|
// no-clobber when gh is missing) makes blind firing safe. ENOENT = the sidecar is not
|
|
169
169
|
// adopted in this repo (the common non-cohort case) — zero noise; any other spawn
|
|
170
170
|
// failure keeps a non-fatal stderr breadcrumb.
|
|
171
|
+
// A SECOND verb rides this same block: \`totem-status refresh-obligation-store\`
|
|
172
|
+
// (mmnto-ai/totem-status#127 slice-two residual, sibling of mmnto-ai/totem#2556)
|
|
173
|
+
// writes the durable obligation store beside the GH snapshot, so it gets the same
|
|
174
|
+
// session-start moment. Same primary-checkout gate, same detached+unref spawn, same
|
|
175
|
+
// inherited log fd, same ENOENT-silent arm — and each firing stamps its own \`verb=\`
|
|
176
|
+
// field, so the log records WHICH verbs fired and in what order. That does NOT
|
|
177
|
+
// restore the #2570 per-child reap discriminator: both stamps are written
|
|
178
|
+
// back-to-back before either child writes, and child output carries no verb tag
|
|
179
|
+
// and arrives in nondeterministic order, so a silent tail attributes only to the
|
|
180
|
+
// LAST verb stamped. Reopen when the sidecar tags its own output. Blind firing
|
|
181
|
+
// stays safe here too: that verb is in-process single-flight only, so it races the
|
|
182
|
+
// daemon exactly the way its manual invocation already does.
|
|
171
183
|
// PRIMARY checkout only (.git must be a DIRECTORY): in a linked worktree .git is a
|
|
172
184
|
// pointer FILE, and a detached child inheriting the worktree cwd holds a Windows
|
|
173
185
|
// directory lock that breaks worktree removal; the primary's hooks + the daemon
|
|
@@ -192,10 +204,14 @@ try {
|
|
|
192
204
|
// exit-0-or-nothing contract, a reaped or dying child leaves NO trace
|
|
193
205
|
// (Windows detached is not job-object breakaway — a hook-harness
|
|
194
206
|
// tree-kill takes the child mid-run). Each firing stamps a workspace-root
|
|
195
|
-
// log and hands the
|
|
196
|
-
//
|
|
197
|
-
//
|
|
198
|
-
//
|
|
207
|
+
// log and hands the children the same fd, so their output lands after the
|
|
208
|
+
// stamps. Measured caveat now that TWO verbs share one fd: both stamps are
|
|
209
|
+
// written back-to-back before either child writes, and the children's
|
|
210
|
+
// output is unlabelled and interleaves nondeterministically — so a silent
|
|
211
|
+
// tail no longer discriminates per child; it attributes only to the LAST
|
|
212
|
+
// verb stamped. The stamps still record which verbs fired, and in what
|
|
213
|
+
// order. Log failures degrade to the previous blind firing — the stamp
|
|
214
|
+
// must never block or break the spawn.
|
|
199
215
|
const { openSync, closeSync, appendFileSync, existsSync, writeFileSync } = require('fs');
|
|
200
216
|
// REPO-LOCAL log, inside .git (falsification round: the primary-checkout
|
|
201
217
|
// gate just proved .git is a directory; never tracked, dies with the
|
|
@@ -218,7 +234,7 @@ try {
|
|
|
218
234
|
} catch {
|
|
219
235
|
// no log yet — nothing to cap
|
|
220
236
|
}
|
|
221
|
-
appendFileSync(logPath, '[' + new Date().toISOString() + '] gemini spawn cwd=' + scrub(process.cwd()) + ' path-has-go-bin=' + /go[\\\\/]bin/i.test(process.env.PATH || '') + ' cwd-shadow-exe=' + existsSync(nodePath.join(process.cwd(), 'totem-status.exe')) + '\\n');
|
|
237
|
+
appendFileSync(logPath, '[' + new Date().toISOString() + '] gemini spawn cwd=' + scrub(process.cwd()) + ' path-has-go-bin=' + /go[\\\\/]bin/i.test(process.env.PATH || '') + ' cwd-shadow-exe=' + existsSync(nodePath.join(process.cwd(), 'totem-status.exe')) + ' verb=refresh-gh\\n');
|
|
222
238
|
logFd = openSync(logPath, 'a');
|
|
223
239
|
stdio = ['ignore', logFd, logFd];
|
|
224
240
|
} catch {
|
|
@@ -230,7 +246,7 @@ try {
|
|
|
230
246
|
});
|
|
231
247
|
refresh.on('error', (err) => {
|
|
232
248
|
try {
|
|
233
|
-
appendFileSync(logPath, '[' + new Date().toISOString() + '] gemini spawn-error code=' + ((err && err.code) || 'unknown') + '\\n');
|
|
249
|
+
appendFileSync(logPath, '[' + new Date().toISOString() + '] gemini spawn-error code=' + ((err && err.code) || 'unknown') + ' verb=refresh-gh\\n');
|
|
234
250
|
} catch {
|
|
235
251
|
// log write failed — fall through to the stderr breadcrumb
|
|
236
252
|
}
|
|
@@ -238,7 +254,31 @@ try {
|
|
|
238
254
|
process.stderr.write('[SessionStart] totem-status refresh-gh spawn failed (non-fatal): ' + (err instanceof Error ? err.message : String(err)) + '\\n');
|
|
239
255
|
});
|
|
240
256
|
refresh.unref();
|
|
241
|
-
//
|
|
257
|
+
// Second verb, same gate and same log fd (see the banner above). Written out
|
|
258
|
+
// rather than looped so the spawn, the stamp, and the breadcrumb each carry a
|
|
259
|
+
// literal verb — a reader of the generated hook (or of the log) never has to
|
|
260
|
+
// resolve a variable to know which refresh fired.
|
|
261
|
+
try {
|
|
262
|
+
appendFileSync(logPath, '[' + new Date().toISOString() + '] gemini spawn cwd=' + scrub(process.cwd()) + ' path-has-go-bin=' + /go[\\\\/]bin/i.test(process.env.PATH || '') + ' cwd-shadow-exe=' + existsSync(nodePath.join(process.cwd(), 'totem-status.exe')) + ' verb=refresh-obligation-store\\n');
|
|
263
|
+
} catch {
|
|
264
|
+
// log unavailable — this verb still fires blind, exactly as the first does
|
|
265
|
+
}
|
|
266
|
+
const refreshStore = spawn('totem-status', ['refresh-obligation-store'], {
|
|
267
|
+
detached: true,
|
|
268
|
+
stdio,
|
|
269
|
+
});
|
|
270
|
+
refreshStore.on('error', (err) => {
|
|
271
|
+
try {
|
|
272
|
+
appendFileSync(logPath, '[' + new Date().toISOString() + '] gemini spawn-error code=' + ((err && err.code) || 'unknown') + ' verb=refresh-obligation-store\\n');
|
|
273
|
+
} catch {
|
|
274
|
+
// log write failed — fall through to the stderr breadcrumb
|
|
275
|
+
}
|
|
276
|
+
if (err && err.code === 'ENOENT') return;
|
|
277
|
+
process.stderr.write('[SessionStart] totem-status refresh-obligation-store spawn failed (non-fatal): ' + (err instanceof Error ? err.message : String(err)) + '\\n');
|
|
278
|
+
});
|
|
279
|
+
refreshStore.unref();
|
|
280
|
+
// Each child holds its own copy of the fd from spawn time; release the parent's
|
|
281
|
+
// once BOTH are away (an early close would hand the second spawn an EBADF).
|
|
242
282
|
if (logFd !== null) {
|
|
243
283
|
try {
|
|
244
284
|
closeSync(logFd);
|
|
@@ -248,7 +288,10 @@ try {
|
|
|
248
288
|
}
|
|
249
289
|
}
|
|
250
290
|
} catch (err) {
|
|
251
|
-
|
|
291
|
+
// Block-level breadcrumb: this catch covers the whole gated block, so neither
|
|
292
|
+
// verb fired — it names the SIDECAR, not one verb. The per-spawn breadcrumbs
|
|
293
|
+
// inside still name their own verb.
|
|
294
|
+
process.stderr.write('[SessionStart] totem-status sidecar refresh unavailable (non-fatal): ' + (err instanceof Error ? err.message : String(err)) + '\\n');
|
|
252
295
|
}
|
|
253
296
|
|
|
254
297
|
// ─── A.3.a: mint session ID + log session_start event ──────────
|
|
@@ -1007,6 +1050,18 @@ try {
|
|
|
1007
1050
|
// is missing) makes blind firing safe. ENOENT = the sidecar is not adopted in
|
|
1008
1051
|
// this repo (the common non-cohort case) — zero noise; any other spawn failure
|
|
1009
1052
|
// keeps a non-fatal stderr breadcrumb.
|
|
1053
|
+
// A SECOND verb rides this same block: \`totem-status refresh-obligation-store\`
|
|
1054
|
+
// (mmnto-ai/totem-status#127 slice-two residual, sibling of mmnto-ai/totem#2556)
|
|
1055
|
+
// writes the durable obligation store beside the GH snapshot, so it gets the same
|
|
1056
|
+
// session-start moment. Same primary-checkout gate, same detached+unref spawn, same
|
|
1057
|
+
// inherited log fd, same ENOENT-silent arm — and each firing stamps its own \`verb=\`
|
|
1058
|
+
// field, so the log records WHICH verbs fired and in what order. That does NOT
|
|
1059
|
+
// restore the #2570 per-child reap discriminator: both stamps are written
|
|
1060
|
+
// back-to-back before either child writes, and child output carries no verb tag
|
|
1061
|
+
// and arrives in nondeterministic order, so a silent tail attributes only to the
|
|
1062
|
+
// LAST verb stamped. Reopen when the sidecar tags its own output. Blind firing
|
|
1063
|
+
// stays safe here too: that verb is in-process single-flight only, so it races the
|
|
1064
|
+
// daemon exactly the way its manual invocation already does.
|
|
1010
1065
|
// PRIMARY checkout only (.git must be a DIRECTORY): in a linked worktree .git is a
|
|
1011
1066
|
// pointer FILE, and a detached child inheriting the worktree cwd holds a Windows
|
|
1012
1067
|
// directory lock that breaks worktree removal; the primary's hooks + the daemon
|
|
@@ -1031,10 +1086,14 @@ try {
|
|
|
1031
1086
|
// exit-0-or-nothing contract, a reaped or dying child leaves NO trace
|
|
1032
1087
|
// (Windows detached is not job-object breakaway — a hook-harness
|
|
1033
1088
|
// tree-kill takes the child mid-run). Each firing stamps a workspace-root
|
|
1034
|
-
// log and hands the
|
|
1035
|
-
//
|
|
1036
|
-
//
|
|
1037
|
-
//
|
|
1089
|
+
// log and hands the children the same fd, so their output lands after the
|
|
1090
|
+
// stamps. Measured caveat now that TWO verbs share one fd: both stamps are
|
|
1091
|
+
// written back-to-back before either child writes, and the children's
|
|
1092
|
+
// output is unlabelled and interleaves nondeterministically — so a silent
|
|
1093
|
+
// tail no longer discriminates per child; it attributes only to the LAST
|
|
1094
|
+
// verb stamped. The stamps still record which verbs fired, and in what
|
|
1095
|
+
// order. Log failures degrade to the previous blind firing — the stamp
|
|
1096
|
+
// must never block or break the spawn.
|
|
1038
1097
|
const { openSync, closeSync, appendFileSync, existsSync, writeFileSync } = require('fs');
|
|
1039
1098
|
// REPO-LOCAL log, inside .git (falsification round: the primary-checkout
|
|
1040
1099
|
// gate just proved .git is a directory; never tracked, dies with the
|
|
@@ -1057,7 +1116,7 @@ try {
|
|
|
1057
1116
|
} catch {
|
|
1058
1117
|
// no log yet — nothing to cap
|
|
1059
1118
|
}
|
|
1060
|
-
appendFileSync(logPath, '[' + new Date().toISOString() + '] claude spawn cwd=' + scrub(process.cwd()) + ' path-has-go-bin=' + /go[\\\\/]bin/i.test(process.env.PATH || '') + ' cwd-shadow-exe=' + existsSync(nodePath.join(process.cwd(), 'totem-status.exe')) + '\\n');
|
|
1119
|
+
appendFileSync(logPath, '[' + new Date().toISOString() + '] claude spawn cwd=' + scrub(process.cwd()) + ' path-has-go-bin=' + /go[\\\\/]bin/i.test(process.env.PATH || '') + ' cwd-shadow-exe=' + existsSync(nodePath.join(process.cwd(), 'totem-status.exe')) + ' verb=refresh-gh\\n');
|
|
1061
1120
|
logFd = openSync(logPath, 'a');
|
|
1062
1121
|
stdio = ['ignore', logFd, logFd];
|
|
1063
1122
|
} catch {
|
|
@@ -1069,7 +1128,7 @@ try {
|
|
|
1069
1128
|
});
|
|
1070
1129
|
refresh.on('error', (err) => {
|
|
1071
1130
|
try {
|
|
1072
|
-
appendFileSync(logPath, '[' + new Date().toISOString() + '] claude spawn-error code=' + ((err && err.code) || 'unknown') + '\\n');
|
|
1131
|
+
appendFileSync(logPath, '[' + new Date().toISOString() + '] claude spawn-error code=' + ((err && err.code) || 'unknown') + ' verb=refresh-gh\\n');
|
|
1073
1132
|
} catch {
|
|
1074
1133
|
// log write failed — fall through to the stderr breadcrumb
|
|
1075
1134
|
}
|
|
@@ -1077,7 +1136,31 @@ try {
|
|
|
1077
1136
|
process.stderr.write('[SessionStart] totem-status refresh-gh spawn failed (non-fatal): ' + (err instanceof Error ? err.message : String(err)) + '\\n');
|
|
1078
1137
|
});
|
|
1079
1138
|
refresh.unref();
|
|
1080
|
-
//
|
|
1139
|
+
// Second verb, same gate and same log fd (see the banner above). Written out
|
|
1140
|
+
// rather than looped so the spawn, the stamp, and the breadcrumb each carry a
|
|
1141
|
+
// literal verb — a reader of the generated hook (or of the log) never has to
|
|
1142
|
+
// resolve a variable to know which refresh fired.
|
|
1143
|
+
try {
|
|
1144
|
+
appendFileSync(logPath, '[' + new Date().toISOString() + '] claude spawn cwd=' + scrub(process.cwd()) + ' path-has-go-bin=' + /go[\\\\/]bin/i.test(process.env.PATH || '') + ' cwd-shadow-exe=' + existsSync(nodePath.join(process.cwd(), 'totem-status.exe')) + ' verb=refresh-obligation-store\\n');
|
|
1145
|
+
} catch {
|
|
1146
|
+
// log unavailable — this verb still fires blind, exactly as the first does
|
|
1147
|
+
}
|
|
1148
|
+
const refreshStore = spawn('totem-status', ['refresh-obligation-store'], {
|
|
1149
|
+
detached: true,
|
|
1150
|
+
stdio,
|
|
1151
|
+
});
|
|
1152
|
+
refreshStore.on('error', (err) => {
|
|
1153
|
+
try {
|
|
1154
|
+
appendFileSync(logPath, '[' + new Date().toISOString() + '] claude spawn-error code=' + ((err && err.code) || 'unknown') + ' verb=refresh-obligation-store\\n');
|
|
1155
|
+
} catch {
|
|
1156
|
+
// log write failed — fall through to the stderr breadcrumb
|
|
1157
|
+
}
|
|
1158
|
+
if (err && err.code === 'ENOENT') return;
|
|
1159
|
+
process.stderr.write('[SessionStart] totem-status refresh-obligation-store spawn failed (non-fatal): ' + (err instanceof Error ? err.message : String(err)) + '\\n');
|
|
1160
|
+
});
|
|
1161
|
+
refreshStore.unref();
|
|
1162
|
+
// Each child holds its own copy of the fd from spawn time; release the parent's
|
|
1163
|
+
// once BOTH are away (an early close would hand the second spawn an EBADF).
|
|
1081
1164
|
if (logFd !== null) {
|
|
1082
1165
|
try {
|
|
1083
1166
|
closeSync(logFd);
|
|
@@ -1087,7 +1170,10 @@ try {
|
|
|
1087
1170
|
}
|
|
1088
1171
|
}
|
|
1089
1172
|
} catch (err) {
|
|
1090
|
-
|
|
1173
|
+
// Block-level breadcrumb: this catch covers the whole gated block, so neither
|
|
1174
|
+
// verb fired — it names the SIDECAR, not one verb. The per-spawn breadcrumbs
|
|
1175
|
+
// inside still name their own verb.
|
|
1176
|
+
process.stderr.write('[SessionStart] totem-status sidecar refresh unavailable (non-fatal): ' + (err instanceof Error ? err.message : String(err)) + '\\n');
|
|
1091
1177
|
}
|
|
1092
1178
|
|
|
1093
1179
|
// ─── totem describe briefing (existing behavior) ────────────────
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-templates.js","sourceRoot":"","sources":["../../src/commands/init-templates.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,qEAAqE;AAMrE,6DAA6D;AAC7D,+EAA+E;AAC/E,sEAAsE;AAEtE,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,CAAC;AACjC,MAAM,CAAC,MAAM,YAAY,GAAG,+BAA+B,CAAC;AAC5D,MAAM,CAAC,MAAM,UAAU,GAAG,6BAA6B,CAAC;AACxD,MAAM,CAAC,MAAM,iBAAiB,GAAG,uCAAuC,CAAC;AACzE,MAAM,CAAC,MAAM,eAAe,GAAG,0CAA0C,CAAC;AAE1E,MAAM,CAAC,MAAM,eAAe,GAAG;EAC7B,YAAY;8BACgB,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0C1C,UAAU;CACX,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,2BAA2B,CAAC;AAE7D;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,+BAA+B,CAAC;AAE9D;;;;;;;;;GASG;AACH,MAAM,UAAU,eAAe,CAAC,OAAe,EAAE,MAAc;IAC7D,MAAM,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACpC,IAAI,GAAG,KAAK,CAAC,CAAC;QAAE,OAAO,KAAK,CAAC;IAC7B,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,CAAC;AACnD,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAe,EAAE,MAAc,EAAE,SAAiB;IACnF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