@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
@@ -1,20 +1,23 @@
1
1
  # Built-in graders v1
2
2
 
3
- The first built-in graders inspect a complete, bounded final-message
4
- observation. The engine compiles evaluator-owned check declarations before host
3
+ Built-in graders assess candidate output, shell-check results, and Git fixture
4
+ state. The engine compiles evaluator-owned check declarations before host
5
5
  execution. A missing or incomplete observation yields `unavailable` for every
6
6
  output check; it never passes. A failed assertion yields `failed` while grading
7
7
  itself remains `completed`.
8
8
 
9
9
  Each declaration has `{ "id", "grader", "configuration" }`. The supported
10
- output graders are:
10
+ built-in graders are:
11
11
 
12
- | Grader | Configuration | Assessment |
13
- | -------------- | ------------------------------------------------------------------ | ----------------------------------------------------------- |
14
- | `sevro.regex` | `pattern` string; optional `negate` boolean and `flags` string | Tests final-message text with multiline matching. |
15
- | `sevro.json` | Optional RFC 6901 `pointer`, `equals`, `contains`, `exactDocument` | Parses JSON, then checks selected value or an array member. |
16
- | `sevro.schema` | Inline `schema` object; optional `exactDocument` | Validates the parsed JSON with JSON Schema Draft 2020-12. |
17
- | `sevro.output` | Optional text, JSON, and schema assertions in one declaration | Retains one outcome for a combined final-message contract. |
12
+ | Grader | Configuration | Assessment |
13
+ | ---------------- | ----------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
14
+ | `sevro.regex` | `pattern` string; optional `negate` boolean and `flags` string | Tests final-message text with multiline matching. |
15
+ | `sevro.json` | Optional RFC 6901 `pointer`, `equals`, `contains`, `exactDocument` | Parses JSON, then checks selected value or an array member. |
16
+ | `sevro.schema` | Inline `schema` object; optional `exactDocument` | Validates the parsed JSON with JSON Schema Draft 2020-12. |
17
+ | `sevro.output` | Optional text, JSON, and schema assertions in one declaration | Retains one outcome for a combined final-message contract. |
18
+ | `sevro.shell` | `run` string; optional `expectedExitCode`, `timeoutMs`, and stdout assertions | Checks exit code and optional stdout assertions in an isolated shell. |
19
+ | `sevro.git-head` | `kind`: `"changed"`, `"unchanged"`, or `"base-ancestor"` | Compares fixture HEAD and ancestry with the captured base revision. |
20
+ | `sevro.semantic` | `proposition` string; optional `artifactPath` | Judges a proposition against the final response or saved document through a separate semantic host route. |
18
21
 
19
22
  JSON may be raw or contained in one `json` code fence. `exactDocument` requires
20
23
  the whole trimmed message to be that JSON document or fence. `contains` selects
@@ -35,8 +38,10 @@ The shell-check process runner accepts a bounded evaluator-owned `run` string,
35
38
  optional `expectedExitCode` and `timeoutMs`, plus `expectExact`, `expectRegex`,
36
39
  `notRegex`, and regex `flags` for stdout. Exact matching removes one final
37
40
  newline; regex matching always uses multiline mode. The runner executes with
38
- `sh -e`. On macOS it runs through the outer sandbox with network access denied,
39
- a credential-free environment, and caller-declared protected roots. Without a
41
+ `sh -e`. On macOS and Linux it runs through the outer sandbox with network access denied
42
+ by default, a credential-free environment, and caller-declared protected roots.
43
+ The runtime [local HTTP option](runtime-v1.md#local-http-test-servers) permits
44
+ socket-using upstream tests while retaining outbound isolation. Without a
40
45
  stdout assertion, process output is discarded. With one, the runner captures
41
46
  at most 1 MiB in memory and retains only its digest and byte length. Oversized
42
47
  or invalid UTF-8 output is a grading error.
@@ -46,11 +51,16 @@ one bounded observation per check. A mismatched exit code or stdout assertion
46
51
  fails the task; an isolation, timeout, or process error makes grading
47
52
  an error. Callers must supply `shellIsolation.protectedRoots` for any shell
48
53
  check. The engine also protects its package source, project, results, user
49
- home, configured host homes, and active peer fixtures. The caller's list must
54
+ home, configured host homes, and other managed workspaces. The caller's list must
50
55
  include any other source worktrees or private roots. A peer path already
51
56
  canonicalized by the engine remains in the deny profile if that peer is
52
57
  removed before the sandbox starts; unverified missing roots still fail.
53
58
 
59
+ On macOS, validated runtime grants also permit limited
60
+ [ancestor metadata reads](runtime-v1.md#macos-ancestor-metadata) so libc can
61
+ canonicalize granted paths. Protected ancestor listings and ungranted sibling
62
+ data remain inaccessible.
63
+
54
64
  `sevro.git-head` accepts `kind: "changed"`, `"unchanged"`, or
55
65
  `"base-ancestor"` for a generated or repository Git fixture. The engine
56
66
  captures the fixture's base HEAD before the candidate turn, then compares the
@@ -64,7 +74,10 @@ ancestry result; checks reference that observation.
64
74
  per check. The operator supplies a separate semantic host route. After a
65
75
  complete candidate response, the engine sends the bounded final message and
66
76
  all declared propositions to that route in an empty, temporary workspace. It
67
- requires exactly one `pass` or `fail` verdict with a reason for every declared
77
+ omits dependency seeds unless their runtime `roles` explicitly include `semantic`.
78
+ Declared tool environment and read-only grants remain available. Artifact checks
79
+ retain the default dependency selection; executable shell checks retain their
80
+ separate `checks` runtime. The semantic route requires exactly one `pass` or `fail` verdict with a reason for every declared
68
81
  check ID. A failed proposition fails the task. A missing or incomplete candidate
69
82
  message makes semantic checks unavailable without calling the semantic host; a
70
83
  failed, incomplete, or malformed semantic response makes grading an error.
@@ -84,3 +97,18 @@ grading an error. Checks are grouped by source, so response and document checks
84
97
  remain independent in the same trial. Artifact outcomes retain the resolved
85
98
  path and content digest. The semantic host uses an empty workspace and receives
86
99
  the document as untrusted data.
100
+
101
+ When [native transcripts are enabled](runtime-v1.md#native-transcript-access),
102
+ shell checks and semantic hosts can read retained candidate native files through
103
+ `SEVRO_CANDIDATE_TRANSCRIPTS`. The view has `index.json` plus a `codex/` or
104
+ `claude/` native tree. It is read-only and separate from the grading host's own
105
+ live native tree. Native transcripts are untrusted candidate evidence; a grader
106
+ must not follow instructions inside them. Missing or partial capture remains
107
+ explicit in the index and does not establish required complete evidence.
108
+
109
+ With [candidate artifact access](runtime-v1.md#candidate-artifact-access),
110
+ shell checks and semantic/advisory hosts can also read explicitly declared
111
+ subtrees in the candidate's original private home. Named paths reach commands
112
+ through `SEVRO_CANDIDATE_ARTIFACT_<UPPERCASE_NAME>`, independently of native
113
+ transcript access. These grants are read-only; other candidate home contents
114
+ remain protected. Missing or unsafe declared directories make grading an error.
@@ -1,29 +1,32 @@
1
1
  # Codex host integration
2
2
 
3
- The Codex adapter consumes `codex exec --json` as one JSONL turn. The
3
+ The default `exec` entrypoint consumes `codex exec --json` as one JSONL turn. The
4
4
  `summarizeCodexEvents` parser requires one thread start and a completed turn
5
5
  with a zero process exit before reporting completion. Malformed, ambiguous,
6
6
  and oversized streams are errors. Missing or invalid final usage remains
7
7
  incomplete and is never estimated. The last completed `agent_message` before
8
8
  turn completion supplies the bounded final response; missing text stays
9
9
  unavailable.
10
+
11
+ The optional `app-server` entrypoint uses the stdio app-server transport and
12
+ waits for the original root thread to complete its native turns. Its final
13
+ response comes from the completing root turn; token usage remains unknown.
14
+ Both entrypoints use the same isolated Codex home and permission-profile
15
+ preflight. See [native goal trials](development-cli.md#native-goal-trials) for
16
+ selection, native-goal observations, and follow-up behavior. The JSONL parser
17
+ rules above apply to the `exec` entrypoint.
18
+
10
19
  The bounded JSONL stream is retained per trial as the private
11
20
  `sevro.codex.events` host artifact. Its file URL and digest appear in trial
12
21
  evidence and are available to extension grading; the stream bytes stay out of
13
22
  the run JSON.
14
- The host also retains a bounded `sevro.codex.skill-reads` observation. It
15
- records the first verified mounted skill and ordered skill names, without
16
- commands or skill bodies. A completed direct `cat` of a mounted `SKILL.md`
17
- counts only when the command output contains that file's exact body. Direct
18
- `sed -n` pages count after their verified line ranges cover the whole body. An
19
- exact `cat` wrapped by `lean-ctx -c` is accepted only when its reported output
20
- still contains the full body; a compressed summary cannot prove the read. An
21
- attempted indirect, malformed, or incomplete read makes the observation
22
- partial. This is a host observation; an extension decides what selection means
23
- for its case.
24
- The same check accepts skill files below the exact installed plugin roots from
25
- Codex's installation receipts. It does not infer activation from arbitrary
26
- files in the private plugin cache.
23
+ Skill activation uses the common `sevro.host.skill-activations` observation
24
+ from passive hooks in the request's private Codex home. The collector matches
25
+ prepared skill bodies in returned tool content without interpreting shell
26
+ syntax or recovering command output from native sessions. See
27
+ [skill activation evidence](native-hosts.md#skill-activation-evidence) for the
28
+ scope, limits, privacy boundaries, and incomplete collection states.
29
+
27
30
  The `sevro.codex.native-calls` capability retains allowlisted direct goal and
28
31
  agent control calls from the native session bound to the completed thread. Its
29
32
  observation contains only call names, namespaces, and source ordinals, plus the
@@ -48,33 +51,10 @@ only when plaintext is readable. It retains neither message nor prompt bytes.
48
51
  For a second prompt, `sevro.codex.continuation` retains the last validated
49
52
  native-session ordinal before resume. Extensions can compare later call
50
53
  ordinals with that boundary without reading private arguments.
51
- The host also retains separate `sevro.codex.initial-skill-reads` and
52
- `sevro.codex.follow-up-skill-reads` observations. Each applies the same exact
53
- mounted-skill read check to one completed turn, so an extension can grade read
54
- order or a missing repeat read without inferring it from the combined list.
55
-
56
- It also checks native parent command records for exact mounted skill bodies,
57
- including sessions with no spawn request. The bounded diagnostic distinguishes
58
- no read from an incomplete read without claiming skill activation.
59
- It retains the skill name and native ordinal when verified reads complete a
60
- whole body. Repeated complete reads produce separate receipts; paged reads
61
- produce one receipt when their ranges first cover the body. An incomplete
62
- later reread makes the diagnostic partial. Extensions can compare these
63
- ordinals with an accepted owner boundary without retaining commands or output.
64
- Earlier yielded output can complete a read only when its process and unique
65
- call identity bind it to that actor's native command completion. Completed
66
- literal command calls use a bounded TypeScript parser; conditional or ambiguous
67
- code cannot establish that binding. Recovery verifies the exact mounted bytes
68
- and recomputes completeness for the matching CLI command. Private commands,
69
- submitted code and recovered skill bodies stay out of public observations.
70
- For accepted spawns, it also checks up to eight child thread rollouts and
54
+ For accepted spawns, the host checks up to eight child thread rollouts and
71
55
  reports whether each is available, unavailable, ambiguous, or partial, with an
72
- explicit truncation flag. An available rollout includes bounded diagnostics for
73
- native child commands: the number of commands and skill read attempts, whether
74
- the exact mounted `SKILL.md` body was read, and whether the check was complete
75
- or truncated. A rollout with no read differs from a missing or malformed
76
- rollout. These diagnostics do not establish skill activation or task completion
77
- by themselves and retain no child prompt, command, or output.
56
+ explicit truncation flag. Child rollout metadata describes delegation and
57
+ completion; skill activation remains in the common hook observation.
78
58
  An available child rollout also reports whether one nonempty final assistant
79
59
  message matches a later native completion event for the same turn. This proves
80
60
  a returned turn, not the accuracy of the child's work, and retains no message
@@ -90,12 +70,18 @@ discarded. Extensions interpret task names and decide whether a nested reader
90
70
  satisfies their policy.
91
71
  The record proves an invocation attempt, not its success. A missing, ambiguous,
92
72
  unreadable, oversized, or malformed session is unavailable or partial, so its
93
- absence cannot prove that a control was unused. Calls made through submitted
94
- code are not classified by this first observation.
73
+ absence cannot prove that a control was unused. Code Mode submissions now have
74
+ separate bounded `execCalls` inspection receipts, described in the
75
+ [native control contract](native-controls.md). Direct native call ordinals and
76
+ acceptance receipts keep their original meaning; submitted requests do not
77
+ acquire direct native acceptance receipts.
95
78
  For an explicitly declared `$plugin:skill`, the host verifies that the installed
96
79
  skill exists and that the exact token occurs once in the delivered prompt. A
97
- completed turn yields `sevro.codex.explicit-invocation` with the owner first and
98
- verified supporting reads after it. Incomplete reads make that receipt partial.
80
+ completed turn yields a complete `sevro.codex.explicit-invocation` naming the
81
+ dispatched skill. This receipt proves verified dispatch and contains no
82
+ `observedSkills` list. Activation checks require the common hook observation;
83
+ missing hook evidence cannot be repaired by a dispatch receipt or native
84
+ transcript. Failed execution cannot yield a complete dispatch receipt.
99
85
  The `sevro.codex.repository-invocation` capability supports an explicitly
100
86
  declared `$skill` from `.agents/skills/<skill>/SKILL.md`. The host checks that
101
87
  the repository mount is a bounded regular file with no symlink components and
@@ -103,7 +89,7 @@ that the token occurs once across the delivered turns. It uses the same
103
89
  completed-turn dispatch receipt without wrapping the skill as a plugin.
104
90
 
105
91
  `createCodexHost` copies file-based authentication into a private Codex home
106
- for one turn. It supplies only explicit environment variables to the parent
92
+ for each trial. It supplies only explicit environment variables to the parent
107
93
  process and uses a runner-generated permission profile for candidate commands.
108
94
  When the extension declares a local Codex marketplace, the host verifies its
109
95
  manifest contains only the named plugins with local sources, rejects package
@@ -111,7 +97,11 @@ symlinks, and installs it with `codex plugin marketplace add` followed by
111
97
  `codex plugin add`. It checks each installation receipt against the private
112
98
  plugin cache. Candidate commands can read that cache, while the rest of the
113
99
  private Codex home, including authentication and configuration, remains denied.
114
- It refuses fixture-local `.codex` configuration, unsupported enforced
100
+ With the [Codex state opt-in](runtime-v1.md#candidate-codex-configuration-and-user-skills),
101
+ commands may read generated configuration and write actual non-system user skills;
102
+ graders retain read-only access to that request's original paths. Fixture-local
103
+ configuration is accepted as inert represented input on this route. Otherwise,
104
+ the host refuses fixture-local `.codex` configuration. It also refuses unsupported enforced
115
105
  conditions, unreadable or oversized auth files, malformed event streams, and
116
106
  incomplete turns. The host bounds output and runtime, kills its process group
117
107
  on timeout or cancellation, and removes private state after the turn. It is
@@ -119,29 +109,171 @@ available through the engine's injected host interface and the development
119
109
  CLI's explicit `--host codex` route. Its protocol and evidence host ID is
120
110
  `sevro.host.codex`; `codex` remains the CLI route selector.
121
111
 
122
- `prepareMacSandboxCommand` provides the macOS shell-grading boundary. Callers
112
+ `prepareMacSandboxCommand` and `prepareLinuxSandboxCommand` provide the shell-grading boundary. Callers
123
113
  provide absolute protected roots and a private state root; the primitive
124
114
  canonicalizes them, refuses overlap with the fixture workspace, and creates a
125
- temporary `sandbox-exec` profile that denies reads and writes. It fails if
126
- macOS isolation is unavailable. The caller releases the profile after the
115
+ temporary native sandbox that denies reads and writes. It fails if
116
+ isolation is unavailable. The caller releases the sandbox resources after the
127
117
  process exits. The runner assembles the same protected-root set for Codex
128
118
  candidate commands and shell grading.
129
119
 
130
120
  Codex cannot start its native sandbox inside an outer `sandbox-exec` process
131
- on this host. Its runner-generated permission profile therefore sets an
121
+ on macOS. Its runner-generated permission profile therefore sets an
132
122
  explicit workspace rule, denies all other filesystem roots except minimal
133
123
  runtime files and the selected executable's install directories, and
134
124
  specifically denies protected roots and the private Codex home. An executable
135
125
  inside a protected root is rejected. The profile also disables command
136
- network access and clears inherited command environment variables. The Codex
126
+ network access by default and clears inherited command environment variables.
127
+ The runtime [local HTTP option](runtime-v1.md#local-http-test-servers) enables
128
+ Codex's managed network proxy and local binding for socket-using tests.
129
+ The Codex
137
130
  parent can read authentication before it starts sandboxed commands. Tests
138
131
  invoke the installed `codex sandbox` CLI to prove fixture access, denied
139
132
  source/auth reads, and executable access. The process adapter verifies these
140
- properties before every turn.
133
+ properties in one sandbox invocation before each fresh host request, with a
134
+ 60-second bounded startup deadline. The combined probe still requires readable
135
+ private command storage, denied project listing, denied authentication and
136
+ configuration reads (unless configuration access was explicitly enabled), and a
137
+ successful native executable `--version`. Continuation
138
+ turns reuse the same isolated state. The longer deadline accommodates observed
139
+ native policy startup; it is not counted as a performance saving.
140
+
141
+ Native plugin installation remains fresh for every host request. Reusing an
142
+ installed home would carry configuration, marketplace registrations, and
143
+ absolute installation paths into a different private namespace. Selected hook
144
+ wrappers additionally embed that request's runtime, sandbox profile, and receipt
145
+ paths. Replaying an old installation receipt cannot establish a new installed
146
+ path. Sevro therefore retains native marketplace/plugin installation and receipt
147
+ verification, fresh credentials/configuration, hook rewriting, preflight, and
148
+ invocation evidence for every request. See the [startup measurements](evidence/runtime-startup-30/README.md)
149
+ for measured boundaries, copy-on-write assessment, and limitations.
150
+
151
+ ## Retired skill-read evidence
152
+
153
+ The current host no longer emits `sevro.codex.skill-reads`,
154
+ `sevro.codex.initial-skill-reads`, `sevro.codex.follow-up-skill-reads`, or native
155
+ parent/child read diagnostics. Migrate activation checks to
156
+ `sevro.host.skill-activations`; old required evidence remains unavailable rather
157
+ than silently receiving a different meaning. Existing retained run evidence
158
+ keeps its original interpretation.
159
+
160
+ [Issue #70 representative retests](evidence/skill-reads-70/results.json) retain
161
+ separate task, activation, and phase-read outcomes from the private candidate,
162
+ plus its source fingerprints and test-first regression results. Private native
163
+ transcripts remain outside the repository.
164
+
165
+ <details>
166
+ <summary>Historical command-pattern and read-recovery contract</summary>
141
167
 
168
+ The following describes the retired collector before the hook migration.
169
+ These rules are preserved for interpreting older evidence; they do not describe
170
+ the current host.
171
+
172
+ The host also retains a bounded `sevro.codex.skill-reads` observation. It
173
+ records the first verified mounted skill and ordered skill names, without
174
+ commands or skill bodies. A `cat` or `sed -n` attempt counts only when its path
175
+ resolves to a mounted skill or a skill below an installed plugin root verified
176
+ by Codex's installation receipt. Missing targets outside a mounted skill
177
+ directory, listings, and other harmless mentions of `SKILL.md` do not make the
178
+ observation partial. A missing `SKILL.md` target does not count as a read just
179
+ because its parent directory belongs to a mounted skill; an existing mounted
180
+ target that fails or produces incomplete bytes remains partial. A completed direct
181
+ `cat` of one mounted `SKILL.md`, alone or alongside literal documentation
182
+ paths, counts only when the command output contains that file's exact body.
183
+ Batched reads naming more than 64 paths remain partial, as do failed,
184
+ malformed, or incomplete recognized reads. Direct
185
+ `sed -n` pages count after their verified line ranges cover the whole body. An
186
+ exact `cat` wrapped by `lean-ctx -c` is accepted only when its reported output
187
+ still contains the full body; a compressed summary cannot prove the read.
188
+ The same exact-body check accepts a literal read followed by one literal `rg`
189
+ command, separated by a semicolon or newline. It also accepts a single-file
190
+ literal `cat` of the skill followed by one or more literal `cat` reads of
191
+ non-skill files, then one literal `rg` command, with the same separators. For
192
+ example:
193
+
194
+ ```sh
195
+ cat .agents/skills/darrow-guide/SKILL.md; cat docs/specs/repository-guide.md; rg -n -i 'offline|\bsla\b|service.level|guarantee|deployment' --glob '*.md' --glob '!docs/research/**' --glob '!**/SKILL.md' .
196
+ ```
197
+
198
+ This sequence uses the shared stream and native read check. Quoted separators
199
+ remain part of their literal operand. The ordered file bodies must match the
200
+ retained output, so documentation or search output cannot replace an altered
201
+ or incomplete skill read. Literal `cat` commands may read multiple mounted
202
+ skills and documentation, before or after skills, with or without a terminal
203
+ search. Multiple literal terminal `rg` commands are accepted within the command
204
+ bound. Each verified skill receives its own ordered receipt. Documentation
205
+ must resolve within the workspace or a receipt-bound installed plugin root;
206
+ each file is bounded to 1 MiB. Aliases of mounted skills without a literal
207
+ `SKILL.md` operand remain unsupported.
208
+ The 64-operand bound applies across all reads in the sequence. Shell expansions,
209
+ including unquoted glob and tilde operands, are unsupported in this form.
210
+
211
+ The bounded composed-read grammar also accepts `unset` with literal variable
212
+ names, `pwd` or `pwd -P`, `git rev-parse --show-toplevel` (optionally with
213
+ `-C "$PWD"`), `printenv` with literal variable names, and `rg --files` with
214
+ literal arguments before the reads. Prefix `printenv` requires the reads to
215
+ end the command, so environment output cannot replace missing read bytes.
216
+ Literal `printenv` commands may follow reads without prefix `printenv`.
217
+ The fixed pair `repo=$(git -C "$PWD" rev-parse --show-toplevel)` and
218
+ `cd "$repo" && pwd -P` is supported only with absolute read operands. Other
219
+ assignments, substitutions, directory changes, or control flow remain
220
+ unsupported. Prefix and environment output cannot supply skill frontmatter;
221
+ ambiguous repeated output cannot establish an attributable read.
222
+
223
+ The check also accepts a chain of literal
224
+ `cat` fallbacks with `2>/dev/null` and `||`, ending in `true` followed by a newline
225
+ and one literal `rg` discovery command. A fallback chain must resolve to one
226
+ canonical file across all its read operands; absent alternate targets do not
227
+ invalidate the read. Each fallback `cat` names one literal file. Multiple
228
+ existing targets, including unmounted copies,
229
+ cannot establish an attributable read. The total read operands remain bounded
230
+ at 64. The complete command must succeed and expose the mounted file's entire
231
+ exact body. `cat` accepts literal file operands and the optional `--` delimiter;
232
+ other options cannot prove an unchanged read. Substitutions, pipelines, other shell control flow, and dynamic
233
+ search arguments cannot establish a compound read through this check.
234
+ Unrecognized commands remain partial when their output contains the identifying
235
+ `name: <skill>` line from a mounted or receipt-bound installed-plugin skill.
236
+ This is a host observation; an extension decides what selection means for its
237
+ case.
238
+ The same check accepts skill files below the exact installed plugin roots from
239
+ Codex's installation receipts. It does not infer activation from arbitrary
240
+ files in the private plugin cache.
241
+ The host also retains separate `sevro.codex.initial-skill-reads` and
242
+ `sevro.codex.follow-up-skill-reads` observations. Each applies the same exact
243
+ mounted-skill read check to one completed turn, so an extension can grade read
244
+ order or a missing repeat read without inferring it from the combined list.
245
+ For `app-server`, the verified same-thread feedback boundary separates the
246
+ initial phase from the follow-up phase, including subsequent native goal turns.
247
+ Absent, duplicated, foreign-thread, or failed boundaries do not yield phase
248
+ receipts.
249
+
250
+ It also checks native parent command records for exact mounted skill bodies,
251
+ including sessions with no spawn request. The bounded diagnostic distinguishes
252
+ no read from an incomplete read without claiming skill activation.
253
+ It retains the skill name and native ordinal when verified reads complete a
254
+ whole body. Repeated complete reads produce separate receipts; paged reads
255
+ produce one receipt when their ranges first cover the body. An incomplete
256
+ later reread makes the diagnostic partial. Extensions can compare these
257
+ ordinals with an accepted owner boundary without retaining commands or output.
258
+ Earlier yielded output can complete a read only when its process and unique
259
+ call identity bind it to that actor's native command completion. Completed
260
+ literal command calls use a bounded TypeScript parser; conditional or ambiguous
261
+ code cannot establish that binding. Recovery verifies the exact mounted bytes
262
+ and recomputes completeness for the matching CLI command. Private commands,
263
+ submitted code and recovered skill bodies stay out of public observations.
264
+ For accepted spawns, it also checks up to eight child thread rollouts and
265
+ reports whether each is available, unavailable, ambiguous, or partial, with an
266
+ explicit truncation flag. An available rollout includes bounded diagnostics for
267
+ native child commands: the number of commands and skill read attempts, whether
268
+ the exact mounted `SKILL.md` body was read, and whether the check was complete
269
+ or truncated. A rollout with no read differs from a missing or malformed
270
+ rollout. These diagnostics do not establish skill activation or task completion
271
+ by themselves and retain no child prompt, command, or output.
142
272
  Native read diagnostics retain at most 64 `recoverySources` entries. Each
143
273
  records its native ordinal, whether the native completion had output, the
144
274
  yielded chunk count, and separate `completedCall` and `literalCommandCall`
145
275
  flags. These facts distinguish recovery sources without retaining commands,
146
276
  submitted code, or skill bodies. The diagnostic's completeness and truncation
147
277
  fields still determine whether its read evidence can support grading.
278
+
279
+ </details>
@@ -0,0 +1,19 @@
1
+ # Current contracts
2
+
3
+ Read these human contracts and their schemas together:
4
+
5
+ - [Extension protocol v1](extension-protocol-v1.md): transport and operations.
6
+ - [Results/evidence v1](results-v1.md): states, exits, identity, and retention.
7
+ - [Report v1](report-v1.md): summaries and comparison limitations.
8
+ - [Identity v1](identity-v1.md): versioned comparison dimensions and hashing.
9
+ - [Runtime configuration v1](runtime-v1.md): environment, tools, private state, goals, and hooks.
10
+ - [Run settings v1](run-settings-v1.md): recurring evaluation selections and CLI overrides.
11
+ - [Built-in graders v1](builtin-graders-v1.md): output, shell, Git HEAD, and semantic checks.
12
+ - [Schemas](../schemas/): machine-readable public forms.
13
+
14
+ [Guide specification](specs/repository-guide.md) governs the repository assistant.
15
+ [LICENSE](../LICENSE) governs licensing. The
16
+ [TypeScript quality contract](typescript-quality.md) defines source inventories,
17
+ development checks, and coverage policy.
18
+ [Architecture](architecture.md) explains implementation context;
19
+ [historical validation](evidence.md) records past observations. Return to the [hub](README.md).
@@ -0,0 +1,139 @@
1
+ # Create cases and extensions
2
+
3
+ Start with a direct case for a prompt, fixture, and built-in success criteria.
4
+ Copy [the basic graded case](../examples/basic/graded.json), give it a stable
5
+ ID, and replace the prompt/check. Read [built-in graders](builtin-graders-v1.md)
6
+ for regex, JSON, and bounded schema assertions. No criteria means `not_assessed`.
7
+ For complete coding, repository-skill, runtime, semantic and extension projects,
8
+ follow the [runnable recipes](recipes.md), including their deliberate failures.
9
+
10
+ Run it with the [CLI](running-evaluations.md). Direct cases follow `ResolvedCase`
11
+ in [the engine](../src/engine.ts). Fixtures can provide inline files, generated
12
+ Git history, or a declared clean repository. The [CLI reference](development-cli.md)
13
+ owns required source roots/maps; an arbitrary returned path does not grant access.
14
+
15
+ Selecting `--project-root` identifies the project; it does not copy its contents
16
+ into a participant fixture. Declare the files or repository source the participant
17
+ should receive. The [run defaults reference](development-cli.md#run-defaults)
18
+ explains how project identity, fixtures and CLI path resolution interact.
19
+
20
+ ## Evaluate your repository skills
21
+
22
+ Start with one representative task, your actual skill, and observable success
23
+ criteria. This example evaluates a documentation guide's answer with Codex.
24
+ Use [Sevro from `PATH`](installing.md#make-the-command-available).
25
+ Live runs require the [native host prerequisites](native-hosts.md), supported
26
+ isolation, an authenticated Codex installation, and your chosen model.
27
+ They consume that account's model quota.
28
+
29
+ Create this layout, keeping evaluator inputs outside the participant fixture:
30
+
31
+ ```text
32
+ skill-evals/
33
+ ├── cases/
34
+ │ └── explain-startup.json
35
+ ├── sources.json
36
+ └── fixture-repo/
37
+ ├── README.md
38
+ └── .agents/skills/my-guide/
39
+ └── SKILL.md
40
+ ```
41
+
42
+ Copy your guide skill and any supporting resources into `fixture-repo`. Use
43
+ its real name in place of `my-guide`. For this sample task, write a README
44
+ that explains that `bun run dev` starts the application on port `3000`.
45
+ Initialize and commit the fixture repository, leaving it clean. Sevro clones
46
+ that committed revision into a fresh workspace for every trial.
47
+ `--project-root` alone does not copy your project into the participant workspace.
48
+
49
+ Save this case as `cases/explain-startup.json`:
50
+
51
+ ```json
52
+ {
53
+ "id": "my-guide-explain-startup",
54
+ "prompt": "How do I start this application locally, and which port does it use?",
55
+ "fixture": { "sourceRef": "fixture-repo" },
56
+ "checks": [
57
+ {
58
+ "id": "startup-command",
59
+ "grader": "sevro.regex",
60
+ "configuration": { "pattern": "bun run dev" }
61
+ },
62
+ {
63
+ "id": "correct-port",
64
+ "grader": "sevro.regex",
65
+ "configuration": { "pattern": "\\b3000\\b" }
66
+ }
67
+ ],
68
+ "requiredEvidence": []
69
+ }
70
+ ```
71
+
72
+ Save the source map as `sources.json`, replacing the example absolute path
73
+ with the location of your fixture repository:
74
+
75
+ ```json
76
+ {
77
+ "fixture-repo": "file:///absolute/path/skill-evals/fixture-repo"
78
+ }
79
+ ```
80
+
81
+ From `skill-evals`, run the case with your actual model identifier in place
82
+ of `<codex-model>`:
83
+
84
+ ```sh
85
+ sevro run --json \
86
+ --case-file "$PWD/cases/explain-startup.json" \
87
+ --case-source-root "$PWD" \
88
+ --case-source-map-file "$PWD/sources.json" \
89
+ --project-root "$PWD/fixture-repo" \
90
+ --results-root "$PWD/results" \
91
+ --host codex \
92
+ --codex-bin "$(command -v codex)" \
93
+ --codex-auth-file "${CODEX_HOME:-$HOME/.codex}/auth.json" \
94
+ --model <codex-model> --effort medium \
95
+ --condition passive --trials 3 --threshold 1 > result.json
96
+ ```
97
+
98
+ Add `--dry` first to validate preparation without calling the model. Three
99
+ executed trials assess consistency; threshold `1` requires all three to pass.
100
+ Summarize the retained result:
101
+
102
+ ```sh
103
+ sevro report --result-file "$PWD/result.json"
104
+ ```
105
+
106
+ These regex checks assess answer content; they do not prove that the guide was
107
+ selected or that every claim was correct. Add cases for ordinary selection,
108
+ unrelated requests, missing inputs, follow-ups, and skill-specific boundaries.
109
+ For coding skills, use `sevro.shell` to run evaluator-owned tests against the
110
+ resulting workspace, with the required `--shell-isolation` configuration.
111
+ `sevro.semantic` can assess qualitative requirements through a separate judge.
112
+ The [grader reference](builtin-graders-v1.md) defines their limits.
113
+
114
+ To grade skill selection or verify explicit invocation, use an extension that
115
+ prepares skill mounts and interprets complete native host evidence. The
116
+ [extension protocol](extension-protocol-v1.md) defines repository and plugin
117
+ invocations; the checkout's [guide evals](guide-evaluation.md) demonstrate the
118
+ approach. Check those capabilities against your exact installed release:
119
+ this checkout can contain [changes beyond its published version](installing.md#published-package-and-checkout).
120
+
121
+ ## Reusable project policy
122
+
123
+ Use an extension for project-specific discovery, preparation, checks, or
124
+ task-verdict policy. [Extension protocol v1](extension-protocol-v1.md) is the
125
+ contract, backed by [its schema](../schemas/extension-v1.schema.json).
126
+
127
+ An extension is an explicitly trusted executable. Each process accepts one JSON
128
+ request and returns one matching response. `describe` negotiates identity and
129
+ capabilities; `resolve` supplies cases; `prepare` supplies artifacts and
130
+ negotiated requests; `evaluate` supplies extension results. A process boundary
131
+ alone is not a sandbox. Diagnostics use stderr. Keep secrets out of argv,
132
+ redacted configuration, observations, and artifact references.
133
+
134
+ Use an argv-array command file, declare source files, and select a case ID as
135
+ shown in the CLI reference. Replacing built-ins or using an extension verdict
136
+ policy needs explicit selection. These are separate controls: choosing a task
137
+ verdict policy does not disable built-in checks. Unsupported capabilities, incomplete evidence,
138
+ and failed exchanges cannot produce a pass. Separate participant-visible inputs
139
+ from evaluator checks; version policy and preserve its [comparison identity](identity-v1.md).