skillfit 0.10.0 → 0.11.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 (104) hide show
  1. package/README.md +27 -7
  2. package/README.zh-CN.md +27 -7
  3. package/benches/README.md +2 -2
  4. package/dist/cli.js +146 -36
  5. package/dist/cli.test.js +94 -0
  6. package/dist/commands/bench-calibration.js +197 -0
  7. package/dist/commands/bench-calibration.test.js +237 -0
  8. package/dist/commands/bench-check-json.test.js +24 -3
  9. package/dist/commands/bench.js +69 -141
  10. package/dist/commands/calibration-cli.test.js +145 -0
  11. package/dist/commands/eval-agent-preflight.test.js +245 -0
  12. package/dist/commands/eval-cli.js +31 -0
  13. package/dist/commands/eval-component.js +59 -28
  14. package/dist/commands/eval-export-modes.test.js +350 -0
  15. package/dist/commands/eval-export.js +44 -10
  16. package/dist/commands/eval-export.test.js +165 -8
  17. package/dist/commands/eval-interruption.test.js +238 -0
  18. package/dist/commands/eval-plan.js +37 -0
  19. package/dist/commands/eval-preflight.js +61 -0
  20. package/dist/commands/eval-preflight.test.js +382 -0
  21. package/dist/commands/eval-report.js +60 -14
  22. package/dist/commands/eval-report.test.js +2 -2
  23. package/dist/commands/eval-single-arm-replay.js +21 -0
  24. package/dist/commands/eval-single-arm-report.js +223 -0
  25. package/dist/commands/eval.js +184 -112
  26. package/dist/commands/evaluation-report.js +5 -0
  27. package/dist/commands/evaluation-report.test.js +243 -0
  28. package/dist/commands/replay-cancellation.test.js +105 -0
  29. package/dist/commands/workflow-entrypoints.test.js +137 -0
  30. package/dist/harness/agent-preflight.js +180 -0
  31. package/dist/harness/bench.js +2 -1
  32. package/dist/harness/command.js +49 -0
  33. package/dist/harness/eval-audit.js +164 -17
  34. package/dist/harness/eval-budget.js +46 -2
  35. package/dist/harness/eval-budget.test.js +30 -3
  36. package/dist/harness/eval-component.test.js +169 -6
  37. package/dist/harness/eval-contract.js +11 -5
  38. package/dist/harness/executors/api.js +14 -4
  39. package/dist/harness/executors/api.test.js +61 -0
  40. package/dist/harness/executors/cli.js +24 -3
  41. package/dist/harness/experiment-session.js +77 -18
  42. package/dist/harness/experiment-session.test.js +51 -1
  43. package/dist/harness/input-snapshot.js +150 -0
  44. package/dist/harness/interruption.js +48 -0
  45. package/dist/harness/interruption.test.js +31 -0
  46. package/dist/harness/invocation-costs.js +72 -0
  47. package/dist/harness/judge-accounting.test.js +216 -0
  48. package/dist/harness/judge-audit.js +56 -0
  49. package/dist/harness/judge.js +86 -21
  50. package/dist/harness/replay-package.js +71 -5
  51. package/dist/harness/runner.js +92 -44
  52. package/dist/harness/runner.test.js +23 -0
  53. package/dist/harness/single-arm-audit.js +436 -0
  54. package/dist/harness/trigger.js +41 -7
  55. package/dist/harness/trigger.test.js +12 -0
  56. package/dist/harness/verifier-error.js +65 -0
  57. package/dist/harness/verifier.test.js +128 -0
  58. package/docs/bench-authoring.md +34 -9
  59. package/docs/bench-check-json.md +36 -6
  60. package/docs/eval-agent-preflight.md +101 -0
  61. package/docs/eval-case-preflight.md +115 -0
  62. package/docs/eval-component.md +65 -9
  63. package/docs/eval-costs.md +53 -0
  64. package/docs/eval-planning.md +153 -0
  65. package/docs/evaluation-input-snapshots.md +125 -0
  66. package/docs/evaluation-interruption.md +101 -0
  67. package/docs/evaluation-reports.md +143 -0
  68. package/docs/experiment-workflow.md +16 -2
  69. package/docs/first-real-eval.md +55 -5
  70. package/docs/growth-roadmap-2026-10.md +48 -11
  71. package/docs/metrics.md +71 -3
  72. package/docs/plans/2026-10-16-case-workflow-and-release.md +19 -0
  73. package/docs/plans/2026-10-17-workflow-foundations.md +64 -0
  74. package/docs/releases/0.10.0-ci-registry-install.json +140 -0
  75. package/docs/releases/0.10.0-feature-smoke.json +22 -0
  76. package/docs/releases/0.10.0-feature-smoke.mjs +62 -0
  77. package/docs/releases/0.10.0-signatures.txt +7 -0
  78. package/docs/releases/0.10.0-verification.json +76 -0
  79. package/docs/releases/0.10.0.md +44 -8
  80. package/docs/releases/0.10.1-ci-registry-install.json +70 -0
  81. package/docs/releases/0.10.1-feature-smoke.json +28 -0
  82. package/docs/releases/0.10.1-feature-smoke.mjs +95 -0
  83. package/docs/releases/0.10.1-local-registry-install.json +60 -0
  84. package/docs/releases/0.10.1-registry-metadata.json +33 -0
  85. package/docs/releases/0.10.1-signatures.txt +7 -0
  86. package/docs/releases/0.10.1-verification.json +90 -0
  87. package/docs/releases/0.10.1.md +71 -0
  88. package/docs/releases/0.11.0-feature-smoke.mjs +224 -0
  89. package/docs/releases/0.11.0.md +47 -0
  90. package/docs/replay-packages.md +52 -11
  91. package/docs/schemas/agent-preflight.schema.json +31 -0
  92. package/docs/schemas/calibration-plan.schema.json +22 -0
  93. package/docs/schemas/calibration-result.schema.json +17 -0
  94. package/docs/schemas/eval-preflight.schema.json +57 -0
  95. package/docs/schemas/eval-request.schema.json +1 -1
  96. package/docs/schemas/eval-result.schema.json +14 -1
  97. package/docs/schemas/invocation-costs.schema.json +31 -0
  98. package/docs/schemas/judge-call.schema.json +22 -0
  99. package/docs/schemas/single-arm-report.schema.json +20 -0
  100. package/docs/schemas/verifier-error.schema.json +11 -0
  101. package/docs/sharing-results.md +8 -2
  102. package/docs/verifier-contract.md +99 -0
  103. package/package.json +1 -1
  104. package/skills/skillfit/SKILL.md +41 -8
@@ -5,6 +5,15 @@ Paired `eval` runs record descriptive agent costs in `tasks[].costs` and
5
5
  terminal summary and `report eval <manifest.json>` show the same cost tables.
6
6
  Reading a report makes no model call and does not change the manifest or verdict.
7
7
 
8
+ Version 0.11.0 exposes the same paired spending guard through ordinary
9
+ `--spending-budget <file>` and request `spendingBudget`. The five limits and
10
+ effective primary executor deadline are visible in the shared plan and sealed
11
+ for offline replay; the source budget file is unnecessary after execution.
12
+ Limits stop between calls and can overshoot in flight. Version 0.11.0 also
13
+ applies the guard to calibration, trigger runs and both judge orders; judge
14
+ calls count against the same run-wide limits. These are operational limits, separate from relative
15
+ adoption ceilings or a provider invoice. See [shared planning](eval-planning.md).
16
+
8
17
  ## Two populations
9
18
 
10
19
  - **Surviving graded pairs:** the same paired observations used by the quality
@@ -21,6 +30,41 @@ spending totals. An executor invocation does not prove that a provider accepted
21
30
  a request or billed it. These counts do not include the optional judge, earlier
22
31
  calibration cohorts or another experiment's setup spending.
23
32
 
33
+ ## All executor roles (source after npm 0.10.1)
34
+
35
+ New paired manifests and JSON reports add `invocationCosts`, independently of
36
+ the unchanged primary Agent's `overall.costs`. It contains `agent`, `judge` and
37
+ `total` populations and `judgeUsage: recorded | unknown | not-requested`;
38
+ see the [schema](schemas/invocation-costs.schema.json). Each population retains
39
+ the five measures and final/partial/unknown coverage below. Judge `passes`
40
+ counts successfully parsed grading calls, so the combined `passes` is not a task
41
+ success rate and must not be used as the denominator of Agent cost per success.
42
+
43
+ Every judge order saves a version-1 `skillfit.judge-call` receipt under
44
+ `<task>/judge-trial-<n>/call-1.json` or `call-2.json`. It retains the anonymous
45
+ prompt and hash, output, available raw output, executor, invocation/error state,
46
+ token coverage and monotonic elapsed interval. Invalid grading JSON still costs
47
+ an invocation and stops subsequent work. Failure/interruption retains partial or
48
+ unknown usage; it never becomes a free or successfully graded call. Missing
49
+ credentials for an explicitly enabled judge block before primary spending.
50
+
51
+ Reports and offline replay verify saved primary/judge receipts and their ledger.
52
+ Replay checks retained judge prompts/scores/usage; it never asks a judge to grade
53
+ again. Historical missing judge receipts keep judge/combined totals unknown and
54
+ cannot qualify for a complete native export. Legacy primary costs remain readable.
55
+ Calibration and trigger reports expose their own single-arm `usage` population;
56
+ they do not acquire a paired cost comparison.
57
+
58
+ The spending recorder checks before each invocation and after each retained
59
+ receipt. Execution errors or incomplete final usage stop even after the last
60
+ scheduled call; a reached limit prevents the next call. Stopped native sessions
61
+ preserve a controlled `stopCode` (`EXECUTION_FAILED`, `FINAL_USAGE_MISSING` or
62
+ `SPENDING_BUDGET_REACHED`) and safe reason text. No automatic retry or replacement
63
+ is added. Historical absence of `stopCode` is not reconstructed; a received
64
+ SIGINT/SIGTERM retains the interruption as the primary stop reason. Generation,
65
+ local verifier/setup work and another experiment's calls
66
+ are outside these executor token populations; input sealing has separate costs.
67
+
24
68
  Each population records runs, successful tasks and five separate measures:
25
69
  input tokens, cached input tokens, uncached input tokens, output tokens and
26
70
  elapsed seconds. Elapsed time is measured around the agent invocation and
@@ -45,6 +89,15 @@ is recorded as zero. Other executors can supply cache counts through the same
45
89
  optional `TokenUsage.cachedInput` field. Existing surfaces without such counts
46
90
  continue to report unknown cache coverage.
47
91
 
92
+ In 0.10.1, the Chat Completions API executor reads
93
+ `usage.prompt_tokens_details.cached_tokens` into `TokenUsage.cachedInput`, as
94
+ documented by the [official OpenAI API reference](https://developers.openai.com/api/reference/resources/chat/subresources/completions/methods/create).
95
+ It requires a nonnegative safe integer no greater than a valid input total.
96
+ An explicit zero is preserved; missing, malformed, fractional, negative or
97
+ incompatible cache counts remain unknown. Input already includes cached tokens;
98
+ uncached input is still computed by subtraction, with no double counting.
99
+ This fixes new receipts only; historical unknown cache usage is not backfilled.
100
+
48
101
  Each measure contains `knownTotal` and coverage counts `final`, `partial` and
49
102
  `unknown`, which sum to its population's run count. A successful stream with
50
103
  missing input/output usage on a completed turn retains available increments as
@@ -0,0 +1,153 @@
1
+ # Shared evaluation planning (source after npm 0.10.1)
2
+
3
+ Ordinary paired/trigger `eval` and version-1 paired Agent requests share reviewed
4
+ planning. Baseline calibration has a separate typed plan with the same budget,
5
+ deadline and output controls in 0.11.0. npm 0.10.1 does not include these
6
+ additions. Existing revision requests remain valid.
7
+
8
+ ## Settings and baselines
9
+
10
+ | Ordinary paired eval | Agent request field | Meaning |
11
+ | --- | --- | --- |
12
+ | Target path | `candidateSkill` | Candidate complete Skill in installed mode |
13
+ | `--baseline-skill <path>` | `baselineSkill: "./skill-old"` | Previous complete Skill, same frontmatter name and different content |
14
+ | Omit `--baseline-skill` with `--mode installed` | `baselineSkill: null` | No Skill installed by the harness in baseline; complete candidate only in treatment |
15
+ | `--bench <path>` / repeated `--task <id>` | `bench` / `taskIds` | Frozen bench and selected cases in bench order |
16
+ | `--trials <n>` / `--max-calls <n>` | `trials` / `maxCalls` | Fixed repetitions and call ceiling; reject undersized ceilings before calls |
17
+ | `--pair-order baseline-first\|balanced` | `pairOrder` | Default `baseline-first`; `balanced` alternates first arm by task/trial |
18
+ | `--executor-timeout-seconds <n>` | `executorTimeoutSeconds` | Integer 1–3600, deadline per executor invocation |
19
+ | `--spending-budget <file>` | `spendingBudget` | Optional five absolute batch stop lines |
20
+ | `--runs-root <dir>` / `--run-group <fresh-name>` | `runsRoot` / `runGroup` | Output parent and fresh group; existing groups cannot be overwritten |
21
+
22
+ Requests always use installed workspace delivery without judges. `baselineSkill`
23
+ is **required**: explicit null selects no-Skill; a missing, empty or invalid value
24
+ is an error. Existing string paths still select revision comparison. The two arms
25
+ receive identical natural task prompts. “No Skill” describes harness delivery;
26
+ inherited global Skills, rules and plugins still apply. Check the agent profile
27
+ before interpreting installation benefit. Ordinary inject, rules and MCP plans
28
+ retain their existing delivery semantics.
29
+
30
+ CLI agents and requests default to 600 seconds; API execution preserves its
31
+ 120-second default. New paired plans and native records state the effective
32
+ deadline, including defaults. An explicit deadline is applied to the API too.
33
+ The effective deadline also applies to an enabled ordinary-eval judge; each
34
+ invocation has its own timer. Historical records
35
+ without deadline metadata remain unrecorded. Changed timeouts need a fresh
36
+ preview/batch; earlier timeouts and partial usage remain evidence.
37
+
38
+ ## Preview and confirm
39
+
40
+ Save this illustrative `budget.json`; choose actual limits for your authorized
41
+ task before running. These numbers are stop lines, not estimated usage or prices:
42
+
43
+ ```json
44
+ {
45
+ "input": 100000,
46
+ "cachedInput": 100000,
47
+ "uncachedInput": 100000,
48
+ "output": 10000,
49
+ "durationSeconds": 1200
50
+ }
51
+ ```
52
+
53
+ Preview a two-call no-Skill comparison without verifiers, model calls or writes:
54
+
55
+ ```bash
56
+ node dist/cli.js eval ./skill-new --mode installed --bench ./my-bench --task my-task --agent codex --trials 1 --max-calls 2 --pair-order balanced --executor-timeout-seconds 300 --spending-budget ./budget.json --runs-root ./runs --run-group no-skill-001 --json --dry-run
57
+ ```
58
+
59
+ Read `plan.sha256`, then execute the same command with `--dry-run` removed and
60
+ `--plan-sha <plan.sha256>` added **only with spending authorization**. Ordinary
61
+ JSON execution requires the hash and explicit `--run-group`. Human previews
62
+ print the same hash and support the same confirmation, while existing human
63
+ execution without `--json` may still run without a hash. Dry run never executes.
64
+ Agent requests retain their required preview-hash confirmation.
65
+
66
+ `plan.evaluation.agentPreflight` reports the [offline Agent environment checks](eval-agent-preflight.md).
67
+ Preview can return `planned` with a `blocked` environment; live execution rejects
68
+ known failures before case probes or calls. CLI resolution and check results are
69
+ bound into the plan hash and rechecked after case probes. Login remains unknown.
70
+
71
+ `plan.evaluation` has the same effective settings for equivalent installed
72
+ comparisons through either entry point. Request plans additionally bind request
73
+ bytes, purpose and acceptance policy, so their hashes differ from ordinary plans.
74
+ Use the hash from the same entry point; changes to settings, input fingerprints,
75
+ executor identity or compiled implementation invalidate confirmation. Preview
76
+ declares offline case preflight and input snapshots pending; execution performs
77
+ both before dispatch.
78
+
79
+ Budget files are parsed into fixed numeric limits before planning. Those values,
80
+ rather than the source file's path/format, are bound to the hash and sealed in
81
+ the native plan. Editing the file before a new invocation changes the plan when
82
+ the limits change; editing it during a run cannot adjust the running limits.
83
+ Reports, export and offline replay need no original budget file. Request files,
84
+ including inline limits/policy, retain their before/after-call byte guards.
85
+
86
+ ## Baseline calibration and trigger plans
87
+
88
+ These source commands also support repeated `--task`, `--max-calls`,
89
+ `--spending-budget`, `--executor-timeout-seconds`, `--runs-root`, `--run-group`,
90
+ `--json --dry-run` and exact `--plan-sha` confirmation:
91
+
92
+ ```bash
93
+ node dist/cli.js bench check ./my-bench --calibrate --agent codex --task my-task --input workspace --trials 1 --max-calls 1 --spending-budget ./budget.json --executor-timeout-seconds 300 --runs-root ./runs --run-group calibration-001 --json --dry-run
94
+ node dist/cli.js eval ./my-skill --mode trigger --bench ./my-bench --agent codex --task positive-task --task negative-task --trials 1 --max-calls 2 --spending-budget ./budget.json --executor-timeout-seconds 300 --runs-root ./runs --run-group trigger-001 --json --dry-run
95
+ ```
96
+
97
+ Use actual registered IDs. Calibration defaults to two trials per task and runs
98
+ one no-Skill baseline arm. Trigger defaults to five trials, presents on-disk
99
+ files without `--input`, and runs only selected tasks with a `shouldTrigger`
100
+ label. Unlabeled tasks are skipped; a plan with no eligible calls fails.
101
+ Include negative controls to measure false-trigger rate. Neither mode accepts
102
+ `--pair-order`; trigger does not use a judge or a revision baseline.
103
+
104
+ Calibration preview returns `kind: "skillfit.calibration-result"`, `status:
105
+ "planned"`, with a `skillfit.calibration-plan` in `plan`. Confirm its
106
+ `plan.planSha256`. Trigger uses the ordinary `skillfit.eval-result` preview and
107
+ `plan.sha256`; `plan.evaluation.mode` is `trigger`. Both JSON execution paths
108
+ require an explicit `--run-group` from the preview. Keep every effective setting
109
+ the same, remove `--dry-run` and add the correct `--plan-sha`. A generated plan
110
+ does not authorize spending or prove a ready environment.
111
+
112
+ Calibration preview executes no verifier/oracle. Live calibration performs the
113
+ offline case gates before native setup or calls; any hard failure blocks it.
114
+ Missing oracle/coverage evidence is `UNKNOWN`, separate from nonblocking `WARN`
115
+ items such as large fixtures. Its Agent environment is checked before and after
116
+ the probes, just as in eval. Checks and the reviewed plan are sealed; stopped
117
+ calibration keeps every declared task, including tasks not reached.
118
+
119
+ Read either mode through `report eval <run-dir> [--json]`. Calibration reports
120
+ baseline difficulty; trigger reports recall, false-trigger rate and detection
121
+ coverage. New sealed native runs support `--replay` and
122
+ `report eval <run-dir> --export <fresh-dir>` without another model call. Replay
123
+ regrades saved deliveries; it does not obtain new trigger observations or prove
124
+ independent validation. Single-arm reports reject paired `--policy`/`--records`
125
+ overrides and never authorize adoption. See [report types](evaluation-reports.md)
126
+ and [portable packages](replay-packages.md) for historical/runtime limits.
127
+
128
+ ## Stop rules and results
129
+
130
+ All five budget fields are required when supplied. Token lines are positive safe
131
+ integers; seconds are positive finite numbers. Limits count all invoked primary
132
+ agent and enabled judge spending, including failures and excluded partners. Reaching any line stops
133
+ the next call; one in-flight call can overshoot. Missing/partial/invalid final
134
+ usage or an execution/guard error stops further calls and retains known/unknown
135
+ spending. There are no retries, replacements or automatic expansion. The same
136
+ guard covers calibration and trigger invocations. New judge receipts preserve
137
+ both scoring orders and their usage; reports separate primary Agent, judge and
138
+ combined `invocationCosts`. Historical missing judge costs remain unknown, never
139
+ zero. An enabled API judge without credentials is an error before spending;
140
+ login validity still cannot be confirmed offline. See [cost accounting](eval-costs.md).
141
+
142
+ Ordinary `--json` returns the same `skillfit.eval-result` envelope and English
143
+ error reasons as requests, with diagnostics on stderr. Ordinary native runs seal
144
+ the reviewed plan and audit it against actual parameters; both entries retain
145
+ receipts, complete cost coverage and [portable replay](evaluation-input-snapshots.md).
146
+ JSON validation errors exit 2; stopped runs exit 2, or 130/143 for SIGINT/SIGTERM.
147
+ Plans and stopped prefixes cannot authorize adoption.
148
+
149
+ No-Skill results report improvements, regressions and costs, but retain
150
+ `REVISION_COMPARISON_REQUIRED` and `eligibleForUpgrade: false` under the existing
151
+ revision adoption policy. Ordinary runs also lack predeclared component policy
152
+ binding. Neither entry upgrades a Skill. The [acceptance contract](eval-component.md)
153
+ and [statistical protocol](metrics.md) are unchanged.
@@ -0,0 +1,125 @@
1
+ # Sealed evaluation inputs
2
+
3
+ This feature is included in 0.10.1; see its [release record](releases/0.10.1.md)
4
+ for publication status. Existing npm archives and historical evidence are unchanged.
5
+
6
+ New evaluation sessions copy and verify their inputs **before the first agent
7
+ or judge dispatch**. Editing, moving or deleting the original Skill or bench
8
+ afterward no longer prevents export or offline replay. This is a local evidence
9
+ archive; it makes zero model calls and does not rerun an evaluation.
10
+
11
+ ## When sealing happens
12
+
13
+ Live `eval` validates its declaration and runs [offline case gates](eval-case-preflight.md)
14
+ first. Its native session then exclusively claims a fresh output directory,
15
+ copies inputs, verifies their fingerprints and writes the frozen plan last.
16
+ A failed copy, changed source or inconsistent bench stops before dispatch and
17
+ removes only that session's newly claimed output. Existing outputs and sibling
18
+ runs are preserved. No partial snapshot is advertised as a completed run.
19
+
20
+ Preview remains read-only. In request JSON,
21
+ `plan.evaluation.inputSnapshot` is `{schemaVersion: 1, required: true,
22
+ status: "pending"}`; no input archive exists yet. Its policy is part of the
23
+ approved plan, while actual copy time is recorded only after execution starts.
24
+
25
+ Sealing also applies to sessions used by trigger mode and baseline calibration.
26
+ Version 0.11.0 exports/replays their sealed native evidence too; the original
27
+ frozen runtime must support single-arm replay. A separate global
28
+ configuration installation is never performed by this feature.
29
+
30
+ ## What is saved
31
+
32
+ | Native path | Contents |
33
+ | --- | --- |
34
+ | `_inputs/bench/` | Full pinned bench, including prompts, fixtures, verifiers, reference repairs and unselected tasks |
35
+ | `_inputs/target/` | Complete pinned target Skill or configuration experiment directory |
36
+ | `_inputs/baseline-skill/` | Previous complete Skill revision, when present |
37
+ | `_inputs/implementation/` | Compiled implementation used by the run |
38
+ | `_inputs/request.json` | Exact component request bytes, when present |
39
+ | `_inputs.json` | Version 1 snapshot inventory, fingerprints and directory/executable-file metadata |
40
+
41
+ The manifest identifies selected tasks as before; archiving the full bench keeps
42
+ its original content hash and all referenced files available. Empty directories
43
+ are retained. Executable permission bits are preserved on systems that support
44
+ them and checked on POSIX. Git metadata and the current run output are excluded;
45
+ symbolic links and unsupported file types are rejected. The archived bench must
46
+ load with the declared content hash before calls start. Keep Git metadata and
47
+ run outputs out of the task's input tree rather than relying on unrecorded files.
48
+
49
+ Only the listed project inputs are copied. Global configuration and globally
50
+ installed Skills keep their existing fingerprints/guards; their private contents
51
+ are not archived. External tools, installed dependencies outside these inputs,
52
+ credentials, operating-system state and server-side model identities are not
53
+ captured. Replay still needs Node.js 22+ and the verifier's external toolchains.
54
+
55
+ ## Integrity and runtime behavior
56
+
57
+ `_plan.json.inputSnapshot` binds `_inputs.json` by SHA-256. Every indexed copy is
58
+ checked against the pre-copy fingerprint and exact file/directory inventory.
59
+ The final `_artifacts.json` also covers snapshot files. The normal session checks
60
+ both original input drift and archive integrity between calls. Editing the
61
+ originals during a live evaluation still stops further dispatches; this feature
62
+ does not make a changing cohort valid. The saved snapshots retain the initially
63
+ declared inputs for inspecting or exporting that stopped run.
64
+
65
+ A missing, changed, linked or incomplete declared snapshot fails closed. Neither
66
+ matching current originals nor `--input-root` overrides bypass a damaged archive.
67
+ An updated outer artifact index cannot hide a change that disagrees with the
68
+ plan-bound snapshot inventory. Hashes establish byte consistency, not independent
69
+ publisher authentication; retain a trusted copy of evidence hashes for provenance.
70
+
71
+ JSON assessment returns `inputSnapshot` with its descriptor and cost. Historical
72
+ runs return `null`, not a fabricated archive. Stopped/incomplete reports retain
73
+ their existing `evidence.verified: false` semantics; a snapshot alone never makes
74
+ them completed, improves their cost coverage or authorizes adoption.
75
+
76
+ ## Export and replay after the originals change
77
+
78
+ ```bash
79
+ skillfit report eval ./runs/my-run --json --replay
80
+ skillfit report eval ./runs/my-run --export ./exports/my-run --json
81
+ skillfit report eval ./runs/my-run --export ./exports/my-run --yes --json
82
+ node ./exports/my-run/reproduce.mjs
83
+ ```
84
+
85
+ Native replay defaults to the sealed bench. Portable export defaults to sealed
86
+ inputs and the sealed implementation/request, so it works after original files
87
+ change or disappear. The native run directory itself can also be moved before
88
+ export. Explicit recovery roots still require exactly matching fingerprints;
89
+ the snapshot is validated first. Existing/nested export destinations remain
90
+ forbidden, and previews still write nothing.
91
+
92
+ Runs without `inputSnapshot` use the original matching-root recovery contract
93
+ described in [replay packages](replay-packages.md). New software does not rewrite
94
+ old plans, synthesize missing historical inputs or repair damaged evidence by
95
+ substituting newer files. Historical published evidence remains append-only.
96
+
97
+ ## Local overhead and privacy
98
+
99
+ `inputSnapshot.cost` records `modelCalls: 0`, observed `durationMs`, `files` and
100
+ `bytes`. Counts include the input payload and `_inputs.json`; bytes are apparent
101
+ file sizes, not filesystem allocation. Elapsed time covers snapshot copying and
102
+ verification, not later per-call guards or an external toolchain bill. Sealing
103
+ and integrity checks add local I/O and storage without changing primary-agent
104
+ token totals, call budgets, duration populations or statistical/adoption rules.
105
+ Per-call archive checks run within the existing trial timer where applicable;
106
+ `inputSnapshot.cost.durationMs` is only the one-time sealing interval.
107
+
108
+ Portable export preserves the unchanged native archive and also supplies the
109
+ portable input/runtime layout; it therefore contains additional copies. Its
110
+ existing byte/file preview includes those source copies. No automatic pruning
111
+ or redaction removes evidence. Snapshots can include repository data, reference
112
+ answers and private target resources: review the run/package before sharing.
113
+
114
+ ## Offline regression checks
115
+
116
+ ```bash
117
+ npm test
118
+ node --test dist/commands/eval-export.test.js dist/harness/experiment-session.test.js dist/harness/eval-component.test.js
119
+ ```
120
+
121
+ Tests use mock executors and local files. They cover archive presence before
122
+ dispatch, zero-call failure cleanup, source/archive drift, complete Skill/request
123
+ retention, changed/deleted originals, moved runs, stopped costs, portable replay,
124
+ legacy recovery, empty fixtures, executable files and corrupted/linked snapshots.
125
+ No real model API or agent CLI is called.
@@ -0,0 +1,101 @@
1
+ # Interrupt and retain an evaluation
2
+
3
+ This fix is included in 0.10.1; see the [release record](releases/0.10.1.md)
4
+ for publication status. The immutable npm 0.10.0 archive does not include it. It changes interruption
5
+ handling, not the statistical or adoption protocol.
6
+
7
+ ## Stop a live run
8
+
9
+ Press **Ctrl+C** once during a live evaluation. The same path handles `SIGTERM`.
10
+ It covers paired inject/installed evaluations, JSON request execution, trigger
11
+ evaluations and live `bench check --calibrate`. It also stops an active harness
12
+ verifier or judge. Read-only JSON previews and reports start no executor.
13
+
14
+ Version 0.11.0 extends cancellation across standalone `bench check`,
15
+ including its verifier and reference-repair descendants. Disposable probe copies
16
+ are removed. Nested checks reuse the enclosing evaluation's cancellation context
17
+ and restore handlers when finished; they do not swallow the interruption.
18
+
19
+ The source also cancels [offline case preflight](eval-case-preflight.md) before
20
+ dispatch. Its verifier/oracle trees stop with exit 130/143 and zero model calls;
21
+ because a native run has not started, no stopped run directory is synthesized.
22
+ Once a run directory exists, the retained-evidence contract below applies.
23
+
24
+ The runner stops subsequent dispatches, terminates managed CLI/process trees
25
+ and waits for output to close. POSIX uses the process group; Windows uses
26
+ `taskkill /T`. Pipe draining is bounded when a descendant retains a pipe. HTTP
27
+ executors abort their local request. The process then seals retained records and
28
+ exits **130 for SIGINT** or **143 for SIGTERM**, including request-based JSON
29
+ execution. Diagnostics go to stderr; JSON stdout remains one document.
30
+
31
+ Repeated signals during cleanup keep the first interruption and do not bypass
32
+ sealing. There is no automatic retry, replacement, partner invocation or expansion.
33
+ Wait for the command to finish rather than treating the first signal as an
34
+ immediate process exit. After sealing, signal handlers and cancellation context
35
+ are removed so later operations do not inherit a cancelled run.
36
+
37
+ ## Retained evidence
38
+
39
+ The native run directory keeps:
40
+
41
+ - `_plan.json` and `_calls.jsonl`: original declaration and actual dispatch events.
42
+ - In new source runs, `_inputs.json` and `_inputs/`: sealed inputs available even
43
+ if original Skill/bench/request paths later change or disappear.
44
+ - Existing per-trial output, transcripts and `_result.json`: settled final usage
45
+ stays final; recovered counters from an interrupted call stay partial; missing
46
+ usage stays unknown. Interruption is an execution error, not a graded failure.
47
+ - `_interruption.json`: version 1 signal name, receipt time, exit code and
48
+ `automaticRetry: false`.
49
+ - `_session.json`: stopped status, call counts and stop reason.
50
+ - `_artifacts.json`: inventory and hashes of retained files, including interruption
51
+ metadata. A stopped prefix does not acquire a completed efficacy verdict.
52
+
53
+ Version 0.11.0 records each judge call separately and shows primary
54
+ Agent, judge and combined invocation costs; missing/partial usage remains
55
+ incomplete. An interrupted judge also retains the existing
56
+ `_interrupted-judge-<call>.json` record. Neither a receipt nor a known token total
57
+ proves an exact provider bill. See [cost accounting](eval-costs.md).
58
+
59
+ The same source seals stopped calibration `_calibration.json` records with the
60
+ whole declared task set, including zero-count tasks not reached. Trigger receipts
61
+ retain interrupted output/tokens with partial/unknown status. Supported sealed
62
+ paired, calibration and trigger runs, including new judge receipts, can be read,
63
+ audited and exported with the shared report entry point. Historical summaries
64
+ without native evidence remain unverified; missing original runtime support
65
+ cannot be silently supplied by substituting a new implementation.
66
+
67
+ Inspect a stopped native run without another agent call:
68
+
69
+ ```bash
70
+ node dist/cli.js report eval ./runs/my-run --json
71
+ node dist/cli.js report eval ./runs/my-run --export ./exports/my-run --json
72
+ ```
73
+
74
+ Export uses [sealed inputs](evaluation-input-snapshots.md) for new source runs;
75
+ older runs still require matching recovered inputs. A fresh destination is required. A completed
76
+ export replays the same stopped status and cost coverage; it cannot authorize an
77
+ upgrade. Preserve this run, fix the cause and make a fresh bounded declaration if
78
+ further spending is authorized. Unused slots are not permission to continue.
79
+
80
+ Local cancellation cannot guarantee that a provider stops work already accepted
81
+ on its servers. Usage unavailable after HTTP cancellation remains unknown.
82
+ `SIGKILL`, power loss and storage failures can prevent sealing; a directory without
83
+ final session/index files remains incomplete. Built-in executors and managed local
84
+ processes participate in cancellation; unrelated services are outside that control.
85
+
86
+ ## Offline regression checks
87
+
88
+ ```bash
89
+ npm test
90
+ node --test dist/commands/eval-interruption.test.js dist/commands/bench-calibration.test.js dist/harness/interruption.test.js
91
+ ```
92
+
93
+ The tests inject fake Node CLI/process trees and a fake fetch implementation. They
94
+ check standalone verifier/oracle descendants and interrupted primary/verifier/judge work, trigger/calibration/request execution,
95
+ repeated signals, between-call interruption, partial and unknown costs, sealed
96
+ inventories, stopped-package replay, exit codes and handler/context cleanup.
97
+ POSIX integration tests deliver real OS signals to the harness. Windows tests emit
98
+ the corresponding Node signal event through an isolated harness because Node's
99
+ `child.kill('SIGINT')` forcibly terminates a Windows process; real Windows
100
+ `taskkill /T` still terminates the fake CLI and its descendant. These tests do not
101
+ establish physical-console event delivery or call any real model or agent CLI.
@@ -0,0 +1,143 @@
1
+ # Read an evaluation report
2
+
3
+ Version 0.10.1 uses the same saved-evidence assessment for Markdown and JSON.
4
+ Both formats accept a manifest file, native run directory or portable replay
5
+ package directory. Neither starts an agent or changes the saved run.
6
+
7
+ Version 0.11.0 also displays the saved [Agent environment preflight](eval-agent-preflight.md).
8
+ JSON exposes `agentPreflight`; human reports omit its local evidence paths.
9
+ Missing historical metadata stays null. Reading/replaying a report does not
10
+ repeat environment/authentication probes or claim the current machine is ready.
11
+
12
+ ```bash
13
+ skillfit report eval ./runs/my-run
14
+ skillfit report eval ./runs/my-run --json
15
+ skillfit report eval ./runs/my-run/manifest.json
16
+ skillfit report eval ./exports/my-run --replay
17
+ ```
18
+
19
+ For paired runs, `--json` changes the format, not which evidence is checked. `--replay`,
20
+ `--records <run-dir>` and `--policy <policy.json>` work with either format.
21
+ Replay grades disposable delivery copies using trusted local verifiers; it
22
+ does not call a model. An overridden policy is post-hoc and cannot authorize
23
+ adoption unless it matches the policy frozen before execution. Portable packages
24
+ already pin their run/bench and reject external records/bench overrides.
25
+
26
+ ## Completed, stopped and incomplete inputs
27
+
28
+ - A completed manifest retains the existing quality/facet/cost tables. Markdown
29
+ also shows the native audit status, separate acceptance decision, upgrade
30
+ eligibility and reasons. A statistical quality verdict is not an adoption
31
+ decision. `automaticUpgrade` remains false.
32
+ - A paired native directory without a final manifest shows retained stopped/
33
+ incomplete spending; the single-arm dispatch below handles calibration and
34
+ trigger sessions separately. It displays the stop reason when
35
+ available, retained costs, missing/invalid receipt counts and unknown coverage.
36
+ It does not fabricate a paired quality verdict or overwrite the run.
37
+ - A standalone historical manifest stays readable. Missing native evidence
38
+ remains `unverified`; rendering it cannot authenticate the source or qualify
39
+ it for adoption. Available current preflight and input-snapshot metadata are
40
+ displayed separately; their presence alone does not validate a stopped run.
41
+ - Corrupt native evidence is reported as unverified with audit/acceptance
42
+ reasons. A changed portable package fails its inventory/hash verification
43
+ before rendering. An empty directory, missing path or malformed/unsupported
44
+ manifest is an input error.
45
+
46
+ Successful rendering keeps exit 0 even if acceptance is `reject` or
47
+ `inconclusive`; callers must inspect `acceptance` and `evidence` rather than
48
+ interpret the exit code as approval to upgrade. Invalid inputs fail nonzero.
49
+ JSON keeps its version 1 contract. Human reports abbreviate the local run root
50
+ as `[run]` in diagnostic text; JSON retains precise paths for investigation.
51
+
52
+ Saved costs stay in their original final/partial/unknown populations. Reports do
53
+ not replace missing cache counts with zero or estimate unrecorded billing.
54
+ See [cost accounting](eval-costs.md), [input snapshots](evaluation-input-snapshots.md)
55
+ and [portable packages](replay-packages.md). Review project data before sharing.
56
+
57
+ ## Calibration and trigger reports (source after npm 0.10.1)
58
+
59
+ Version 0.11.0 recognizes baseline calibration and trigger runs; the immutable
60
+ npm 0.10.1 archive is unchanged.
61
+ Markdown and JSON use the same read-only dispatcher:
62
+
63
+ ```bash
64
+ node dist/cli.js report eval ./runs/calibrate-my-bench
65
+ node dist/cli.js report eval ./runs/calibrate-my-bench/_calibration.json --json
66
+ node dist/cli.js report eval ./runs/trigger-my-skill
67
+ node dist/cli.js report eval ./runs/trigger-my-skill/manifest.json --json
68
+ ```
69
+
70
+ | Saved result | JSON kind (schemaVersion 1) | Output |
71
+ | --- | --- | --- |
72
+ | Paired v4 manifest | `skillfit.eval-result` (unchanged) | Paired quality/cost observations, native audit and separate acceptance policy |
73
+ | Calibration `_calibration.json` | `skillfit.calibration-report` | `evaluationType: "calibration"`, baseline pass rate, task difficulty bands and available baseline receipt usage |
74
+ | Trigger v1 manifest (`mode: "trigger"`) | `skillfit.trigger-report` | `evaluationType: "trigger"`, recall, false-trigger rate, precision, F1, class breakdowns and detection coverage |
75
+
76
+ Calibration directories resolve `_calibration.json`, rather than requiring a
77
+ paired `manifest.json`. Both directories and explicit summary files work;
78
+ renamed standalone calibration summaries are recognized by their v1 shape.
79
+ Ambiguous directories containing both final summary types fail. An unrelated
80
+ schema-v1 file is never accepted as a paired experiment.
81
+
82
+ `status` follows consistent saved experiment/session metadata: `completed`,
83
+ `stopped` or `incomplete`. A summary without recorded session metadata is
84
+ `reported`, with unverified provenance. Missing final summaries are `stopped`
85
+ only when a saved session says stopped; otherwise they are `incomplete`, even
86
+ if a sidecar claims completion. Their `summary` is null: no final metrics are
87
+ invented. Present summaries must have valid counts and trial coverage; conflicts
88
+ with the saved session or native plan fail rather than being silently reclassified.
89
+
90
+ Calibration `summary.tasks` includes `passes`, `completed`, ungraded `errors`,
91
+ `passRate` and `difficulty`. Completed runs exclude execution errors. Bands match
92
+ the existing calibration protocol: pass rate >=90% is `saturated`, <=10% is
93
+ `floor`, otherwise `discriminative`; zero completed runs are `unmeasured` with
94
+ null pass rate. `summary.metrics` retains totals and measured/discriminative task
95
+ counts. Native `usage` shows available baseline receipt totals with
96
+ final/partial/unknown coverage, including unknown missing receipts; it is null
97
+ when no native invocation ledger is available. No per-success A/B change or bill
98
+ is inferred. Difficulty is not a measure of Skill benefit.
99
+
100
+ Trigger metrics are recomputed from retained task counts using the existing
101
+ formulas; provided aggregate fields must agree. Unknown detections and execution
102
+ errors stay separate and outside rate denominators. Zero denominators remain
103
+ null (`n/a`); recall, false-trigger rate and precision use Wilson 95% intervals.
104
+ F1 has no invented interval. Available `triggerClass` breakdowns, competition
105
+ mode, source warnings and the distinction between a `SKILL.md` read and a Skill
106
+ invocation stay visible. Historical input/output token aggregates are not a
107
+ complete cost population; absent cache/final-usage evidence remains unknown.
108
+
109
+ Standalone historical single-arm summaries return `evidence.verified: false`
110
+ with scope `saved-summary-only`. Version 0.11.0 can audit sealed native single-arm
111
+ receipts with scope `single-arm-native`; `evidence.verified` reports the actual
112
+ inventory/ledger/input/receipt check result. Both return `acceptance.decision: "inconclusive"`,
113
+ `eligibleForUpgrade: false`, `automaticUpgrade: false`. Parsing a consistent
114
+ summary is not a paired native audit, independent validation or adoption decision.
115
+ Verifying single-arm evidence does not establish an A/B effect. They do not enter the paired efficacy protocol. The existing request-based
116
+ revision component and paired report JSON contract remain unchanged.
117
+
118
+ `--policy` and external `--records` remain paired-report options. Sealed native
119
+ single-arm reports now accept `--replay` and an optional matching `--bench` only
120
+ with replay. Regrading uses disposable saved deliveries. Trigger discovery is
121
+ recomputed from retained observations, not a new Agent invocation. Changed
122
+ deliveries, fingerprints and verdicts fail verification. Calibration/trigger
123
+ exports retain the original compiled implementation and reject older runtimes
124
+ without single-arm replay support; see [portable packages](replay-packages.md).
125
+ Successful rendering exits 0; invalid human inputs exit 1, while invalid JSON
126
+ reports use the existing error envelope and exit 2. Saved input files are never
127
+ rewritten, and reading any of these reports makes zero model or agent CLI calls.
128
+
129
+ ## Judge spending and stop reasons (source after npm 0.10.1)
130
+
131
+ Paired Markdown and JSON additionally show `invocationCosts`: separate primary,
132
+ judge and combined populations. The original Agent A/B quality and cost tables
133
+ remain unchanged. Successful, failed and interrupted judge orders have independent
134
+ receipts and final/partial/unknown usage. Missing historical judge usage stays
135
+ unknown. See [all executor roles](eval-costs.md#all-executor-roles-source-after-npm-0101).
136
+
137
+ Budget stops retain `session.stopCode` and safe reason text. Single-arm reports
138
+ show the same frozen `spendingBudget` limits/latest state as paired reports.
139
+ The native audit and any upgrade eligibility are separate decisions; all
140
+ single-arm, stopped and insufficient-evidence results remain ineligible.
141
+ The [single-arm schema](schemas/single-arm-report.schema.json) and
142
+ [calibration command schema](schemas/calibration-result.schema.json) describe
143
+ their machine envelopes.
@@ -2,14 +2,28 @@
2
2
 
3
3
  Use the existing CLI workflow to compare a pinned Skill with baseline on real failures. A historical replay does not create an upstream PR: its purpose is to grade both arms consistently before spending time installing a Skill.
4
4
 
5
+ Version 0.10.1 handles Ctrl+C/SIGTERM by stopping managed evaluation
6
+ processes, retaining available output/usage and sealing a stopped run before
7
+ exit 130/143. No partner/retry/replacement is dispatched after cancellation.
8
+ See [interruption and retained records](evaluation-interruption.md). Forced
9
+ termination/power loss may prevent sealing. The same release enforces offline
10
+ case gates and seals project input copies before dispatch. See [sealed inputs](evaluation-input-snapshots.md).
11
+
12
+ Version 0.11.0 shares reviewed plans between ordinary paired eval and
13
+ Agent requests, including [budget/deadline/output controls](eval-planning.md).
14
+ Use `--json --dry-run` for a machine-readable ordinary plan. JSON execution
15
+ requires its hash and an explicit fresh group. Request `baselineSkill: null`
16
+ matches ordinary installed delivery without `--baseline-skill`; both keep
17
+ inherited configuration and cannot authorize revision adoption.
18
+
5
19
  1. Prepare independent tasks from issue requirements and pinned bug/fix revisions. Keep the fix, grader and oracle outside trial workspaces. Run `bench check` offline and review its NOP, oracle and counterexample gates. The [lru-cache replay](../benches/contrib/oss-lru-cache/README.md) has three independently sourced failures; difficulty is initially unknown.
6
20
  2. Dry-run baseline calibration with the input mode you will later evaluate. For the three-task replay: `skillfit bench check benches/contrib/oss-lru-cache --calibrate --agent codex --input workspace --trials 2 --max-calls 6 --dry-run`. Run without `--dry-run` only after reviewing the fixed plan. Keep saturated tasks as regression controls; repair broken graders/environments before interpreting a floor.
7
21
  3. Declare a fresh paired run with the full Skill installed only in treatment: `skillfit eval <skill-dir> --mode installed --bench <bench-dir> --agent codex --trials 5 --max-calls <ceiling> --dry-run`. The declared count is tasks × trials × two arms, plus two judge calls per pair when enabled. The default ceiling equals the declared count. A lower ceiling rejects the entire plan; it never truncates tasks, retries errors, or adds replacement samples.
8
22
  4. Run the reviewed command without `--dry-run`. Fresh groups retain `_plan.json` (bench/target/implementation hashes, Node/package/available CLI versions, allowlisted configured model settings, declared workspace paths and call budget), `_calls.jsonl` (append-only started/finished/failed events with prompt hashes), `_session.json` (completion/stop reason), and `_artifacts.json` (regular-file hashes and unfollowed symlink targets). Calibration also retains `_calibration.json` with task counts. Existing groups are never overwritten.
9
- 5. Generate a portable report: `skillfit report eval runs/<group>/manifest.json`. Inspect task checks, errors, token coverage, read observations and session completeness before deciding. Partial/stopped sessions produce no installation recommendation even if their surviving subset favors treatment. Preserve their receipts, then fix the cause and predeclare a fresh run. Do not pool adaptive calibration into validation.
23
+ 5. Read a saved-evidence report: `skillfit report eval runs/<group>` (add `--json` for an Agent). Both formats accept the same completed or stopped run and show audit/acceptance reasons. See [report inputs](evaluation-reports.md). Inspect task checks, errors, token coverage, read observations and session completeness before deciding. Partial/stopped sessions produce no installation recommendation even if their surviving subset favors treatment. Preserve their receipts, then fix the cause and predeclare a fresh run. Do not pool adaptive calibration into validation.
10
24
 
11
25
  Before and after each model/judge call, the harness checks pinned input bytes and matrix-listed user configuration/Skill roots. Executor failures or detected drift stop further actual calls. Returned output/transcripts are retained when a post-call check detects drift, but the trial is ungraded. Only pure project-trust registrations for predeclared disposable workspaces are excluded from the configuration hash, along with final blank newline separators; other fields, paths, trust values and bytes remain covered. Plans freeze each workspace's logical and physical path: pure trust registrations for either name are allowed, while alias retargeting stops further calls. Input symlinks are rejected; top-level global Skill directory aliases are pinned through their resolved content plus a watched inventory.
12
26
 
13
27
  This is an inspection contract, not environment isolation or tamper-proof attestation. API configured model names and allowlisted CLI settings do not prove which server model served a response. Inherited plugins, unlisted paths, toolchains, server-side drift and sampling remain uncontrolled. Judge sandbox paths are temporary and not exempted from trust checks; a new unplanned trust registration stops the run. Only the selected primary agent's matrix configuration is fingerprinted; a different judge's environment remains unrecorded. Do not include raw configuration, auth files or credentials in published artifacts. Paths and agent output may still contain private project material; inspect them before sharing.
14
28
 
15
- Paired installed-Skill read counts describe mechanical observations on surviving graded pairs. Read-unobserved is not proof of non-use; read-observed is not proof of benefit. Use separately labeled positive/negative trigger runs for trigger precision/recall. The frozen verdict formulas remain unchanged, and optional workflow metadata keeps legal legacy v4 manifests readable with unchanged rendering.
29
+ Paired installed-Skill read counts describe mechanical observations on surviving graded pairs. Read-unobserved is not proof of non-use; read-observed is not proof of benefit. Use separately labeled positive/negative trigger runs for trigger precision/recall. The frozen verdict formulas remain unchanged, and optional workflow metadata keeps legal legacy v4 manifests readable with unchanged quality tables and verdict formulas.