@bjoernrochel/sevro 0.1.0-rc.2 → 0.1.0-rc.21

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 (243) hide show
  1. package/CONTRIBUTING.md +170 -0
  2. package/LICENSE +63 -136
  3. package/README.md +83 -66
  4. package/docs/README.md +44 -0
  5. package/docs/acknowledgements.md +14 -0
  6. package/docs/architecture.md +146 -0
  7. package/docs/assets/README.md +27 -0
  8. package/docs/assets/sevro-logo.png +0 -0
  9. package/docs/assets/sevro-symbol.svg +1 -0
  10. package/docs/assets/sevro-wordmark.svg +1 -0
  11. package/docs/builtin-graders-v1.md +41 -13
  12. package/docs/codex-host.md +184 -52
  13. package/docs/contracts.md +19 -0
  14. package/docs/creating-cases.md +139 -0
  15. package/docs/development-cli.md +190 -30
  16. package/docs/documentation-quality.md +61 -0
  17. package/docs/evaluation-workflow.md +110 -0
  18. package/docs/evidence/code-mode-controls-71.md +64 -0
  19. package/docs/evidence/code-mode-programs-85.md +64 -0
  20. package/docs/evidence/codex-state-73/README.md +204 -0
  21. package/docs/evidence/codex-state-73/darrow-migration.patch +182 -0
  22. package/docs/evidence/codex-state-73/results.json +661 -0
  23. package/docs/evidence/local-http-74.md +104 -0
  24. package/docs/evidence/runtime-startup-30/README.md +185 -0
  25. package/docs/evidence/runtime-startup-30/after.json +319 -0
  26. package/docs/evidence/runtime-startup-30/baseline-timeout.jsonl +2 -0
  27. package/docs/evidence/runtime-startup-30/before.json +403 -0
  28. package/docs/evidence/runtime-startup-30/consumer-smoke.json +63 -0
  29. package/docs/evidence/runtime-startup-30/full-policy-diagnostic.jsonl +3 -0
  30. package/docs/evidence/runtime-startup-30/minimal-policy-diagnostic.jsonl +3 -0
  31. package/docs/evidence/runtime-startup-30/plugin-template-assessment.json +20 -0
  32. package/docs/evidence/runtime-startup-30/seedless-timeout.jsonl +2 -0
  33. package/docs/evidence/skill-reads-70/results.json +823 -0
  34. package/docs/evidence.md +21 -0
  35. package/docs/extension-protocol-v1.md +50 -16
  36. package/docs/fixture-cleanup-validation.md +3 -0
  37. package/docs/getting-started.md +102 -0
  38. package/docs/guide-evaluation.md +89 -0
  39. package/docs/guide-verification.json +239 -0
  40. package/docs/identity-v1.md +35 -1
  41. package/docs/installing.md +88 -0
  42. package/docs/licenses/BUSL-1.1-0.1.0-rc.2.txt +159 -0
  43. package/docs/licensing.md +42 -0
  44. package/docs/native-controls.md +76 -5
  45. package/docs/native-hosts.md +228 -0
  46. package/docs/reading-results.md +141 -0
  47. package/docs/recipes.md +489 -0
  48. package/docs/releases.md +81 -40
  49. package/docs/report-v1.md +29 -1
  50. package/docs/results-v1.md +180 -0
  51. package/docs/run-settings-v1.md +147 -0
  52. package/docs/running-evaluations.md +31 -0
  53. package/docs/runtime-v1.md +614 -0
  54. package/docs/specs/repository-guide.md +58 -0
  55. package/docs/troubleshooting.md +30 -0
  56. package/docs/typescript-quality.md +234 -0
  57. package/docs/usability-study.md +114 -0
  58. package/examples/basic/host.ts +2 -2
  59. package/examples/recipes/candidate.ts +26 -0
  60. package/examples/recipes/cases/coding-change.json +21 -0
  61. package/examples/recipes/cases/host-tools.json +21 -0
  62. package/examples/recipes/cases/mise.json +21 -0
  63. package/examples/recipes/cases/node.json +21 -0
  64. package/examples/recipes/cases/python-uv.json +21 -0
  65. package/examples/recipes/cases/semantic.json +17 -0
  66. package/examples/recipes/coding-change/check.ts +23 -0
  67. package/examples/recipes/extension-artifacts.ts +65 -0
  68. package/examples/recipes/extension-methods.ts +174 -0
  69. package/examples/recipes/extension.ts +37 -0
  70. package/examples/recipes/repository-skill/.agents/skills/startup-guide/SKILL.md +7 -0
  71. package/examples/recipes/repository-skill/.claude/skills/startup-guide/SKILL.md +7 -0
  72. package/examples/recipes/repository-skill/README.md +3 -0
  73. package/examples/recipes/run-inputs.ts +188 -0
  74. package/examples/recipes/run-options.ts +131 -0
  75. package/examples/recipes/run.ts +63 -0
  76. package/examples/recipes/runtime/empty.json +1 -0
  77. package/examples/recipes/runtime/goals.json +1 -0
  78. package/examples/recipes/runtime/mise.json +6 -0
  79. package/examples/recipes/runtime/path.json +1 -0
  80. package/examples/recipes/runtime/plugins.json +4 -0
  81. package/examples/recipes/runtime/python-uv.json +10 -0
  82. package/examples/recipes/semantic-judge.ts +29 -0
  83. package/examples/templates/coding/adapter.ts +17 -0
  84. package/examples/templates/coding/case.json +15 -0
  85. package/examples/templates/repository-skill/.agents/skills/startup-guide/SKILL.md +6 -0
  86. package/examples/templates/repository-skill/extension-data.ts +64 -0
  87. package/examples/templates/repository-skill/extension.ts +31 -0
  88. package/examples/templates/response/adapter.ts +12 -0
  89. package/examples/templates/response/case.json +13 -0
  90. package/package.json +39 -6
  91. package/schemas/report-v1.schema.json +9 -0
  92. package/schemas/run-evidence-v1.schema.json +2 -1
  93. package/schemas/runtime-v1.schema.json +193 -0
  94. package/src/advisory.ts +10 -5
  95. package/src/candidate-artifacts.ts +208 -0
  96. package/src/candidate-codex-state.ts +185 -0
  97. package/src/case-validation.ts +105 -0
  98. package/src/cli/cancellation.ts +20 -0
  99. package/src/cli/command.ts +81 -0
  100. package/src/cli/completion.ts +15 -0
  101. package/src/cli/demo.ts +59 -0
  102. package/src/cli/evaluation.ts +55 -0
  103. package/src/cli/extension.ts +79 -0
  104. package/src/cli/help.ts +222 -0
  105. package/src/cli/hosts.ts +59 -0
  106. package/src/cli/init-settings.ts +30 -0
  107. package/src/cli/init.ts +111 -0
  108. package/src/cli/invocation.ts +627 -0
  109. package/src/cli/loading.ts +151 -0
  110. package/src/cli/preparation.ts +163 -0
  111. package/src/cli/presentation.ts +91 -0
  112. package/src/cli/progress.ts +6 -0
  113. package/src/cli/run-manifest.ts +133 -0
  114. package/src/cli/run-options.ts +101 -0
  115. package/src/cli/run-overrides.ts +83 -0
  116. package/src/cli/settings.ts +160 -0
  117. package/src/cli/summary.ts +43 -0
  118. package/src/cli.ts +13 -843
  119. package/src/contract-types.ts +94 -0
  120. package/src/engine.ts +19 -2373
  121. package/src/evaluation/advisory.ts +150 -0
  122. package/src/evaluation/check-plan.ts +510 -0
  123. package/src/evaluation/collection.ts +88 -0
  124. package/src/evaluation/context.ts +10 -0
  125. package/src/evaluation/grading-host.ts +39 -0
  126. package/src/evaluation/grading.ts +258 -0
  127. package/src/evaluation/invocation-plan.ts +548 -0
  128. package/src/evaluation/plan.ts +736 -0
  129. package/src/evaluation/progress.ts +19 -0
  130. package/src/evaluation/resources.ts +241 -0
  131. package/src/evaluation/run.ts +206 -0
  132. package/src/{trial-scheduler.ts → evaluation/scheduler.ts} +3 -1
  133. package/src/evaluation/semantic.ts +312 -0
  134. package/src/evaluation/trial.ts +866 -0
  135. package/src/evaluation/types.ts +207 -0
  136. package/src/evidence/host-results.ts +92 -0
  137. package/src/evidence/retained-artifacts.ts +18 -0
  138. package/src/evidence/trial-writer.ts +203 -0
  139. package/src/evidence/usage.ts +17 -0
  140. package/src/extension-client.ts +228 -148
  141. package/src/extension-session.ts +326 -195
  142. package/src/fixtures/advisory.ts +338 -0
  143. package/src/fixtures/bin.ts +57 -0
  144. package/src/{fixture-cleanup.ts → fixtures/cleanup.ts} +13 -7
  145. package/src/fixtures/create.ts +187 -0
  146. package/src/fixtures/generated.ts +300 -0
  147. package/src/fixtures/git-hooks.ts +24 -0
  148. package/src/fixtures/preparation.ts +270 -0
  149. package/src/{repository-fixture.ts → fixtures/repository.ts} +207 -85
  150. package/src/fixtures/setup.ts +224 -0
  151. package/src/fixtures/tools.ts +88 -0
  152. package/src/fixtures/workspace-state.ts +212 -0
  153. package/src/generated/cli-result.cjs +2 -0
  154. package/src/generated/cli-result.d.cts +3 -0
  155. package/src/generated/extension.cjs +2 -0
  156. package/src/generated/extension.d.cts +3 -0
  157. package/src/generated/report.cjs +2 -0
  158. package/src/generated/report.d.cts +3 -0
  159. package/src/generated/run-evidence.cjs +2 -0
  160. package/src/generated/run-evidence.d.cts +3 -0
  161. package/src/generated/runtime.cjs +2 -0
  162. package/src/generated/runtime.d.cts +3 -0
  163. package/src/graders/artifact.ts +56 -23
  164. package/src/graders/git-head.ts +79 -75
  165. package/src/graders/output.ts +222 -140
  166. package/src/graders/semantic.ts +102 -43
  167. package/src/graders/shell.ts +379 -207
  168. package/src/host-diagnostic-redaction.ts +52 -0
  169. package/src/host-diagnostics.ts +319 -0
  170. package/src/hosts/claude-continuation.ts +63 -18
  171. package/src/hosts/claude-credential.ts +43 -62
  172. package/src/hosts/claude-events.ts +86 -51
  173. package/src/hosts/claude-keychain.ts +59 -0
  174. package/src/hosts/claude-native-goal.ts +57 -33
  175. package/src/hosts/claude-process.ts +111 -0
  176. package/src/hosts/claude-repository-invocation.ts +208 -117
  177. package/src/hosts/claude-settings.ts +240 -21
  178. package/src/hosts/claude-skill-activations.ts +166 -0
  179. package/src/hosts/claude-state.ts +403 -0
  180. package/src/hosts/claude-tool-calls.ts +171 -106
  181. package/src/hosts/claude.ts +561 -451
  182. package/src/hosts/codex-app-server.ts +326 -178
  183. package/src/hosts/codex-configuration.ts +44 -18
  184. package/src/hosts/codex-events.ts +97 -60
  185. package/src/hosts/codex-exec-controls.ts +516 -0
  186. package/src/hosts/codex-invocation.ts +70 -0
  187. package/src/hosts/codex-marketplace.ts +283 -0
  188. package/src/hosts/codex-native-calls.ts +546 -500
  189. package/src/hosts/codex-process.ts +202 -0
  190. package/src/hosts/codex-profile.ts +257 -28
  191. package/src/hosts/codex-session-files.ts +106 -0
  192. package/src/hosts/codex-state.ts +492 -0
  193. package/src/hosts/codex.ts +783 -832
  194. package/src/hosts/isolation-common.ts +94 -0
  195. package/src/hosts/isolation-roots.ts +54 -27
  196. package/src/hosts/isolation.ts +10 -0
  197. package/src/hosts/linux-sandbox.ts +159 -0
  198. package/src/hosts/mac-sandbox.ts +187 -61
  199. package/src/hosts/native-controls.ts +152 -62
  200. package/src/hosts/process-lifecycle.ts +37 -0
  201. package/src/hosts/protected-worktrees.ts +51 -19
  202. package/src/hosts/skill-hook-catalog.ts +131 -0
  203. package/src/hosts/skill-hook-handler.ts +374 -0
  204. package/src/hosts/skill-hooks.ts +580 -0
  205. package/src/hosts/workspace-fingerprint.ts +55 -35
  206. package/src/identity.ts +102 -48
  207. package/src/instrumentation.ts +109 -48
  208. package/src/native-transcript-state.ts +131 -0
  209. package/src/native-transcript-view.ts +90 -0
  210. package/src/native-transcripts.ts +286 -0
  211. package/src/process-lifecycle.ts +150 -0
  212. package/src/provenance.ts +161 -81
  213. package/src/prune.ts +215 -0
  214. package/src/report.ts +172 -140
  215. package/src/resolved-case.ts +33 -0
  216. package/src/results-lock.ts +29 -0
  217. package/src/results.ts +133 -86
  218. package/src/run-owner.ts +154 -63
  219. package/src/runtime/config.ts +456 -0
  220. package/src/runtime/discovery-apple.ts +90 -0
  221. package/src/runtime/discovery-providers.ts +63 -0
  222. package/src/runtime/discovery.ts +70 -0
  223. package/src/runtime/hook-processes.ts +97 -0
  224. package/src/runtime/hooks.ts +476 -0
  225. package/src/runtime/paths.ts +313 -0
  226. package/src/runtime/query.ts +85 -0
  227. package/src/runtime/seeds.ts +134 -0
  228. package/src/runtime/shared-cache.ts +143 -0
  229. package/src/runtime/state.ts +143 -0
  230. package/src/schema-types.ts +198 -0
  231. package/src/schema.ts +15 -19
  232. package/src/transcript-retention.ts +146 -0
  233. package/src/value-guards.ts +20 -0
  234. package/src/advisory-fixture.ts +0 -282
  235. package/src/fixture-bin.ts +0 -87
  236. package/src/fixture-setup.ts +0 -163
  237. package/src/generated-fixture.ts +0 -220
  238. package/src/git-hooks.ts +0 -63
  239. package/src/hosts/claude-nested-skills.ts +0 -218
  240. package/src/hosts/codex-command-output.ts +0 -399
  241. package/src/hosts/codex-executor-command.ts +0 -195
  242. package/src/hosts/codex-skill-reads.ts +0 -391
  243. package/src/preparation.ts +0 -211
@@ -0,0 +1,141 @@
1
+ # Read results and evidence
2
+
3
+ Read all three states before calling an evaluation successful:
4
+
5
+ | Example | Execution | Grading | Task |
6
+ | -------------------------- | --------- | ------------- | ------------ |
7
+ | Declared checks satisfied | completed | completed | passed |
8
+ | A check violated | completed | completed | failed |
9
+ | Prompt without checks | completed | not_requested | not_assessed |
10
+ | Successful dry preparation | not_run | not_requested | not_assessed |
11
+
12
+ Exit `0` includes successful prompt-only/dry runs. It does not alone prove a
13
+ passing assessment. [Results v1](results-v1.md) defines errors, interruption,
14
+ aggregation, and exit-code precedence.
15
+
16
+ `--json` writes one versioned result to stdout; diagnostics use stderr.
17
+ `evidencePath` names retained run evidence, or is `null` for pre-run failures.
18
+ Completed trial evidence is saved under `--results-root` before cleanup.
19
+ Do not assume a run-directory name or publish private host artifacts.
20
+
21
+ Human output lists each trial, failed/unavailable check
22
+ reasons, measured candidate duration, unknown/known usage and retained paths.
23
+ Preparation/candidate/grading/evidence progress appears on stderr. Stage completion
24
+ means the attempt ended; read the three result states to determine its outcome.
25
+ See the [evaluation workflow](evaluation-workflow.md) for the complete progression.
26
+
27
+ ## Interpret skill exposure
28
+
29
+ In retained Codex `sevro.host.skill-activations` observations, read
30
+ `data.skillExposures` alongside `data.collectionStatus`. A skill may have `full`
31
+ or `partial` exposure even when collection is incomplete. `none` means no
32
+ exposure was detected within a complete collection's scope; `unknown` means
33
+ collection gaps prevent that conclusion. `ambiguous` means identical bodies
34
+ could not identify a named skill. Missing fields in older evidence remain
35
+ unknown.
36
+
37
+ Full exposure establishes that a tool caller received the complete prepared
38
+ body, not that the model followed it. Partial exposure establishes only
39
+ recognizable fragments. Cases that accept partial exposure must say so in
40
+ their extension policy. The separate `sevro.host.skill-exposure-claims`
41
+ observation supports positive exposure checks without treating gaps as absence
42
+ or first selection. [Native host evidence](native-hosts.md#skill-activation-evidence)
43
+ defines the fields and limits; Claude's native skill-tool evidence has a
44
+ different scope. Task verdicts and existing activation requirements retain their
45
+ current meaning.
46
+
47
+ ## Summarize runs
48
+
49
+ ```sh
50
+ sevro report --json --result-file /absolute/path/sevro-result.json
51
+ ```
52
+
53
+ `sevro report --latest` uses the most recently retained CLI result in
54
+ `<cwd>/.sevro/results`. Add
55
+ `--results-root ./other-results` to select another root. Dry/failed runs may be
56
+ latest; a pre-run error does not replace it. CLI `--result-file` also accepts
57
+ cwd-relative paths. Missing result or referenced evidence is an error, never
58
+ a fabricated row.
59
+
60
+ The command assumes [Sevro is on `PATH`](installing.md#make-the-command-available).
61
+ For a contributor checkout, use `bun src/cli.ts` in place of `sevro`.
62
+ [Report v1](report-v1.md) defines fields and limits. Missing cost, usage, or
63
+ duration is unknown, not zero. Advisory recommendations remain independent
64
+ of the task verdict.
65
+
66
+ ## Prune retained results
67
+
68
+ Run `sevro prune` to permanently delete older retained evidence. With no options,
69
+ it keeps the newest **10 results** under `<cwd>/.sevro/results`. Each completed
70
+ attempt counts separately, including repeated evaluations, dry runs, failures,
71
+ and interrupted runs that retained a CLI result.
72
+
73
+ ```sh
74
+ sevro prune
75
+ sevro prune --results-root ./other-results --keep 5
76
+ sevro prune --older-than 30d
77
+ sevro prune --latest
78
+ ```
79
+
80
+ Choose at most one explicit policy. `--keep` accepts a positive safe integer;
81
+ `--latest` is equivalent to `--keep 1`. `--older-than` accepts a positive integer
82
+ followed by `ms`, `s`, `m`, `h`, `d`, or `w` (milliseconds through weeks). It
83
+ deletes results strictly older than that duration at invocation. Age and newest
84
+ ordering use each retained `result.json` file's modification time; copying or
85
+ editing that file can change its retention age. Equal timestamps sort by
86
+ absolute result-directory path, ascending. Relative roots resolve from the
87
+ invoking directory.
88
+
89
+ Pruning finds retained result directories inside the selected root, including
90
+ nested `attempts` trees, validates results and their colocated run evidence, and
91
+ removes each selected result's entire directory. Directories without a retained
92
+ `result.json` are not themselves deleted. Active and unrecognized ownership states
93
+ are excluded from the retention count. Descendant directory links are not
94
+ followed; linked result, evidence, ownership and lock files are refused. The
95
+ selected root itself may be a directory alias. Invalid policies or unreadable,
96
+ malformed, inconsistent or unsafe retained inputs return exit `64` with a
97
+ diagnostic. Validation completes before any result deletion or latest update.
98
+
99
+ Pruning and CLI result publication serialize access to the root. Before deleting
100
+ evidence, pruning atomically points `latest.json` at the newest remaining
101
+ completed result, or removes the index if none remain. `sevro report --latest`
102
+ and explicit reports for surviving results keep working; reports naming deleted
103
+ results fail. An empty or missing results root is a successful no-op. Ownership
104
+ coordination metadata, partial attempts without CLI results, temporary fixtures,
105
+ and a separate `--run-state-root` remain outside evidence pruning.
106
+
107
+ ### Remove native transcript bundles
108
+
109
+ Use `--native-transcripts` to permanently remove captured native bundles while
110
+ keeping every result, recorded hash, observation, and other artifact:
111
+
112
+ ```sh
113
+ sevro prune --native-transcripts
114
+ sevro prune --native-transcripts --older-than 30d
115
+ sevro prune --native-transcripts --keep 5
116
+ sevro report --latest
117
+ ```
118
+
119
+ Without a policy, this mode removes bundles from all completed results. With
120
+ `--keep 5`, it preserves the newest five results' bundles and removes bundles
121
+ from older results. `--latest` preserves the newest result's bundles;
122
+ `--older-than` removes bundles only from results older than the given duration.
123
+ Age, ordering, root selection, active-run protection, and input validation follow
124
+ the rules above. The mode includes candidate, semantic, and advisory bundles.
125
+
126
+ `result.json`, `run.json`, trial evidence, and `latest.json` stay unchanged.
127
+ Before removing bytes, pruning atomically saves a private
128
+ `native-transcripts-pruned.json` receipt beside `run.json`. Keep that receipt
129
+ with the evidence: reports require it to distinguish intentional pruning from
130
+ missing evidence. Reports show retained and pruned bundle counts while preserving
131
+ the original verdicts and measurements. Pruned native bytes cannot be decoded
132
+ or recovered from hashes. Repeating the command safely resumes interrupted
133
+ deletions; ordinary whole-result pruning still works afterward.
134
+
135
+ ## Compare carefully
136
+
137
+ [Identity v1](identity-v1.md) binds inputs, evaluator content, host/model/effort,
138
+ conditions, and fixtures. Matching labels alone do not establish matched
139
+ conditions. Historical missing fields stay unknown unless provenance establishes
140
+ them. Read [schemas](../schemas/) with the human contracts: schema validity alone
141
+ cannot establish every cross-record identity, containment, or artifact reference.
@@ -0,0 +1,489 @@
1
+ # Run complete evaluation recipes
2
+
3
+ Copy a recipe, run its positive and negative controls, then select a native
4
+ model. The complete projects live in [examples/recipes](../examples/recipes).
5
+ They include cases, fixtures, evaluator checks, runtime files, adapters, and a
6
+ small extension.
7
+
8
+ ## Prepare a recipe project
9
+
10
+ Use Bun 1.3.13, Git, Node 24.13.0, and `rg`. Shell checks need macOS
11
+ `sandbox-exec` or Ubuntu `bubblewrap`; native Claude also needs `socat` on
12
+ Ubuntu. Python/UV and mise add the prerequisites stated below.
13
+ [Install Sevro](installing.md), then set the recipe path from the directory
14
+ containing its local installation:
15
+
16
+ ```sh
17
+ export SEVRO_RECIPES="$PWD/node_modules/@bjoernrochel/sevro/examples/recipes"
18
+ ```
19
+
20
+ Run commands below from an otherwise empty working directory to keep generated
21
+ outputs together. The launcher uses
22
+ the CLI beside its original package; it does not require a global installation.
23
+
24
+ To adapt a separate copy, preserve the small project's whole directory:
25
+
26
+ ```sh
27
+ export SEVRO_RECIPE_CLI="$(cd "$SEVRO_RECIPES/../../src" && pwd)/cli.ts"
28
+ cp -R "$SEVRO_RECIPES" ./my-recipes
29
+ export SEVRO_RECIPES="$PWD/my-recipes"
30
+ ```
31
+
32
+ Each command saves `result.json`, the materialized case or extension command,
33
+ and retained evidence under `.sevro-recipes/<recipe>/<route>/<mode>/` in your
34
+ current directory. The project snapshot is separate from recipe inputs and
35
+ results. Stderr names the exact result path and effective settings; stdout is
36
+ one `sevro.cli-result.v1` JSON document. Follow its absolute `evidencePath`.
37
+ The launcher supplies explicit source, project, config, runtime, isolation,
38
+ condition, trial and threshold options; inspect [run.ts](../examples/recipes/run.ts)
39
+ and the saved inputs when adapting a plain CLI invocation. Existing results
40
+ remain until you remove their directory.
41
+
42
+ For every deterministic positive control, expect exit `0`, execution
43
+ `completed`, grading `completed`, task `passed`. Each separate `--fail` command
44
+ deliberately exits `1` with execution/grading `completed` and task `failed`.
45
+ Run negative controls separately when using a shell with `set -e`. A missing
46
+ tool is a prerequisite error, not a passing or intentionally failing control.
47
+
48
+ `candidate.ts` is an explicitly trusted deterministic fixture editor. It changes
49
+ the arithmetic implementation for the coding recipe and supplies a fixed answer
50
+ for the other controls. It does not simulate native tool permissions: the real
51
+ isolated shell graders execute the stated tools and assertions. Native routes
52
+ run the actual task with the same fixture and runtime policy.
53
+
54
+ For any recipe that offers a deterministic control, replace `deterministic`
55
+ with `codex` or `claude` to use a real participant. First install/authenticate
56
+ the selected [native CLI](native-hosts.md). For Codex, set the model to an
57
+ available identifier and supply your private authentication file path:
58
+
59
+ ```sh
60
+ export SEVRO_RECIPE_MODEL='replace-with-an-available-Codex-model'
61
+ export SEVRO_RECIPE_CODEX_AUTH="${CODEX_HOME:-$HOME/.codex}/auth.json"
62
+ bun "$SEVRO_RECIPES/run.ts" coding-change codex --dry
63
+ bun "$SEVRO_RECIPES/run.ts" coding-change codex
64
+ ```
65
+
66
+ For Claude, use its supported credential route and a Claude model identifier:
67
+
68
+ ```sh
69
+ export SEVRO_RECIPE_MODEL='replace-with-an-available-Claude-model'
70
+ bun "$SEVRO_RECIPES/run.ts" coding-change claude --dry
71
+ bun "$SEVRO_RECIPES/run.ts" coding-change claude
72
+ ```
73
+
74
+ Substitute the other recipe name to run its native task. `--dry` prepares and
75
+ retains inputs without calling a model; remove it for execution. Add `--fail`
76
+ to a live command for its deliberate negative control. Native model outcomes
77
+ must be observed; a model can ignore a negative-control instruction. The
78
+ semantic recipe additionally requires its judge route described below.
79
+
80
+ ## Fix a coding bug with hidden evaluator checks
81
+
82
+ Files: [coding-change case](../examples/recipes/cases/coding-change.json),
83
+ [typed evaluator test](../examples/recipes/coding-change/check.ts),
84
+ [tool configuration](../examples/recipes/runtime/path.json), and
85
+ [candidate](../examples/recipes/candidate.ts). Prerequisite: Node on `PATH`.
86
+ The fixture contains a broken `math.cjs` and a task README. The task asks the
87
+ participant to implement addition. The evaluator checks positive, negative and
88
+ zero arguments. Its source stays outside the candidate fixture: the launcher
89
+ transpiles the checked TypeScript test and embeds its JavaScript in the
90
+ evaluator-owned shell command before execution.
91
+
92
+ <!-- sevro-example:recipe-coding-change-pass -->
93
+
94
+ ```sh
95
+ bun "$SEVRO_RECIPES/run.ts" coding-change deterministic
96
+ ```
97
+
98
+ The isolated check first asserts that the original evaluator test is unreadable,
99
+ then runs Node against the changed fixture. The passing shell observation
100
+ retains the result and stdout digest. The negative control leaves subtraction
101
+ in place, so the arithmetic assertion fails:
102
+
103
+ <!-- sevro-example:recipe-coding-change-fail -->
104
+
105
+ ```sh
106
+ bun "$SEVRO_RECIPES/run.ts" coding-change deterministic --fail
107
+ ```
108
+
109
+ Use a native route below to evaluate an actual coding agent. Adding a participant
110
+ test to the fixture would make it visible; it would not replace this hidden
111
+ evaluator-owned check. The launcher selects `--shell-isolation` and protects
112
+ the recipe source; declare additional private worktrees through the
113
+ [CLI's protected roots](development-cli.md).
114
+
115
+ ## Add host-tool access, one capability at a time
116
+
117
+ The smallest useful runtime file is
118
+ [runtime/empty.json](../examples/recipes/runtime/empty.json):
119
+
120
+ ```json
121
+ { "format": "sevro.runtime.v1" }
122
+ ```
123
+
124
+ It selects the existing isolation defaults without importing tools or hooks.
125
+ Add only a declared non-secret `PATH` to reuse installed tools:
126
+
127
+ ```json
128
+ {
129
+ "format": "sevro.runtime.v1",
130
+ "environment": { "inherit": ["PATH"] }
131
+ }
132
+ ```
133
+
134
+ Sevro filters credential-related PATH entries, discovers bounded installation
135
+ support trees, grants read-only tool access, and keeps private writable home
136
+ and temporary directories. It does not grant the full operator home. Runtime
137
+ values enter retained evidence; do not put secrets in this file. See
138
+ [runtime details](runtime-v1.md#environment-and-host-tools).
139
+
140
+ ### Minimal tool: ripgrep
141
+
142
+ Files: [host-tools case](../examples/recipes/cases/host-tools.json) and
143
+ [PATH runtime](../examples/recipes/runtime/path.json). Prerequisite: standalone `rg` on
144
+ `PATH`, installed outside Codex/Claude credential directories (for example,
145
+ `brew install ripgrep` on macOS or `apt-get install ripgrep` on Ubuntu).
146
+ Sevro deliberately filters a Codex session's injected `~/.codex/.../rg` path;
147
+ that embedded executable alone does not satisfy this recipe. The fixture's `app.env` contains `port=3000`; an actual isolated `rg`
148
+ process must find exactly that line.
149
+
150
+ <!-- sevro-example:recipe-host-tools-pass -->
151
+
152
+ ```sh
153
+ bun "$SEVRO_RECIPES/run.ts" host-tools deterministic
154
+ ```
155
+
156
+ The negative fixture contains port `9000`, so that same search fails:
157
+
158
+ <!-- sevro-example:recipe-host-tools-fail -->
159
+
160
+ ```sh
161
+ bun "$SEVRO_RECIPES/run.ts" host-tools deterministic --fail
162
+ ```
163
+
164
+ ### Node
165
+
166
+ Files: [Node case](../examples/recipes/cases/node.json) and the same PATH runtime.
167
+ Prerequisite: Node 24 on `PATH`. The fixture contains `app.json`. A real isolated
168
+ Node process parses it, asserts the port, and prints `3000`.
169
+
170
+ <!-- sevro-example:recipe-node-pass -->
171
+
172
+ ```sh
173
+ bun "$SEVRO_RECIPES/run.ts" node deterministic
174
+ ```
175
+
176
+ The negative fixture sets port `9000`, causing the Node assertion to fail:
177
+
178
+ <!-- sevro-example:recipe-node-fail -->
179
+
180
+ ```sh
181
+ bun "$SEVRO_RECIPES/run.ts" node deterministic --fail
182
+ ```
183
+
184
+ ### Python with UV
185
+
186
+ Files: [Python/UV case](../examples/recipes/cases/python-uv.json) and
187
+ [UV runtime](../examples/recipes/runtime/python-uv.json). Install `uv` and an
188
+ existing Python 3 first; CI uses UV `0.11.21`. Both executables must be on
189
+ `PATH`. The launcher selects `python3`; optionally export `RECIPE_PYTHON` to
190
+ the absolute existing interpreter you want. Put that interpreter's installation
191
+ bin on `PATH` too, so its bounded support installation can be discovered.
192
+
193
+ This adds a private writable `UV_CACHE_DIR` and disables Python downloads.
194
+ `uv run --offline --no-project` runs the selected existing interpreter, with no
195
+ dependency resolution or network. Python parses the fixture JSON, asserts its
196
+ port and prints `3000`:
197
+
198
+ <!-- sevro-example:recipe-python-uv-pass -->
199
+
200
+ ```sh
201
+ bun "$SEVRO_RECIPES/run.ts" python-uv deterministic
202
+ ```
203
+
204
+ The negative fixture changes the port to `9000`; Python raises an assertion:
205
+
206
+ <!-- sevro-example:recipe-python-uv-fail -->
207
+
208
+ ```sh
209
+ bun "$SEVRO_RECIPES/run.ts" python-uv deterministic --fail
210
+ ```
211
+
212
+ For real dependencies, prepare a public cache once outside the evaluated project
213
+ and declare a [shared cache](runtime-v1.md#reuse-a-shared-dependency-cache), then
214
+ use your locked offline install command. Select only the roles using UV; add
215
+ `checks` only when the grader needs it. The same directory can serve candidates,
216
+ hooks, and UV-based graders across trials and runs without copying the cache.
217
+ Use [private seeds](runtime-v1.md#private-writable-state) when isolated dependency
218
+ bytes matter more than disk reuse. This dependency-free recipe needs no cache seed.
219
+
220
+ ### An existing mise installation
221
+
222
+ Files: [mise case](../examples/recipes/cases/mise.json),
223
+ [runtime](../examples/recipes/runtime/mise.json), and the selection in
224
+ [run-options.ts](../examples/recipes/run-options.ts). Install mise first; CI
225
+ uses `2026.3.13`. Prepare its exact tool before evaluation:
226
+
227
+ ```sh
228
+ mise install node@24.13.0
229
+ mise where node@24.13.0
230
+ ```
231
+
232
+ The launcher asks `mise where node@24.13.0`, prepends that installation's `bin`
233
+ to the declared PATH, then runs its Node inside isolation. The evaluator checks
234
+ the exact Node version and fixture port and prints `3000`. This route executes
235
+ the resolved versioned tool; it does not run a mutable mise shim inside the
236
+ sandbox or grant mise's whole data directory.
237
+
238
+ <!-- sevro-example:recipe-mise-pass -->
239
+
240
+ ```sh
241
+ bun "$SEVRO_RECIPES/run.ts" mise deterministic
242
+ ```
243
+
244
+ The negative fixture changes the port to `9000`, failing the same Node check:
245
+
246
+ <!-- sevro-example:recipe-mise-fail -->
247
+
248
+ ```sh
249
+ bun "$SEVRO_RECIPES/run.ts" mise deterministic --fail
250
+ ```
251
+
252
+ An attempted isolated `mise exec` with read-only operator data returned
253
+ `Operation not permitted` on macOS. If your shim needs extra discovery or
254
+ writable state, resolve the existing installation before launch as above.
255
+ Do not solve that failure by granting the operator's whole home.
256
+
257
+ ## Evaluate a repository skill with Codex or Claude
258
+
259
+ Files: the complete [sample repository](../examples/recipes/repository-skill/README.md),
260
+ its [Codex skill](../examples/recipes/repository-skill/.agents/skills/startup-guide/SKILL.md),
261
+ its [Claude skill](../examples/recipes/repository-skill/.claude/skills/startup-guide/SKILL.md),
262
+ and the [extension](../examples/recipes/extension.ts). The extension builds a
263
+ fresh committed Git fixture and mounts the selected skill as a Git-excluded
264
+ artifact. The README is participant-visible; checks and extension source stay
265
+ outside. Copy these actual skill bodies and their supporting files when
266
+ substituting your own skill.
267
+
268
+ Install the [native host prerequisites](native-hosts.md). Dry preparation needs
269
+ the selected CLI on PATH, but no model login or quota. It negotiates repository
270
+ invocation, mounts and hashes the actual skill, validates the case and runtime,
271
+ and retains the artifacts. Expect exit `0`, execution `not_run`, grading
272
+ `not_requested`, task `not_assessed`:
273
+
274
+ <!-- sevro-example:recipe-repository-skill-codex-dry -->
275
+
276
+ ```sh
277
+ bun "$SEVRO_RECIPES/run.ts" repository-skill codex --dry
278
+ ```
279
+
280
+ <!-- sevro-example:recipe-repository-skill-claude-dry -->
281
+
282
+ ```sh
283
+ bun "$SEVRO_RECIPES/run.ts" repository-skill claude --dry
284
+ ```
285
+
286
+ For a real Codex trial, export `SEVRO_RECIPE_MODEL` to an available Codex model
287
+ and `SEVRO_RECIPE_CODEX_AUTH` to your private absolute `auth.json` path, then
288
+ remove `--dry`. For Claude, export `SEVRO_RECIPE_MODEL` to an available Claude
289
+ model and authenticate through one of its documented credential routes, then
290
+ remove `--dry`. Credentials stay outside recipe/project inputs and argv.
291
+ These calls consume account quota.
292
+
293
+ ```sh
294
+ bun "$SEVRO_RECIPES/run.ts" repository-skill codex
295
+ bun "$SEVRO_RECIPES/run.ts" repository-skill codex --fail
296
+ ```
297
+
298
+ With `SEVRO_RECIPE_MODEL` set for Claude instead:
299
+
300
+ ```sh
301
+ bun "$SEVRO_RECIPES/run.ts" repository-skill claude
302
+ bun "$SEVRO_RECIPES/run.ts" repository-skill claude --fail
303
+ ```
304
+
305
+ The neutral invocation placeholder becomes `$startup-guide` for Codex and
306
+ `/startup-guide` at the start of Claude's prompt. Claude uses the required
307
+ `--claude-project-settings`; its runtime leaves goals/hooks disabled. Passing
308
+ requires answer content (command and port), the prepared-file assertion, and a
309
+ complete explicit-invocation receipt. That receipt proves the bounded dispatch,
310
+ not general grounding or quality across other questions.
311
+
312
+ The deliberate failure is the same command without `--dry`, with `--fail`
313
+ added. It explicitly requests the wrong response; expected task verdict is
314
+ `failed`, exit `1`. An actual model can disregard a negative-control prompt;
315
+ inspect its observed answer and receipt if it unexpectedly passes. Dry
316
+ `--fail` only validates that negative-control preparation; it does not observe
317
+ model failure.
318
+
319
+ ## Add a separate semantic judge
320
+
321
+ Files: [semantic case](../examples/recipes/cases/semantic.json), candidate
322
+ adapter and [protocol judge](../examples/recipes/semantic-judge.ts). The case
323
+ asks for the startup explanation and declares a proposition requiring the
324
+ command and port. These credential-free controls exercise routing, source
325
+ construction, verdict parsing, and retained semantic evidence:
326
+
327
+ <!-- sevro-example:recipe-semantic-pass -->
328
+
329
+ ```sh
330
+ bun "$SEVRO_RECIPES/run.ts" semantic deterministic
331
+ ```
332
+
333
+ <!-- sevro-example:recipe-semantic-fail -->
334
+
335
+ ```sh
336
+ bun "$SEVRO_RECIPES/run.ts" semantic deterministic --fail
337
+ ```
338
+
339
+ The protocol judge derives pass/fail from the actual candidate-response field
340
+ using an exact fixture oracle. It is not a model and does not establish
341
+ qualitative judgment quality. The negative response gives the wrong command
342
+ and port; semantic grading completes with a failing proposition.
343
+
344
+ For an actual model candidate and judge, set the native variables above and
345
+ export `SEVRO_RECIPE_JUDGE_MODEL` to an available Codex judge model:
346
+
347
+ ```sh
348
+ bun "$SEVRO_RECIPES/run.ts" semantic codex --dry
349
+ bun "$SEVRO_RECIPES/run.ts" semantic codex
350
+ ```
351
+
352
+ `semantic claude` selects a Claude candidate with a separate Codex judge;
353
+ it needs both CLIs and the Codex auth path. A correct response is expected to
354
+ pass; add `--fail` for the deliberately wrong-response task and an expected
355
+ failed verdict. Live verdicts remain observations, not guarantees.
356
+
357
+ This response-only recipe makes one candidate model call and one additional
358
+ judge call per completed trial. The judge receives all its propositions in an
359
+ empty temporary workspace. Separate document sources can add further calls;
360
+ missing candidate output can avoid a judge call. Judge usage and raw structured
361
+ verdicts are retained separately. A malformed or incomplete judge response is
362
+ a grading error, not a failed proposition or a passing task. Read
363
+ [semantic grading](builtin-graders-v1.md) before adapting its oracle.
364
+
365
+ ## Run the complete extension lifecycle
366
+
367
+ Files: [extension.ts](../examples/recipes/extension.ts),
368
+ [methods](../examples/recipes/extension-methods.ts), and
369
+ [artifact preparation](../examples/recipes/extension-artifacts.ts). Prerequisites:
370
+ Bun, Git and the platform's shell isolation tool. No model is required:
371
+
372
+ <!-- sevro-example:recipe-lifecycle-pass -->
373
+
374
+ ```sh
375
+ bun "$SEVRO_RECIPES/run.ts" lifecycle deterministic
376
+ ```
377
+
378
+ `describe` advertises version/capabilities/grader; `resolve` returns the task
379
+ and committed fixture; `prepare` supplies hashed Git-excluded `startup.txt`;
380
+ the candidate runs; an isolated built-in check reads the mounted bytes; then
381
+ `evaluate` checks the complete final-message evidence for port `3000` and cites
382
+ that observation. The default task policy combines these checks. Evidence is
383
+ saved before cleanup. Every extension method runs in a fresh process, so prior
384
+ process globals are not state. Stdout contains only its matching protocol
385
+ response; diagnostics belong on stderr.
386
+
387
+ <!-- sevro-example:recipe-lifecycle-fail -->
388
+
389
+ ```sh
390
+ bun "$SEVRO_RECIPES/run.ts" lifecycle deterministic --fail
391
+ ```
392
+
393
+ The wrong final answer fails the built-in output assertion and extension check,
394
+ while preparation's shell check still passes. The extension cannot turn missing
395
+ evidence or a failed exchange into success. Inspect the saved argv command and
396
+ source closure, including its skill resources, to adapt it into your own
397
+ [trusted extension](extension-protocol-v1.md).
398
+
399
+ ## Pair plugins, goals, and hooks with preparation
400
+
401
+ Files: the same extension and artifact builder, plus
402
+ [goals runtime](../examples/recipes/runtime/goals.json) and
403
+ [selected-plugin runtime](../examples/recipes/runtime/plugins.json).
404
+ Prerequisites: a native CLI with plugin and native-goal support; use the
405
+ [checked host versions](typescript-quality.md#environment-and-ci). The plugin
406
+ manifests, skill and SessionStart command hook are all prepared artifacts, not
407
+ an undeclared global installation. The Codex package uses a local marketplace;
408
+ Claude uses declared plugin directories. The extension explicitly invokes the
409
+ prepared `startup:startup-guide` skill.
410
+
411
+ First add only native goals to the empty runtime and validate preparation:
412
+
413
+ <!-- sevro-example:recipe-goals-codex-dry -->
414
+
415
+ ```sh
416
+ bun "$SEVRO_RECIPES/run.ts" plugins codex --dry --goals-only
417
+ ```
418
+
419
+ <!-- sevro-example:recipe-goals-claude-dry -->
420
+
421
+ ```sh
422
+ bun "$SEVRO_RECIPES/run.ts" plugins claude --dry --goals-only
423
+ ```
424
+
425
+ Then add `hooks.plugins: ["startup"]` so only this prepared plugin's command
426
+ handlers are authorized. Codex selects app-server for its native goal route;
427
+ Claude uses plugin-only settings, so do not add `--claude-project-settings`:
428
+
429
+ <!-- sevro-example:recipe-plugins-codex-dry -->
430
+
431
+ ```sh
432
+ bun "$SEVRO_RECIPES/run.ts" plugins codex --dry
433
+ ```
434
+
435
+ <!-- sevro-example:recipe-plugins-claude-dry -->
436
+
437
+ ```sh
438
+ bun "$SEVRO_RECIPES/run.ts" plugins claude --dry
439
+ ```
440
+
441
+ All four dry commands expect `not_run`/`not_requested`/`not_assessed`, exit `0`.
442
+ They validate preparation and retain its actual hashed files. They do not
443
+ install a plugin into a live native host, execute its hook, or observe a goal.
444
+ `--goals-only` is deliberately a preparation step; the final recipe's hook
445
+ assertion requires the subsequent full policy.
446
+
447
+ With the native model/credentials configured, remove `--dry` from the full
448
+ plugin command. Expect `passed`, exit `0`: the selected SessionStart hook
449
+ writes `hook-ran.txt`, an isolated shell assertion reads `hook ran`, and the
450
+ skill answer supplies the startup command/port. The hook runs credential-free
451
+ with network denied and only the prepared plugin subtree readable.
452
+ `hooks.nativeGoal` enables the native goal facility; inspect retained
453
+ `sevro.host.native-goal` observations for actual creation/status. Enabling the
454
+ facility or passing this startup task alone does not prove goal completion.
455
+
456
+ ```sh
457
+ bun "$SEVRO_RECIPES/run.ts" plugins codex
458
+ bun "$SEVRO_RECIPES/run.ts" plugins codex --fail
459
+ ```
460
+
461
+ Or, with the Claude model/credential route configured:
462
+
463
+ ```sh
464
+ bun "$SEVRO_RECIPES/run.ts" plugins claude
465
+ bun "$SEVRO_RECIPES/run.ts" plugins claude --fail
466
+ ```
467
+
468
+ For a deliberate failure, run that live command with `--fail`; the requested
469
+ wrong response should fail the answer checks while the hook assertion passes.
470
+ Removing `startup` from the runtime's allowed plugins is a separate diagnostic:
471
+ the command hook is filtered and the hook-file assertion fails. Native/model
472
+ behavior must be observed before claiming either live outcome.
473
+
474
+ ## What tutorial verification proves
475
+
476
+ `bun run test:docs-examples` packs this candidate, copies the packaged recipe
477
+ project to a fresh consumer directory, and executes every marked deterministic
478
+ positive/negative command. It runs real isolated `rg`, Node, UV/Python and
479
+ mise-selected Node checks, the hidden arithmetic test, semantic protocol
480
+ control, and the entire extension lifecycle. Missing UV, Python, mise or its
481
+ declared Node installation fails with an actionable prerequisite error; no
482
+ recipe is silently skipped. CI provisions these tools explicitly.
483
+
484
+ The verifier also dry-prepares every recipe with both native hosts, including
485
+ both skill/plugin variants, negative-control inputs and the goals-only step,
486
+ and verifies retained artifact digests. These are not authenticated model,
487
+ goal, plugin-installation or hook-execution trials. Run the live commands to
488
+ measure those routes. The separate published-consumer check executes the
489
+ installed-package tutorial using the exact current version and license metadata.