chore(cleanup): R-b R1 — Voyage's own stats, events and OTel export removed
Removes Voyage's measurement, statistics and export apparatus (decision 189; condition 175 met in step 1) and the R-a leftovers: lib/stats/, lib/exporters/, the otel-export and post-bash-stats hooks, yardstick, end-state and comparison gates, synthesis-measure, gold-scorer, docs/observability.md, examples/observability/, docs/T1-cc26-delegated-orchestration.md and their tests and fixtures. The six command stats phases and the /trekexecute main-merge event blocks go; intent-approval --stamp no longer emits brief-approved. README and docs point to Claude Code's own OpenTelemetry. Files removed: 52. Files edited: 37. npm test: 2930 tests (2928 pass / 0 fail / 2 skipped) before, 2600 tests (2598 pass / 0 fail / 2 skipped) after. removed-surfaces group R1 green. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
92010d20de
commit
21480e8627
89 changed files with 94 additions and 10290 deletions
|
|
@ -8,7 +8,7 @@
|
|||
// (a) brief without a marker → /trekplan's check exits non-zero
|
||||
// (b) marker + intent text edited after → exits non-zero (stale)
|
||||
// (c) valid marker → exits 0 (known negative)
|
||||
// (d) the stamp runs before the manual/auto fork and emits brief-approved
|
||||
// (d) the stamp runs before the manual/auto fork
|
||||
//
|
||||
// The module is imported dynamically so a missing module fails each test on its
|
||||
// own instead of crashing the file into a single failure.
|
||||
|
|
@ -86,12 +86,6 @@ function gate(briefPath) {
|
|||
return run(commandLine('commands/trekplan.md', '--check'), { '{brief_path}': briefPath });
|
||||
}
|
||||
|
||||
function stampInto(dir, env) {
|
||||
// {BRIEF_PATH} since M2 (the resolved --approve target); {PROJECT_DIR} kept for the old spelling
|
||||
return run(commandLine('commands/trekbrief.md', '--stamp'),
|
||||
{ '{BRIEF_PATH}': join(dir, 'brief.md'), '{PROJECT_DIR}': dir }, env);
|
||||
}
|
||||
|
||||
function codes(res) {
|
||||
const out = JSON.parse(res.stdout);
|
||||
return out.errors.map((e) => e.code);
|
||||
|
|
@ -223,7 +217,7 @@ test('trekplan prose: the intent-approval gate sits in "Read the brief" and says
|
|||
assert.match(section, /\*\*halt\*\*/i);
|
||||
});
|
||||
|
||||
// ---- (d) the stamp: operator answer → marker + brief-approved, on BOTH paths ----
|
||||
// ---- (d) the stamp: operator answer → marker, on BOTH paths ----
|
||||
|
||||
test('(d) trekbrief: the stamp step runs BEFORE the Phase 5 manual/auto fork', () => {
|
||||
const text = read('commands/trekbrief.md');
|
||||
|
|
@ -239,47 +233,6 @@ test('(d) trekbrief: the stamp step runs BEFORE the Phase 5 manual/auto fork', (
|
|||
assert.match(before, /--quick/);
|
||||
});
|
||||
|
||||
test('(d) trekbrief: the auto path no longer emits brief-approved on its own (one emission, not two)', () => {
|
||||
const text = read('commands/trekbrief.md');
|
||||
const auto = text.indexOf('### Auto path');
|
||||
const phase6 = text.indexOf('## Phase 6');
|
||||
assert.ok(auto > 0 && phase6 > auto);
|
||||
assert.ok(!/--event brief-approved/.test(text.slice(auto, phase6)),
|
||||
'brief-approved is emitted by the stamp; a second emission on the auto path would double-count');
|
||||
});
|
||||
|
||||
test('(d) the manual-path stamp line writes the marker AND emits a brief-approved record', () => {
|
||||
const dir = tmpDir();
|
||||
const data = tmpDir();
|
||||
try {
|
||||
writeFileSync(join(dir, 'brief.md'), BRIEF);
|
||||
const r = stampInto(dir, { CLAUDE_PLUGIN_DATA: data });
|
||||
assert.equal(r.status, 0, `stamp failed: ${r.stdout} ${r.stderr}`);
|
||||
const after = readFileSync(join(dir, 'brief.md'), 'utf8');
|
||||
assert.match(after, /^intent_approved_hash: "sha256:[0-9a-f]{64}"$/m);
|
||||
assert.match(after, /^intent_approved_at: "\d{4}-\d\d-\d\dT[^"]+"$/m);
|
||||
const statsFile = join(data, 'trekexecute-stats.jsonl');
|
||||
assert.ok(existsSync(statsFile), 'brief-approved record must be written');
|
||||
const recs = readFileSync(statsFile, 'utf8').trim().split('\n').map((l) => JSON.parse(l));
|
||||
const ev = recs.filter((x) => x.event === 'brief-approved');
|
||||
assert.equal(ev.length, 1);
|
||||
assert.equal(ev[0].payload.slug, 'dark-mode-toggle');
|
||||
assert.match(ev[0].payload.intent_hash, /^sha256:[0-9a-f]{64}$/);
|
||||
// and the gate now passes on the stamped file
|
||||
assert.equal(gate(join(dir, 'brief.md')).status, 0);
|
||||
} finally {
|
||||
rmSync(dir, { recursive: true, force: true });
|
||||
rmSync(data, { recursive: true, force: true });
|
||||
}
|
||||
});
|
||||
|
||||
test('(d) with CLAUDE_PLUGIN_DATA unset the record still lands (fallback = the dir the yardstick reads)', async () => {
|
||||
const { resolveApprovalDataDir } = await load();
|
||||
const d = resolveApprovalDataDir({ HOME: '/home/someone' });
|
||||
assert.equal(d, '/home/someone/.claude/plugins/data/voyage-ktg-plugin-marketplace');
|
||||
assert.equal(resolveApprovalDataDir({ CLAUDE_PLUGIN_DATA: '/x/y', HOME: '/h' }), '/x/y');
|
||||
});
|
||||
|
||||
test('re-stamping replaces the marker instead of duplicating it', async () => {
|
||||
const { stampIntentApproval } = await load();
|
||||
const once = stampIntentApproval(BRIEF, new Date('2026-09-23T08:00:00Z')).text;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue