@bjoernrochel/sevro 0.1.0-rc.8 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (228) hide show
  1. package/CONTRIBUTING.md +22 -6
  2. package/README.md +5 -1
  3. package/docs/README.md +19 -15
  4. package/docs/architecture.md +138 -17
  5. package/docs/assets/README.md +5 -4
  6. package/docs/builtin-graders-v1.md +9 -2
  7. package/docs/codex-host.md +155 -57
  8. package/docs/contracts.md +2 -1
  9. package/docs/creating-cases.md +9 -2
  10. package/docs/development-cli.md +187 -19
  11. package/docs/documentation-quality.md +12 -2
  12. package/docs/evaluation-workflow.md +110 -0
  13. package/docs/extension-protocol-v1.md +26 -3
  14. package/docs/getting-started.md +23 -2
  15. package/docs/guide-evaluation.md +33 -1
  16. package/docs/identity-v1.md +25 -2
  17. package/docs/installing.md +11 -11
  18. package/docs/native-controls.md +76 -5
  19. package/docs/native-hosts.md +196 -7
  20. package/docs/reading-results.md +102 -0
  21. package/docs/recipes.md +489 -0
  22. package/docs/releases.md +31 -12
  23. package/docs/report-v1.md +29 -1
  24. package/docs/results-v1.md +122 -4
  25. package/docs/run-settings-v1.md +147 -0
  26. package/docs/runtime-v1.md +255 -22
  27. package/docs/troubleshooting.md +12 -12
  28. package/docs/typescript-quality.md +89 -26
  29. package/examples/recipes/candidate.ts +26 -0
  30. package/examples/recipes/cases/coding-change.json +21 -0
  31. package/examples/recipes/cases/host-tools.json +21 -0
  32. package/examples/recipes/cases/mise.json +21 -0
  33. package/examples/recipes/cases/node.json +21 -0
  34. package/examples/recipes/cases/python-uv.json +21 -0
  35. package/examples/recipes/cases/semantic.json +17 -0
  36. package/examples/recipes/coding-change/check.ts +23 -0
  37. package/examples/recipes/extension-artifacts.ts +65 -0
  38. package/examples/recipes/extension-methods.ts +174 -0
  39. package/examples/recipes/extension.ts +37 -0
  40. package/examples/recipes/repository-skill/.agents/skills/startup-guide/SKILL.md +7 -0
  41. package/examples/recipes/repository-skill/.claude/skills/startup-guide/SKILL.md +7 -0
  42. package/examples/recipes/repository-skill/README.md +3 -0
  43. package/examples/recipes/run-inputs.ts +188 -0
  44. package/examples/recipes/run-options.ts +131 -0
  45. package/examples/recipes/run.ts +63 -0
  46. package/examples/recipes/runtime/empty.json +1 -0
  47. package/examples/recipes/runtime/goals.json +1 -0
  48. package/examples/recipes/runtime/mise.json +6 -0
  49. package/examples/recipes/runtime/path.json +1 -0
  50. package/examples/recipes/runtime/plugins.json +4 -0
  51. package/examples/recipes/runtime/python-uv.json +10 -0
  52. package/examples/recipes/semantic-judge.ts +29 -0
  53. package/examples/templates/coding/adapter.ts +17 -0
  54. package/examples/templates/coding/case.json +15 -0
  55. package/examples/templates/repository-skill/.agents/skills/startup-guide/SKILL.md +6 -0
  56. package/examples/templates/repository-skill/extension-data.ts +64 -0
  57. package/examples/templates/repository-skill/extension.ts +31 -0
  58. package/examples/templates/response/adapter.ts +12 -0
  59. package/examples/templates/response/case.json +13 -0
  60. package/package.json +11 -5
  61. package/schemas/report-v1.schema.json +9 -0
  62. package/schemas/run-evidence-v1.schema.json +2 -1
  63. package/schemas/runtime-v1.schema.json +43 -7
  64. package/src/advisory.ts +2 -2
  65. package/src/candidate-artifacts.ts +42 -11
  66. package/src/candidate-codex-state.ts +185 -0
  67. package/src/case-validation.ts +73 -50
  68. package/src/cli/cancellation.ts +20 -0
  69. package/src/cli/command.ts +87 -0
  70. package/src/cli/completion.ts +15 -0
  71. package/src/cli/demo.ts +60 -0
  72. package/src/cli/evaluation.ts +55 -0
  73. package/src/cli/extension.ts +79 -0
  74. package/src/cli/help.ts +198 -0
  75. package/src/cli/hosts.ts +55 -0
  76. package/src/cli/init-settings.ts +30 -0
  77. package/src/cli/init.ts +111 -0
  78. package/src/{cli-invocation.ts → cli/invocation.ts} +214 -218
  79. package/src/cli/loading.ts +151 -0
  80. package/src/cli/preparation.ts +154 -0
  81. package/src/cli/presentation.ts +93 -0
  82. package/src/cli/progress.ts +6 -0
  83. package/src/cli/run-manifest.ts +128 -0
  84. package/src/cli/run-options.ts +403 -0
  85. package/src/cli/run-overrides.ts +69 -0
  86. package/src/cli/settings.ts +154 -0
  87. package/src/cli/summary.ts +43 -0
  88. package/src/cli.ts +13 -591
  89. package/src/contract-types.ts +94 -0
  90. package/src/engine.ts +9 -5
  91. package/src/evaluation/advisory.ts +150 -0
  92. package/src/{evaluation-check-plan.ts → evaluation/check-plan.ts} +103 -67
  93. package/src/evaluation/collection.ts +88 -0
  94. package/src/evaluation/context.ts +10 -0
  95. package/src/{evaluation-grading-host.ts → evaluation/grading-host.ts} +5 -5
  96. package/src/evaluation/grading.ts +235 -0
  97. package/src/{evaluation-invocation-plan.ts → evaluation/invocation-plan.ts} +147 -58
  98. package/src/{evaluation-plan.ts → evaluation/plan.ts} +208 -141
  99. package/src/evaluation/progress.ts +19 -0
  100. package/src/evaluation/resources.ts +241 -0
  101. package/src/evaluation/run.ts +206 -0
  102. package/src/{evaluation-semantic.ts → evaluation/semantic.ts} +77 -87
  103. package/src/evaluation/trial.ts +800 -0
  104. package/src/{evaluation-types.ts → evaluation/types.ts} +79 -29
  105. package/src/evidence/host-results.ts +85 -0
  106. package/src/evidence/retained-artifacts.ts +18 -0
  107. package/src/evidence/trial-writer.ts +203 -0
  108. package/src/evidence/usage.ts +17 -0
  109. package/src/extension-client.ts +34 -96
  110. package/src/extension-session.ts +24 -48
  111. package/src/{advisory-fixture.ts → fixtures/advisory.ts} +12 -72
  112. package/src/{fixture-bin.ts → fixtures/bin.ts} +1 -1
  113. package/src/{fixture-cleanup.ts → fixtures/cleanup.ts} +13 -7
  114. package/src/fixtures/create.ts +183 -0
  115. package/src/{generated-fixture.ts → fixtures/generated.ts} +10 -53
  116. package/src/{git-hooks.ts → fixtures/git-hooks.ts} +1 -1
  117. package/src/{preparation.ts → fixtures/preparation.ts} +6 -16
  118. package/src/{repository-fixture.ts → fixtures/repository.ts} +30 -64
  119. package/src/{fixture-setup.ts → fixtures/setup.ts} +33 -51
  120. package/src/{fixture-tools.ts → fixtures/tools.ts} +1 -1
  121. package/src/{workspace-state.ts → fixtures/workspace-state.ts} +5 -5
  122. package/src/generated/cli-result.d.cts +2 -1
  123. package/src/generated/extension.d.cts +2 -1
  124. package/src/generated/report.cjs +1 -1
  125. package/src/generated/report.d.cts +2 -1
  126. package/src/generated/run-evidence.cjs +1 -1
  127. package/src/generated/run-evidence.d.cts +2 -1
  128. package/src/generated/runtime.cjs +1 -1
  129. package/src/generated/runtime.d.cts +2 -1
  130. package/src/git.ts +93 -0
  131. package/src/graders/git-head.ts +29 -84
  132. package/src/graders/shell.ts +50 -68
  133. package/src/host-diagnostic-redaction.ts +52 -0
  134. package/src/host-diagnostics.ts +331 -0
  135. package/src/hosts/claude-continuation.ts +57 -40
  136. package/src/hosts/claude-credential.ts +160 -63
  137. package/src/hosts/claude-events.ts +34 -18
  138. package/src/hosts/claude-keychain.ts +78 -21
  139. package/src/hosts/claude-login-recovery.ts +85 -0
  140. package/src/hosts/claude-login-refresh.ts +178 -0
  141. package/src/hosts/claude-login-store.ts +162 -0
  142. package/src/hosts/claude-login.ts +107 -0
  143. package/src/hosts/claude-native-goal.ts +15 -12
  144. package/src/hosts/claude-process.ts +10 -50
  145. package/src/hosts/claude-refresh-lock.ts +81 -0
  146. package/src/hosts/claude-repository-invocation.ts +9 -34
  147. package/src/hosts/claude-settings.ts +46 -9
  148. package/src/hosts/claude-skill-activations.ts +169 -0
  149. package/src/hosts/claude-state.ts +28 -15
  150. package/src/hosts/claude-tool-calls.ts +13 -10
  151. package/src/hosts/claude.ts +121 -81
  152. package/src/hosts/codex-app-server.ts +78 -52
  153. package/src/hosts/codex-configuration.ts +5 -10
  154. package/src/hosts/codex-exec-controls.ts +516 -0
  155. package/src/hosts/codex-marketplace.ts +12 -10
  156. package/src/hosts/codex-native-calls.ts +15 -122
  157. package/src/hosts/codex-process.ts +10 -183
  158. package/src/hosts/codex-profile.ts +36 -21
  159. package/src/hosts/codex-session-files.ts +1 -9
  160. package/src/hosts/codex-state.ts +134 -18
  161. package/src/hosts/codex.ts +210 -183
  162. package/src/hosts/isolation-common.ts +8 -11
  163. package/src/hosts/isolation-roots.ts +2 -2
  164. package/src/hosts/linux-sandbox.ts +15 -2
  165. package/src/hosts/mac-sandbox.ts +87 -18
  166. package/src/hosts/native-controls.ts +72 -22
  167. package/src/hosts/native-request.ts +55 -0
  168. package/src/hosts/process-lifecycle.ts +216 -48
  169. package/src/hosts/protected-worktrees.ts +1 -1
  170. package/src/hosts/skill-hook-catalog.ts +131 -0
  171. package/src/hosts/skill-hook-handler.ts +374 -0
  172. package/src/hosts/skill-hooks.ts +577 -0
  173. package/src/instrumentation.ts +7 -8
  174. package/src/native-transcript-state.ts +22 -3
  175. package/src/native-transcript-view.ts +52 -13
  176. package/src/native-transcripts.ts +26 -11
  177. package/src/paths.ts +22 -0
  178. package/src/process-lifecycle.ts +150 -0
  179. package/src/provenance.ts +27 -7
  180. package/src/prune.ts +300 -0
  181. package/src/report.ts +63 -36
  182. package/src/resolved-case.ts +1 -1
  183. package/src/results-lock.ts +42 -0
  184. package/src/results.ts +14 -18
  185. package/src/{runtime-config.ts → runtime/config.ts} +160 -46
  186. package/src/{runtime-discovery-apple.ts → runtime/discovery-apple.ts} +3 -3
  187. package/src/{runtime-discovery-providers.ts → runtime/discovery-providers.ts} +3 -9
  188. package/src/{runtime-discovery.ts → runtime/discovery.ts} +4 -4
  189. package/src/{runtime-hook-processes.ts → runtime/hook-processes.ts} +1 -1
  190. package/src/{runtime-hooks.ts → runtime/hooks.ts} +32 -22
  191. package/src/{runtime-paths.ts → runtime/paths.ts} +5 -19
  192. package/src/{runtime-query.ts → runtime/query.ts} +5 -5
  193. package/src/{runtime-seeds.ts → runtime/seeds.ts} +3 -3
  194. package/src/runtime/shared-cache.ts +130 -0
  195. package/src/{runtime-state.ts → runtime/state.ts} +28 -11
  196. package/src/schema-types.ts +73 -161
  197. package/src/shell.ts +4 -0
  198. package/src/transcript-retention.ts +146 -0
  199. package/src/value-guards.ts +22 -0
  200. package/docs/assets/sevro-logo.png +0 -0
  201. package/docs/assets/sevro-symbol.svg +0 -1
  202. package/docs/assets/sevro-wordmark.svg +0 -1
  203. package/docs/cache-ownership-validation.md +0 -49
  204. package/docs/claude-continuation-validation.md +0 -47
  205. package/docs/concurrency-validation.md +0 -86
  206. package/docs/configuration-root-validation.md +0 -70
  207. package/docs/engine-slice.md +0 -114
  208. package/docs/evidence/runtime-startup-30/README.md +0 -185
  209. package/docs/evidence/runtime-startup-30/after.json +0 -319
  210. package/docs/evidence/runtime-startup-30/baseline-timeout.jsonl +0 -2
  211. package/docs/evidence/runtime-startup-30/before.json +0 -403
  212. package/docs/evidence/runtime-startup-30/consumer-smoke.json +0 -63
  213. package/docs/evidence/runtime-startup-30/full-policy-diagnostic.jsonl +0 -3
  214. package/docs/evidence/runtime-startup-30/minimal-policy-diagnostic.jsonl +0 -3
  215. package/docs/evidence/runtime-startup-30/plugin-template-assessment.json +0 -20
  216. package/docs/evidence/runtime-startup-30/seedless-timeout.jsonl +0 -2
  217. package/docs/evidence.md +0 -17
  218. package/docs/fixture-cleanup-validation.md +0 -73
  219. package/docs/guide-verification.json +0 -239
  220. package/src/evaluation-context.ts +0 -259
  221. package/src/evaluation-fixture.ts +0 -302
  222. package/src/evaluation-run.ts +0 -200
  223. package/src/evaluation-trial.ts +0 -1016
  224. package/src/hosts/claude-nested-skills.ts +0 -272
  225. package/src/hosts/codex-command-output.ts +0 -510
  226. package/src/hosts/codex-executor-command.ts +0 -291
  227. package/src/hosts/codex-skill-reads.ts +0 -783
  228. /package/src/{trial-scheduler.ts → evaluation/scheduler.ts} +0 -0
@@ -1,49 +0,0 @@
1
- # Cache ownership validation
2
-
3
- The public CLI's curated Claude runtime no longer supplies repository-specific
4
- cache variables. Tools select their own defaults under an isolated home in the
5
- trial's Git metadata. Candidate and shell-check homes are separate; their
6
- curated UV cache is shared within one trial.
7
-
8
- ## Test-first trace
9
-
10
- 1. Red — `bun test tests/cli.test.ts -t "CLI curated Claude runtime leaves repository caches to tools"`:
11
- the synthetic Claude process rejected the injected `DARROW_CACHE_DIR`;
12
- the public result recorded failed execution and exit 2 instead of a passed
13
- task. Product code was unchanged.
14
- 2. Green — `bun test tests/cli.test.ts -t "CLI curated Claude runtime leaves repository caches to tools"`:
15
- one test passed after removing that override and placing the curated
16
- candidate home in Git metadata. An intermediate fixture correction
17
- canonicalized macOS path aliases before testing containment.
18
- 3. Red — `bun test tests/cli.test.ts -t "CLI curated shell grading leaves repository caches to tools"`:
19
- candidate execution completed, but the isolated shell check rejected the
20
- injected cache override and the public task failed. The shell grader was
21
- unchanged.
22
- 4. Green — `bun test tests/cli.test.ts -t "CLI curated shell grading leaves repository caches to tools"`:
23
- one test passed after removing the shell override. Intermediate test repairs
24
- corrected the public check status to `passed` and read checks from the
25
- documented CLI result, rather than a nonexistent evidence field.
26
-
27
- The two commands remain the literal focused commands for these slices.
28
- Intermediate fixture/assertion failures are not additional behavior evidence.
29
- The candidate test supplies an unusable caller cache override and verifies
30
- that it is absent from the host environment. Both tests write tool-owned cache
31
- files. The shell test also verifies the curated cache, separate homes, and
32
- an unchanged Git worktree.
33
-
34
- ## Final gates
35
-
36
- - `bun run typecheck`
37
- - `bun run format:check`
38
- - `bun test`
39
- - `bun run test:package-install`
40
-
41
- The installation gate exercises the same environment migration through the
42
- installed CLI, synthetic Claude executable, and an isolated shell check, with
43
- no source Git metadata. Darrow separately runs its installed-package parity
44
- gate against the exact candidate tarball.
45
-
46
- These fixtures exercise Sevro's real preparation, execution, shell isolation,
47
- grading, and package boundary. Claude is synthetic; this is not live model
48
- evidence or proof of Claude's own sandbox behavior. No release is published by
49
- these checks.
@@ -1,47 +0,0 @@
1
- # Claude continuation validation
2
-
3
- The bundled Claude host now starts and resumes the same UUID-bound native
4
- session for a declared follow-up prompt. The public CLI regressions use
5
- synthetic executables and credentials without model calls.
6
-
7
- Working directory: `/Users/bjro/Sources/sevro`.
8
-
9
- ## Public CLI slices
10
-
11
- 1. Red — `lean-ctx -c 'bun test tests/cli.test.ts -t "CLI resumes Claude in the same isolated session and grades its final turn"'`:
12
- exit `64`, with `selected host does not support continuation`.
13
- 2. Green — `lean-ctx -c 'bun test tests/cli.test.ts -t "CLI resumes Claude in the same isolated session and grades its final turn"'`:
14
- one test passed with eight assertions. Both calls use the same native
15
- session, settings, credentials, model, and effort. The final response passes;
16
- separate turn artifacts, combined usage, and the workspace boundary remain
17
- in public evidence. A later guard also confirms exactly one initial and one
18
- resume launch, bringing this test to nine assertions.
19
- 3. Red — `lean-ctx -c 'bun test tests/cli.test.ts -t "CLI leaves Claude usage unmeasured when a resumed result belongs to another session"'`:
20
- foreign-session usage was incorrectly retained as complete with four input
21
- tokens, six output tokens, and cost `0.03`.
22
- 4. Green — `lean-ctx -c 'bun test tests/cli.test.ts -t "CLI leaves Claude usage unmeasured when a resumed result belongs to another session"'`:
23
- one test passed with three assertions. Execution fails, task success is
24
- unassessed, and unbound token and cost measurements remain unknown.
25
-
26
- The first test initially omitted the generated fixture's `kind`. Its invalid
27
- configuration was corrected before the meaningful red above; that setup error
28
- was not a missing-behavior red.
29
-
30
- ## Additional guards and final gates
31
-
32
- Two additional CLI guards passed with 62 assertions. They cover failed,
33
- missing, foreign, and duplicate native results in either turn, prevent resume
34
- after an invalid initial result, retain failed event evidence without grading,
35
- and preserve changed, unmeasured, or incomplete usage observations. They were
36
- added after implementation, without a test-first claim. One initial assertion
37
- used the wrong retained-check location; it was corrected to the public CLI
38
- trial checks.
39
-
40
- The full `lean-ctx -c 'bun test'` gate passed 210 tests with 1,131 assertions
41
- across 36 files in 67.67 seconds. Typechecking and formatting passed.
42
- `lean-ctx -c 'bun run test:package-install'` installed Sevro `0.1.0-dev.0`
43
- without source Git metadata and passed its public-command checks.
44
-
45
- These results verify the implementation and deterministic failure boundaries.
46
- A live continuation and Darrow's installed-package integration are recorded
47
- separately when observed. This remains an unpublished development version.
@@ -1,86 +0,0 @@
1
- # Trial concurrency validation
2
-
3
- The public CLI preserves the positive `--jobs` contract required by Darrow's
4
- extraction. Its default is three; the option bounds trials within one case.
5
- Tests invoke the actual CLI and replace only the external candidate host with
6
- synthetic adapters. No live model call was made.
7
-
8
- ## Observed test-first slice
9
-
10
- Working directory: `/Users/bjro/Sources/sevro`.
11
-
12
- Red — `lean-ctx -c 'bun test tests/cli-concurrency.test.ts -t "CLI bounds parallel trials and retains ordered isolated evidence"'`:
13
- exit `64` because the public CLI did not accept `--jobs`.
14
-
15
- Green — `lean-ctx -c 'bun test tests/cli-concurrency.test.ts -t "CLI bounds parallel trials and retains ordered isolated evidence"'`:
16
- one test passed with 23 assertions. Five trials reach a peak of two active host
17
- calls, retain separate workspaces and artifacts, and preserve trial-number order
18
- in results, run evidence, and checkpoints. Every workspace is removed after
19
- its trial artifact is retained.
20
-
21
- The first implementation run reached the concurrency assertions but exposed
22
- an incorrect temporary-path oracle: macOS canonicalized `/var` to `/private/var`.
23
- The fixture now uses its canonical root; the original missing-option red remains
24
- the test-first evidence.
25
-
26
- ## Additional guards
27
-
28
- Four post-implementation guards cover cancellation of both active trials without
29
- starting queued work; persistence failure that retains a completed peer before
30
- diagnostic finalization and keeps the failed fixture; default three-job and
31
- explicit serial execution with different configuration identities; and invalid
32
- job limits before result or state storage is created. The complete file passed
33
- five tests with 70 assertions. These guards do not claim an observed red.
34
-
35
- Five prior internal tests require serial host-call order to bind expected trial
36
- values, or a completed first trial before a later failure or cancellation.
37
- They now request `jobs: 1` explicitly and retain their original assertions.
38
- The first three focused repairs passed three tests with 25 assertions.
39
- The combined command `lean-ctx -c 'bun test tests/engine.test.ts tests/claude-host.test.ts -t "runs trials, applies threshold|host artifacts are retained|host failure retains completed|cancellation retains prior|failed Claude execution"'`
40
- passed all five serial tests with 51 assertions.
41
-
42
- Final gates cover the full Sevro suite, types, formatting, installed-package
43
- verification, and Darrow public-interface parity against the same tarball.
44
- The bounded independent review retains its exact scope and checks outside the
45
- repository. Dry or synthetic execution does not prove live-model stability.
46
-
47
- ## Review repairs
48
-
49
- The independent review identified future-peer sandbox access, late admission
50
- shutdown on errors, and cancellation before first admission. Each repair has
51
- an observed public-CLI red and green in `/Users/bjro/Sources/sevro`.
52
-
53
- Red — `lean-ctx -c 'bun test tests/cli-concurrency.test.ts -t "CLI retains interruption before admitting its first trial"'`:
54
- SIGINT returned `70` instead of `130`.
55
-
56
- Green — `lean-ctx -c 'bun test tests/cli-concurrency.test.ts -t "CLI retains interruption before admitting its first trial"'`:
57
- one test passed with 20 assertions, covering SIGINT and SIGTERM, no host calls,
58
- empty trial evidence, retained results, and interrupted ownership. The first
59
- fixture sent its signal before CLI handlers existed and was corrected before
60
- the recorded red; that process exit is not red evidence.
61
-
62
- Red — `lean-ctx -c 'bun test tests/cli-concurrency.test.ts -t "CLI sandbox denies read and write access to later admitted peer fixtures"'`:
63
- the real macOS sandbox allowed access to the later peer, failing the isolation
64
- check with task exit `1`.
65
-
66
- Green — `lean-ctx -c 'bun test tests/cli-concurrency.test.ts -t "CLI sandbox denies read and write access to later admitted peer fixtures"'`:
67
- one test passed with four assertions. Trial one can use its own fixture while
68
- its sandbox denies reading and writing trial three's marker; trial three keeps
69
- the original content. The initial inline fixture produced an unrelated Git
70
- metadata grading error. Using a declared generated Git fixture established the
71
- recorded isolation red. Candidate and semantic roots are reserved before
72
- execution. Peer roots are denied directly without querying Git metadata that
73
- may still be under preparation.
74
-
75
- Red — `lean-ctx -c 'bun test tests/cli-concurrency.test.ts -t "CLI closes queued admission when grading fails before advisory retention"'`:
76
- four candidate calls started instead of two while the failing trial's advisory
77
- work remained held.
78
-
79
- Green — `lean-ctx -c 'bun test tests/cli-concurrency.test.ts -t "CLI closes queued admission when grading fails before advisory retention"'`:
80
- one test passed with eight assertions. A required grader error closes admission
81
- immediately; both admitted trials and advisory results remain retained.
82
-
83
- A post-implementation guard also covers an execution failure with an already
84
- active peer, retained trial artifacts, and completed ownership. It makes no red
85
- claim. These repairs require fresh checks and verification of the original
86
- closed finding set before committing.
@@ -1,70 +0,0 @@
1
- # Configuration root validation
2
-
3
- The public CLI imports one explicit Codex setting from a separate configuration
4
- root, binds each used role's effective value into retained configuration and
5
- evaluation identity, and protects that repository's primary and linked worktrees.
6
- The runtime TOML dependency is pinned to `smol-toml` 1.8.0.
7
-
8
- Working directory: `/Users/bjro/Sources/sevro`.
9
-
10
- ## Observed test-first slices
11
-
12
- 1. Red — `lean-ctx -c 'bun test tests/cli.test.ts -t "CLI imports only the Codex limit from its separate configuration root"'`:
13
- exit `64`, `sevro.invocation.invalid`, because `--config-root` was unsupported.
14
- 2. Green — `lean-ctx -c 'bun test tests/cli.test.ts -t "CLI imports only the Codex limit from its separate configuration root"'`:
15
- one test passed with eight assertions. The synthetic Codex process requires
16
- the imported limit in its isolated configuration and rejects an unrelated
17
- model marker. Changed limits are retained and change evaluation identity.
18
- 3. Red — `lean-ctx -c 'bun test tests/cli.test.ts -t "CLI isolates a separate configuration repository and its linked worktree"'`:
19
- task exit `1`; the primary configuration secret was denied, but the linked
20
- worktree secret remained readable by the isolated shell grader.
21
- 4. Green — `lean-ctx -c 'bun test tests/cli.test.ts -t "CLI isolates a separate configuration repository and its linked worktree"'`:
22
- one test passed with three assertions; both protected-source reads fail.
23
- 5. Red — `lean-ctx -c 'bun test tests/cli.test.ts -t "CLI refuses a dangling Codex configuration link before execution"'`:
24
- incorrectly returned `0` for a declared unreadable configuration link.
25
- 6. Green — `lean-ctx -c 'bun test tests/cli.test.ts -t "CLI refuses a dangling Codex configuration link before execution"'`:
26
- one test passed with three assertions; exit `64`, execution `not_run`.
27
-
28
- Before implementation, the first test's identity assertion was corrected to
29
- read `evaluationIdentity.digest` from retained evidence rather than an absent
30
- CLI result field. The second test's check status oracle was also corrected
31
- from `pass` to the documented `passed` before implementation. Both literal red
32
- commands were rerun and still failed for the missing product behavior above.
33
-
34
- Additional guards were added after implementation without a test-first claim.
35
- They cover missing files and settings, all three Codex roles, malformed TOML,
36
- non-table agent settings, invalid numeric types and ranges, a non-file config,
37
- and relative, missing, or non-directory configuration roots. Together the five
38
- new tests contain 65 assertions. No live model call is involved; macOS isolation
39
- tests use the installed Codex sandbox and a synthetic candidate executable.
40
-
41
- ## Test timeout repair
42
-
43
- The first full `bun test` gate completed 214 tests and timed out the existing
44
- eight-scenario Claude continuation guard after its default five seconds. Timeout
45
- cleanup removed its active fixture, producing a subsequent ownership diagnostic.
46
- The test now has an explicit ten-second bound, with every assertion unchanged.
47
- `lean-ctx -c 'bun test tests/cli.test.ts -t "Claude continuation never grades failed or unbound native results"'`
48
- then passed one test with 52 assertions in 3.96 seconds. This is test harness
49
- maintenance, without a product-behavior red/green claim.
50
-
51
- ## Independent review repairs
52
-
53
- The bounded independent review found two medium blocking findings: a dangling
54
- intermediate `.codex` directory link was treated as absent configuration, and
55
- an explicitly empty `--config-root` silently selected the project root. The
56
- original candidate-bound report is retained at
57
- `/Users/bjro/.darrow/reviews-issue95-configuration-root/8794a1ce3463a83e1434abc110042a76e2397e27951a9a5cbf42214d9bbfc77b/darrow-review.k328difz/review.md`.
58
-
59
- 1. Red — `lean-ctx -c 'bun test tests/cli.test.ts -t "CLI distinguishes absent Codex configuration from a dangling directory link"'`:
60
- returned `0` for the unreadable declared directory link; absent and ordinary
61
- empty directories already retained the null host default.
62
- 2. Green — `lean-ctx -c 'bun test tests/cli.test.ts -t "CLI distinguishes absent Codex configuration from a dangling directory link"'`:
63
- one test passed with seven assertions; the link fails with `64`, execution
64
- `not_run`, and an absolute configuration-path diagnostic.
65
- 3. Red — `lean-ctx -c 'bun test tests/cli.test.ts -t "CLI rejects an explicitly empty configuration root"'`:
66
- returned `0` when the supplied empty option should fail.
67
- 4. Green — `lean-ctx -c 'bun test tests/cli.test.ts -t "CLI rejects an explicitly empty configuration root"'`:
68
- one test passed with four assertions for both separate and equals option
69
- forms; each returns `64` and execution `not_run`. Omission still defaults
70
- to the project root through the existing retained-role guards.
@@ -1,114 +0,0 @@
1
- # First engine slice
2
-
3
- `runEvaluation` accepts a resolved inline, generated Git, or repository fixture case and an injected host
4
- adapter. It is an internal API while the host isolation adapters, extension
5
- lifecycle, and public CLI are being built. The synthetic adapter in the tests
6
- exercises the actual engine path without a model call.
7
-
8
- The engine validates check configuration and fixture paths before execution.
9
- Repository sources must be declared under an explicit source root, clean, and
10
- committed. Each trial clones the fixed commit without hardlinks or remotes.
11
- The source revision contributes to fixture identity; a changed or dirty source
12
- is refused before it can silently alter a trial. Submodules and preparation
13
- artifacts targeting `.git/` are refused.
14
- Generated Git fixtures validate a bounded commit list, optional working-tree
15
- files, and staged overlay paths before execution. Each trial builds the same
16
- history with a fixed local identity and date, then applies its own working-tree
17
- state. The declarative history enters fixture identity; no trial can inherit a
18
- previous trial's edits.
19
- The engine runs up to the configured positive `jobs` limit at once, defaulting
20
- to three. Each admitted trial owns its workspace and artifact names. Completed
21
- trial evidence is checkpointed before cleanup and retained in trial-number order,
22
- including when trials complete out of order. Errors stop later admission and
23
- active work drains before finalization. Use one job when serial ordering is needed;
24
- custom hosts must support independent concurrent calls when the limit is higher.
25
- Reserve all candidate and semantic workspace roots before launching a process;
26
- prepare fixture contents only after admission. Sandbox deny lists include future
27
- peers. Clear completed candidate contents after retention, keep their empty roots
28
- until active work drains, and then remove unused and completed reservations.
29
- Close admission when an execution or required grading error is detected, before
30
- advisory work, persistence, or cleanup. Already admitted peers still retain evidence.
31
- For each trial it creates a separate workspace, asks the adapter to run the
32
- prompt, grades its bounded final message, writes the raw-message reference and
33
- trial artifact, and only then removes the workspace. An adapter exception
34
- becomes an execution failure; a later failure leaves earlier trial artifacts
35
- intact. A failed trial checkpoint retains its fixture and cannot produce a
36
- successful result.
37
- Dry preparation still validates the case, runs extension preparation, creates
38
- the fixture, and retains a trial record. It skips the host and all grading,
39
- records `not_run` / `not_requested` / `not_assessed`, and has a separate
40
- evaluation identity from an executed run.
41
-
42
- The final `run.json` follows the v1 evidence schema and contains separate
43
- execution, grading, and task states. It records the exact runner build and
44
- project content digests derived by the CLI or explicitly supplied by the
45
- caller, plus a computed evaluation identity. Missing optional usage stays
46
- `null` and incomplete. Results storage
47
- is explicit and independent of the project root. A packaged runner records its
48
- package identity without Git; a private development checkout reads its own Git
49
- revision and hashes tracked and untracked changes for the local runner
50
- identity. A Git-backed project records its own revision and dirty content;
51
- a project without a commit retains unknown Git provenance alongside a bounded
52
- project content snapshot digest. An optional independent
53
- run-state root holds an active record and a checkpoint pointing to each
54
- retained trial. An evaluation-identity claim uses a short SQLite transaction
55
- to admit one verified process owner. A live owner blocks an equivalent run;
56
- an unverifiable owner is refused, while a confirmed dead owner is marked
57
- interrupted and its prior attempt files are kept before a new claim starts.
58
- The active record reaches `complete` only after final run evidence is written.
59
- Process identity includes the PID, host, and operating-system start time to
60
- protect against PID reuse. If start time cannot be verified, the run stops
61
- before host execution.
62
- The CLI passes SIGINT and SIGTERM through an abort signal. A cooperating host
63
- stops its work; the engine retains completed trial artifacts, records the
64
- cancelled trial, finalizes the active attempt as `interrupted`, and exits 130
65
- or 143 after writing run evidence. An adapter that ignores cancellation cannot
66
- be force-stopped by the injected-host interface.
67
-
68
- The host can return bounded, namespaced observations alongside its final
69
- message and bounded evidence artifacts. The engine retains them before
70
- extension grading. It passes observations and artifact file references to the
71
- extension without copying artifact bytes into run JSON. Missing or partial
72
- required host evidence makes grading unavailable; malformed host evidence
73
- fails execution. The engine also accepts shell checks when the caller supplies
74
- protected source roots. They run through the macOS outer sandbox after host
75
- execution, and their exit observations are retained with the trial. An
76
- unavailable boundary produces a grading error rather than a passing check.
77
- Semantic checks use a separately supplied host identity and an empty grader
78
- workspace. A complete candidate final message is sent to that route with the
79
- declared propositions. The engine requires one bounded verdict per check,
80
- retains the raw response and grader artifacts outside the fixture, and records
81
- the route and per-check observations. Missing candidate output makes semantic
82
- checks unavailable; failed or malformed grader output makes grading an error.
83
- Git HEAD checks capture the base commit before the candidate turn and grade
84
- unchanged HEAD, changed HEAD, or base ancestry afterward. Candidate edits to
85
- fixture files cannot rewrite the expected base revision.
86
- An optional negotiated extension can add declared checks. The engine calls its
87
- `prepare` method before host execution and its `evaluate` method for each
88
- trial. It retains extension identity, configuration digest, protocol,
89
- capabilities, grader selection, check evidence references, and metrics.
90
- Missing declared extension checks remain unavailable; extension errors cannot
91
- become a passing assessment. Inline preparation artifacts are decoded, checked
92
- against their SHA-256 digests, mounted into each fixture, and retained outside
93
- it for later inspection. Source-reference artifacts resolve only through a
94
- caller-declared ID-to-file-URL map under an explicit case source root. Their
95
- bytes receive the same size, path, and digest checks before mounting and
96
- retention.
97
- An explicitly selected extension task-verdict policy receives its policy ID
98
- during `evaluate` and must return a recommendation. The engine uses that
99
- recommendation only when execution and grading completed with all required
100
- evidence available. It retains the selected policy and trial recommendation;
101
- missing recommendations are grading errors. An explicitly replaced built-in
102
- grader still has its declaration validated, but its checks do not run or count
103
- toward the task verdict. At least one declared extension check must take its
104
- place. The selection enters comparison identity and retained evidence.
105
- An extension may request a negotiated host instrumentation capability during
106
- `prepare`. The engine checks the host-declared capability and whether it
107
- changes execution before starting a trial. Execution-changing requests are
108
- refused in a passive condition. The host receives the request and must report
109
- exactly what it applied; a mismatch or an unconfirmed enforced condition fails
110
- execution. Run and trial evidence retain requested and applied instrumentation
111
- separately. The bundled Codex adapter advertises no instrumentation capabilities.
112
-
113
- Additional host adapters and host-specific instrumentation implementations
114
- remain in progress.
@@ -1,185 +0,0 @@
1
- # Runtime startup measurements for issue 30
2
-
3
- The matched synthetic native-host benchmark reduced candidate setup plus the
4
- controlled participant from 14.37–14.92 seconds to 6.20–6.66 seconds. The response-only
5
- grading host call, including its separate native startup, fell from 13.49–15.03
6
- seconds to 5.45–5.65 seconds. These are runner-boundary measurements with synthetic
7
- model responses, not measurements of API latency or live model quality.
8
-
9
- ## Reproduction and conditions
10
-
11
- Run the same maintained [benchmark harness](../../../scripts/benchmark-runtime-startup.ts)
12
- against an unchanged checkout of `c205482b25d4d52a395c70434f2b392f6acfb279` and this
13
- candidate, sequentially on one machine:
14
-
15
- ```sh
16
- bun scripts/benchmark-runtime-startup.ts /absolute/baseline /tmp/before.json
17
- bun scripts/benchmark-runtime-startup.ts /absolute/candidate /tmp/after.json
18
- ```
19
-
20
- The retained [before](before.json) and [after](after.json) observations used
21
- macOS arm64, Bun 1.3.13, Codex CLI 0.162.1, the same synthetic plugin/response case,
22
- `synthetic-candidate` and `synthetic-semantic` model labels, and `low` effort.
23
- There were three candidate/semantic repetitions in each process, with a 32 MiB,
24
- 2,049-entry public dependency tree. Every role received a fresh private home and
25
- native plugin installation. The first candidate used a cold verified-snapshot
26
- cache; repetitions two and three reused the policy. OS filesystem caches were
27
- uncontrolled and are not described as cold. Baseline ran before candidate;
28
- order effects and three repetitions limit generalization.
29
-
30
- The harness wraps the same production functions and process boundaries without
31
- changing their arguments or timeout. Only external model output is replaced by a
32
- fixed event stream. The native plugin installer and `codex sandbox` remain real.
33
- This fixture does not claim live skill invocation; separate native integration
34
- coverage and consumer smoke own that evidence. Timings overlap: runtime and
35
- sandbox phases are inside candidate/grading-host totals, and plugin commands are
36
- inside plugin installation. Do not sum both levels. The `grading` measurement surrounds the semantic host
37
- call with its response-only policy; it excludes engine fixture preparation,
38
- verdict parsing, and extension bookkeeping.
39
-
40
- ## Observed timings
41
-
42
- All values below are milliseconds, in repetition order.
43
-
44
- | Boundary | Before | After |
45
- | -------------------------------------------- | ------------------------ | --------------------- |
46
- | Configuration fingerprint (once) | 262 | 299 |
47
- | Candidate runtime preparation | 1,969 / 1,357 / 1,273 | 721 / 431 / 443 |
48
- | Candidate hook dependency preparation | 1,226 / 1,465 / 1,235 | No invocation |
49
- | Fresh native plugin installation | 385 / 141 / 143 | 188 / 141 / 143 |
50
- | Candidate sandbox probes, summed per role | 10,938 / 11,032 / 11,622 | 5,490 / 5,404 / 5,448 |
51
- | Controlled participant process | 27 / 29 / 39 | 27 / 27 / 24 |
52
- | Candidate total | 14,925 / 14,369 / 14,666 | 6,659 / 6,199 / 6,257 |
53
- | Semantic runtime preparation | 1,174 / 1,236 / 2,262 | Under 1 each |
54
- | Semantic hook dependency preparation | 1,105 / 1,087 / 1,363 | No invocation |
55
- | Semantic sandbox probes, summed per role | 10,855 / 10,803 / 11,032 | 5,548 / 5,360 / 5,365 |
56
- | Controlled semantic response process | 28 / 44 / 27 | 29 / 28 / 28 |
57
- | Grading host total, including native startup | 13,495 / 13,534 / 15,030 | 5,647 / 5,454 / 5,460 |
58
-
59
- The probe count fell from two to one per fresh role. Candidate dependency
60
- materialization reuses immutable verified bytes after its first capture, and
61
- response-only grading no longer materializes implicit candidate dependencies.
62
- Configuration hashing remains necessary for identity. Fresh-install warm timings
63
- were essentially unchanged; no plugin-install speedup is claimed. Participant
64
- and semantic outputs are synthetic controls, so no API/model saving is claimed.
65
-
66
- ## Startup deadline diagnosis
67
-
68
- A separate authenticated Darrow baseline using Codex 0.162.1 and `gpt-6-luna`
69
- with medium effort failed before participant execution: the first sandbox probe
70
- hit its 10-second deadline at 10,004.8 ms. A seedless control retained the same
71
- tool declarations and also timed out at 10,004.2 ms. With only the diagnostic
72
- probe deadline increased to 60 seconds, both original full-policy probes passed
73
- at 10,649.1 and 10,690.4 ms. Participant execution was deliberately withheld in
74
- that diagnostic. A minimal-policy control without tool grants or seeds passed
75
- at 5,372.8 and 5,681.1 ms.
76
-
77
- Raw diagnostic records are retained for the [original timeout](baseline-timeout.jsonl),
78
- [seedless timeout](seedless-timeout.jsonl), [full policy with diagnostic deadline](full-policy-diagnostic.jsonl),
79
- and [minimal policy](minimal-policy-diagnostic.jsonl). The maintained
80
- [diagnostic preload](../../../scripts/diagnose-codex-startup.ts) records bounded
81
- phase timing/errors and withholds app-server participant execution. To reproduce
82
- against an explicit checkout, set `SEVRO_DIAGNOSTIC_SOURCE_ROOT` and
83
- `SEVRO_DIAGNOSTIC_PHASE_FILE`, then use a CLI wrapper running:
84
-
85
- ```sh
86
- bun --preload /absolute/candidate/scripts/diagnose-codex-startup.ts /absolute/baseline/src/cli.ts "$@" --runner-checkout-root /absolute/baseline
87
- ```
88
-
89
- Point Darrow's `SEVRO_PACKAGE_BIN` at that wrapper and run:
90
-
91
- ```sh
92
- bun evals/runner/run.ts --harness codex --owner-evaluation passive --skill create-commit --case create-commit-conventional-format --model gpt-6-luna --effort medium --trials 1 --jobs 1 --threshold 1 --results-root /absolute/outside-project-results --output /absolute/selection.json
93
- ```
94
-
95
- For the deadline control, additionally set `SEVRO_DIAGNOSTIC_TIMEOUT_MS=60000`.
96
- For runtime controls, append `-- --runtime-config-file /absolute/runtime.json`:
97
- seedless keeps the original policy except `runtime.seedDirectories=[]`; minimal
98
- keeps only `format`, `nativeTranscripts: true`, and `hooks.nativeGoal: true`.
99
- The original diagnostic used the same wrappers with fixed paths; the retained
100
- preload makes those paths explicit through environment variables.
101
-
102
- These one-off controls locate the failure in native sandbox startup and show
103
- that dependency copying is not necessary for the timeout. Declared tool grants
104
- increase observed startup on this machine. They do not establish the exact
105
- native CLI mechanism or a general policy-size scaling law. The product now uses
106
- a bounded 60-second preflight; the measured saving comes from eliminating the
107
- second invocation and repeated preparation, not from increasing that deadline.
108
- The unavailable baseline participant, activation, and grading evidence remain
109
- unavailable rather than being assigned successful outcomes.
110
-
111
- ## Snapshot and copy-on-write assessment
112
-
113
- The production snapshot owns verified bytes only in runner memory, keyed by the
114
- policy's seed descriptor. Candidate, peer, checker, and hook writable files never
115
- alias it. First capture must match the configured digest; later source changes
116
- do not change that snapshot. Regression coverage changes candidate files and the
117
- operator source between trials and verifies that the next trial still receives
118
- the original bytes. Executable modes, internal-link dereferencing, empty
119
- directories, source protection, offline environment, and role separation remain
120
- checked.
121
-
122
- The benchmark also exercised `COPYFILE_FICLONE_FORCE` on a 32 MiB file. It
123
- succeeded in about one millisecond in both runs, and changing the destination
124
- left the source length unchanged. This establishes local copy-on-write support,
125
- not portable availability or an immutable directory snapshot. The current
126
- in-memory snapshot deliberately avoids a persistent cache path and its cleanup,
127
- source-mutation, and cross-process trust requirements. Native clone reuse is not
128
- implemented; ordinary materialization works on filesystems without cloning.
129
- Retained policies retain their verified bytes until garbage collection, up to
130
- the existing per-seed bounds. This memory tradeoff should be measured separately
131
- for substantially larger dependency sets.
132
-
133
- ## Native installation reuse assessment
134
-
135
- Every actual native installation in both benchmark runs produced configuration
136
- containing its private home and fixture workspace paths, as retained in the
137
- `installation-assets` observations. Native install receipts bind an
138
- `installedPath` inside that particular home's plugin cache; production verifies
139
- it before accepting explicit invocation. Authorized hook wrappers also bind the
140
- private runtime, sandbox profile, and execution receipt directory.
141
-
142
- A separate [native cache-only reuse experiment](plugin-template-assessment.json)
143
- installed a local synthetic plugin into a fresh credential-free home. The native
144
- registration wrote `source_type = "local"` and the original absolute marketplace
145
- path; the receipt contained the original private `installedPath`. After copying
146
- only `plugins/cache` into a second fresh home, `codex plugin list --json` returned
147
- empty `installed` and `available` arrays. To reproduce, use fresh `HOME` and
148
- `CODEX_HOME`, run `codex plugin marketplace add /absolute/market --json` and
149
- `codex plugin add probe@sevro-assessment --json`, copy `plugins/cache` to another
150
- fresh home, and list there. Paths in the raw record use `<assessment>` for the
151
- throwaway root; no credential file was present.
152
-
153
- An entire installed-home template therefore cannot be replayed into a new trial
154
- without rewriting and reverifying those identities, isolating credentials and
155
- configuration, and obtaining evidence for the new installed paths. Reusing
156
- just package files would still require native registration and receipt checks.
157
- For the measured fixture, warm fresh installation costs about 140 ms versus
158
- roughly 5.4 seconds for one sandbox startup. No template reuse is implemented.
159
- Fresh authentication/configuration, native registration and plugin installation,
160
- receipt validation, hook projection, the combined preflight, and native
161
- invocation evidence remain per-request work. Fresh-install integration coverage
162
- is retained.
163
-
164
- ## Authenticated consumer smoke
165
-
166
- The [bounded consumer summary](consumer-smoke.json) records Darrow revision
167
- `34606ad9e1952b7f4e9c56befa446c18e1a2eb5d`, with no tracked consumer edits. The
168
- candidate's explicit `tdd-explicit-invocation` case passed execution, shell and
169
- semantic grading, and complete native explicit-invocation activation. Candidate
170
- and semantic routes used Codex 0.162.1, `gpt-6-luna`, medium effort, one trial,
171
- one job, and threshold one:
172
-
173
- ```sh
174
- SEVRO_CHECKOUT=/absolute/candidate bun evals/runner/run.ts --harness codex --owner-evaluation passive --skill tdd --case tdd-explicit-invocation --model gpt-6-luna --effort medium --semantic-check-model gpt-6-luna --semantic-check-effort medium --trials 1 --jobs 1 --threshold 1 --results-root /absolute/outside-project-results --output /absolute/selection.json
175
- ```
176
-
177
- The earlier implicit `create-commit-conventional-format` smoke completed
178
- execution and grading on the candidate, including its three shell checks, but
179
- failed the expected HEAD-change assertion. Its fixture mounted the backend under
180
- `.agents` without plugin manifests required by the launcher; the participant
181
- refused the commit. Activation stayed unavailable. The unchanged baseline had
182
- failed that case before participant execution at sandbox preflight. These
183
- outcomes are retained honestly; neither the fixture failure nor the later
184
- single-trial success establishes a matched live latency comparison or repeated
185
- model reliability. Private native transcripts and credentials remain outside Git.