skillfit 0.11.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/README.md +68 -104
  2. package/README.zh-CN.md +68 -101
  3. package/benches/README.md +6 -2
  4. package/dist/cli.js +28 -16
  5. package/dist/commands/bench-calibration.js +5 -1
  6. package/dist/commands/bench-check-report.js +1 -34
  7. package/dist/commands/bench-draft.js +167 -0
  8. package/dist/commands/bench-draft.test.js +168 -0
  9. package/dist/commands/bench-manage.js +5 -4
  10. package/dist/commands/bench-source.js +101 -0
  11. package/dist/commands/bench-source.test.js +84 -0
  12. package/dist/commands/bench.js +157 -328
  13. package/dist/commands/eval-api-failure.test.js +46 -0
  14. package/dist/commands/eval-layout.test.js +126 -0
  15. package/dist/commands/eval-preflight-error.js +9 -0
  16. package/dist/commands/eval-preflight.js +4 -11
  17. package/dist/commands/eval-report.js +6 -459
  18. package/dist/commands/eval.js +7 -32
  19. package/dist/commands/install.js +14 -98
  20. package/dist/harness/agent-preflight.js +18 -2
  21. package/dist/harness/bench-check.js +277 -0
  22. package/dist/harness/bench-diagnostics.js +34 -0
  23. package/dist/harness/bench-location.js +29 -0
  24. package/dist/harness/bench-location.test.js +33 -0
  25. package/dist/harness/bench.js +8 -3
  26. package/dist/harness/eval-acceptance.js +1 -1
  27. package/dist/harness/eval-audit.js +2 -2
  28. package/dist/harness/eval-manifest.js +456 -0
  29. package/dist/harness/evaluation-layout.js +30 -0
  30. package/dist/harness/executors/api.js +20 -7
  31. package/dist/harness/executors/cli.js +15 -25
  32. package/dist/harness/experiment-session.js +5 -15
  33. package/dist/harness/hash.js +3 -1
  34. package/dist/harness/runner.js +5 -4
  35. package/dist/harness/single-arm-audit.js +1 -1
  36. package/dist/harness/trigger.js +1 -1
  37. package/dist/harness/verifier-timeout.js +8 -0
  38. package/dist/harness/verifier-timeout.test.js +76 -0
  39. package/dist/install/constants.js +1 -0
  40. package/dist/install/transaction.js +112 -0
  41. package/docs/README.md +65 -0
  42. package/docs/architecture.md +86 -0
  43. package/docs/archive-delivery.md +83 -0
  44. package/docs/archive-inventory.md +91 -0
  45. package/docs/bench-authoring.md +23 -3
  46. package/docs/bench-drafting.md +75 -0
  47. package/docs/case-management.md +12 -1
  48. package/docs/eval-agent-preflight.md +15 -2
  49. package/docs/eval-costs.md +28 -2
  50. package/docs/eval-planning.md +14 -0
  51. package/docs/evaluation-input-snapshots.md +20 -4
  52. package/docs/evaluation-reports.md +1 -1
  53. package/docs/first-real-eval.md +28 -3
  54. package/docs/growth-roadmap-2026-10.md +23 -18
  55. package/docs/package-contents.md +73 -0
  56. package/docs/plans/2026-10-17-workflow-foundations.md +37 -2
  57. package/docs/plans/2026-10-20-archive-replay-verification.json +125 -0
  58. package/docs/plans/2026-10-20-archive-source-verification.json +256 -0
  59. package/docs/plans/2026-10-20-delivery-verification.json +146 -0
  60. package/docs/plans/2026-10-20-docs-architecture-cleanup.md +233 -0
  61. package/docs/plans/2026-10-20-install-transactions-and-archive-delivery.md +233 -0
  62. package/docs/plans/2026-10-21-npm-0.13.0-release.md +41 -0
  63. package/docs/releases/0.11.0-ci-registry-install.json +130 -0
  64. package/docs/releases/0.11.0-feature-smoke.json +1576 -0
  65. package/docs/releases/0.11.0-local-attempt-1.json +24 -0
  66. package/docs/releases/0.11.0-local-attempt-1.log +19 -0
  67. package/docs/releases/0.11.0-local-registry-install.json +25 -0
  68. package/docs/releases/0.11.0-registry-metadata.json +33 -0
  69. package/docs/releases/0.11.0-signatures.txt +12 -0
  70. package/docs/releases/0.11.0-verification.json +95 -0
  71. package/docs/releases/0.11.0.md +54 -11
  72. package/docs/releases/0.12.0-attestation-check.json +22 -0
  73. package/docs/releases/0.12.0-attestations.json +155 -0
  74. package/docs/releases/0.12.0-ci-registry-install.json +90 -0
  75. package/docs/releases/0.12.0-feature-smoke.json +34 -0
  76. package/docs/releases/0.12.0-feature-smoke.mjs +73 -0
  77. package/docs/releases/0.12.0-foundations-smoke.json +1576 -0
  78. package/docs/releases/0.12.0-local-registry-install.json +75 -0
  79. package/docs/releases/0.12.0-preparation-attempt-1.json +22 -0
  80. package/docs/releases/0.12.0-registry-metadata.json +96 -0
  81. package/docs/releases/0.12.0-signatures.txt +6 -0
  82. package/docs/releases/0.12.0-verification.json +99 -0
  83. package/docs/releases/0.12.0.md +82 -0
  84. package/docs/releases/0.13.0-feature-smoke.mjs +114 -0
  85. package/docs/releases/0.13.0-preparation.json +102 -0
  86. package/docs/releases/0.13.0.md +61 -0
  87. package/docs/releases/archive-delivery-smoke.mjs +37 -0
  88. package/docs/reproducible-offline-example.md +1 -1
  89. package/docs/schemas/agent-preflight.schema.json +1 -1
  90. package/docs/verifier-contract.md +9 -0
  91. package/evidence/README.md +24 -1
  92. package/evidence/archive-catalog.v1.json +8044 -0
  93. package/evidence/fetch-archives.mjs +211 -0
  94. package/package.json +9 -2
  95. package/skills/skillfit/SKILL.md +25 -5
  96. package/dist/cli.test.js +0 -193
  97. package/dist/commands/bench-calibration.test.js +0 -237
  98. package/dist/commands/bench-check-json.test.js +0 -242
  99. package/dist/commands/bench-manage.test.js +0 -87
  100. package/dist/commands/bench.test.js +0 -1162
  101. package/dist/commands/bundle.test.js +0 -142
  102. package/dist/commands/calibration-cli.test.js +0 -145
  103. package/dist/commands/doctor.test.js +0 -280
  104. package/dist/commands/eval-agent-preflight.test.js +0 -245
  105. package/dist/commands/eval-export-modes.test.js +0 -350
  106. package/dist/commands/eval-export.test.js +0 -279
  107. package/dist/commands/eval-interruption.test.js +0 -238
  108. package/dist/commands/eval-preflight.test.js +0 -382
  109. package/dist/commands/eval-report.test.js +0 -367
  110. package/dist/commands/eval.test.js +0 -503
  111. package/dist/commands/evaluation-report.test.js +0 -243
  112. package/dist/commands/install.test.js +0 -555
  113. package/dist/commands/replay-cancellation.test.js +0 -105
  114. package/dist/commands/report.test.js +0 -110
  115. package/dist/commands/setup.test.js +0 -150
  116. package/dist/commands/upstream.test.js +0 -139
  117. package/dist/commands/workflow-entrypoints.test.js +0 -137
  118. package/dist/docs.test.js +0 -154
  119. package/dist/frontmatter.test.js +0 -49
  120. package/dist/harness/bench.test.js +0 -109
  121. package/dist/harness/bundle.test.js +0 -71
  122. package/dist/harness/codex-usage.test.js +0 -87
  123. package/dist/harness/costs.test.js +0 -92
  124. package/dist/harness/eval-budget.test.js +0 -237
  125. package/dist/harness/eval-component.test.js +0 -770
  126. package/dist/harness/eval-efficiency.test.js +0 -56
  127. package/dist/harness/execution-timing.test.js +0 -61
  128. package/dist/harness/executors/api.test.js +0 -136
  129. package/dist/harness/executors/cli.test.js +0 -510
  130. package/dist/harness/executors/mock.test.js +0 -43
  131. package/dist/harness/experiment-session.test.js +0 -317
  132. package/dist/harness/installed-skill.test.js +0 -162
  133. package/dist/harness/interruption.test.js +0 -31
  134. package/dist/harness/judge-accounting.test.js +0 -216
  135. package/dist/harness/judge.test.js +0 -181
  136. package/dist/harness/kimi-usage.test.js +0 -62
  137. package/dist/harness/native-diff.test.js +0 -53
  138. package/dist/harness/oss-lru-cache.test.js +0 -79
  139. package/dist/harness/oss-normalize-url.test.js +0 -64
  140. package/dist/harness/oss-regression-witness.test.js +0 -89
  141. package/dist/harness/oss-skill-followup.test.js +0 -59
  142. package/dist/harness/prompt.test.js +0 -48
  143. package/dist/harness/receipts.test.js +0 -148
  144. package/dist/harness/report.test.js +0 -297
  145. package/dist/harness/runner.test.js +0 -635
  146. package/dist/harness/skill-revision.test.js +0 -148
  147. package/dist/harness/stats.test.js +0 -124
  148. package/dist/harness/target.test.js +0 -60
  149. package/dist/harness/trigger.test.js +0 -261
  150. package/dist/harness/verifier-summary.test.js +0 -99
  151. package/dist/harness/verifier.test.js +0 -128
  152. package/dist/harness/waza-behavior.test.js +0 -139
  153. package/dist/mcp/probe.test.js +0 -139
  154. package/evidence/artifacts/2026-10-12-diagnosing-revision/calibration-records.tar.gz +0 -0
  155. package/evidence/artifacts/2026-10-12-diagnosing-revision/interrupted-records.tar.gz +0 -0
  156. package/evidence/artifacts/2026-10-12-diagnosing-revision/validation-records.tar.gz +0 -0
  157. package/evidence/artifacts/2026-10-12-diagnosing-v2/regression-records.tar.gz +0 -0
  158. package/evidence/artifacts/2026-10-12-diagnosing-v2/transfer-records.tar.gz +0 -0
  159. package/evidence/artifacts/2026-10-12-normalize-url-v2-available/readiness-records.tar.gz +0 -0
  160. package/evidence/artifacts/2026-10-12-normalize-url-v2-comparison/records.tar.gz +0 -0
  161. package/evidence/artifacts/2026-10-12-normalize-url-v2-recovery/records.tar.gz +0 -0
  162. package/evidence/artifacts/2026-10-12-normalize-url-v2-validated/records.tar.gz +0 -0
  163. package/evidence/artifacts/2026-10-13-debugging-completed-development/package.tar.gz +0 -0
  164. package/evidence/artifacts/2026-10-13-debugging-controls-and-sleep-stop/package.tar.gz +0 -0
  165. package/evidence/artifacts/2026-10-13-debugging-development-stops/package.tar.gz +0 -0
  166. package/evidence/artifacts/2026-10-14-debugging-followup-routing-stop/package.tar.gz +0 -0
  167. package/evidence/artifacts/2026-10-14-debugging-independent-validation/package.tar.gz +0 -0
  168. package/evidence/artifacts/2026-10-14-debugging-reading-pilot-and-cost-review/package.tar.gz +0 -0
  169. package/evidence/artifacts/2026-10-14-debugging-spending-stop/package.tar.gz +0 -0
  170. package/evidence/artifacts/2026-10-15-independent-comparison-regression-stop/package.tar.gz +0 -0
  171. package/evidence/artifacts/2026-10-15-native-diff-mechanism/package.tar.gz +0 -0
  172. package/evidence/artifacts/2026-10-15-receiver-mechanism-stop/package.tar.gz +0 -0
@@ -1,4 +1,4 @@
1
- import { createHash, randomUUID } from 'node:crypto';
1
+ import { createHash } from 'node:crypto';
2
2
  import { existsSync } from 'node:fs';
3
3
  import { promises as fs } from 'node:fs';
4
4
  import * as os from 'node:os';
@@ -6,10 +6,12 @@ import * as path from 'node:path';
6
6
  import { fileURLToPath } from 'node:url';
7
7
  import { getAgent } from '../agents.js';
8
8
  import { parseFrontmatter } from '../frontmatter.js';
9
+ import { BACKUP_SUFFIX } from '../install/constants.js';
10
+ import { executeTransaction } from '../install/transaction.js';
9
11
  import { confirm as confirmPrompt } from './confirm.js';
10
12
  export const MARKER_START = '<!-- SKILLFIT_START -->';
11
13
  export const MARKER_END = '<!-- SKILLFIT_END -->';
12
- export const BACKUP_SUFFIX = '.skillfit-bak';
14
+ export { BACKUP_SUFFIX } from '../install/constants.js';
13
15
  export const LOCKFILE_NAME = 'skillfit.lock.json';
14
16
  const NAME_PATTERN = /^[a-z0-9][a-z0-9-]*$/;
15
17
  export async function runInstall(opts) {
@@ -71,7 +73,12 @@ export async function runInstall(opts) {
71
73
  }
72
74
  recordEntries(lock, items, manifest, now().toISOString());
73
75
  const lockContent = `${JSON.stringify(lock, null, 2)}\n`;
74
- await executeWrites(writes, lockPath, lockContent, async () => {
76
+ const files = writes.flatMap(item => item.files.map(file => ({
77
+ path: file.path, content: file.content, backup: file.backup ? 'first' : 'none',
78
+ })));
79
+ // Metadata is committed last and backs up its immediately previous version.
80
+ files.push({ path: lockPath, content: lockContent, backup: existsSync(lockPath) ? 'previous' : 'none' });
81
+ const written = await executeTransaction(files, async () => {
75
82
  const problems = await validateWrites(writes);
76
83
  if (problems.length > 0) {
77
84
  throw new Error(`Post-install validation failed:\n ${problems.join('\n ')}`);
@@ -79,7 +86,10 @@ export async function runInstall(opts) {
79
86
  if (await fs.readFile(lockPath, 'utf8') !== lockContent) {
80
87
  throw new Error(`Post-install validation failed: lockfile content differs from the plan at ${lockPath}`);
81
88
  }
82
- }, log);
89
+ });
90
+ for (const entry of written.slice(0, -1)) {
91
+ log(` wrote ${entry.target}${entry.backedUp ? ` (backup: ${entry.backedUp})` : ''}`);
92
+ }
83
93
  log(`Post-install validation passed (${writes.length} item(s) checked).`);
84
94
  log(`Lockfile updated: ${lockPath}`);
85
95
  log('Install complete.');
@@ -506,100 +516,6 @@ function printPlan(log, manifest, scope, scopeDir, items) {
506
516
  log('');
507
517
  log(`Summary: ${counts.create} create, ${counts.update} update, ${counts.skip} skipped (unchanged), ${counts.conflict} conflict`);
508
518
  }
509
- async function executeWrites(writes, lockPath, lockContent, validate, log) {
510
- // Every target gets a temporary copy of its immediately previous state for rollback. The
511
- // user-facing .skillfit-bak has a different purpose: it preserves the earliest original.
512
- // Include the lockfile in this batch so its write and post-write validation can also roll back.
513
- const files = writes.flatMap((item) => item.files.map((file) => ({ ...file, isLockfile: false })));
514
- files.push({ path: lockPath, content: lockContent, backup: existsSync(lockPath), isLockfile: true });
515
- const staged = [];
516
- try {
517
- for (const file of files) {
518
- await fs.mkdir(path.dirname(file.path), { recursive: true });
519
- const suffix = `${process.pid}.${randomUUID()}`;
520
- const tmp = `${file.path}.${suffix}.skillfit-staged`;
521
- const restore = existsSync(file.path) ? `${file.path}.${suffix}.skillfit-restore` : null;
522
- const entry = { target: file.path, tmp, restore, backedUp: null, isLockfile: file.isLockfile };
523
- staged.push(entry);
524
- if (restore)
525
- await fs.copyFile(file.path, restore);
526
- if (file.backup) {
527
- // The lockfile backup tracks the previous version; user-content backups keep the first.
528
- if (file.isLockfile) {
529
- await fs.copyFile(file.path, file.path + BACKUP_SUFFIX);
530
- entry.backedUp = file.path + BACKUP_SUFFIX;
531
- }
532
- else {
533
- entry.backedUp = await backupOnce(file.path);
534
- }
535
- }
536
- await fs.writeFile(tmp, file.content);
537
- }
538
- }
539
- catch (error) {
540
- await cleanupStaged(staged);
541
- throw error;
542
- }
543
- const applied = [];
544
- try {
545
- for (const entry of staged) {
546
- await fs.rename(entry.tmp, entry.target);
547
- applied.push(entry);
548
- }
549
- await validate();
550
- }
551
- catch (error) {
552
- const rollbackFailures = [];
553
- const preserveRestores = new Set();
554
- for (const entry of applied.reverse()) {
555
- try {
556
- if (entry.restore)
557
- await fs.copyFile(entry.restore, entry.target);
558
- else
559
- await fs.rm(entry.target, { force: true });
560
- }
561
- catch (rollbackError) {
562
- rollbackFailures.push(`${entry.target}: ${rollbackError.message}`);
563
- preserveRestores.add(entry.target);
564
- }
565
- }
566
- await cleanupStaged(staged, preserveRestores);
567
- if (rollbackFailures.length > 0) {
568
- throw new Error(`Install failed (${error.message}) and rollback failed for ${rollbackFailures.join('; ')}. ` +
569
- `Recovery copies with the .skillfit-restore suffix were kept beside those targets.`, { cause: error });
570
- }
571
- throw error;
572
- }
573
- await cleanupStaged(staged);
574
- for (const entry of staged) {
575
- if (!entry.isLockfile)
576
- log(` wrote ${entry.target}${entry.backedUp ? ` (backup: ${entry.backedUp})` : ''}`);
577
- }
578
- }
579
- async function cleanupStaged(staged, preserveRestores = new Set()) {
580
- for (const entry of staged) {
581
- await fs.rm(entry.tmp, { force: true });
582
- if (entry.restore && !preserveRestores.has(entry.target))
583
- await fs.rm(entry.restore, { force: true });
584
- }
585
- }
586
- /**
587
- * Back up a file at most once. `.skillfit-bak` is a single slot, and the copy worth keeping is the
588
- * user's pre-skillfit original: overwriting it on a later update would destroy the only copy of the
589
- * content the suffix exists to protect. Returns the backup path when one was created, else null.
590
- */
591
- async function backupOnce(target) {
592
- const backup = target + BACKUP_SUFFIX;
593
- try {
594
- await fs.access(backup);
595
- return null;
596
- }
597
- catch {
598
- // absent — take the backup
599
- }
600
- await fs.copyFile(target, backup);
601
- return backup;
602
- }
603
519
  async function validateWrites(writes) {
604
520
  const problems = [];
605
521
  for (const item of writes) {
@@ -40,6 +40,10 @@ function report(checks) {
40
40
  summary: { failures: count('FAIL'), passed: count('PASS'), unknown: count('UNKNOWN'), info: count('INFO') },
41
41
  cost: { modelCalls: 0, cliInvocations: 0 } };
42
42
  }
43
+ export function agentTokenCounters(agent) {
44
+ return agent.headless.streamJson?.wireShape === 'codex-items'
45
+ ? ['input', 'cachedInput', 'output'] : agent.headless.usageFromSessionLog ? ['input', 'output'] : [];
46
+ }
43
47
  export function inspectAgentEnvironment(options) {
44
48
  const checks = [], env = options.env ?? process.env;
45
49
  const home = options.homeDir ?? homedir();
@@ -55,8 +59,8 @@ export function inspectAgentEnvironment(options) {
55
59
  for (const role of options.roles) {
56
60
  const agent = role.definition;
57
61
  const add = (code, status, message, remediation = null, paths = []) => checks.push({ code, status, message, remediation, paths, role: role.role, agent: agent?.id ?? null });
58
- const streamed = role.role === 'agent' && (options.mode === 'trigger' || (options.mode === 'installed' && agent?.headless.streamJson));
59
- const argv = streamed ? agent?.headless.streamJson?.argv : agent?.headless.argv;
62
+ const trigger = role.role === 'agent' && options.mode === 'trigger';
63
+ const argv = trigger ? agent?.headless.streamJson?.argv : agent?.headless.streamJson?.argv ?? agent?.headless.argv;
60
64
  const binary = argv?.[0] ?? agent?.headless.argv[0] ?? agent?.detect.binaries[0];
61
65
  if (role.injected)
62
66
  add('EXECUTOR_INJECTED', 'UNKNOWN', 'Injected executor: installed CLI availability and runtime capabilities are not attested.');
@@ -78,6 +82,18 @@ export function inspectAgentEnvironment(options) {
78
82
  error = 'No executor available; pass --agent or set SKILLFIT_API_KEY.';
79
83
  add('MATRIX_CAPABILITY', error ? 'FAIL' : role.injected && !agent ? 'UNKNOWN' : 'PASS', error ??
80
84
  (agent ? 'Declared matrix capabilities match this evaluation; installed CLI flag compatibility was not probed.' : 'Executor supports the declared evaluation surface.'), error ? 'Select a compatible agent/input/mode or correct its configuration, then create a fresh preview.' : null);
85
+ if (agent && !role.injected) {
86
+ // These are adapter capabilities declared by matrix wire shape, not a probe
87
+ // or a guarantee that this installed CLI/provider will return final counters.
88
+ const metrics = agentTokenCounters(agent);
89
+ const missing = ['input', 'cachedInput', 'output'].filter(metric => !metrics.includes(metric));
90
+ const blocked = options.spendingBudget && missing.length > 0;
91
+ add('USAGE_CAPABILITY', blocked ? 'FAIL' : options.spendingBudget ? 'PASS' : 'INFO', `CLI adapter token counters: ${metrics.join(', ') || 'none'}. ${blocked
92
+ ? `Whole-batch spending limits require unavailable counters: ${missing.join(', ')}; no calls may start.`
93
+ : 'Actual missing/partial final counters remain unknown and stop a budgeted batch.'}`, blocked ? 'Choose an adapter/provider with all required counters or explicitly review a new plan without token spending limits; unknown usage cannot be treated as zero.' : null);
94
+ }
95
+ else
96
+ add('USAGE_CAPABILITY', 'UNKNOWN', 'Final token/cache coverage cannot be confirmed offline for this API or injected executor; runtime spending guards still require complete final counters.');
81
97
  add('AUTHENTICATION', 'UNKNOWN', 'Login and credential validity cannot be confirmed offline; no authentication command, credential file or network probe was used.', 'Confirm authentication separately before authorizing a live run.');
82
98
  if (role.role !== 'agent' || options.target.kind !== 'skill')
83
99
  continue;
@@ -0,0 +1,277 @@
1
+ import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, statSync, writeFileSync } from 'node:fs';
2
+ import { tmpdir } from 'node:os';
3
+ import { dirname, join, resolve } from 'node:path';
4
+ import { loadBench, selectBenchTasks } from './bench.js';
5
+ import { resolveBenchDir } from './bench-location.js';
6
+ import { listFilesRecursive } from './hash.js';
7
+ import { runVerifier, verifierFailure } from './runner.js';
8
+ import { MOCK_MARKER_FILE } from './constants.js';
9
+ import { verdictFromOutput } from './verifier-summary.js';
10
+ import { throwIfEvaluationInterrupted, withEvaluationInterrupts } from './interruption.js';
11
+ import { benchDiagnostic, benchCheckEvidence } from './bench-diagnostics.js';
12
+ const FIXTURE_SIZE_WARN_BYTES = 64 * 1024;
13
+ // benches/README.md: a verifier decomposes its acceptance criteria into 2–8 named checks.
14
+ const MIN_FACET_CHECKS = 2;
15
+ const MAX_FACET_CHECKS = 8;
16
+ // docs/metrics.md: >=30% of trigger-labelled tasks should be negative controls.
17
+ const NEGATIVE_CONTROL_TARGET = 0.3;
18
+ const NEGATIVE_CONTROL_PERCENT = 30;
19
+ async function probeVerifier(benchDir, verifier, output, timeoutSeconds) {
20
+ const dir = mkdtempSync(join(tmpdir(), 'skillfit-check-'));
21
+ try {
22
+ if (output !== null) {
23
+ writeFileSync(join(dir, '_output.md'), output, 'utf8');
24
+ }
25
+ const result = await runVerifier(benchDir, verifier, dir, timeoutSeconds);
26
+ return {
27
+ exitCode: result.exitCode,
28
+ error: result.error,
29
+ output: result.output,
30
+ checks: verdictFromOutput(result.output)?.checks ?? null,
31
+ };
32
+ }
33
+ finally {
34
+ rmSync(dir, { recursive: true, force: true });
35
+ }
36
+ }
37
+ function facetCountCheck(taskId, checks) {
38
+ // `checks` is optional in the verifier contract; with no checks there is no graded signal to gate.
39
+ if (checks === null)
40
+ return null;
41
+ if (checks.length >= MIN_FACET_CHECKS && checks.length <= MAX_FACET_CHECKS) {
42
+ return {
43
+ status: 'PASS',
44
+ message: `${taskId}: ${checks.length} facet check(s), within the ${MIN_FACET_CHECKS}–${MAX_FACET_CHECKS} contract`,
45
+ };
46
+ }
47
+ const why = checks.length < MIN_FACET_CHECKS
48
+ ? 'a single check is binary pass/fail in facet costume — it carries none of the graded signal facet scores exist to provide'
49
+ : 'the trial score is dominated by whatever these checks happen to measure, and the per-facet table stops being readable';
50
+ return {
51
+ status: 'WARN',
52
+ message: `${taskId}: ${checks.length} facet check(s) — outside the ${MIN_FACET_CHECKS}–${MAX_FACET_CHECKS} range in benches/README.md (${why})`,
53
+ };
54
+ }
55
+ export function copyFixture(fixtureDir, dest) {
56
+ for (const rel of listFilesRecursive(fixtureDir)) {
57
+ const target = join(dest, rel);
58
+ mkdirSync(dirname(target), { recursive: true });
59
+ writeFileSync(target, readFileSync(join(fixtureDir, rel)));
60
+ }
61
+ }
62
+ export async function runOracleGate(benchDir, fixtureDir, oracle, verifier, timeoutSeconds, record) {
63
+ const dir = mkdtempSync(join(tmpdir(), 'skillfit-check-'));
64
+ try {
65
+ copyFixture(fixtureDir, dir);
66
+ const oracleRun = await runVerifier(benchDir, oracle, dir, timeoutSeconds);
67
+ record?.('oracle', oracleRun);
68
+ if (oracleRun.error !== null || oracleRun.exitCode !== 0) {
69
+ return {
70
+ kind: 'oracle-failed',
71
+ result: oracleRun,
72
+ command: oracle,
73
+ exitCode: oracleRun.exitCode,
74
+ reason: oracleRun.error !== null || oracleRun.exitCode === null ? verifierFailure('oracle', oracle, oracleRun.error) : null,
75
+ };
76
+ }
77
+ const graded = await runVerifier(benchDir, verifier, dir, timeoutSeconds);
78
+ record?.('oracle-verifier', graded);
79
+ if (graded.error !== null || graded.exitCode !== 0) {
80
+ return {
81
+ kind: 'verifier-failed',
82
+ result: graded,
83
+ command: verifier,
84
+ reason: graded.error !== null || graded.exitCode === null ? verifierFailure('verifier', verifier, graded.error) : null,
85
+ };
86
+ }
87
+ const score = verdictFromOutput(graded.output)?.score ?? null;
88
+ if (score !== null && score < 1) {
89
+ return { kind: 'low-score', score, result: graded, command: verifier };
90
+ }
91
+ return { kind: 'pass', score, result: graded, command: verifier };
92
+ }
93
+ finally {
94
+ rmSync(dir, { recursive: true, force: true });
95
+ }
96
+ }
97
+ async function probeOracle(benchDir, fixture, oracle, verifier, timeoutSeconds) {
98
+ const gate = await runOracleGate(benchDir, join(benchDir, fixture), oracle, verifier, timeoutSeconds);
99
+ switch (gate.kind) {
100
+ case 'oracle-failed':
101
+ return {
102
+ status: 'FAIL',
103
+ evidence: benchCheckEvidence(gate.result, gate.command),
104
+ message: gate.reason ??
105
+ `oracle command itself failed (exit ${gate.exitCode}) — the reference solution cannot run`,
106
+ };
107
+ case 'verifier-failed':
108
+ return {
109
+ status: 'FAIL',
110
+ evidence: benchCheckEvidence(gate.result, gate.command),
111
+ message: gate.reason ?? 'oracle solution does not pass the verifier — the task is unwinnable or the oracle is stale',
112
+ };
113
+ case 'low-score':
114
+ return {
115
+ status: 'FAIL',
116
+ evidence: benchCheckEvidence(gate.result, gate.command),
117
+ message: `oracle passes the verifier but scores ${gate.score.toFixed(2)} on its checks — the checks are stricter than the exit code`,
118
+ };
119
+ case 'pass':
120
+ return {
121
+ status: 'PASS',
122
+ evidence: benchCheckEvidence(gate.result, gate.command),
123
+ message: `oracle solution passes the verifier${gate.score !== null ? ' with full checks' : ''}`,
124
+ };
125
+ }
126
+ }
127
+ /** Probe a loaded selection with disposable copies; no executor or calibration. */
128
+ export async function inspectBenchIntegrity(bench, push) {
129
+ let labeledTasks = 0;
130
+ let negativeTasks = 0;
131
+ for (const task of bench.tasks) {
132
+ const taskPush = (code, status, message, evidence) => push(code, status, message, task, evidence);
133
+ let facetChecks = null;
134
+ if ((task.verifierKind ?? 'output') === 'command') {
135
+ const fixtureCopy = mkdtempSync(join(tmpdir(), 'skillfit-check-'));
136
+ try {
137
+ copyFixture(join(bench.dir, task.fixture), fixtureCopy);
138
+ const pristine = await runVerifier(bench.dir, task.verifier, fixtureCopy, task.verifierTimeoutSeconds);
139
+ facetChecks = verdictFromOutput(pristine.output)?.checks ?? null;
140
+ if (pristine.error !== null || pristine.exitCode === null) {
141
+ // Without this branch a verifier that cannot even be spawned reads as a clean NOP gate:
142
+ // "fails on the untouched fixture" is exactly what `exitCode !== 0` looks like.
143
+ taskPush('UNTOUCHED_FIXTURE', 'FAIL', `${task.id}: ${verifierFailure('verifier', task.verifier, pristine.error)}`, benchCheckEvidence(pristine, task.verifier));
144
+ }
145
+ else if (pristine.exitCode === 0) {
146
+ taskPush('UNTOUCHED_FIXTURE', 'FAIL', `${task.id}: command verifier already passes on the untouched fixture — the task is solved or the verifier is broken`, benchCheckEvidence(pristine, task.verifier));
147
+ }
148
+ else {
149
+ taskPush('UNTOUCHED_FIXTURE', 'PASS', `${task.id}: command verifier fails on the untouched fixture (the failure reproduces)`, benchCheckEvidence(pristine, task.verifier));
150
+ }
151
+ }
152
+ finally {
153
+ rmSync(fixtureCopy, { recursive: true, force: true });
154
+ }
155
+ }
156
+ else {
157
+ const missing = await probeVerifier(bench.dir, task.verifier, null, task.verifierTimeoutSeconds);
158
+ if (missing.error !== null || missing.exitCode === null) {
159
+ taskPush('MISSING_OUTPUT', 'FAIL', `${task.id}: ${verifierFailure('verifier', task.verifier, missing.error)}`, benchCheckEvidence(missing, task.verifier));
160
+ }
161
+ else if (missing.exitCode === 0) {
162
+ taskPush('MISSING_OUTPUT', 'FAIL', `${task.id}: verifier does not reject a missing _output.md`, benchCheckEvidence(missing, task.verifier));
163
+ }
164
+ else {
165
+ taskPush('MISSING_OUTPUT', 'PASS', `${task.id}: verifier rejects missing output`, benchCheckEvidence(missing, task.verifier));
166
+ }
167
+ const empty = await probeVerifier(bench.dir, task.verifier, '', task.verifierTimeoutSeconds);
168
+ facetChecks = empty.checks;
169
+ if (empty.error !== null || empty.exitCode === null) {
170
+ taskPush('EMPTY_OUTPUT', 'FAIL', `${task.id}: ${verifierFailure('verifier', task.verifier, empty.error)}`, benchCheckEvidence(empty, task.verifier));
171
+ }
172
+ else if (empty.exitCode === 0) {
173
+ taskPush('EMPTY_OUTPUT', 'FAIL', `${task.id}: verifier passes an empty output — it cannot tell success from silence`, benchCheckEvidence(empty, task.verifier));
174
+ }
175
+ else {
176
+ taskPush('EMPTY_OUTPUT', 'PASS', `${task.id}: verifier rejects empty output`, benchCheckEvidence(empty, task.verifier));
177
+ }
178
+ }
179
+ const facetGate = facetCountCheck(task.id, facetChecks);
180
+ if (facetGate)
181
+ taskPush('FACET_COUNT', facetGate.status, facetGate.message);
182
+ if (task.oracle) {
183
+ const oracleResult = await probeOracle(bench.dir, task.fixture, task.oracle, task.verifier, task.verifierTimeoutSeconds);
184
+ taskPush('ORACLE', oracleResult.status, `${task.id}: ${oracleResult.message}`, oracleResult.evidence);
185
+ }
186
+ else {
187
+ taskPush('ORACLE', 'WARN', `${task.id}: no oracle — task winnability is unverified (nothing proves a correct solution passes this verifier; register one with --oracle or write ground-truth/oracle-${task.id}.mjs)`);
188
+ }
189
+ const markerPath = join(bench.dir, task.fixture, MOCK_MARKER_FILE);
190
+ if ((task.verifierKind ?? 'output') === 'command') {
191
+ taskPush('MOCK_COVERAGE', 'INFO', `${task.id}: command verifier — mock-arm probes not applicable (a mock writes _output.md text, not file edits)${task.oracle
192
+ ? '; offline coverage comes from the oracle and NOP gates above'
193
+ : '; with no oracle registered, nothing offline shows this task is solvable'}`);
194
+ }
195
+ else if (existsSync(markerPath)) {
196
+ try {
197
+ const marker = JSON.parse(readFileSync(markerPath, 'utf8'));
198
+ for (const arm of ['baseline', 'treatment']) {
199
+ const behavior = marker[arm];
200
+ if (behavior?.output === undefined) {
201
+ taskPush(arm === 'baseline' ? 'MOCK_BASELINE' : 'MOCK_TREATMENT', 'INFO', `${task.id}: no mock ${arm} output — this arm was not probed`);
202
+ continue;
203
+ }
204
+ const probe = await probeVerifier(bench.dir, task.verifier, behavior.output, task.verifierTimeoutSeconds);
205
+ taskPush(arm === 'baseline' ? 'MOCK_BASELINE' : 'MOCK_TREATMENT', probe.error !== null || probe.exitCode === null ? 'FAIL' : 'INFO', `${task.id}: mock ${arm} output → ${probe.error !== null || probe.exitCode === null ? verifierFailure('verifier', task.verifier, probe.error) : `verifier ${probe.exitCode === 0 ? 'pass' : 'fail'}`}`, benchCheckEvidence(probe, task.verifier));
206
+ }
207
+ }
208
+ catch (error) {
209
+ throwIfEvaluationInterrupted();
210
+ taskPush('MOCK_MARKER', 'FAIL', `${task.id}: ${MOCK_MARKER_FILE} is unreadable (${error.message})`);
211
+ }
212
+ }
213
+ else {
214
+ taskPush('MOCK_COVERAGE', 'INFO', `${task.id}: no ${MOCK_MARKER_FILE} (offline mock runs will produce empty outputs)`);
215
+ }
216
+ const fixtureDir = join(bench.dir, task.fixture);
217
+ const fixtureBytes = listFilesRecursive(fixtureDir)
218
+ .map((rel) => statSync(join(fixtureDir, rel)).size)
219
+ .reduce((sum, size) => sum + size, 0);
220
+ if (fixtureBytes > FIXTURE_SIZE_WARN_BYTES) {
221
+ taskPush('FIXTURE_SIZE', 'WARN', `${task.id}: fixture is ${Math.round(fixtureBytes / 1024)} KB — inject mode inlines it into every prompt; keep it lean`);
222
+ }
223
+ else {
224
+ taskPush('FIXTURE_SIZE', 'PASS', `${task.id}: fixture size ${Math.round(fixtureBytes / 1024)} KB`);
225
+ }
226
+ if (task.shouldTrigger === undefined) {
227
+ taskPush('TRIGGER_LABEL', 'INFO', `${task.id}: no shouldTrigger label (trigger mode will skip this task)`);
228
+ }
229
+ else {
230
+ labeledTasks++;
231
+ if (task.shouldTrigger === false)
232
+ negativeTasks++;
233
+ }
234
+ }
235
+ if (labeledTasks > 0) {
236
+ const fraction = negativeTasks / labeledTasks;
237
+ const percent = Math.round(fraction * 100);
238
+ if (negativeTasks === 0) {
239
+ push('NEGATIVE_CONTROLS', 'WARN', 'no shouldTrigger:false (negative-control) tasks — trigger mode cannot measure false-trigger rate (see docs/metrics.md)');
240
+ }
241
+ else if (fraction < NEGATIVE_CONTROL_TARGET) {
242
+ push('NEGATIVE_CONTROLS', 'WARN', `${negativeTasks}/${labeledTasks} labeled task(s) are negative controls (${percent}%) — below the ${NEGATIVE_CONTROL_PERCENT}% target in docs/metrics.md, so false-trigger rate rests on a thin sample`);
243
+ }
244
+ else {
245
+ push('NEGATIVE_CONTROLS', 'PASS', `${negativeTasks}/${labeledTasks} labeled task(s) are negative controls (${percent}%) — at or above the ${NEGATIVE_CONTROL_PERCENT}% target`);
246
+ }
247
+ }
248
+ }
249
+ /** Shared offline entry for callers that need data rather than a CLI summary. */
250
+ export async function runOfflineBenchCheck(options) {
251
+ return withEvaluationInterrupts(async () => {
252
+ let dir = resolve(options.dir ?? '.');
253
+ const checks = [];
254
+ let identity = null;
255
+ const result = () => ({ dir, bench: identity, checks,
256
+ failures: checks.filter(check => check.status === 'FAIL').length,
257
+ warnings: checks.filter(check => check.status === 'WARN').length });
258
+ const push = (code, status, message, task, evidence) => {
259
+ throwIfEvaluationInterrupted();
260
+ checks.push(benchDiagnostic(code, status, message, task, evidence));
261
+ options.log?.(`[${status}] ${message}`);
262
+ };
263
+ let bench;
264
+ try {
265
+ dir = resolveBenchDir(options.dir ?? '.');
266
+ bench = selectBenchTasks(loadBench(dir), options.taskIds);
267
+ }
268
+ catch (error) {
269
+ push('BENCH_LOAD', 'FAIL', `bench does not load: ${error.message}`);
270
+ return result();
271
+ }
272
+ identity = { name: bench.name, sha256: bench.contentSha256, taskCount: bench.tasks.length };
273
+ push('BENCH_LOAD', 'PASS', `bench.json valid (${bench.tasks.length} task(s), content sha256 ${bench.contentSha256.slice(0, 12)}…)`);
274
+ await inspectBenchIntegrity(bench, push);
275
+ return result();
276
+ });
277
+ }
@@ -0,0 +1,34 @@
1
+ import { verdictFromOutput } from './verifier-summary.js';
2
+ import { MOCK_MARKER_FILE } from './constants.js';
3
+ const GATES = {
4
+ BENCH_LOAD: [null, 'Fix bench.json and its referenced files, then run bench check again.'],
5
+ UNTOUCHED_FIXTURE: ['verifier', 'Make the verifier executable and ensure the untouched fixture fails for the intended defect.'],
6
+ MISSING_OUTPUT: ['verifier', 'Make the verifier executable and reject a missing _output.md.'],
7
+ EMPTY_OUTPUT: ['verifier', 'Make the verifier executable and reject an empty _output.md.'],
8
+ FACET_COUNT: ['verifier', 'Decompose acceptance into 2–8 deterministic named checks.'],
9
+ ORACLE: ['oracle', 'Inspect the oracle and verifier output; register a reference repair that passes every check.'],
10
+ MOCK_COVERAGE: ['fixture', 'Add a valid .skillfit-mock.json marker for output tasks if mock coverage is needed.'],
11
+ MOCK_MARKER: ['fixture', 'Fix the .skillfit-mock.json file so it contains valid JSON.'],
12
+ MOCK_BASELINE: ['fixture', 'Inspect the baseline mock output and verifier.'],
13
+ MOCK_TREATMENT: ['fixture', 'Inspect the treatment mock output and verifier.'],
14
+ FIXTURE_SIZE: ['fixture', 'Shrink the fixture while preserving the real defect and acceptance checks.'],
15
+ TRIGGER_LABEL: ['shouldTrigger', 'Label trigger tasks and include appropriate negative controls.'],
16
+ NEGATIVE_CONTROLS: ['shouldTrigger', 'Add representative shouldTrigger:false tasks to reach the documented 30% target.'],
17
+ CALIBRATION: [null, 'Inspect the calibration records before considering a separately budgeted run.'],
18
+ };
19
+ export function benchDiagnostic(code, status, message, task, evidence = null) {
20
+ const [field, remediation] = GATES[code];
21
+ const marker = code.startsWith('MOCK_');
22
+ const path = task && field === 'fixture'
23
+ ? `${task.fixture}${marker ? `/${MOCK_MARKER_FILE}` : ''}` : 'bench.json';
24
+ return { code, status, message, taskId: task?.id ?? null,
25
+ location: { path, field: path === 'bench.json' && field ? `tasks[].${field}` : null },
26
+ remediation: status === 'FAIL' || status === 'WARN' ? remediation : null, evidence };
27
+ }
28
+ /** Bound process text without dropping exit status or individual verifier checks. */
29
+ export function benchCheckEvidence(result, command) {
30
+ // Verifier JSON is interpreted consistently with the existing runner.
31
+ return { command, exitCode: result.exitCode, error: result.error,
32
+ output: result.output.slice(-8192), outputTruncated: result.output.length > 8192,
33
+ checks: verdictFromOutput(result.output)?.checks ?? null };
34
+ }
@@ -0,0 +1,29 @@
1
+ import { existsSync, readdirSync, statSync } from 'node:fs';
2
+ import { isAbsolute, join, resolve } from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+ /** Paths win over bundled names. Explicit/existing local paths never fall back. */
5
+ export function resolveBenchDir(bench, options = {}) {
6
+ const root = options.bundledRoot ?? fileURLToPath(new URL('../../benches', import.meta.url));
7
+ const cwd = options.cwd ?? process.cwd();
8
+ if (bench !== undefined) {
9
+ const dir = resolve(cwd, bench);
10
+ if (existsSync(join(dir, 'bench.json')))
11
+ return dir;
12
+ if (existsSync(dir) || isAbsolute(bench) || /[\\/]/.test(bench) || bench === '.' || bench === '..') {
13
+ throw new Error(`Not a bench directory (missing bench.json): ${dir}`);
14
+ }
15
+ }
16
+ const candidates = existsSync(root) ? readdirSync(root).sort().map(name => ({ name, dir: join(root, name) }))
17
+ .filter(entry => statSync(entry.dir).isDirectory() && existsSync(join(entry.dir, 'bench.json'))) : [];
18
+ if (bench !== undefined) {
19
+ const match = candidates.find(entry => entry.name === bench);
20
+ if (match)
21
+ return match.dir;
22
+ throw new Error(`Not a bench directory (missing bench.json): ${resolve(cwd, bench)}`);
23
+ }
24
+ if (candidates.length === 1)
25
+ return candidates[0].dir;
26
+ if (!candidates.length)
27
+ throw new Error(`No bundled benches found under ${root}; pass --bench <path>`);
28
+ throw new Error(`More than one bundled bench is available; pick one explicitly:\n${candidates.map(entry => ` --bench ${entry.name}`).join('\n')}`);
29
+ }
@@ -0,0 +1,33 @@
1
+ import assert from 'node:assert/strict';
2
+ import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs';
3
+ import { tmpdir } from 'node:os';
4
+ import { join } from 'node:path';
5
+ import { test } from 'node:test';
6
+ import { resolveBenchDir } from './bench-location.js';
7
+ test('bench references prefer local inputs, preserve explicit-path errors and choose bundled names consistently', t => {
8
+ const root = mkdtempSync(join(tmpdir(), 'skillfit-bench-reference-'));
9
+ t.after(() => rmSync(root, { recursive: true, force: true }));
10
+ const cwd = join(root, 'user'), bundledRoot = join(root, 'package', 'benches');
11
+ mkdirSync(cwd);
12
+ mkdirSync(bundledRoot, { recursive: true });
13
+ const options = { cwd, bundledRoot };
14
+ assert.throws(() => resolveBenchDir(undefined, options), /No bundled benches/);
15
+ const bundled = join(bundledRoot, 'example');
16
+ mkdirSync(bundled);
17
+ writeFileSync(join(bundled, 'bench.json'), '{}');
18
+ assert.equal(resolveBenchDir('example', options), bundled);
19
+ assert.equal(resolveBenchDir(undefined, options), bundled);
20
+ assert.throws(() => resolveBenchDir('./example', options), /Not a bench directory/);
21
+ assert.throws(() => resolveBenchDir('absent', options), /missing bench.json/);
22
+ const local = join(cwd, 'example');
23
+ mkdirSync(local);
24
+ assert.throws(() => resolveBenchDir('example', options), /Not a bench directory/, 'An existing local directory must not silently use a bundled case.');
25
+ writeFileSync(join(local, 'bench.json'), '{malformed-but-local');
26
+ assert.equal(resolveBenchDir('example', options), local);
27
+ assert.equal(resolveBenchDir('./example', options), local);
28
+ assert.equal(resolveBenchDir('.', { ...options, cwd: local }), local);
29
+ const other = join(bundledRoot, 'other');
30
+ mkdirSync(other);
31
+ writeFileSync(join(other, 'bench.json'), '{}');
32
+ assert.throws(() => resolveBenchDir(undefined, options), /pick one explicitly/);
33
+ });
@@ -2,9 +2,12 @@ import { existsSync, readFileSync, statSync } from 'node:fs';
2
2
  import { basename, isAbsolute, join, resolve, sep } from 'node:path';
3
3
  import { hashFileSet, listFilesRecursive } from './hash.js';
4
4
  import { parseCommand } from './command.js';
5
+ import { parseVerifierTimeoutSeconds } from './verifier-timeout.js';
5
6
  export const BENCH_SCHEMA_VERSION = 1;
6
7
  const TASK_ID_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
7
8
  function assertRelativeInside(benchDir, rel, label) {
9
+ if (rel.split(/[\\/]/).includes('.git'))
10
+ throw new Error(`${label} cannot reference Git metadata: ${rel}`);
8
11
  if (isAbsolute(rel) || rel.split(/[\\/]/).includes('..')) {
9
12
  throw new Error(`${label} must be a relative path inside the bench directory: ${rel}`);
10
13
  }
@@ -49,6 +52,8 @@ export function validateBenchTask(benchDir, raw, index) {
49
52
  throw new Error(`bench.json task "${id}" has an invalid "verifierKind" field (expected "output" or "command")`);
50
53
  }
51
54
  const verifierKindField = verifierKind === undefined ? {} : { verifierKind: verifierKind };
55
+ const timeoutField = task['verifierTimeoutSeconds'] === undefined ? {} :
56
+ { verifierTimeoutSeconds: parseVerifierTimeoutSeconds(task['verifierTimeoutSeconds']) };
52
57
  if (shouldTrigger !== undefined && typeof shouldTrigger !== 'boolean') {
53
58
  throw new Error(`bench.json task "${id}" has an invalid "shouldTrigger" field`);
54
59
  }
@@ -98,9 +103,9 @@ export function validateBenchTask(benchDir, raw, index) {
98
103
  if (!existsSync(rubricAbs) || !statSync(rubricAbs).isFile()) {
99
104
  throw new Error(`task "${id}" rubric file not found: ${rubric}`);
100
105
  }
101
- return { id, fixture, prompt, verifier, rubric, ...triggerField, ...promptTriggerField, ...verifierKindField, ...oracleField };
106
+ return { id, fixture, prompt, verifier, rubric, ...triggerField, ...promptTriggerField, ...verifierKindField, ...timeoutField, ...oracleField };
102
107
  }
103
- return { id, fixture, prompt, verifier, ...triggerField, ...promptTriggerField, ...verifierKindField, ...oracleField };
108
+ return { id, fixture, prompt, verifier, ...triggerField, ...promptTriggerField, ...verifierKindField, ...timeoutField, ...oracleField };
104
109
  }
105
110
  export function loadBench(benchDir) {
106
111
  const dir = resolve(benchDir);
@@ -130,7 +135,7 @@ export function loadBench(benchDir) {
130
135
  seen.add(task.id);
131
136
  }
132
137
  const name = typeof raw.name === 'string' && raw.name.trim() !== '' ? raw.name : basename(dir);
133
- const contentSha256 = hashFileSet(dir, listFilesRecursive(dir));
138
+ const contentSha256 = hashFileSet(dir, listFilesRecursive(dir, { excludeGitMetadata: true }));
134
139
  return { dir, name, schemaVersion: BENCH_SCHEMA_VERSION, tasks, contentSha256 };
135
140
  }
136
141
  /** Keep manifest order so selecting IDs cannot silently change balanced pair order. */
@@ -1,4 +1,4 @@
1
- import { parseEvalReport } from '../commands/eval-report.js';
1
+ import { parseEvalReport } from './eval-manifest.js';
2
2
  import { completeCost, COST_METRICS } from './costs.js';
3
3
  import { parseAcceptancePolicy, policyHash, record } from './eval-contract.js';
4
4
  import { efficiencyEvidence } from './eval-efficiency.js';
@@ -10,7 +10,7 @@ import { sha256File, sha256Text } from './hash.js';
10
10
  import { collectInstalledSkillTarget } from './installed-skill.js';
11
11
  import { runVerifier, summarizeJudge } from './runner.js';
12
12
  import { verdictFromOutput } from './verifier-summary.js';
13
- import { parseEvalReport } from '../commands/eval-report.js';
13
+ import { parseEvalReport } from './eval-manifest.js';
14
14
  import { pairConditions } from './types.js';
15
15
  import { NATIVE_DIFF_PATH, NATIVE_DIFF_SNAPSHOT } from './native-diff.js';
16
16
  import { assertSpendingCanContinue, parseSpendingBudget, spendingBudgetState } from './eval-budget.js';
@@ -228,7 +228,7 @@ export async function auditEvaluation(value, runDir, options = {}) {
228
228
  const scratch = mkdtempSync(join(tmpdir(), 'skillfit-eval-replay-'));
229
229
  try {
230
230
  cpSync(join(root, task.id, arm, `trial-${trial}`), scratch, { recursive: true, filter: path => basename(path) !== '.git' });
231
- const grade = await runVerifier(bench.dir, definition.verifier, scratch), summary = verdictFromOutput(grade.output);
231
+ const grade = await runVerifier(bench.dir, definition.verifier, scratch, definition.verifierTimeoutSeconds), summary = verdictFromOutput(grade.output);
232
232
  assert.equal(grade.error, null, `Replay verifier failed: ${grade.error}`);
233
233
  assert.notEqual(grade.exitCode, null);
234
234
  assert.equal(grade.exitCode, r.verifierExitCode);