feat(voyage)!: rename stats filenames, settings keys, hook prefixes [skip-docs]

- lib/stats/event-emit.mjs: STATS_FILENAME -> trekexecute-stats.jsonl + comment
- hooks/scripts/post-bash-stats.mjs: stats target + comment -> trekexecute-stats.jsonl
- lib/stats/cache-analyzer.mjs: help-text + comment -> trekexecute-stats.jsonl
- tests/lib/stats-event-emit.test.mjs (lines 104, 117): fixture assertions
- settings.json: ultraplan/ultraresearch -> trekplan/trekresearch keys + statsFile values
- tests/lib/doc-consistency.test.mjs: allowlist (line 83) + accessor cfg.ultraplan?.* -> cfg.trekplan?.* (lines 91, 93) — atomic-pair, prevents vacuous undefined assertions
- scripts/q3-cache-prefix-experiment.mjs: STATS_JSONL hardcoded path -> voyage data dir + trekexecute filename
- hooks/scripts/pre-bash-executor.mjs (2 lines), pre-compact-flush.mjs (2 lines), pre-write-executor.mjs (1 line): [ultraplan]/[ultraplan-local] stderr prefix -> [voyage]
- commands + agents/review-orchestrator.md + CLAUDE.md: prose stats filename literals -> trek* equivalents

Atomic per session-spec: settings.json scope keys + doc-consistency.test.mjs
allowlist + property accessors committed together to prevent silent vacuous
undefined-equals-undefined assertions.

Part of voyage-rebrand session 2 (W3.7 / Step 9).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Kjell Tore Guttormsen 2026-05-05 14:49:03 +02:00
commit c407d3451d
18 changed files with 34 additions and 34 deletions

View file

@ -142,7 +142,7 @@ Doc-consistency test at `tests/lib/doc-consistency.test.mjs` pins agent-table co
`hooks/scripts/session-title.mjs` (UserPromptSubmit, CC v2.1.94+) sets `sessionTitle` to `ultra:<command>:<slug>` for ultra-command invocations. Helps multi-session headless runs identify themselves in process lists. `hooks/scripts/session-title.mjs` (UserPromptSubmit, CC v2.1.94+) sets `sessionTitle` to `ultra:<command>:<slug>` for ultra-command invocations. Helps multi-session headless runs identify themselves in process lists.
`hooks/scripts/post-bash-stats.mjs` (PostToolUse, CC v2.1.97+) appends `duration_ms` for each Bash call into `${CLAUDE_PLUGIN_DATA}/ultraexecute-stats.jsonl`. Useful for finding long-running verify or checkpoint commands. `hooks/scripts/post-bash-stats.mjs` (PostToolUse, CC v2.1.97+) appends `duration_ms` for each Bash call into `${CLAUDE_PLUGIN_DATA}/trekexecute-stats.jsonl`. Useful for finding long-running verify or checkpoint commands.
`hooks/scripts/post-compact-flush.mjs` (PostCompact event, v3.4.0) re-injects `.session-state.local.json` after context compaction so multi-session work survives a compaction boundary. Companion to `pre-compact-flush.mjs` (which writes the state file before compaction); together they form the rehydrate cycle that keeps `/ultracontinue-local` reliable across long-running multi-session work. `hooks/scripts/post-compact-flush.mjs` (PostCompact event, v3.4.0) re-injects `.session-state.local.json` after context compaction so multi-session work survives a compaction boundary. Companion to `pre-compact-flush.mjs` (which writes the state file before compaction); together they form the rehydrate cycle that keeps `/ultracontinue-local` reliable across long-running multi-session work.
@ -222,11 +222,11 @@ Legacy paths (still work without `--project`):
- Progress: `{plan-dir}/.ultraexecute-progress-{slug}.json` - Progress: `{plan-dir}/.ultraexecute-progress-{slug}.json`
Stats: Stats:
- Brief stats: `${CLAUDE_PLUGIN_DATA}/ultrabrief-stats.jsonl` - Brief stats: `${CLAUDE_PLUGIN_DATA}/trekbrief-stats.jsonl`
- Plan stats: `${CLAUDE_PLUGIN_DATA}/ultraplan-stats.jsonl` - Plan stats: `${CLAUDE_PLUGIN_DATA}/trekplan-stats.jsonl`
- Exec stats: `${CLAUDE_PLUGIN_DATA}/ultraexecute-stats.jsonl` - Exec stats: `${CLAUDE_PLUGIN_DATA}/trekexecute-stats.jsonl`
- Research stats: `${CLAUDE_PLUGIN_DATA}/ultraresearch-stats.jsonl` - Research stats: `${CLAUDE_PLUGIN_DATA}/trekresearch-stats.jsonl`
- Continue stats: `${CLAUDE_PLUGIN_DATA}/ultracontinue-stats.jsonl` - Continue stats: `${CLAUDE_PLUGIN_DATA}/trekcontinue-stats.jsonl`
## Terminology ## Terminology

View file

@ -210,7 +210,7 @@ If validation fails, repair the file (most failures are fixable in place
finding-ID). Do NOT proceed if any REVIEW_REQUIRED_FRONTMATTER field is finding-ID). Do NOT proceed if any REVIEW_REQUIRED_FRONTMATTER field is
missing. missing.
Append a stats line to `${CLAUDE_PLUGIN_DATA}/ultrareview-stats.jsonl`: Append a stats line to `${CLAUDE_PLUGIN_DATA}/trekreview-stats.jsonl`:
```json ```json
{"ts":"...","slug":"...","verdict":"BLOCK|WARN|ALLOW","counts":{"BLOCKER":N,"MAJOR":N,"MINOR":N,"SUGGESTION":N},"reviewed_files_count":N,"mode":"default|quick|validate|dry-run","duration_ms":N} {"ts":"...","slug":"...","verdict":"BLOCK|WARN|ALLOW","counts":{"BLOCKER":N,"MAJOR":N,"MINOR":N,"SUGGESTION":N},"reviewed_files_count":N,"mode":"default|quick|validate|dry-run","duration_ms":N}
``` ```

View file

@ -654,7 +654,7 @@ Or:
## Phase 7 — Stats tracking ## Phase 7 — Stats tracking
Append one record to `${CLAUDE_PLUGIN_DATA}/ultrabrief-stats.jsonl`: Append one record to `${CLAUDE_PLUGIN_DATA}/trekbrief-stats.jsonl`:
```json ```json
{ {

View file

@ -286,7 +286,7 @@ disk. Cannot continue automatically.` and exit. Do not guess.
## Phase 5 — Stats tracking ## Phase 5 — Stats tracking
Append a one-line JSON record to `${CLAUDE_PLUGIN_DATA}/ultracontinue-stats.jsonl` Append a one-line JSON record to `${CLAUDE_PLUGIN_DATA}/trekcontinue-stats.jsonl`
if the env var is set; silently skip otherwise. if the env var is set; silently skip otherwise.
```json ```json

View file

@ -1468,7 +1468,7 @@ The `ultraexecute_summary` key makes it grep-able in log files from headless run
## Phase 9 — Stats tracking ## Phase 9 — Stats tracking
Append one record to `${CLAUDE_PLUGIN_DATA}/ultraexecute-stats.jsonl`: Append one record to `${CLAUDE_PLUGIN_DATA}/trekexecute-stats.jsonl`:
```json ```json
{ {

View file

@ -802,7 +802,7 @@ If eligible:
## Phase 12 — Session tracking ## Phase 12 — Session tracking
After the plan is presented (Phase 10) or after handoff (Phase 11), write a After the plan is presented (Phase 10) or after handoff (Phase 11), write a
session record to `${CLAUDE_PLUGIN_DATA}/ultraplan-stats.jsonl` (create the file session record to `${CLAUDE_PLUGIN_DATA}/trekplan-stats.jsonl` (create the file
if it does not exist). if it does not exist).
Record format (one JSON line): Record format (one JSON line):

View file

@ -385,7 +385,7 @@ You can:
### Stats tracking ### Stats tracking
Write a session record to `${CLAUDE_PLUGIN_DATA}/ultraresearch-stats.jsonl` Write a session record to `${CLAUDE_PLUGIN_DATA}/trekresearch-stats.jsonl`
(create the file if it does not exist). (create the file if it does not exist).
Record format (one JSON line): Record format (one JSON line):

View file

@ -252,7 +252,7 @@ If validation fails:
stop and ask the user to re-run; do not silently produce an invalid stop and ask the user to re-run; do not silently produce an invalid
review.md. review.md.
Append a stats line to `${CLAUDE_PLUGIN_DATA}/ultrareview-stats.jsonl` Append a stats line to `${CLAUDE_PLUGIN_DATA}/trekreview-stats.jsonl`
(create the file if it does not exist): (create the file if it does not exist):
```json ```json

View file

@ -2,7 +2,7 @@
// post-bash-stats.mjs — PostToolUse hook (CC v2.1.97+) // post-bash-stats.mjs — PostToolUse hook (CC v2.1.97+)
// //
// Captures duration_ms from PostToolUse payload for Bash tool calls and // Captures duration_ms from PostToolUse payload for Bash tool calls and
// appends a structured stats line to ${CLAUDE_PLUGIN_DATA}/ultraexecute-stats.jsonl // appends a structured stats line to ${CLAUDE_PLUGIN_DATA}/trekexecute-stats.jsonl
// when the running session is an ultraexecute session. // when the running session is an ultraexecute session.
// //
// Detection: only fires when the tool input matches the verify/checkpoint // Detection: only fires when the tool input matches the verify/checkpoint
@ -47,7 +47,7 @@ async function readStdin() {
success: payload.tool_response?.success !== false, success: payload.tool_response?.success !== false,
}); });
const target = join(dataDir, 'ultraexecute-stats.jsonl'); const target = join(dataDir, 'trekexecute-stats.jsonl');
try { try {
mkdirSync(dirname(target), { recursive: true }); mkdirSync(dirname(target), { recursive: true });
} catch {} } catch {}

View file

@ -220,7 +220,7 @@ const normalized = normalizeCommand(deobfuscated);
for (const rule of BLOCK_RULES) { for (const rule of BLOCK_RULES) {
if (rule.pattern.test(normalized)) { if (rule.pattern.test(normalized)) {
process.stderr.write( process.stderr.write(
`[ultraplan] BLOCKED: ${rule.name}\n` + `[voyage] BLOCKED: ${rule.name}\n` +
` Command: ${normalized.slice(0, 200)}${normalized.length > 200 ? '...' : ''}\n` + ` Command: ${normalized.slice(0, 200)}${normalized.length > 200 ? '...' : ''}\n` +
` ${rule.description}\n` ` ${rule.description}\n`
); );
@ -238,7 +238,7 @@ for (const rule of WARN_RULES) {
if (warnings.length > 0) { if (warnings.length > 0) {
process.stderr.write( process.stderr.write(
`[ultraplan] SECURITY ADVISORY: Potentially risky command.\n` + `[voyage] SECURITY ADVISORY: Potentially risky command.\n` +
` Command: ${normalized.slice(0, 200)}${normalized.length > 200 ? '...' : ''}\n` + ` Command: ${normalized.slice(0, 200)}${normalized.length > 200 ? '...' : ''}\n` +
warnings.join('\n') + '\n' warnings.join('\n') + '\n'
); );

View file

@ -170,7 +170,7 @@ for (const { projDir, progPath, planPath } of progressFiles) {
}; };
} }
atomicWriteJson(progPath, progress); atomicWriteJson(progPath, progress);
process.stderr.write(`[ultraplan-local] pre-compact flush: ${progPath} -> current_step=${derivedStep}\n`); process.stderr.write(`[voyage] pre-compact flush: ${progPath} -> current_step=${derivedStep}\n`);
mutationsMade++; mutationsMade++;
} }
@ -178,7 +178,7 @@ for (const { projDir, progPath, planPath } of progressFiles) {
// progress.json mutation — the state file may exist for a session that // progress.json mutation — the state file may exist for a session that
// hasn't advanced step yet, and we still want updated_at to track liveness. // hasn't advanced step yet, and we still want updated_at to track liveness.
if (refreshSessionState(projDir)) { if (refreshSessionState(projDir)) {
process.stderr.write(`[ultraplan-local] pre-compact refresh: ${projDir}/.session-state.local.json\n`); process.stderr.write(`[voyage] pre-compact refresh: ${projDir}/.session-state.local.json\n`);
mutationsMade++; mutationsMade++;
} }
} }

View file

@ -113,7 +113,7 @@ const resolved = resolve(filePath);
for (const rule of BLOCK_RULES) { for (const rule of BLOCK_RULES) {
if (rule.test(resolved)) { if (rule.test(resolved)) {
process.stderr.write( process.stderr.write(
`[ultraplan] BLOCKED: ${rule.name}\n` + `[voyage] BLOCKED: ${rule.name}\n` +
` Path: ${resolved}\n` + ` Path: ${resolved}\n` +
` ${rule.description}\n` ` ${rule.description}\n`
); );

View file

@ -1,5 +1,5 @@
// lib/stats/cache-analyzer.mjs // lib/stats/cache-analyzer.mjs
// Summarizes ultraexecute-stats.jsonl: total events, percentile wall times, // Summarizes trekexecute-stats.jsonl: total events, percentile wall times,
// time range. Companion to event-emit.mjs (which produces the jsonl). // time range. Companion to event-emit.mjs (which produces the jsonl).
// //
// Designed for /ultraplan-local Spor C: gives C3 telemetry context when // Designed for /ultraplan-local Spor C: gives C3 telemetry context when
@ -11,7 +11,7 @@
import { readFileSync, existsSync } from 'node:fs'; import { readFileSync, existsSync } from 'node:fs';
function usage() { function usage() {
return `cache-analyzer.mjs — summarize ultraexecute-stats.jsonl return `cache-analyzer.mjs — summarize trekexecute-stats.jsonl
USAGE: USAGE:
node lib/stats/cache-analyzer.mjs --json <path-to-jsonl> node lib/stats/cache-analyzer.mjs --json <path-to-jsonl>

View file

@ -1,7 +1,7 @@
// lib/stats/event-emit.mjs // lib/stats/event-emit.mjs
// Atomic JSONL append for autonomy-lifecycle events (plan-v2 Step 6). // Atomic JSONL append for autonomy-lifecycle events (plan-v2 Step 6).
// //
// Writes one line per event to ${CLAUDE_PLUGIN_DATA}/ultraexecute-stats.jsonl // Writes one line per event to ${CLAUDE_PLUGIN_DATA}/trekexecute-stats.jsonl
// (or override via CLAUDE_PLUGIN_DATA env var; falls back to silent skip if // (or override via CLAUDE_PLUGIN_DATA env var; falls back to silent skip if
// the directory doesn't exist — stats failures must NEVER block workflow). // the directory doesn't exist — stats failures must NEVER block workflow).
// //
@ -28,7 +28,7 @@ export const KNOWN_EVENTS = Object.freeze(new Set([
'user_input', 'user_input',
])); ]));
const STATS_FILENAME = 'ultraexecute-stats.jsonl'; const STATS_FILENAME = 'trekexecute-stats.jsonl';
/** /**
* Resolve the stats file path. Honors CLAUDE_PLUGIN_DATA env var. * Resolve the stats file path. Honors CLAUDE_PLUGIN_DATA env var.

View file

@ -30,7 +30,7 @@ const PROJECT_DIR = resolve(
'.claude/projects/2026-05-04-spor-c-q3-cache-prefix-experiment', '.claude/projects/2026-05-04-spor-c-q3-cache-prefix-experiment',
); );
const DEFAULT_OUT = join(PROJECT_DIR, 'q3-experiment-results.local.md'); const DEFAULT_OUT = join(PROJECT_DIR, 'q3-experiment-results.local.md');
const STATS_JSONL = '/Users/ktg/.claude/plugins/data/ultraplan-local-ktg-plugin-marketplace/ultraexecute-stats.jsonl'; const STATS_JSONL = '/Users/ktg/.claude/plugins/data/voyage-ktg-plugin-marketplace/trekexecute-stats.jsonl';
const ANALYZER = resolve(process.cwd(), 'lib/stats/cache-analyzer.mjs'); const ANALYZER = resolve(process.cwd(), 'lib/stats/cache-analyzer.mjs');
const MIN_PARENT_TOKENS = 150_000; const MIN_PARENT_TOKENS = 150_000;

View file

@ -1,5 +1,5 @@
{ {
"ultraplan": { "trekplan": {
"defaultMode": "default", "defaultMode": "default",
"autoResearch": true, "autoResearch": true,
"interview": { "interview": {
@ -8,10 +8,10 @@
}, },
"tracking": { "tracking": {
"enabled": true, "enabled": true,
"statsFile": "ultraplan-stats.jsonl" "statsFile": "trekplan-stats.jsonl"
} }
}, },
"ultraresearch": { "trekresearch": {
"defaultMode": "default", "defaultMode": "default",
"maxDimensions": 8, "maxDimensions": 8,
"geminiBridge": { "geminiBridge": {
@ -25,7 +25,7 @@
}, },
"tracking": { "tracking": {
"enabled": true, "enabled": true,
"statsFile": "ultraresearch-stats.jsonl" "statsFile": "trekresearch-stats.jsonl"
} }
} }
} }

View file

@ -80,7 +80,7 @@ test('commands/trekexecute.md still parses v1.7 plan schema', () => {
test('settings.json has only known top-level scopes after Spor 0 cleanup', () => { test('settings.json has only known top-level scopes after Spor 0 cleanup', () => {
const cfg = JSON.parse(read('settings.json')); const cfg = JSON.parse(read('settings.json'));
const known = ['ultraplan', 'ultraresearch']; const known = ['trekplan', 'trekresearch'];
for (const k of Object.keys(cfg)) { for (const k of Object.keys(cfg)) {
assert.ok(known.includes(k), `Unknown top-level scope in settings.json: ${k}`); assert.ok(known.includes(k), `Unknown top-level scope in settings.json: ${k}`);
} }
@ -88,9 +88,9 @@ test('settings.json has only known top-level scopes after Spor 0 cleanup', () =>
test('settings.json no longer carries vestigial exploration block', () => { test('settings.json no longer carries vestigial exploration block', () => {
const cfg = JSON.parse(read('settings.json')); const cfg = JSON.parse(read('settings.json'));
assert.equal(cfg.ultraplan?.exploration, undefined, assert.equal(cfg.trekplan?.exploration, undefined,
'exploration block was vestigial — should be deleted in v3.1.0 Spor 0'); 'exploration block was vestigial — should be deleted in v3.1.0 Spor 0');
assert.equal(cfg.ultraplan?.agentTeam, undefined, assert.equal(cfg.trekplan?.agentTeam, undefined,
'agentTeam block was vestigial — should be deleted in v3.1.0 Spor 0'); 'agentTeam block was vestigial — should be deleted in v3.1.0 Spor 0');
}); });

View file

@ -101,7 +101,7 @@ test('emit never throws when stats path is unwritable', () => {
test('resolveStatsPath honors CLAUDE_PLUGIN_DATA env var', () => { test('resolveStatsPath honors CLAUDE_PLUGIN_DATA env var', () => {
const r = resolveStatsPath({ CLAUDE_PLUGIN_DATA: '/var/data/plugin' }); const r = resolveStatsPath({ CLAUDE_PLUGIN_DATA: '/var/data/plugin' });
assert.equal(r, '/var/data/plugin/ultraexecute-stats.jsonl'); assert.equal(r, '/var/data/plugin/trekexecute-stats.jsonl');
assert.equal(resolveStatsPath({}), null); assert.equal(resolveStatsPath({}), null);
}); });
@ -114,7 +114,7 @@ test('CLI shim writes via emit when CLAUDE_PLUGIN_DATA is set', () => {
env: { ...process.env, CLAUDE_PLUGIN_DATA: dir }, env: { ...process.env, CLAUDE_PLUGIN_DATA: dir },
encoding: 'utf-8', encoding: 'utf-8',
}); });
const path = join(dir, 'ultraexecute-stats.jsonl'); const path = join(dir, 'trekexecute-stats.jsonl');
assert.ok(existsSync(path)); assert.ok(existsSync(path));
const line = readFileSync(path, 'utf-8').trim(); const line = readFileSync(path, 'utf-8').trim();
const parsed = JSON.parse(line); const parsed = JSON.parse(line);