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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (243) hide show
  1. package/CONTRIBUTING.md +170 -0
  2. package/LICENSE +63 -136
  3. package/README.md +83 -66
  4. package/docs/README.md +44 -0
  5. package/docs/acknowledgements.md +14 -0
  6. package/docs/architecture.md +146 -0
  7. package/docs/assets/README.md +27 -0
  8. package/docs/assets/sevro-logo.png +0 -0
  9. package/docs/assets/sevro-symbol.svg +1 -0
  10. package/docs/assets/sevro-wordmark.svg +1 -0
  11. package/docs/builtin-graders-v1.md +41 -13
  12. package/docs/codex-host.md +184 -52
  13. package/docs/contracts.md +19 -0
  14. package/docs/creating-cases.md +139 -0
  15. package/docs/development-cli.md +190 -30
  16. package/docs/documentation-quality.md +61 -0
  17. package/docs/evaluation-workflow.md +110 -0
  18. package/docs/evidence/code-mode-controls-71.md +64 -0
  19. package/docs/evidence/code-mode-programs-85.md +64 -0
  20. package/docs/evidence/codex-state-73/README.md +204 -0
  21. package/docs/evidence/codex-state-73/darrow-migration.patch +182 -0
  22. package/docs/evidence/codex-state-73/results.json +661 -0
  23. package/docs/evidence/local-http-74.md +104 -0
  24. package/docs/evidence/runtime-startup-30/README.md +185 -0
  25. package/docs/evidence/runtime-startup-30/after.json +319 -0
  26. package/docs/evidence/runtime-startup-30/baseline-timeout.jsonl +2 -0
  27. package/docs/evidence/runtime-startup-30/before.json +403 -0
  28. package/docs/evidence/runtime-startup-30/consumer-smoke.json +63 -0
  29. package/docs/evidence/runtime-startup-30/full-policy-diagnostic.jsonl +3 -0
  30. package/docs/evidence/runtime-startup-30/minimal-policy-diagnostic.jsonl +3 -0
  31. package/docs/evidence/runtime-startup-30/plugin-template-assessment.json +20 -0
  32. package/docs/evidence/runtime-startup-30/seedless-timeout.jsonl +2 -0
  33. package/docs/evidence/skill-reads-70/results.json +823 -0
  34. package/docs/evidence.md +21 -0
  35. package/docs/extension-protocol-v1.md +50 -16
  36. package/docs/fixture-cleanup-validation.md +3 -0
  37. package/docs/getting-started.md +102 -0
  38. package/docs/guide-evaluation.md +89 -0
  39. package/docs/guide-verification.json +239 -0
  40. package/docs/identity-v1.md +35 -1
  41. package/docs/installing.md +88 -0
  42. package/docs/licenses/BUSL-1.1-0.1.0-rc.2.txt +159 -0
  43. package/docs/licensing.md +42 -0
  44. package/docs/native-controls.md +76 -5
  45. package/docs/native-hosts.md +228 -0
  46. package/docs/reading-results.md +141 -0
  47. package/docs/recipes.md +489 -0
  48. package/docs/releases.md +81 -40
  49. package/docs/report-v1.md +29 -1
  50. package/docs/results-v1.md +180 -0
  51. package/docs/run-settings-v1.md +147 -0
  52. package/docs/running-evaluations.md +31 -0
  53. package/docs/runtime-v1.md +614 -0
  54. package/docs/specs/repository-guide.md +58 -0
  55. package/docs/troubleshooting.md +30 -0
  56. package/docs/typescript-quality.md +234 -0
  57. package/docs/usability-study.md +114 -0
  58. package/examples/basic/host.ts +2 -2
  59. package/examples/recipes/candidate.ts +26 -0
  60. package/examples/recipes/cases/coding-change.json +21 -0
  61. package/examples/recipes/cases/host-tools.json +21 -0
  62. package/examples/recipes/cases/mise.json +21 -0
  63. package/examples/recipes/cases/node.json +21 -0
  64. package/examples/recipes/cases/python-uv.json +21 -0
  65. package/examples/recipes/cases/semantic.json +17 -0
  66. package/examples/recipes/coding-change/check.ts +23 -0
  67. package/examples/recipes/extension-artifacts.ts +65 -0
  68. package/examples/recipes/extension-methods.ts +174 -0
  69. package/examples/recipes/extension.ts +37 -0
  70. package/examples/recipes/repository-skill/.agents/skills/startup-guide/SKILL.md +7 -0
  71. package/examples/recipes/repository-skill/.claude/skills/startup-guide/SKILL.md +7 -0
  72. package/examples/recipes/repository-skill/README.md +3 -0
  73. package/examples/recipes/run-inputs.ts +188 -0
  74. package/examples/recipes/run-options.ts +131 -0
  75. package/examples/recipes/run.ts +63 -0
  76. package/examples/recipes/runtime/empty.json +1 -0
  77. package/examples/recipes/runtime/goals.json +1 -0
  78. package/examples/recipes/runtime/mise.json +6 -0
  79. package/examples/recipes/runtime/path.json +1 -0
  80. package/examples/recipes/runtime/plugins.json +4 -0
  81. package/examples/recipes/runtime/python-uv.json +10 -0
  82. package/examples/recipes/semantic-judge.ts +29 -0
  83. package/examples/templates/coding/adapter.ts +17 -0
  84. package/examples/templates/coding/case.json +15 -0
  85. package/examples/templates/repository-skill/.agents/skills/startup-guide/SKILL.md +6 -0
  86. package/examples/templates/repository-skill/extension-data.ts +64 -0
  87. package/examples/templates/repository-skill/extension.ts +31 -0
  88. package/examples/templates/response/adapter.ts +12 -0
  89. package/examples/templates/response/case.json +13 -0
  90. package/package.json +39 -6
  91. package/schemas/report-v1.schema.json +9 -0
  92. package/schemas/run-evidence-v1.schema.json +2 -1
  93. package/schemas/runtime-v1.schema.json +193 -0
  94. package/src/advisory.ts +10 -5
  95. package/src/candidate-artifacts.ts +208 -0
  96. package/src/candidate-codex-state.ts +185 -0
  97. package/src/case-validation.ts +105 -0
  98. package/src/cli/cancellation.ts +20 -0
  99. package/src/cli/command.ts +81 -0
  100. package/src/cli/completion.ts +15 -0
  101. package/src/cli/demo.ts +59 -0
  102. package/src/cli/evaluation.ts +55 -0
  103. package/src/cli/extension.ts +79 -0
  104. package/src/cli/help.ts +222 -0
  105. package/src/cli/hosts.ts +59 -0
  106. package/src/cli/init-settings.ts +30 -0
  107. package/src/cli/init.ts +111 -0
  108. package/src/cli/invocation.ts +627 -0
  109. package/src/cli/loading.ts +151 -0
  110. package/src/cli/preparation.ts +163 -0
  111. package/src/cli/presentation.ts +91 -0
  112. package/src/cli/progress.ts +6 -0
  113. package/src/cli/run-manifest.ts +133 -0
  114. package/src/cli/run-options.ts +101 -0
  115. package/src/cli/run-overrides.ts +83 -0
  116. package/src/cli/settings.ts +160 -0
  117. package/src/cli/summary.ts +43 -0
  118. package/src/cli.ts +13 -843
  119. package/src/contract-types.ts +94 -0
  120. package/src/engine.ts +19 -2373
  121. package/src/evaluation/advisory.ts +150 -0
  122. package/src/evaluation/check-plan.ts +510 -0
  123. package/src/evaluation/collection.ts +88 -0
  124. package/src/evaluation/context.ts +10 -0
  125. package/src/evaluation/grading-host.ts +39 -0
  126. package/src/evaluation/grading.ts +258 -0
  127. package/src/evaluation/invocation-plan.ts +548 -0
  128. package/src/evaluation/plan.ts +736 -0
  129. package/src/evaluation/progress.ts +19 -0
  130. package/src/evaluation/resources.ts +241 -0
  131. package/src/evaluation/run.ts +206 -0
  132. package/src/{trial-scheduler.ts → evaluation/scheduler.ts} +3 -1
  133. package/src/evaluation/semantic.ts +312 -0
  134. package/src/evaluation/trial.ts +866 -0
  135. package/src/evaluation/types.ts +207 -0
  136. package/src/evidence/host-results.ts +92 -0
  137. package/src/evidence/retained-artifacts.ts +18 -0
  138. package/src/evidence/trial-writer.ts +203 -0
  139. package/src/evidence/usage.ts +17 -0
  140. package/src/extension-client.ts +228 -148
  141. package/src/extension-session.ts +326 -195
  142. package/src/fixtures/advisory.ts +338 -0
  143. package/src/fixtures/bin.ts +57 -0
  144. package/src/{fixture-cleanup.ts → fixtures/cleanup.ts} +13 -7
  145. package/src/fixtures/create.ts +187 -0
  146. package/src/fixtures/generated.ts +300 -0
  147. package/src/fixtures/git-hooks.ts +24 -0
  148. package/src/fixtures/preparation.ts +270 -0
  149. package/src/{repository-fixture.ts → fixtures/repository.ts} +207 -85
  150. package/src/fixtures/setup.ts +224 -0
  151. package/src/fixtures/tools.ts +88 -0
  152. package/src/fixtures/workspace-state.ts +212 -0
  153. package/src/generated/cli-result.cjs +2 -0
  154. package/src/generated/cli-result.d.cts +3 -0
  155. package/src/generated/extension.cjs +2 -0
  156. package/src/generated/extension.d.cts +3 -0
  157. package/src/generated/report.cjs +2 -0
  158. package/src/generated/report.d.cts +3 -0
  159. package/src/generated/run-evidence.cjs +2 -0
  160. package/src/generated/run-evidence.d.cts +3 -0
  161. package/src/generated/runtime.cjs +2 -0
  162. package/src/generated/runtime.d.cts +3 -0
  163. package/src/graders/artifact.ts +56 -23
  164. package/src/graders/git-head.ts +79 -75
  165. package/src/graders/output.ts +222 -140
  166. package/src/graders/semantic.ts +102 -43
  167. package/src/graders/shell.ts +379 -207
  168. package/src/host-diagnostic-redaction.ts +52 -0
  169. package/src/host-diagnostics.ts +319 -0
  170. package/src/hosts/claude-continuation.ts +63 -18
  171. package/src/hosts/claude-credential.ts +43 -62
  172. package/src/hosts/claude-events.ts +86 -51
  173. package/src/hosts/claude-keychain.ts +59 -0
  174. package/src/hosts/claude-native-goal.ts +57 -33
  175. package/src/hosts/claude-process.ts +111 -0
  176. package/src/hosts/claude-repository-invocation.ts +208 -117
  177. package/src/hosts/claude-settings.ts +240 -21
  178. package/src/hosts/claude-skill-activations.ts +166 -0
  179. package/src/hosts/claude-state.ts +403 -0
  180. package/src/hosts/claude-tool-calls.ts +171 -106
  181. package/src/hosts/claude.ts +561 -451
  182. package/src/hosts/codex-app-server.ts +326 -178
  183. package/src/hosts/codex-configuration.ts +44 -18
  184. package/src/hosts/codex-events.ts +97 -60
  185. package/src/hosts/codex-exec-controls.ts +516 -0
  186. package/src/hosts/codex-invocation.ts +70 -0
  187. package/src/hosts/codex-marketplace.ts +283 -0
  188. package/src/hosts/codex-native-calls.ts +546 -500
  189. package/src/hosts/codex-process.ts +202 -0
  190. package/src/hosts/codex-profile.ts +257 -28
  191. package/src/hosts/codex-session-files.ts +106 -0
  192. package/src/hosts/codex-state.ts +492 -0
  193. package/src/hosts/codex.ts +783 -832
  194. package/src/hosts/isolation-common.ts +94 -0
  195. package/src/hosts/isolation-roots.ts +54 -27
  196. package/src/hosts/isolation.ts +10 -0
  197. package/src/hosts/linux-sandbox.ts +159 -0
  198. package/src/hosts/mac-sandbox.ts +187 -61
  199. package/src/hosts/native-controls.ts +152 -62
  200. package/src/hosts/process-lifecycle.ts +37 -0
  201. package/src/hosts/protected-worktrees.ts +51 -19
  202. package/src/hosts/skill-hook-catalog.ts +131 -0
  203. package/src/hosts/skill-hook-handler.ts +374 -0
  204. package/src/hosts/skill-hooks.ts +580 -0
  205. package/src/hosts/workspace-fingerprint.ts +55 -35
  206. package/src/identity.ts +102 -48
  207. package/src/instrumentation.ts +109 -48
  208. package/src/native-transcript-state.ts +131 -0
  209. package/src/native-transcript-view.ts +90 -0
  210. package/src/native-transcripts.ts +286 -0
  211. package/src/process-lifecycle.ts +150 -0
  212. package/src/provenance.ts +161 -81
  213. package/src/prune.ts +215 -0
  214. package/src/report.ts +172 -140
  215. package/src/resolved-case.ts +33 -0
  216. package/src/results-lock.ts +29 -0
  217. package/src/results.ts +133 -86
  218. package/src/run-owner.ts +154 -63
  219. package/src/runtime/config.ts +456 -0
  220. package/src/runtime/discovery-apple.ts +90 -0
  221. package/src/runtime/discovery-providers.ts +63 -0
  222. package/src/runtime/discovery.ts +70 -0
  223. package/src/runtime/hook-processes.ts +97 -0
  224. package/src/runtime/hooks.ts +476 -0
  225. package/src/runtime/paths.ts +313 -0
  226. package/src/runtime/query.ts +85 -0
  227. package/src/runtime/seeds.ts +134 -0
  228. package/src/runtime/shared-cache.ts +143 -0
  229. package/src/runtime/state.ts +143 -0
  230. package/src/schema-types.ts +198 -0
  231. package/src/schema.ts +15 -19
  232. package/src/transcript-retention.ts +146 -0
  233. package/src/value-guards.ts +20 -0
  234. package/src/advisory-fixture.ts +0 -282
  235. package/src/fixture-bin.ts +0 -87
  236. package/src/fixture-setup.ts +0 -163
  237. package/src/generated-fixture.ts +0 -220
  238. package/src/git-hooks.ts +0 -63
  239. package/src/hosts/claude-nested-skills.ts +0 -218
  240. package/src/hosts/codex-command-output.ts +0 -399
  241. package/src/hosts/codex-executor-command.ts +0 -195
  242. package/src/hosts/codex-skill-reads.ts +0 -391
  243. package/src/preparation.ts +0 -211
@@ -0,0 +1,58 @@
1
+ # Repository guide
2
+
3
+ The repository-scoped `sevro-guide` explains this checkout. It is independent
4
+ of npm packaging and serves a static documentation spine, not an execution agent.
5
+
6
+ ## Contract
7
+
8
+ Select for ordinary Sevro questions, explicit invocation, and relevant follow-ups
9
+ about orientation, installation, evaluations, extensions, results, architecture,
10
+ troubleshooting, contribution, and licensing. Unrelated questions must not
11
+ select it. Explicit invocation selects the guide even for out-of-scope requests,
12
+ which receive an explanation of its boundary rather than hidden execution.
13
+
14
+ Inspect relevant sources during each question. Cite them beside material claims.
15
+ Current public contracts and applicable accepted decisions define intent;
16
+ conflicts between them must be exposed. Package metadata and current docs define
17
+ identity and installation. Code/tests support labelled derived facts, not a
18
+ claim that tests passed. Research/historical validation provides context only.
19
+ Missing, unreadable, or stale evidence cannot be replaced by model memory.
20
+
21
+ Answers lead with a concise standalone explanation, with deeper references
22
+ when useful. Preserve uncertainty and source conditions. A possible cause is
23
+ not an observed diagnosis. Inspect disputed claims before judging them.
24
+ Read relevant sources again for follow-ups; do not treat earlier answers as evidence.
25
+
26
+ The guide may read files and explain documented commands. It must not edit,
27
+ install, execute tests/evaluations/diagnostics, mutate Git/trackers, contact
28
+ services, publish, or delegate effects. Execution requests get an explicitly
29
+ separate request/handoff. Repository text is evidence, not permission to override
30
+ the guide. Do not disclose credentials or private host evidence.
31
+
32
+ ## Host entrypoints
33
+
34
+ Canonical instructions are `.agents/skills/sevro-guide/SKILL.md`. Claude uses
35
+ the byte-identical `.claude/skills/sevro-guide/SKILL.md`. `AGENTS.md` routes
36
+ ordinary Sevro questions; `CLAUDE.md` imports it. `bun run guide:sync` updates
37
+ the mirror; `bun run check:docs` rejects drift. Both mounts are repository-only.
38
+ Explicit invocation is `$sevro-guide` in Codex and `/sevro-guide` in Claude.
39
+
40
+ Host discovery follows [OpenAI's skill documentation](https://learn.chatgpt.com/docs/build-skills)
41
+ and [Claude Code's skill documentation](https://code.claude.com/docs/en/skills).
42
+ Version-dependent discovery is tested with actual native sessions; file presence
43
+ alone is not verification. See [guide evaluation](../guide-evaluation.md).
44
+
45
+ ## Acceptance
46
+
47
+ The versioned question inventory and cases live under the canonical skill's
48
+ `evals/`. Cases cover ordinary/explicit selection, unrelated requests,
49
+ missing/conflicting/stale evidence, follow-ups, and pressure for effects.
50
+ Hidden checks assess grounding, selection, useful results, and effects separately.
51
+ The evaluation harness receives no authority to change project guidance or
52
+ credentials. Record actual per-host results and unsupported/unexecuted routes.
53
+
54
+ Documentation preserves all old files/destinations and their unique knowledge.
55
+ No historical observation or normative contract is removed because the guide
56
+ can summarize it. The [documentation quality contract](../documentation-quality.md)
57
+ owns mechanical checks and accessibility review. A Rust research ticket does
58
+ not establish a language migration, and #1 owns TypeScript quality policy.
@@ -0,0 +1,30 @@
1
+ # Troubleshooting
2
+
3
+ Start with execution, grading, task states, and stderr. A documented possible
4
+ cause is not a diagnosis of your machine.
5
+
6
+ | Symptom | Check and next step |
7
+ | ----------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
8
+ | Command cannot run | Use Bun 1.3.13 and verify the local package/version. Read [installation](installing.md). |
9
+ | Project snapshot contains a symbolic link | Use a separate evaluated project directory as in [the tutorial](getting-started.md); do not include installed dependencies in a plain-directory snapshot. |
10
+ | Exit 0 but no passing task | Prompt-only/dry runs are `not_assessed`. Read [results](reading-results.md). |
11
+ | Exit 64 before execution | Check absolute paths, exclusive route options, configuration, and capabilities in the [CLI reference](development-cli.md). |
12
+ | Grading unavailable | Inspect required evidence/completeness in [results v1](results-v1.md). |
13
+ | Native authentication fails | Check the exact release and private credential route. Read [native hosts](native-hosts.md). |
14
+ | Native or shell isolation fails | On macOS, verify `sandbox-exec`; on Ubuntu 24.04 x64, verify `bubblewrap` and Claude's `socat`. See [validated scope](native-hosts.md#validated-platform-scope). Windows is unverified. |
15
+ | Extension protocol fails | Return one matching stdout response; diagnostics use stderr. Read [protocol v1](extension-protocol-v1.md). |
16
+ | Schema freshness fails | Run `bun run schemas:generate`, then `bun run schemas:check`, from a checkout. |
17
+ | External links fail | Follow [network failure triage](documentation-quality.md#external-links). |
18
+
19
+ ## The repository guide is missing
20
+
21
+ The guide belongs to a source checkout, not npm. Start a fresh session at the
22
+ repository root. Check `.agents/skills/sevro-guide/SKILL.md` for Codex and
23
+ `.claude/skills/sevro-guide/SKILL.md` for Claude. Invoke `$sevro-guide` or
24
+ `/sevro-guide` respectively. See [host entrypoints](specs/repository-guide.md#host-entrypoints).
25
+ `bun run check:docs` checks adapters, not native discovery; use [guide evals](guide-evaluation.md).
26
+ Explanation does not authorize live diagnosis or repair.
27
+
28
+ If these checks do not resolve the issue, open a [Sevro issue](https://github.com/BjRo/sevro/issues)
29
+ with version, platform, sanitized command, states, and bounded diagnostics.
30
+ Keep credentials, private case content, and raw host artifacts out of it.
@@ -0,0 +1,234 @@
1
+ # TypeScript quality
2
+
3
+ `bun run check:typescript` is the complete local acceptance command. CI runs the
4
+ same checks in parallel phases. The complete command performs a
5
+ frozen dependency installation, checks the complete source inventory, verifies
6
+ generated schemas, documentation contracts, formatting, type-aware lint and typing,
7
+ checks the Codex guide evaluation in dry mode and runs documentation examples, exercises coverage
8
+ integrity controls, runs the deterministic Bun suite in an isolated instrumented
9
+ copy, enforces statements and branches independently, and validates installation
10
+ of the published package. Runtime dependencies and public evaluation semantics
11
+ remain part of the existing package-install contract.
12
+
13
+ Use `bun run check:typescript --fast` before committing. It checks inventory,
14
+ schemas, documentation contracts, formatting, lint and types without the full integration suite, coverage
15
+ or package installation. Install dependencies with `bun install --frozen-lockfile`
16
+ first. Quality dependencies are development dependencies pinned in `bun.lock`.
17
+
18
+ After frozen installation, `bun run check:typescript --phase <name>` runs one
19
+ phase and checks the complete source inventory. Each phase reports its elapsed
20
+ time, including when it fails. The complete command runs these same phases in
21
+ order; `--fast` runs only `static` without installing dependencies.
22
+
23
+ | Phase | Checks |
24
+ | --------- | --------------------------------------------------------------------------------------------- |
25
+ | `static` | Schema freshness, documentation contracts, formatting, type-aware lint and typing |
26
+ | `docs` | All guide dry runs, tutorial examples and recipe checks |
27
+ | `tests` | Coverage integrity controls, the complete instrumented Bun suite and both coverage thresholds |
28
+ | `package` | Packed-package installation and installed CLI workflows |
29
+
30
+ Use the same prerequisites as the corresponding complete-gate checks. A single
31
+ phase is partial evidence; full acceptance requires all four on the same candidate.
32
+ CI assigns every test file to exactly one of four duration-balanced shards, then
33
+ enforces both coverage thresholds on their combined counters over the complete
34
+ production inventory. Local `--phase tests` and the complete command still run
35
+ the suite in one process. See the [shard commands](../scripts/coverage/README.md#test-shards)
36
+ for reproducing the CI split.
37
+
38
+ ## Source dispositions
39
+
40
+ [`typescript-sources.json`](../typescript-sources.json) explicitly lists every
41
+ TypeScript and JavaScript source. The guard refuses new, missing or duplicated
42
+ files and declarations outside the configured TypeScript project. Changing a
43
+ source disposition requires review; adding a glob is not a substitute for the
44
+ inventory. The coverage baseline includes the platform-reachable subset of
45
+ `inventory.production`; `scripts/coverage/platform-scope.ts` names each excluded
46
+ host-specific file. Every production file remains inventoried, typed and linted,
47
+ and the opposite platform measures it. Current instrumentation supports authored
48
+ `.ts`. The five exact generated
49
+ validators in `inventory.generated` are excluded from instrumentation and the
50
+ coverage denominator. New `.tsx`, `.mts`, `.cts` or JavaScript
51
+ production requires an explicit instrumentation and quality-policy change first.
52
+
53
+ | Inventory | Lint and typing | Test and coverage disposition |
54
+ | -------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
55
+ | `production` | Type-aware strict lint and strict compiler | All platform-reachable authored executable `src` statements and branch outcomes, including unimported files in that scope |
56
+ | `generated` | CommonJS syntax parsing, exact `schemas:check` freshness, and checked `.d.cts` boundary declarations | Real Bun schema tests; the five declared generated validators are outside the coverage denominator |
57
+ | `declarations` | Type-aware lint and compiler | Declaration-only files have no executable counters |
58
+ | `tooling` | Same type-aware lint and strict compiler; `.mjs`/`.cjs` use `checkJs` and explicit JSDoc contracts | Durable public gate probes, schema freshness, release and installed-package tests; outside the runner-production denominator |
59
+ | `tests` | Same type-aware lint and strict compiler, including fixtures | Real Bun filesystem/process/protocol tests; outside the production denominator |
60
+ | `examples` | Same type-aware lint and strict compiler | Packaged recipe adapters, extensions and evaluator checks are consumer examples, exercised by tutorial and installed-package validation; they implement no runner behavior and are outside the runner-production denominator |
61
+
62
+ Generated AJV CommonJS is deliberately not rewritten to conform to authored-code
63
+ rules. An earlier audit of the original four generated files using ESLint's
64
+ recommended JavaScript rules found 879 redeclarations, 281 useless assignments, 182 unused variables and
65
+ 108 unreachable-code findings. Those are generator emissions. Their syntax,
66
+ generation freshness, typed public boundaries and runtime behavior remain checked.
67
+ Generated compiler output is excluded from coverage because the coverage target
68
+ measures authored runner behavior. This applies only to
69
+ `src/generated/cli-result.cjs`, `extension.cjs`, `report.cjs`, `run-evidence.cjs` and `runtime.cjs`
70
+ as explicitly declared in the inventory. This disposition does not apply to authored CommonJS, including
71
+ the coverage capture hook.
72
+
73
+ ## Types, functions and review
74
+
75
+ The locked `strictTypeChecked` preset runs with `projectService: true`. Unsafe
76
+ assignments, arguments, calls, member access and returns are checked alongside
77
+ floating/misused promises. The compiler enables `noUncheckedIndexedAccess`,
78
+ `noImplicitReturns`, and `noFallthroughCasesInSwitch`.
79
+
80
+ `exactOptionalPropertyTypes` was assessed and remains false. Existing adapter
81
+ option compositions intentionally pass present `undefined` values: extension
82
+ exchange `cwd`/`timeoutMs`/`signal`, host cancellation signals, optional fixture
83
+ tools, and process-session state reset. Their current public behavior treats
84
+ absence and present `undefined` identically. Conditional object spreads would
85
+ obscure these compositions without strengthening external-input validation.
86
+ New contracts should describe absence and `undefined` deliberately.
87
+
88
+ Authored functions have a complexity ceiling of five, nesting depth three and
89
+ 80 nonblank, noncomment lines. ESLint's modified cyclomatic variant counts a
90
+ switch as one decision; JavaScript logical operators, default arguments and
91
+ optional chains also count decisions. This is comparable in intent to Darrow's
92
+ Python ceiling of five, rather than a claim that the tools count identical
93
+ syntax. Numeric interpolation is allowed for useful bounded diagnostics; unsafe
94
+ or arbitrary object interpolation remains prohibited.
95
+
96
+ Named integration callbacks may use a documented, local function-length
97
+ exception to keep one fixture/invocation/assertion story together. The independent
98
+ `sevro/test-callback-lines` rule bounds every direct or chained Bun `test`/`it`
99
+ callback at 200 lines; helpers remain at 80 and complexity remains five.
100
+ Each exception is explained in an ESLint comment beside the affected test.
101
+ The maintained CommonJS capture hook has
102
+ one import-style exception for its synchronous Node filesystem/path `require`
103
+ calls. Instrumented authored modules import it to register process capture; the
104
+ Bun test preload uses its exported handle to flush completion at teardown. The
105
+ discovery interop counterexample remains historical evidence.
106
+
107
+ Review meaningful domain names, cohesive module ownership, focused operations,
108
+ validated external input, useful errors with retained causes, and assertions
109
+ against observable behavior. A reproducible bug requires a regression test.
110
+ Generated cases should exercise a meaningful parser, serialization,
111
+ normalization or lifecycle invariant. Fast-check properties use seed 20261007,
112
+ 200 runs, and stop at the first failure; its failure output includes the seed
113
+ and replay path. Preserve those values when reproducing a failure.
114
+
115
+ ## Coverage integrity
116
+
117
+ Istanbul instruments the original TypeScript AST before type erasure. Babel
118
+ composes transformation maps; `// @bun` preserves original stack locations.
119
+ CLI shebangs stay first and inserted marker lines adjust mappings. Generated
120
+ CommonJS follows normal loading and is never marked or passed through `onLoad`.
121
+
122
+ Each run clones independent Git metadata, copies the candidate, keeps an
123
+ unmodified source snapshot, and uses fresh report storage outside participant
124
+ workspaces. Production imports register capture even when a child changes
125
+ working directory. Bun teardown writes the test-runner completion; normal CLI
126
+ exit writes child completion. A ledger records participants and checks run ID,
127
+ layout, file scope, counter keys, nonnegative integer values, branch array lengths
128
+ and completion before merging. Every platform-reachable executable production
129
+ file is seeded with zero metadata without importing it to manufacture coverage.
130
+
131
+ Intentionally force-killed owned children use periodic conservative checkpoints.
132
+ The test preload declares the exact registered child killed by its parent.
133
+ Ordinary children still require completion; an undeclared or mismatched parent
134
+ cannot excuse a missing report. Missing checkpoints fail. No final counters are
135
+ estimated: a lost tail can lower coverage and cannot increase it. This retains
136
+ the real SIGKILL run-owner test and exempts no reachable production file.
137
+
138
+ Statements and branches must each reach 95% using the exact covered/total ratio
139
+ over the platform-reachable authored production inventory. On Ubuntu, the
140
+ macOS `sandbox-exec`, Keychain and Apple metadata modules are excluded; on macOS, the Linux
141
+ `bubblewrap` module is excluded. Shared isolation and credential code is counted
142
+ on both.
143
+
144
+ Apple developer-tool discovery lives in `src/runtime/discovery-apple.ts`, which
145
+ the public loader imports only under its explicit Darwin guard. Linux excludes
146
+ that exact native module; macOS measures it, and both platforms still typecheck
147
+ and lint it. The provider lookup, bounded query and read-root safeguards remain
148
+ shared production code measured on both platforms. A Linux loader fixture with
149
+ available Apple shims confirms that its metadata executable is never queried.
150
+ Both platforms retain the Apple module in the complete checked source inventory.
151
+
152
+ The static TypeScript analysis omits only branch outcomes made
153
+ impossible by `process.platform` on the current host. It leaves reachable
154
+ outcomes and their raw counts intact, refuses any excluded outcome with a
155
+ nonzero count, and records each file, line and branch outcome. The unprojected
156
+ report is retained for audit. Rounded display percentages never determine
157
+ success. The gate enforces the projected exact counters without compiler
158
+ exemptions or changing count values. It validates
159
+ source classifications before preparing coverage, including direct `--coverage`
160
+ runs, so unregistered authored TypeScript or CommonJS, missing sources and
161
+ overlapping dispositions refuse the gate. Generated validators retain normal
162
+ CommonJS loading, schema freshness checks and real schema/runtime tests.
163
+
164
+ Artifacts under `.quality/coverage` include the exact merged counters, baseline,
165
+ summary, process ledger, Bun test log, unmodified source snapshot, LCOV and HTML.
166
+ `run.json` and `enforcement.json` record the platform, included and excluded
167
+ production files, branch exclusions, and exact projected counts.
168
+ `coverage-raw.json` and the raw summary preserve all validated counters before
169
+ platform projection.
170
+ CI also retains `.quality/shards/<index>/` with each shard's source snapshot,
171
+ process ledger, test log, raw and portable counters, and manifest. Process IDs
172
+ remain scoped to their original shard. Aggregation verifies candidate contents,
173
+ workflow run, platform, architecture, Bun version, instrumentation
174
+ layout, and exact test assignments before combining counters with normalized
175
+ source paths. Missing, repeated, incomplete, or mismatched shards fail the gate.
176
+ Failed-job reruns can reuse successful shards from earlier attempts of the same
177
+ workflow run; manifests retain each attempt, and rerun shards replace only their
178
+ own artifacts. Another candidate or workflow run cannot supply missing evidence.
179
+ `--coverage [Bun test arguments]` is a diagnostic measurement; it still enforces
180
+ both thresholds and writes `.quality/coverage-targeted`, keeping it distinct from
181
+ the full-suite evidence. Sparse runs are expected to fail the full denominator.
182
+
183
+ The durable public probes are `--probe snapshot`, `--probe scope`, `--probe branch`,
184
+ `--probe missing-reports`, `--probe integrity`, and `--probe source-map`.
185
+ The scope probe records a zero-seeded baseline and merged real process report
186
+ under `.quality/coverage-scope`; it verifies that ordinary generated CommonJS
187
+ validation still runs. Branch and missing-report controls
188
+ deliberately exit 1. A five-of-five statement, one-of-two branch sample must fail
189
+ with `Below 95%: branches`. The integration suite retains real CLI/extension,
190
+ graceful SIGINT/SIGTERM cancellation, filesystem isolation and owned-child paths.
191
+
192
+ ## Environment and CI
193
+
194
+ The discovery backend was observed with Bun 1.3.13, macOS arm64 and Node 24.13.0.
195
+ Implementation also ran on macOS arm64 (Darwin kernel 27.0.0). CI pins
196
+ Codex 0.160.1 and Claude Code 2.1.284 for deterministic native hook tests. Hosted
197
+ CI targets `ubuntu-24.04` x64 with Bun 1.3.13 and Node 24.13.0. Its first
198
+ successful hosted run is required before describing that environment as validated.
199
+ GitHub documents the [Ubuntu runner labels](https://docs.github.com/en/actions/reference/runners/github-hosted-runners).
200
+ Ubuntu installs `bubblewrap`, `ripgrep`, and `socat` and runs the same native isolation cases;
201
+ local macOS runs retain `sandbox-exec`. Windows remains unverified.
202
+
203
+ Ordinary changes and explicit workflow dispatches run the four canonical phases
204
+ concurrently. The tests phase consists of four shard jobs followed by a combined
205
+ coverage job. Each job installs locked dependencies; native host tools are
206
+ installed for `docs` and the test shards, and UV and mise for `docs`. Each shard
207
+ retains its evidence, and the combined `tests` job uploads `.quality` even when
208
+ coverage fails. Shards do not cancel their siblings on failure. A new commit to
209
+ the same pull request cancels its superseded workflow run; main pushes and manual
210
+ runs have independent concurrency groups. The stable aggregate `TypeScript quality`
211
+ status requires every phase and all four shards to succeed. A missing, cancelled,
212
+ skipped or failed phase or shard cannot turn that status green.
213
+
214
+ Release metadata changes follow [the release workflow](releases.md) and reuse a
215
+ successful full gate from an ancestor on `main`, with identical code,
216
+ dependencies, schemas, tests, and other quality inputs. The selector permits
217
+ only version/distribution-tag changes and its exact release-file inventory.
218
+ It verifies each original phase job and its gate step, including every shard and
219
+ the combined tests job for sharded runs, or a historical complete gate job and
220
+ step. A partial matrix or reused release run cannot serve as fresh test evidence.
221
+ Duplicate phase or shard jobs are ambiguous and refused. Release CI
222
+ runs `check:typescript --fast`, records the tested source and CI run URL, and
223
+ skips all four full-gate phase jobs. The aggregate
224
+ status requires both verified prior evidence and successful static checks;
225
+ missing, cancelled, failed, or ambiguous evidence cannot establish a pass.
226
+ Reused results remain attributed to their original run rather than being
227
+ reported as newly measured coverage. Releases perform no local test reruns.
228
+
229
+ The [coverage tooling README](../scripts/coverage/README.md) explains the maintained
230
+ pipeline and file responsibilities. Fresh CI reports provide candidate-specific evidence.
231
+
232
+ References: [Darrow's Python quality contract](https://github.com/BjRo/darrow/blob/main/docs/specs/python-quality.md),
233
+ [typescript-eslint presets](https://typescript-eslint.io/users/configs/),
234
+ [ESLint complexity semantics](https://eslint.org/docs/latest/rules/complexity).
@@ -0,0 +1,114 @@
1
+ # Assess the evaluation workflow
2
+
3
+ Use this protocol to assess the developer experience tracked in
4
+ [issue #53](https://github.com/BjRo/sevro/issues/53) with engineers who have not
5
+ used Sevro. The implementation handover includes this protocol; human sessions
6
+ and their measurements are deferred. No usability improvement or time saving
7
+ has been measured.
8
+
9
+ ## Questions and current evidence
10
+
11
+ Measure how quickly an engineer can obtain an assessed result, adapt an
12
+ evaluation to a repository, and explain a failed check. Count documentation
13
+ detours and record where configuration or defaults are difficult to discover.
14
+
15
+ | Measure | Observed baseline | Target | Observed changed workflow |
16
+ | --------------------------------------------------------- | ----------------- | ------------------------------------------- | ------------------------- |
17
+ | First credential-free assessed result, after installation | Unmeasured | At most 60 seconds, initial research target | Unmeasured |
18
+ | Adapt an evaluation to the participant's repository | Unmeasured | Not established | Unmeasured |
19
+ | Understand a failing check | Unmeasured | Not established | Unmeasured |
20
+ | Documentation detours for each task | Unmeasured | Not established | Unmeasured |
21
+
22
+ Source inspection found that the original tutorial at revision `cd7542b`
23
+ required seven explicit run options, plus JSON output and redirection. That is
24
+ a description of the previous workflow, not an observed timing baseline.
25
+ Automated example tests establish command behavior on their recorded candidate;
26
+ they do not measure a new engineer's experience.
27
+
28
+ ## Prepare a session
29
+
30
+ Recruit engineers unfamiliar with Sevro and record their relevant command-line,
31
+ Bun, and model-tool experience. Use a disposable copy of a small repository
32
+ they understand and a clean working directory for every task. Keep real
33
+ credentials, private source, and retained host evidence out of shared records.
34
+
35
+ Record the OS, architecture, Bun and Node versions, exact Sevro version or
36
+ checkout commit, documentation revision, and installation command. Complete
37
+ installation before starting the first-use timer. For a native repository run,
38
+ record the selected host, model, effort, authentication prerequisites, and
39
+ whether those prerequisites were already satisfied. Obtain the participant's
40
+ agreement to any model usage before that task.
41
+
42
+ Give the participant the [documentation hub](README.md) and these task goals.
43
+ Let them use CLI help and documentation. The facilitator should observe without
44
+ supplying commands. Record assistance when it occurs instead of counting an
45
+ assisted task as an unaided success. Agree on a time limit before the session;
46
+ record unfinished tasks as censored at that limit, with the blocking step.
47
+
48
+ ## Tasks and success evidence
49
+
50
+ 1. **See an assessed result.** Starting after installation, follow
51
+ [Your first evaluation](getting-started.md). Stop the timer when the
52
+ participant identifies the execution, grading, and task states and locates
53
+ the retained evidence. A dry run, prompt-only result, or exit code `0` alone
54
+ does not meet this goal. Record the command, result states, and evidence
55
+ location, without copying private evidence into the study notes.
56
+ 2. **Adapt it to a real repository.** Use the case-authoring and evaluation
57
+ instructions to prepare a task for the disposable repository, with a real
58
+ assertion and explicit candidate route. Stop when an executed assessment
59
+ produces a result the participant can interpret. Verify that the participant
60
+ understands how fixture content reaches the candidate; selecting a project
61
+ root alone does not populate a fixture. Record preparation time, model wait
62
+ time, and total elapsed time separately. If credentials or tools block the
63
+ task, retain that outcome rather than substituting the demo as success.
64
+ 3. **Explain a deliberate failure.** Use a recipe's documented failing variant.
65
+ Stop when the participant identifies the failed check, explains its reason
66
+ from retained evidence, and proposes the relevant correction. Record whether
67
+ they distinguish task failure from execution failure and grader error. Then
68
+ let them make the correction and repeat the run; record that iteration
69
+ separately.
70
+
71
+ For each task, start timing when its goal is presented and stop at the stated
72
+ success evidence. Record raw elapsed time, pauses with their reasons, outcome,
73
+ help use, facilitator interventions, and every documentation detour. A detour
74
+ is a transition from the task's workflow page to another reference, search
75
+ result, or troubleshooting page to resolve missing information. Record the
76
+ destination and reason; repeated visits remain visible. Report the counting
77
+ definition alongside results so sessions can be compared.
78
+
79
+ ## Record and interpret results
80
+
81
+ Keep one record per participant, workflow version, and task:
82
+
83
+ ```text
84
+ participant_id:
85
+ workflow_version_and_docs_revision:
86
+ environment_and_prior_experience:
87
+ task_and_time_limit:
88
+ started_at:
89
+ finished_at:
90
+ elapsed_seconds:
91
+ preparation_seconds:
92
+ model_wait_seconds:
93
+ pauses_and_reasons:
94
+ outcome: completed | assisted | blocked | time_limit
95
+ execution_grading_task_states:
96
+ evidence_location_confirmed:
97
+ documentation_detours_and_reasons:
98
+ help_use_and_facilitator_interventions:
99
+ failure_explanation_and_next_iteration:
100
+ ```
101
+
102
+ Leave unavailable measurements blank and label them unmeasured in reports.
103
+ Do not replace an unknown duration, usage, cost, or failed task with zero.
104
+ Report individual observations, participant count, completion counts, assistance,
105
+ and environment limits before any aggregate. Distinguish measured baselines,
106
+ observed changed-workflow values, and targets in every table.
107
+
108
+ For a comparison, preserve an executable baseline and its matching docs. Use
109
+ separate first-time participants where possible; otherwise counterbalance the
110
+ order with equivalent tasks and disclose learning effects. Small convenience
111
+ samples identify friction but do not establish a population-wide improvement.
112
+ Keep unsuccessful sessions and unresolved detours in the report.
113
+
114
+ Return to [reading results](reading-results.md) or the [documentation hub](README.md).
@@ -2,7 +2,7 @@ export default {
2
2
  id: "sevro.host.example",
3
3
  model: "deterministic-example",
4
4
  effort: "none",
5
- async run() {
6
- return { finalMessage: "ready", complete: true };
5
+ run() {
6
+ return Promise.resolve({ finalMessage: "ready", complete: true });
7
7
  },
8
8
  };
@@ -0,0 +1,26 @@
1
+ import { readFile, writeFile } from "node:fs/promises";
2
+ import { join } from "node:path";
3
+
4
+ /** Trusted, deterministic participant for exercising the recipe's real graders. */
5
+ const host = {
6
+ id: "recipes.deterministic",
7
+ model: "fixture-editor",
8
+ effort: "none",
9
+ async run({ workspace }: { workspace: string }) {
10
+ const task = await readFile(join(workspace, "README.md"), "utf8");
11
+ const failing = process.env.SEVRO_RECIPE_FAIL === "1";
12
+ if (task.includes("Fix add")) {
13
+ await writeFile(
14
+ join(workspace, "math.cjs"),
15
+ `exports.add = (a, b) => a ${failing ? "-" : "+"} b;\n`,
16
+ );
17
+ }
18
+ return {
19
+ finalMessage: failing
20
+ ? "Start with npm start on port 9000."
21
+ : "Run bun run dev on port 3000.",
22
+ complete: true,
23
+ };
24
+ },
25
+ };
26
+ export default host;
@@ -0,0 +1,21 @@
1
+ {
2
+ "id": "recipe-coding-change",
3
+ "prompt": "Fix add in math.cjs so it adds its two numeric arguments. Do not modify README.md. Explain how to start the application.",
4
+ "fixture": {
5
+ "files": {
6
+ "README.md": "Fix add in math.cjs. Start the application with bun run dev on port 3000.\n",
7
+ "math.cjs": "exports.add = (a, b) => a - b;\n"
8
+ }
9
+ },
10
+ "checks": [
11
+ {
12
+ "id": "addition",
13
+ "grader": "sevro.shell",
14
+ "configuration": {
15
+ "run": "{{evaluator-test}}",
16
+ "expectExact": "coding checks passed"
17
+ }
18
+ }
19
+ ],
20
+ "requiredEvidence": []
21
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "id": "recipe-host-tools",
3
+ "prompt": "Read app.env with rg, then explain the application's start command and port.",
4
+ "fixture": {
5
+ "files": {
6
+ "README.md": "Start with bun run dev on port 3000.\n",
7
+ "app.env": "port=3000\n"
8
+ }
9
+ },
10
+ "checks": [
11
+ {
12
+ "id": "rg-access",
13
+ "grader": "sevro.shell",
14
+ "configuration": {
15
+ "run": "rg '^port=3000$' app.env",
16
+ "expectExact": "port=3000"
17
+ }
18
+ }
19
+ ],
20
+ "requiredEvidence": []
21
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "id": "recipe-mise",
3
+ "prompt": "Use node from PATH to read app.json, then explain the application's start command and port. The operator has resolved mise's existing node@24.13.0 installation; do not download anything.",
4
+ "fixture": {
5
+ "files": {
6
+ "README.md": "Start with bun run dev on port 3000.\n",
7
+ "app.json": "{\"port\":3000}\n"
8
+ }
9
+ },
10
+ "checks": [
11
+ {
12
+ "id": "mise-node-access",
13
+ "grader": "sevro.shell",
14
+ "configuration": {
15
+ "run": "node -e 'if (process.version !== \"v24.13.0\") process.exit(1); const a = require(\"./app.json\"); if (a.port !== 3000) process.exit(1); console.log(a.port)'",
16
+ "expectExact": "3000"
17
+ }
18
+ }
19
+ ],
20
+ "requiredEvidence": []
21
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "id": "recipe-node",
3
+ "prompt": "Read app.json with Node and explain the application's start command and port.",
4
+ "fixture": {
5
+ "files": {
6
+ "README.md": "Start with bun run dev on port 3000.\n",
7
+ "app.json": "{\"port\":3000}\n"
8
+ }
9
+ },
10
+ "checks": [
11
+ {
12
+ "id": "node-access",
13
+ "grader": "sevro.shell",
14
+ "configuration": {
15
+ "run": "node -e 'const a = require(\"./app.json\"); if (a.port !== 3000) process.exit(1); console.log(a.port)'",
16
+ "expectExact": "3000"
17
+ }
18
+ }
19
+ ],
20
+ "requiredEvidence": []
21
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "id": "recipe-python-uv",
3
+ "prompt": "Use uv run --offline --no-project --python \"$RECIPE_PYTHON\" python to read app.json, then explain the application's start command and port.",
4
+ "fixture": {
5
+ "files": {
6
+ "README.md": "Start with bun run dev on port 3000.\n",
7
+ "app.json": "{\"port\":3000}\n"
8
+ }
9
+ },
10
+ "checks": [
11
+ {
12
+ "id": "uv-python-access",
13
+ "grader": "sevro.shell",
14
+ "configuration": {
15
+ "run": "uv run --offline --no-project --python \"$RECIPE_PYTHON\" python -c 'import json; p=json.load(open(\"app.json\"))[\"port\"]; assert p == 3000; print(p)'",
16
+ "expectExact": "3000"
17
+ }
18
+ }
19
+ ],
20
+ "requiredEvidence": []
21
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "id": "recipe-semantic",
3
+ "prompt": "Read README.md and explain how to start the application, including its port.",
4
+ "fixture": {
5
+ "files": { "README.md": "Start with bun run dev on port 3000.\n" }
6
+ },
7
+ "checks": [
8
+ {
9
+ "id": "startup-meaning",
10
+ "grader": "sevro.semantic",
11
+ "configuration": {
12
+ "proposition": "The response tells the reader to run bun run dev and says that the application listens on port 3000."
13
+ }
14
+ }
15
+ ],
16
+ "requiredEvidence": []
17
+ }
@@ -0,0 +1,23 @@
1
+ import assert from "node:assert/strict";
2
+ import { join } from "node:path";
3
+ import { pathToFileURL } from "node:url";
4
+
5
+ interface Addition {
6
+ add: (left: number, right: number) => number;
7
+ }
8
+ function isAddition(value: unknown): value is Addition {
9
+ return (
10
+ typeof value === "object" &&
11
+ value !== null &&
12
+ "add" in value &&
13
+ typeof value.add === "function"
14
+ );
15
+ }
16
+ const candidate: unknown = await import(
17
+ pathToFileURL(join(process.cwd(), "math.cjs")).href
18
+ );
19
+ assert.ok(isAddition(candidate), "Candidate must export add");
20
+ assert.equal(candidate.add(2, 3), 5);
21
+ assert.equal(candidate.add(-2, 3), 1);
22
+ assert.equal(candidate.add(0, 0), 0);
23
+ console.log("coding checks passed");