@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,4 @@
1
+ {
2
+ "format": "sevro.runtime.v1",
3
+ "hooks": { "nativeGoal": true, "plugins": ["startup"] }
4
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "format": "sevro.runtime.v1",
3
+ "environment": {
4
+ "inherit": ["PATH", "RECIPE_PYTHON"],
5
+ "set": {
6
+ "UV_CACHE_DIR": "{{sevro.runtime}}/uv-cache",
7
+ "UV_PYTHON_DOWNLOADS": "never"
8
+ }
9
+ }
10
+ }
@@ -0,0 +1,29 @@
1
+ /** Protocol control only: use a real judge for qualitative model assessment. */
2
+ const judge = {
3
+ id: "recipes.protocol-judge",
4
+ model: "exact-fixture-oracle",
5
+ effort: "none",
6
+ run({ prompt }: { prompt: string }) {
7
+ const match =
8
+ /<candidate-response-json>\s*([\s\S]*?)\s*<\/candidate-response-json>/.exec(
9
+ prompt,
10
+ );
11
+ if (!match?.[1]) throw new Error("Missing semantic candidate response");
12
+ const candidate: unknown = JSON.parse(match[1]);
13
+ const passed = candidate === "Run bun run dev on port 3000.";
14
+ return Promise.resolve({
15
+ complete: true,
16
+ finalMessage: JSON.stringify({
17
+ checks: [
18
+ {
19
+ id: "startup-meaning",
20
+ verdict: passed ? "pass" : "fail",
21
+ reason:
22
+ "Exact deterministic fixture oracle; no model judgment was made.",
23
+ },
24
+ ],
25
+ }),
26
+ });
27
+ },
28
+ };
29
+ export default judge;
@@ -0,0 +1,17 @@
1
+ import { writeFile } from "node:fs/promises";
2
+ import { join } from "node:path";
3
+
4
+ /** Deterministic file editor; it exercises the evaluator, not model coding ability. */
5
+ export default {
6
+ id: "template.coding",
7
+ model: "deterministic-editor",
8
+ effort: "none",
9
+ async run({ workspace }: { workspace: string }) {
10
+ if (process.env.SEVRO_TEMPLATE_FAIL !== "1")
11
+ await writeFile(
12
+ join(workspace, "add.sh"),
13
+ 'add() { echo "$(( $1 + $2 ))"; }\n',
14
+ );
15
+ return { finalMessage: "Completed the coding task.", complete: true };
16
+ },
17
+ };
@@ -0,0 +1,15 @@
1
+ {
2
+ "id": "coding-addition",
3
+ "prompt": "Fix add.sh so add computes integer addition. Preserve the add shell function interface.",
4
+ "fixture": { "files": { "add.sh": "add() { echo \"$(( $1 - $2 ))\"; }\n" } },
5
+ "checks": [
6
+ {
7
+ "id": "addition",
8
+ "grader": "sevro.shell",
9
+ "configuration": {
10
+ "run": ". ./add.sh; test \"$(add 2 3)\" = 5 && test \"$(add -2 -3)\" = -5 && test \"$(add 0 0)\" = 0"
11
+ }
12
+ }
13
+ ],
14
+ "requiredEvidence": []
15
+ }
@@ -0,0 +1,6 @@
1
+ ---
2
+ name: startup-guide
3
+ description: Explain the sample application's start command and port.
4
+ ---
5
+
6
+ Read README.md. State the exact start command and port. Do not change files.
@@ -0,0 +1,64 @@
1
+ import { createHash } from "node:crypto";
2
+ import { readFile } from "node:fs/promises";
3
+ import { join } from "node:path";
4
+
5
+ export const description = {
6
+ extension: { id: "template.startup", version: "1.0.0" },
7
+ protocols: ["sevro.extension.v1"],
8
+ requiredCapabilities: ["sevro.codex.repository-invocation"],
9
+ optionalCapabilities: [],
10
+ graders: [],
11
+ taskVerdictPolicies: [],
12
+ };
13
+
14
+ export const resolved = {
15
+ cases: [
16
+ {
17
+ id: "repository-skill",
18
+ prompt:
19
+ "{{sevro.skill_invocation}} Explain the application's start command and port. Do not change files.",
20
+ fixture: {
21
+ kind: "generated",
22
+ commits: [
23
+ {
24
+ message: "Initialize application",
25
+ files: { "README.md": "Run bun run dev on port 3000.\n" },
26
+ },
27
+ ],
28
+ },
29
+ checks: [
30
+ {
31
+ id: "start-command",
32
+ grader: "sevro.regex",
33
+ configuration: { pattern: "bun run dev" },
34
+ },
35
+ {
36
+ id: "port",
37
+ grader: "sevro.regex",
38
+ configuration: { pattern: "\\b3000\\b" },
39
+ },
40
+ ],
41
+ requiredEvidence: ["sevro.codex.explicit-invocation"],
42
+ extensionData: {},
43
+ },
44
+ ],
45
+ };
46
+
47
+ export async function prepare() {
48
+ const relativePath = ".agents/skills/startup-guide/SKILL.md";
49
+ const body = await readFile(join(import.meta.dir, relativePath));
50
+ return {
51
+ artifacts: [
52
+ {
53
+ id: "template.startup-skill",
54
+ relativePath,
55
+ sha256: createHash("sha256").update(body).digest("hex"),
56
+ contentBase64: body.toString("base64"),
57
+ gitExclude: true,
58
+ },
59
+ ],
60
+ requestedInstrumentation: [],
61
+ extensionData: {},
62
+ codexRepositorySkillInvocation: { skillName: "startup-guide" },
63
+ };
64
+ }
@@ -0,0 +1,31 @@
1
+ import { description, prepare, resolved } from "./extension-data";
2
+
3
+ function record(value: unknown): Record<string, unknown> {
4
+ if (!value || typeof value !== "object" || Array.isArray(value))
5
+ throw new Error("Expected a protocol request object");
6
+ return value as Record<string, unknown>;
7
+ }
8
+
9
+ const request = record(JSON.parse(await Bun.stdin.text()) as unknown);
10
+ async function result() {
11
+ switch (request.method) {
12
+ case "describe":
13
+ return description;
14
+ case "resolve":
15
+ return resolved;
16
+ case "prepare":
17
+ return await prepare();
18
+ case "evaluate":
19
+ return { checks: [], metrics: [] };
20
+ default:
21
+ throw new Error("Unsupported extension method");
22
+ }
23
+ }
24
+ process.stdout.write(
25
+ JSON.stringify({
26
+ protocol: request.protocol,
27
+ id: request.id,
28
+ method: request.method,
29
+ result: await result(),
30
+ }),
31
+ );
@@ -0,0 +1,12 @@
1
+ /** Deterministic starter; replace with an explicit native route to evaluate a model. */
2
+ export default {
3
+ id: "template.response",
4
+ model: "deterministic-example",
5
+ effort: "none",
6
+ run() {
7
+ return Promise.resolve({
8
+ finalMessage: process.env.SEVRO_TEMPLATE_FAIL === "1" ? "wrong" : "ready",
9
+ complete: true,
10
+ });
11
+ },
12
+ };
@@ -0,0 +1,13 @@
1
+ {
2
+ "id": "response-check",
3
+ "prompt": "Return exactly ready.",
4
+ "fixture": { "files": { "README.md": "Response-check fixture.\n" } },
5
+ "checks": [
6
+ {
7
+ "id": "ready",
8
+ "grader": "sevro.regex",
9
+ "configuration": { "pattern": "^ready$" }
10
+ }
11
+ ],
12
+ "requiredEvidence": []
13
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bjoernrochel/sevro",
3
- "version": "0.1.0-rc.2",
4
- "license": "BUSL-1.1",
3
+ "version": "0.1.0-rc.21",
4
+ "license": "SEE LICENSE IN LICENSE",
5
5
  "description": "A standalone evaluation runner for agentic coding capabilities",
6
6
  "type": "module",
7
7
  "private": false,
@@ -12,11 +12,13 @@
12
12
  "publishConfig": {
13
13
  "registry": "https://registry.npmjs.org/",
14
14
  "access": "public",
15
- "tag": "next"
15
+ "tag": "latest"
16
16
  },
17
17
  "packageManager": "bun@1.3.13",
18
18
  "files": [
19
19
  "README.md",
20
+ "CONTRIBUTING.md",
21
+ "LICENSE",
20
22
  "docs/",
21
23
  "examples/",
22
24
  "schemas/",
@@ -26,12 +28,23 @@
26
28
  "sevro": "./src/cli.ts"
27
29
  },
28
30
  "scripts": {
31
+ "check:typescript": "bun scripts/check-typescript.ts",
32
+ "check:typescript:fast": "bun run check:typescript --fast",
33
+ "lint": "eslint . --max-warnings 0",
29
34
  "cli:dev": "bun src/cli.ts",
30
35
  "test": "bun test",
36
+ "schemas:generate": "bun scripts/generate-schemas.ts",
37
+ "schemas:check": "bun scripts/generate-schemas.ts --check",
31
38
  "test:package-install": "bun scripts/verify-package-install.ts",
39
+ "check:docs": "bun scripts/check-docs.ts",
40
+ "docs:sync": "bun scripts/sync-release-docs.ts",
41
+ "check:docs:external": "bun scripts/check-docs.ts --external",
42
+ "test:docs-examples": "bun scripts/verify-doc-examples.ts",
43
+ "guide:sync": "bun scripts/sync-guide.ts",
44
+ "eval:guide": "bun scripts/eval-guide.ts",
32
45
  "release:prepare": "bun scripts/prepare-release.ts",
33
46
  "typecheck": "tsc --noEmit",
34
- "format:check": "prettier --check README.md docs/*.md examples/**/*.json examples/**/*.ts schemas/*.json src/**/*.ts scripts/**/*.ts tests/**/*.ts package.json tsconfig.json .github/workflows/*.yml"
47
+ "format:check": "prettier --check README.md CONTRIBUTING.md AGENTS.md CLAUDE.md 'docs/**/*.md' '.agents/**/*.md' '.agents/**/*.json' '.claude/**/*.md' 'scripts/**/*.md' 'scripts/**/*.json' examples/**/*.json examples/**/*.ts schemas/*.json src/**/*.ts scripts/**/*.ts scripts/**/*.cjs tests/**/*.ts eslint.config.mjs package.json tsconfig.json typescript-sources.json .github/workflows/*.yml"
35
48
  },
36
49
  "dependencies": {
37
50
  "ajv": "8.20.0",
@@ -39,7 +52,27 @@
39
52
  "typescript": "5.9.3"
40
53
  },
41
54
  "devDependencies": {
42
- "@types/bun": "^1.2.0",
43
- "prettier": "^3.9.9"
55
+ "@babel/core": "8.0.6",
56
+ "@babel/plugin-transform-typescript": "8.0.6",
57
+ "@eslint/js": "10.0.1",
58
+ "@types/bun": "1.3.13",
59
+ "@types/markdown-it": "14.1.2",
60
+ "@types/shell-quote": "1.7.5",
61
+ "@types/istanbul-lib-coverage": "2.0.6",
62
+ "@types/istanbul-lib-instrument": "1.7.8",
63
+ "@types/istanbul-lib-report": "3.0.3",
64
+ "@types/istanbul-reports": "3.0.4",
65
+ "eslint": "10.12.0",
66
+ "fast-check": "4.10.2",
67
+ "github-slugger": "2.0.0",
68
+ "istanbul-lib-coverage": "3.2.2",
69
+ "istanbul-lib-instrument": "6.0.3",
70
+ "istanbul-lib-report": "3.0.1",
71
+ "istanbul-lib-source-maps": "5.0.6",
72
+ "istanbul-reports": "3.2.0",
73
+ "markdown-it": "14.2.0",
74
+ "prettier": "^3.9.9",
75
+ "shell-quote": "1.12.0",
76
+ "typescript-eslint": "8.71.1"
44
77
  }
45
78
  }
@@ -110,6 +110,15 @@
110
110
  "domainOutcomes"
111
111
  ],
112
112
  "properties": {
113
+ "nativeTranscripts": {
114
+ "type": "object",
115
+ "required": ["retained", "pruned"],
116
+ "properties": {
117
+ "retained": { "type": "integer", "minimum": 0 },
118
+ "pruned": { "type": "integer", "minimum": 0 }
119
+ },
120
+ "additionalProperties": false
121
+ },
113
122
  "resultFile": { "$ref": "#/$defs/path" },
114
123
  "evidencePath": { "type": ["string", "null"] },
115
124
  "runId": { "type": ["string", "null"] },
@@ -80,7 +80,8 @@
80
80
  "required": ["digest", "redacted"],
81
81
  "properties": {
82
82
  "digest": { "$ref": "#/$defs/digest" },
83
- "redacted": { "type": "object" }
83
+ "redacted": { "type": "object" },
84
+ "resolved": { "type": "object" }
84
85
  },
85
86
  "additionalProperties": false
86
87
  },
@@ -0,0 +1,193 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:sevro:schema:runtime:v1",
4
+ "title": "Sevro runtime policy v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["format"],
8
+ "properties": {
9
+ "codexState": {
10
+ "type": "boolean"
11
+ },
12
+ "network": {
13
+ "type": "object",
14
+ "additionalProperties": false,
15
+ "properties": {
16
+ "localHttp": { "type": "boolean" }
17
+ }
18
+ },
19
+ "nativeTranscripts": {
20
+ "type": "boolean"
21
+ },
22
+ "hooks": {
23
+ "type": "object",
24
+ "additionalProperties": false,
25
+ "properties": {
26
+ "nativeGoal": {
27
+ "type": "boolean"
28
+ },
29
+ "plugins": {
30
+ "type": "array",
31
+ "maxItems": 64,
32
+ "uniqueItems": true,
33
+ "items": {
34
+ "type": "string",
35
+ "pattern": "^[a-z][a-z0-9-]*$",
36
+ "maxLength": 128
37
+ }
38
+ }
39
+ }
40
+ },
41
+ "runtime": {
42
+ "type": "object",
43
+ "additionalProperties": false,
44
+ "properties": {
45
+ "artifactDirectories": {
46
+ "type": "array",
47
+ "maxItems": 16,
48
+ "items": {
49
+ "type": "object",
50
+ "additionalProperties": false,
51
+ "required": ["name", "path"],
52
+ "properties": {
53
+ "name": {
54
+ "type": "string",
55
+ "pattern": "^[a-z][a-z0-9_]{0,63}$"
56
+ },
57
+ "path": {
58
+ "type": "string",
59
+ "minLength": 1,
60
+ "maxLength": 4096
61
+ }
62
+ }
63
+ }
64
+ },
65
+ "sharedCacheDirectories": {
66
+ "type": "array",
67
+ "maxItems": 16,
68
+ "items": {
69
+ "type": "object",
70
+ "additionalProperties": false,
71
+ "required": ["source", "target", "roles"],
72
+ "properties": {
73
+ "source": { "type": "string", "minLength": 1, "maxLength": 4096 },
74
+ "target": {
75
+ "type": "string",
76
+ "pattern": "^[a-z][a-z0-9-]{0,63}$",
77
+ "not": { "enum": ["home", "tmp"] }
78
+ },
79
+ "roles": {
80
+ "type": "array",
81
+ "minItems": 1,
82
+ "maxItems": 5,
83
+ "uniqueItems": true,
84
+ "items": {
85
+ "enum": [
86
+ "candidate",
87
+ "checks",
88
+ "hooks",
89
+ "semantic",
90
+ "advisory"
91
+ ]
92
+ }
93
+ }
94
+ }
95
+ }
96
+ },
97
+ "seedDirectories": {
98
+ "type": "array",
99
+ "maxItems": 16,
100
+ "items": {
101
+ "type": "object",
102
+ "additionalProperties": false,
103
+ "required": ["source", "target"],
104
+ "properties": {
105
+ "source": {
106
+ "type": "string",
107
+ "minLength": 1,
108
+ "maxLength": 4096
109
+ },
110
+ "target": {
111
+ "type": "string",
112
+ "pattern": "^[a-z][a-z0-9-]{0,63}$",
113
+ "not": {
114
+ "enum": ["home", "tmp"]
115
+ }
116
+ },
117
+ "roles": {
118
+ "type": "array",
119
+ "minItems": 1,
120
+ "maxItems": 5,
121
+ "uniqueItems": true,
122
+ "items": {
123
+ "enum": [
124
+ "candidate",
125
+ "checks",
126
+ "hooks",
127
+ "semantic",
128
+ "advisory"
129
+ ]
130
+ }
131
+ }
132
+ }
133
+ }
134
+ }
135
+ }
136
+ },
137
+ "format": {
138
+ "const": "sevro.runtime.v1"
139
+ },
140
+ "filesystem": {
141
+ "type": "object",
142
+ "additionalProperties": false,
143
+ "properties": {
144
+ "optionalReadOnlyRoots": {
145
+ "type": "array",
146
+ "maxItems": 64,
147
+ "uniqueItems": true,
148
+ "items": {
149
+ "type": "string",
150
+ "minLength": 1,
151
+ "maxLength": 4096
152
+ }
153
+ },
154
+ "readOnlyRoots": {
155
+ "type": "array",
156
+ "maxItems": 64,
157
+ "uniqueItems": true,
158
+ "items": {
159
+ "type": "string",
160
+ "minLength": 1,
161
+ "maxLength": 4096
162
+ }
163
+ }
164
+ }
165
+ },
166
+ "environment": {
167
+ "type": "object",
168
+ "additionalProperties": false,
169
+ "properties": {
170
+ "inherit": {
171
+ "type": "array",
172
+ "maxItems": 64,
173
+ "uniqueItems": true,
174
+ "items": {
175
+ "type": "string",
176
+ "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,127}$"
177
+ }
178
+ },
179
+ "set": {
180
+ "type": "object",
181
+ "maxProperties": 64,
182
+ "propertyNames": {
183
+ "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,127}$"
184
+ },
185
+ "additionalProperties": {
186
+ "type": "string",
187
+ "maxLength": 8192
188
+ }
189
+ }
190
+ }
191
+ }
192
+ }
193
+ }
package/src/advisory.ts CHANGED
@@ -7,14 +7,14 @@ const DIMENSIONS = [
7
7
  "scopeDiscipline",
8
8
  ] as const;
9
9
 
10
- export interface AdvisoryAssessment {
10
+ export type AdvisoryAssessment = {
11
11
  verdict: "pass" | "fail";
12
12
  overallScore: number;
13
13
  dimensions: Record<(typeof DIMENSIONS)[number], number>;
14
14
  strengths: string[];
15
15
  weaknesses: string[];
16
16
  summary: string;
17
- }
17
+ };
18
18
 
19
19
  function object(value: unknown): Record<string, unknown> {
20
20
  if (!value || typeof value !== "object" || Array.isArray(value))
@@ -51,13 +51,18 @@ function textList(value: unknown): string[] {
51
51
  return value.map(text);
52
52
  }
53
53
 
54
- /** Parse a bounded, exact assessment from an independent review host. */
55
- export function parseAdvisoryAssessment(raw: string): AdvisoryAssessment {
54
+ function advisoryJson(raw: string): Record<string, unknown> {
56
55
  if (Buffer.byteLength(raw, "utf8") > 64 * 1024)
57
56
  throw new Error("advisory assessment exceeds 64 KiB");
58
57
  const trimmed = raw.trim();
59
58
  const fenced = /^```(?:json)?\s*([\s\S]*?)\s*```$/i.exec(trimmed);
60
- const value = object(JSON.parse(fenced ? fenced[1]! : trimmed) as unknown);
59
+ const value: unknown = JSON.parse(fenced?.[1] ?? trimmed);
60
+ return object(value);
61
+ }
62
+
63
+ /** Parse a bounded, exact assessment from an independent review host. */
64
+ export function parseAdvisoryAssessment(raw: string): AdvisoryAssessment {
65
+ const value = advisoryJson(raw);
61
66
  exactKeys(value, [
62
67
  "verdict",
63
68
  "overallScore",