@bjoernrochel/sevro 1.0.0 → 1.1.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.
- package/CONTRIBUTING.md +34 -4
- package/README.md +7 -6
- package/dist/examples/basic/graded.json +13 -0
- package/dist/examples/basic/host.js +9 -0
- package/dist/examples/basic/host.js.map +1 -0
- package/dist/examples/basic/prompt-only.json +7 -0
- package/dist/examples/recipes/candidate.js +23 -0
- package/dist/examples/recipes/candidate.js.map +1 -0
- package/dist/examples/recipes/cases/coding-change.json +21 -0
- package/dist/examples/recipes/cases/host-tools.json +21 -0
- package/dist/examples/recipes/cases/mise.json +21 -0
- package/dist/examples/recipes/cases/node.json +21 -0
- package/dist/examples/recipes/cases/python-uv.json +21 -0
- package/dist/examples/recipes/cases/semantic.json +17 -0
- package/dist/examples/recipes/coding-change/check.js +16 -0
- package/dist/examples/recipes/coding-change/check.js.map +1 -0
- package/dist/examples/recipes/executable.js +20 -0
- package/dist/examples/recipes/executable.js.map +1 -0
- package/dist/examples/recipes/extension-artifacts.js +56 -0
- package/dist/examples/recipes/extension-artifacts.js.map +1 -0
- package/dist/examples/recipes/extension-methods.js +167 -0
- package/dist/examples/recipes/extension-methods.js.map +1 -0
- package/dist/examples/recipes/extension.js +28 -0
- package/dist/examples/recipes/extension.js.map +1 -0
- package/dist/examples/recipes/modules.js +9 -0
- package/dist/examples/recipes/modules.js.map +1 -0
- package/dist/examples/recipes/repository-skill/.agents/skills/startup-guide/SKILL.md +7 -0
- package/dist/examples/recipes/repository-skill/.claude/skills/startup-guide/SKILL.md +7 -0
- package/dist/examples/recipes/repository-skill/README.md +3 -0
- package/dist/examples/recipes/run-inputs.js +144 -0
- package/dist/examples/recipes/run-inputs.js.map +1 -0
- package/dist/examples/recipes/run-options.js +103 -0
- package/dist/examples/recipes/run-options.js.map +1 -0
- package/dist/examples/recipes/run.js +62 -0
- package/dist/examples/recipes/run.js.map +1 -0
- package/dist/examples/recipes/runtime/empty.json +1 -0
- package/dist/examples/recipes/runtime/goals.json +1 -0
- package/dist/examples/recipes/runtime/mise.json +6 -0
- package/dist/examples/recipes/runtime/path.json +1 -0
- package/dist/examples/recipes/runtime/plugins.json +4 -0
- package/dist/examples/recipes/runtime/python-uv.json +10 -0
- package/dist/examples/recipes/semantic-judge.js +27 -0
- package/dist/examples/recipes/semantic-judge.js.map +1 -0
- package/dist/examples/templates/coding/adapter.js +14 -0
- package/dist/examples/templates/coding/adapter.js.map +1 -0
- package/dist/examples/templates/coding/case.json +15 -0
- package/dist/examples/templates/repository-skill/.agents/skills/startup-guide/SKILL.md +6 -0
- package/dist/examples/templates/repository-skill/extension-data.js +61 -0
- package/dist/examples/templates/repository-skill/extension-data.js.map +1 -0
- package/dist/examples/templates/repository-skill/extension.js +29 -0
- package/dist/examples/templates/repository-skill/extension.js.map +1 -0
- package/dist/examples/templates/response/adapter.js +13 -0
- package/dist/examples/templates/response/adapter.js.map +1 -0
- package/dist/examples/templates/response/case.json +13 -0
- package/dist/src/advisory.js +86 -0
- package/dist/src/advisory.js.map +1 -0
- package/dist/src/candidate-artifacts.js +139 -0
- package/dist/src/candidate-artifacts.js.map +1 -0
- package/dist/src/candidate-codex-state.js +110 -0
- package/dist/src/candidate-codex-state.js.map +1 -0
- package/dist/src/case-validation.js +92 -0
- package/dist/src/case-validation.js.map +1 -0
- package/dist/src/cli/cancellation.js +21 -0
- package/dist/src/cli/cancellation.js.map +1 -0
- package/dist/src/cli/command.js +60 -0
- package/dist/src/cli/command.js.map +1 -0
- package/dist/src/cli/completion.js +14 -0
- package/dist/src/cli/completion.js.map +1 -0
- package/dist/src/cli/demo.js +45 -0
- package/dist/src/cli/demo.js.map +1 -0
- package/dist/src/cli/evaluation.js +40 -0
- package/dist/src/cli/evaluation.js.map +1 -0
- package/dist/src/cli/extension.js +54 -0
- package/dist/src/cli/extension.js.map +1 -0
- package/dist/src/cli/help.js +190 -0
- package/dist/src/cli/help.js.map +1 -0
- package/dist/src/cli/hosts.js +33 -0
- package/dist/src/cli/hosts.js.map +1 -0
- package/dist/src/cli/init-settings.js +29 -0
- package/dist/src/cli/init-settings.js.map +1 -0
- package/dist/src/cli/init.js +82 -0
- package/dist/src/cli/init.js.map +1 -0
- package/dist/src/cli/invocation.js +431 -0
- package/dist/src/cli/invocation.js.map +1 -0
- package/dist/src/cli/loading.js +110 -0
- package/dist/src/cli/loading.js.map +1 -0
- package/dist/src/cli/preparation.js +88 -0
- package/dist/src/cli/preparation.js.map +1 -0
- package/dist/src/cli/presentation.js +61 -0
- package/dist/src/cli/presentation.js.map +1 -0
- package/dist/src/cli/progress.js +5 -0
- package/dist/src/cli/progress.js.map +1 -0
- package/dist/src/cli/run-manifest.js +108 -0
- package/dist/src/cli/run-manifest.js.map +1 -0
- package/dist/src/cli/run-options.js +367 -0
- package/dist/src/cli/run-options.js.map +1 -0
- package/dist/src/cli/run-overrides.js +51 -0
- package/dist/src/cli/run-overrides.js.map +1 -0
- package/dist/src/cli/settings.js +127 -0
- package/dist/src/cli/settings.js.map +1 -0
- package/dist/src/cli/summary.js +28 -0
- package/dist/src/cli/summary.js.map +1 -0
- package/dist/src/cli.js +20 -0
- package/dist/src/cli.js.map +1 -0
- package/dist/src/contract-types.js +2 -0
- package/dist/src/contract-types.js.map +1 -0
- package/dist/src/engine.js +4 -0
- package/dist/src/engine.js.map +1 -0
- package/dist/src/evaluation/advisory.js +85 -0
- package/dist/src/evaluation/advisory.js.map +1 -0
- package/dist/src/evaluation/check-plan.js +292 -0
- package/dist/src/evaluation/check-plan.js.map +1 -0
- package/dist/src/evaluation/collection.js +61 -0
- package/dist/src/evaluation/collection.js.map +1 -0
- package/dist/src/evaluation/context.js +2 -0
- package/dist/src/evaluation/context.js.map +1 -0
- package/dist/src/evaluation/grading-host.js +28 -0
- package/dist/src/evaluation/grading-host.js.map +1 -0
- package/dist/src/evaluation/grading.js +154 -0
- package/dist/src/evaluation/grading.js.map +1 -0
- package/dist/src/evaluation/invocation-plan.js +312 -0
- package/dist/src/evaluation/invocation-plan.js.map +1 -0
- package/dist/src/evaluation/plan.js +376 -0
- package/dist/src/evaluation/plan.js.map +1 -0
- package/dist/src/evaluation/progress.js +14 -0
- package/dist/src/evaluation/progress.js.map +1 -0
- package/dist/src/evaluation/resources.js +159 -0
- package/dist/src/evaluation/resources.js.map +1 -0
- package/dist/src/evaluation/run.js +148 -0
- package/dist/src/evaluation/run.js.map +1 -0
- package/dist/src/evaluation/scheduler.js +27 -0
- package/dist/src/evaluation/scheduler.js.map +1 -0
- package/dist/src/evaluation/semantic.js +183 -0
- package/dist/src/evaluation/semantic.js.map +1 -0
- package/dist/src/evaluation/trial.js +593 -0
- package/dist/src/evaluation/trial.js.map +1 -0
- package/dist/src/evaluation/types.js +20 -0
- package/dist/src/evaluation/types.js.map +1 -0
- package/dist/src/evidence/host-results.js +67 -0
- package/dist/src/evidence/host-results.js.map +1 -0
- package/dist/src/evidence/retained-artifacts.js +17 -0
- package/dist/src/evidence/retained-artifacts.js.map +1 -0
- package/dist/src/evidence/trial-writer.js +131 -0
- package/dist/src/evidence/trial-writer.js.map +1 -0
- package/dist/src/evidence/usage.js +14 -0
- package/dist/src/evidence/usage.js.map +1 -0
- package/dist/src/executable.js +20 -0
- package/dist/src/executable.js.map +1 -0
- package/dist/src/extension-client.js +212 -0
- package/dist/src/extension-client.js.map +1 -0
- package/dist/src/extension-session.js +236 -0
- package/dist/src/extension-session.js.map +1 -0
- package/dist/src/fixtures/advisory.js +206 -0
- package/dist/src/fixtures/advisory.js.map +1 -0
- package/dist/src/fixtures/bin.js +41 -0
- package/dist/src/fixtures/bin.js.map +1 -0
- package/dist/src/fixtures/cleanup.js +43 -0
- package/dist/src/fixtures/cleanup.js.map +1 -0
- package/dist/src/fixtures/create.js +94 -0
- package/dist/src/fixtures/create.js.map +1 -0
- package/dist/src/fixtures/generated.js +181 -0
- package/dist/src/fixtures/generated.js.map +1 -0
- package/dist/src/fixtures/git-hooks.js +16 -0
- package/dist/src/fixtures/git-hooks.js.map +1 -0
- package/dist/src/fixtures/preparation.js +201 -0
- package/dist/src/fixtures/preparation.js.map +1 -0
- package/dist/src/fixtures/repository.js +255 -0
- package/dist/src/fixtures/repository.js.map +1 -0
- package/dist/src/fixtures/setup.js +175 -0
- package/dist/src/fixtures/setup.js.map +1 -0
- package/dist/src/fixtures/tools.js +57 -0
- package/dist/src/fixtures/tools.js.map +1 -0
- package/dist/src/fixtures/workspace-state.js +155 -0
- package/dist/src/fixtures/workspace-state.js.map +1 -0
- package/dist/src/generated/cli-result.cjs +2 -0
- package/dist/src/generated/extension.cjs +2 -0
- package/dist/src/generated/report.cjs +2 -0
- package/dist/src/generated/run-evidence.cjs +2 -0
- package/dist/src/generated/runtime.cjs +2 -0
- package/dist/src/git.js +72 -0
- package/dist/src/git.js.map +1 -0
- package/dist/src/graders/artifact.js +68 -0
- package/dist/src/graders/artifact.js.map +1 -0
- package/dist/src/graders/git-head.js +112 -0
- package/dist/src/graders/git-head.js.map +1 -0
- package/dist/src/graders/output.js +345 -0
- package/dist/src/graders/output.js.map +1 -0
- package/dist/src/graders/semantic.js +132 -0
- package/dist/src/graders/semantic.js.map +1 -0
- package/dist/src/graders/shell.js +321 -0
- package/dist/src/graders/shell.js.map +1 -0
- package/dist/src/host-diagnostic-redaction.js +52 -0
- package/dist/src/host-diagnostic-redaction.js.map +1 -0
- package/dist/src/host-diagnostics.js +248 -0
- package/dist/src/host-diagnostics.js.map +1 -0
- package/dist/src/hosts/claude-continuation.js +89 -0
- package/dist/src/hosts/claude-continuation.js.map +1 -0
- package/dist/src/hosts/claude-credential.js +121 -0
- package/dist/src/hosts/claude-credential.js.map +1 -0
- package/dist/src/hosts/claude-events.js +136 -0
- package/dist/src/hosts/claude-events.js.map +1 -0
- package/dist/src/hosts/claude-keychain.js +100 -0
- package/dist/src/hosts/claude-keychain.js.map +1 -0
- package/dist/src/hosts/claude-login-recovery.js +67 -0
- package/dist/src/hosts/claude-login-recovery.js.map +1 -0
- package/dist/src/hosts/claude-login-refresh.js +146 -0
- package/dist/src/hosts/claude-login-refresh.js.map +1 -0
- package/dist/src/hosts/claude-login-store.js +124 -0
- package/dist/src/hosts/claude-login-store.js.map +1 -0
- package/dist/src/hosts/claude-login.js +74 -0
- package/dist/src/hosts/claude-login.js.map +1 -0
- package/dist/src/hosts/claude-native-goal.js +138 -0
- package/dist/src/hosts/claude-native-goal.js.map +1 -0
- package/dist/src/hosts/claude-process.js +10 -0
- package/dist/src/hosts/claude-process.js.map +1 -0
- package/dist/src/hosts/claude-refresh-lock.js +76 -0
- package/dist/src/hosts/claude-refresh-lock.js.map +1 -0
- package/dist/src/hosts/claude-repository-invocation.js +229 -0
- package/dist/src/hosts/claude-repository-invocation.js.map +1 -0
- package/dist/src/hosts/claude-settings.js +156 -0
- package/dist/src/hosts/claude-settings.js.map +1 -0
- package/dist/src/hosts/claude-skill-activations.js +131 -0
- package/dist/src/hosts/claude-skill-activations.js.map +1 -0
- package/dist/src/hosts/claude-state.js +237 -0
- package/dist/src/hosts/claude-state.js.map +1 -0
- package/dist/src/hosts/claude-tool-calls.js +150 -0
- package/dist/src/hosts/claude-tool-calls.js.map +1 -0
- package/dist/src/hosts/claude.js +373 -0
- package/dist/src/hosts/claude.js.map +1 -0
- package/dist/src/hosts/codex-app-server.js +764 -0
- package/dist/src/hosts/codex-app-server.js.map +1 -0
- package/dist/src/hosts/codex-configuration.js +91 -0
- package/dist/src/hosts/codex-configuration.js.map +1 -0
- package/dist/src/hosts/codex-events.js +104 -0
- package/dist/src/hosts/codex-events.js.map +1 -0
- package/dist/src/hosts/codex-exec-controls.js +434 -0
- package/dist/src/hosts/codex-exec-controls.js.map +1 -0
- package/dist/src/hosts/codex-invocation.js +54 -0
- package/dist/src/hosts/codex-invocation.js.map +1 -0
- package/dist/src/hosts/codex-marketplace.js +185 -0
- package/dist/src/hosts/codex-marketplace.js.map +1 -0
- package/dist/src/hosts/codex-native-calls.js +516 -0
- package/dist/src/hosts/codex-native-calls.js.map +1 -0
- package/dist/src/hosts/codex-process.js +10 -0
- package/dist/src/hosts/codex-process.js.map +1 -0
- package/dist/src/hosts/codex-profile.js +206 -0
- package/dist/src/hosts/codex-profile.js.map +1 -0
- package/dist/src/hosts/codex-session-files.js +89 -0
- package/dist/src/hosts/codex-session-files.js.map +1 -0
- package/dist/src/hosts/codex-state.js +310 -0
- package/dist/src/hosts/codex-state.js.map +1 -0
- package/dist/src/hosts/codex.js +527 -0
- package/dist/src/hosts/codex.js.map +1 -0
- package/dist/src/hosts/isolation-common.js +43 -0
- package/dist/src/hosts/isolation-common.js.map +1 -0
- package/dist/src/hosts/isolation-roots.js +64 -0
- package/dist/src/hosts/isolation-roots.js.map +1 -0
- package/dist/src/hosts/isolation.js +12 -0
- package/dist/src/hosts/isolation.js.map +1 -0
- package/dist/src/hosts/linux-sandbox.js +127 -0
- package/dist/src/hosts/linux-sandbox.js.map +1 -0
- package/dist/src/hosts/mac-sandbox.js +137 -0
- package/dist/src/hosts/mac-sandbox.js.map +1 -0
- package/dist/src/hosts/native-controls.js +151 -0
- package/dist/src/hosts/native-controls.js.map +1 -0
- package/dist/src/hosts/native-request.js +33 -0
- package/dist/src/hosts/native-request.js.map +1 -0
- package/dist/src/hosts/process-lifecycle.js +167 -0
- package/dist/src/hosts/process-lifecycle.js.map +1 -0
- package/dist/src/hosts/protected-worktrees.js +81 -0
- package/dist/src/hosts/protected-worktrees.js.map +1 -0
- package/dist/src/hosts/skill-hook-catalog.js +100 -0
- package/dist/src/hosts/skill-hook-catalog.js.map +1 -0
- package/dist/src/hosts/skill-hook-handler.js +228 -0
- package/dist/src/hosts/skill-hook-handler.js.map +1 -0
- package/dist/src/hosts/skill-hooks.js +423 -0
- package/dist/src/hosts/skill-hooks.js.map +1 -0
- package/dist/src/hosts/workspace-fingerprint.js +72 -0
- package/dist/src/hosts/workspace-fingerprint.js.map +1 -0
- package/dist/src/identity.js +167 -0
- package/dist/src/identity.js.map +1 -0
- package/dist/src/instrumentation.js +83 -0
- package/dist/src/instrumentation.js.map +1 -0
- package/dist/src/native-transcript-state.js +85 -0
- package/dist/src/native-transcript-state.js.map +1 -0
- package/dist/src/native-transcript-view.js +65 -0
- package/dist/src/native-transcript-view.js.map +1 -0
- package/dist/src/native-transcripts.js +208 -0
- package/dist/src/native-transcripts.js.map +1 -0
- package/dist/src/paths.js +13 -0
- package/dist/src/paths.js.map +1 -0
- package/dist/src/process-lifecycle.js +101 -0
- package/dist/src/process-lifecycle.js.map +1 -0
- package/dist/src/provenance.js +263 -0
- package/dist/src/provenance.js.map +1 -0
- package/dist/src/prune.js +228 -0
- package/dist/src/prune.js.map +1 -0
- package/dist/src/report.js +276 -0
- package/dist/src/report.js.map +1 -0
- package/dist/src/resolved-case.js +29 -0
- package/dist/src/resolved-case.js.map +1 -0
- package/dist/src/results-lock.js +40 -0
- package/dist/src/results-lock.js.map +1 -0
- package/dist/src/results.js +127 -0
- package/dist/src/results.js.map +1 -0
- package/dist/src/run-owner.js +283 -0
- package/dist/src/run-owner.js.map +1 -0
- package/dist/src/runner-paths.js +11 -0
- package/dist/src/runner-paths.js.map +1 -0
- package/dist/src/runtime/config.js +323 -0
- package/dist/src/runtime/config.js.map +1 -0
- package/dist/src/runtime/discovery-apple.js +65 -0
- package/dist/src/runtime/discovery-apple.js.map +1 -0
- package/dist/src/runtime/discovery-providers.js +37 -0
- package/dist/src/runtime/discovery-providers.js.map +1 -0
- package/dist/src/runtime/discovery.js +40 -0
- package/dist/src/runtime/discovery.js.map +1 -0
- package/dist/src/runtime/hook-processes.js +81 -0
- package/dist/src/runtime/hook-processes.js.map +1 -0
- package/dist/src/runtime/hooks.js +304 -0
- package/dist/src/runtime/hooks.js.map +1 -0
- package/dist/src/runtime/paths.js +244 -0
- package/dist/src/runtime/paths.js.map +1 -0
- package/dist/src/runtime/query.js +76 -0
- package/dist/src/runtime/query.js.map +1 -0
- package/dist/src/runtime/seeds.js +98 -0
- package/dist/src/runtime/seeds.js.map +1 -0
- package/dist/src/runtime/shared-cache.js +81 -0
- package/dist/src/runtime/shared-cache.js.map +1 -0
- package/dist/src/runtime/state.js +106 -0
- package/dist/src/runtime/state.js.map +1 -0
- package/dist/src/runtime-process.js +148 -0
- package/dist/src/runtime-process.js.map +1 -0
- package/dist/src/schema-types.js +2 -0
- package/dist/src/schema-types.js.map +1 -0
- package/dist/src/schema.js +16 -0
- package/dist/src/schema.js.map +1 -0
- package/dist/src/shell.js +5 -0
- package/dist/src/shell.js.map +1 -0
- package/dist/src/sqlite-lock.js +18 -0
- package/dist/src/sqlite-lock.js.map +1 -0
- package/dist/src/storage.js +21 -0
- package/dist/src/storage.js.map +1 -0
- package/dist/src/transcript-retention.js +109 -0
- package/dist/src/transcript-retention.js.map +1 -0
- package/dist/src/value-guards.js +26 -0
- package/dist/src/value-guards.js.map +1 -0
- package/docs/architecture.md +5 -2
- package/docs/creating-cases.md +2 -3
- package/docs/development-cli.md +12 -7
- package/docs/documentation-quality.md +4 -3
- package/docs/evaluation-workflow.md +8 -8
- package/docs/getting-started.md +7 -6
- package/docs/guide-evaluation.md +1 -1
- package/docs/identity-v1.md +4 -1
- package/docs/installing.md +31 -13
- package/docs/licensing.md +2 -2
- package/docs/native-hosts.md +1 -1
- package/docs/recipes.md +41 -40
- package/docs/releases.md +20 -4
- package/docs/run-settings-v1.md +3 -3
- package/docs/specs/repository-guide.md +1 -1
- package/docs/troubleshooting.md +1 -1
- package/docs/typescript-quality.md +18 -1
- package/examples/recipes/executable.ts +19 -0
- package/examples/recipes/extension-artifacts.ts +1 -1
- package/examples/recipes/extension.ts +2 -1
- package/examples/recipes/modules.ts +9 -0
- package/examples/recipes/run-inputs.ts +14 -19
- package/examples/recipes/run-options.ts +9 -8
- package/examples/recipes/run.ts +21 -7
- package/examples/templates/repository-skill/extension-data.ts +1 -1
- package/examples/templates/repository-skill/extension.ts +2 -1
- package/package.json +14 -6
- package/src/cli/demo.ts +3 -2
- package/src/cli/help.ts +4 -3
- package/src/cli/init-settings.ts +5 -4
- package/src/cli/init.ts +9 -8
- package/src/cli/invocation.ts +2 -1
- package/src/cli/preparation.ts +2 -2
- package/src/cli.ts +1 -1
- package/src/executable.ts +19 -0
- package/src/extension-client.ts +6 -12
- package/src/fixtures/setup.ts +3 -2
- package/src/git.ts +2 -1
- package/src/graders/git-head.ts +3 -2
- package/src/graders/shell.ts +4 -3
- package/src/hosts/claude-keychain.ts +3 -2
- package/src/hosts/claude-login-refresh.ts +3 -2
- package/src/hosts/claude-refresh-lock.ts +2 -1
- package/src/hosts/isolation-roots.ts +3 -2
- package/src/hosts/process-lifecycle.ts +4 -6
- package/src/hosts/protected-worktrees.ts +2 -1
- package/src/hosts/skill-hook-handler.ts +1 -1
- package/src/hosts/skill-hooks.ts +10 -2
- package/src/provenance.ts +7 -6
- package/src/results-lock.ts +4 -4
- package/src/run-owner.ts +15 -9
- package/src/runner-paths.ts +21 -0
- package/src/runtime/hook-processes.ts +2 -1
- package/src/runtime/hooks.ts +9 -7
- package/src/runtime-process.ts +194 -0
- package/src/sqlite-lock.ts +25 -0
|
@@ -46,7 +46,7 @@ export const resolved = {
|
|
|
46
46
|
|
|
47
47
|
export async function prepare() {
|
|
48
48
|
const relativePath = ".agents/skills/startup-guide/SKILL.md";
|
|
49
|
-
const body = await readFile(join(import.meta.
|
|
49
|
+
const body = await readFile(join(import.meta.dirname, relativePath));
|
|
50
50
|
return {
|
|
51
51
|
artifacts: [
|
|
52
52
|
{
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { description, prepare, resolved } from "./extension-data";
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
2
3
|
|
|
3
4
|
function record(value: unknown): Record<string, unknown> {
|
|
4
5
|
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
@@ -6,7 +7,7 @@ function record(value: unknown): Record<string, unknown> {
|
|
|
6
7
|
return value as Record<string, unknown>;
|
|
7
8
|
}
|
|
8
9
|
|
|
9
|
-
const request = record(JSON.parse(
|
|
10
|
+
const request = record(JSON.parse(readFileSync(0, "utf8")) as unknown);
|
|
10
11
|
async function result() {
|
|
11
12
|
switch (request.method) {
|
|
12
13
|
case "describe":
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bjoernrochel/sevro",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"description": "A standalone evaluation runner for agentic coding capabilities",
|
|
6
6
|
"type": "module",
|
|
@@ -29,10 +29,11 @@
|
|
|
29
29
|
"docs/specs/",
|
|
30
30
|
"examples/",
|
|
31
31
|
"schemas/",
|
|
32
|
-
"src/"
|
|
32
|
+
"src/",
|
|
33
|
+
"dist/"
|
|
33
34
|
],
|
|
34
35
|
"bin": {
|
|
35
|
-
"sevro": "./src/cli.
|
|
36
|
+
"sevro": "./dist/src/cli.js"
|
|
36
37
|
},
|
|
37
38
|
"scripts": {
|
|
38
39
|
"check:typescript": "bun scripts/check-typescript.ts",
|
|
@@ -49,14 +50,18 @@
|
|
|
49
50
|
"test:docs-examples": "bun scripts/verify-doc-examples.ts",
|
|
50
51
|
"guide:sync": "bun scripts/sync-guide.ts",
|
|
51
52
|
"eval:guide": "bun scripts/eval-guide.ts",
|
|
52
|
-
"release:prepare": "bun scripts/prepare-release.ts",
|
|
53
|
+
"release:prepare": "bun run build && bun scripts/prepare-release.ts",
|
|
53
54
|
"typecheck": "tsc --noEmit",
|
|
54
|
-
"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 '.github/workflows/*.yml'"
|
|
55
|
+
"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 '.github/workflows/*.yml'",
|
|
56
|
+
"build": "bun scripts/build.ts",
|
|
57
|
+
"prepack": "bun run build",
|
|
58
|
+
"test:runtime-node": "bun scripts/verify-node-runtime.ts"
|
|
55
59
|
},
|
|
56
60
|
"dependencies": {
|
|
57
61
|
"ajv": "8.20.0",
|
|
58
62
|
"smol-toml": "1.8.0",
|
|
59
|
-
"typescript": "5.9.3"
|
|
63
|
+
"typescript": "5.9.3",
|
|
64
|
+
"yaml": "2.9.1"
|
|
60
65
|
},
|
|
61
66
|
"devDependencies": {
|
|
62
67
|
"@babel/core": "8.0.6",
|
|
@@ -80,5 +85,8 @@
|
|
|
80
85
|
"prettier": "3.9.9",
|
|
81
86
|
"shell-quote": "1.12.0",
|
|
82
87
|
"typescript-eslint": "8.71.1"
|
|
88
|
+
},
|
|
89
|
+
"engines": {
|
|
90
|
+
"node": ">=24.13.0"
|
|
83
91
|
}
|
|
84
92
|
}
|
package/src/cli/demo.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { examplePath } from "../runner-paths";
|
|
1
2
|
import { mkdtemp, rm } from "node:fs/promises";
|
|
2
3
|
import { tmpdir } from "node:os";
|
|
3
4
|
import { join } from "node:path";
|
|
@@ -38,9 +39,9 @@ export async function demoCommand(argv: string[]): Promise<void> {
|
|
|
38
39
|
"run",
|
|
39
40
|
...(json ? ["--json"] : []),
|
|
40
41
|
"--case-file",
|
|
41
|
-
|
|
42
|
+
examplePath("basic", "graded.json"),
|
|
42
43
|
"--adapter-module",
|
|
43
|
-
|
|
44
|
+
examplePath("basic", "host.ts"),
|
|
44
45
|
"--project-root",
|
|
45
46
|
projectRoot,
|
|
46
47
|
"--results-root",
|
package/src/cli/help.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { RUN_OPTIONS, optionsWith, type RunOptionName } from "./run-options";
|
|
2
|
-
import
|
|
2
|
+
import packageJson from "../../package.json" with { type: "json" };
|
|
3
|
+
const { version } = packageJson;
|
|
3
4
|
|
|
4
5
|
const TOP_LEVEL_HELP = `Usage: sevro <command> [options]
|
|
5
6
|
|
|
6
7
|
Examples:
|
|
7
8
|
sevro demo
|
|
8
9
|
sevro init --template response --directory ./my-evaluation
|
|
9
|
-
sevro run --case-file /absolute/case.json --adapter-module /absolute/adapter.
|
|
10
|
+
sevro run --case-file /absolute/case.json --adapter-module /absolute/adapter.js \\
|
|
10
11
|
--project-root /absolute/project --results-root /absolute/results \\
|
|
11
12
|
--condition passive --trials 1 --threshold 1
|
|
12
13
|
sevro run --help
|
|
@@ -28,7 +29,7 @@ Options:
|
|
|
28
29
|
const RUN_HELP = `Usage: sevro run [options]
|
|
29
30
|
|
|
30
31
|
Examples:
|
|
31
|
-
sevro run --case-file /absolute/case.json --adapter-module /absolute/adapter.
|
|
32
|
+
sevro run --case-file /absolute/case.json --adapter-module /absolute/adapter.js \\
|
|
32
33
|
--project-root /absolute/project --results-root /absolute/results \\
|
|
33
34
|
--condition passive --trials 1 --threshold 1
|
|
34
35
|
Add --dry to prepare without calling the candidate or graders.
|
package/src/cli/init-settings.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
|
+
import { runtimeModule } from "../runner-paths";
|
|
2
3
|
|
|
3
4
|
export function templateSettings(template: string) {
|
|
4
5
|
if (template === "repository-skill")
|
|
@@ -9,22 +10,22 @@ export function templateSettings(template: string) {
|
|
|
9
10
|
"extension.ts",
|
|
10
11
|
"extension-data.ts",
|
|
11
12
|
".agents/skills/startup-guide/SKILL.md",
|
|
12
|
-
],
|
|
13
|
+
].map(runtimeModule),
|
|
13
14
|
"case-id": "repository-skill",
|
|
14
15
|
host: "codex",
|
|
15
16
|
};
|
|
16
17
|
return {
|
|
17
18
|
"case-file": "case.json",
|
|
18
|
-
"adapter-module": "adapter.ts",
|
|
19
|
+
"adapter-module": runtimeModule("adapter.ts"),
|
|
19
20
|
"project-root": ".",
|
|
20
21
|
...(template === "coding" ? { "shell-isolation": true } : {}),
|
|
21
22
|
};
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
export function templateCommand(destination: string) {
|
|
25
|
-
return [process.execPath, join(destination, "extension.ts")];
|
|
26
|
+
return [process.execPath, join(destination, runtimeModule("extension.ts"))];
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
export function nativeReadme() {
|
|
29
|
-
return `# Repository skill evaluation\n\nThis template mounts the actual startup-guide skill and requires Codex's explicit invocation evidence plus assertions for the start command and port. Missing evidence remains not_assessed.\n\nPrerequisites: Bun, Git, Codex on PATH, supported native isolation (sandbox-exec on macOS or bubblewrap/socat on Linux), and a readable Codex authentication file. Choose the exact model and effort explicitly. Do not store credentials in run.json.\n\n\`\`\`sh\nsevro run --run-manifest-file run.json --model YOUR_MODEL --effort YOUR_EFFORT --codex-auth-file /absolute/auth.json --dry\nsevro run --run-manifest-file run.json --model YOUR_MODEL --effort YOUR_EFFORT --codex-auth-file /absolute/auth.json\nsevro report --latest\n\`\`\`\n\nDry preparation checks mounts and declarations without calling the model. No authenticated model execution or skill dispatch is established by dry preparation. Live execution may incur provider charges. To create a negative control, change the expected port in extension
|
|
30
|
+
return `# Repository skill evaluation\n\nThis template mounts the actual startup-guide skill and requires Codex's explicit invocation evidence plus assertions for the start command and port. Missing evidence remains not_assessed.\n\nPrerequisites: Node.js 24.13.0 or newer, or Bun 1.3.13, plus Git, Codex on PATH, supported native isolation (sandbox-exec on macOS or bubblewrap/socat on Linux), and a readable Codex authentication file. Choose the exact model and effort explicitly. Do not store credentials in run.json.\n\n\`\`\`sh\nsevro run --run-manifest-file run.json --model YOUR_MODEL --effort YOUR_EFFORT --codex-auth-file /absolute/auth.json --dry\nsevro run --run-manifest-file run.json --model YOUR_MODEL --effort YOUR_EFFORT --codex-auth-file /absolute/auth.json\nsevro report --latest\n\`\`\`\n\nDry preparation checks mounts and declarations without calling the model. No authenticated model execution or skill dispatch is established by dry preparation. Live execution may incur provider charges. To create a negative control, change the expected port in the extension data file to 9000 while leaving the fixture at 3000; rerun and inspect the failed port assertion. Model compliance and measurements are unknown until actually executed.\n\nEdit the copied skill and assertions, prepare again, then rerun the same model/effort/condition. Keep private .sevro evidence out of Git. command.json uses the initializer's absolute selected runtime and extension paths; regenerate it after moving this project.\n`;
|
|
30
31
|
}
|
package/src/cli/init.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { examplePath, sourceRuntime } from "../runner-paths";
|
|
1
2
|
import { cp, mkdir, rm, writeFile } from "node:fs/promises";
|
|
2
3
|
import { dirname, join, resolve } from "node:path";
|
|
3
4
|
import { parseArgs } from "node:util";
|
|
@@ -49,19 +50,19 @@ function starterReadme(template: string) {
|
|
|
49
50
|
: "an exact response assertion";
|
|
50
51
|
const prerequisites =
|
|
51
52
|
template === "coding"
|
|
52
|
-
? "Bun
|
|
53
|
-
: "Bun";
|
|
54
|
-
return `# ${template} evaluation\n\nThis deterministic adapter exercises ${assertion}, without model credentials. Prerequisites: ${prerequisites}.\n\n\`\`\`sh\nsevro run --run-manifest-file run.json --dry\nsevro run --run-manifest-file run.json\nsevro report --latest\nSEVRO_TEMPLATE_FAIL=1 sevro run --run-manifest-file run.json\n\`\`\`\n\nThe negative control must report task=failed and exit 1. Dry preparation is not an assessment.\nEdit case.json and adapter.ts, prepare, then run again. Keep private .sevro evidence out of Git.\nFor a native model, replace the adapter route explicitly with --host, --model and --effort; Codex also requires --codex-auth-file. No model execution or native skill dispatch is established by this adapter.\n`;
|
|
53
|
+
? "Node.js 24.13.0 or newer, or Bun 1.3.13, plus sandbox-exec on macOS or bubblewrap/socat on Linux"
|
|
54
|
+
: "Node.js 24.13.0 or newer, or Bun 1.3.13";
|
|
55
|
+
return `# ${template} evaluation\n\nThis deterministic adapter exercises ${assertion}, without model credentials. Prerequisites: ${prerequisites}.\n\n\`\`\`sh\nsevro run --run-manifest-file run.json --dry\nsevro run --run-manifest-file run.json\nsevro report --latest\nSEVRO_TEMPLATE_FAIL=1 sevro run --run-manifest-file run.json\n\`\`\`\n\nThe negative control must report task=failed and exit 1. Dry preparation is not an assessment.\nEdit case.json and ${sourceRuntime ? "adapter.ts" : "adapter.js"}, prepare, then run again. Keep private .sevro evidence out of Git.\nFor a native model, replace the adapter route explicitly with --host, --model and --effort; Codex also requires --codex-auth-file. No model execution or native skill dispatch is established by this adapter.\n`;
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
async function initialize(template: string, destination: string) {
|
|
58
59
|
await reserveDirectory(destination);
|
|
59
60
|
try {
|
|
60
|
-
await cp(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
);
|
|
61
|
+
await cp(examplePath("templates", template), destination, {
|
|
62
|
+
recursive: true,
|
|
63
|
+
errorOnExist: true,
|
|
64
|
+
force: false,
|
|
65
|
+
});
|
|
65
66
|
await writeFile(
|
|
66
67
|
join(destination, "run.json"),
|
|
67
68
|
JSON.stringify(
|
package/src/cli/invocation.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { which } from "../executable";
|
|
1
2
|
import { join, resolve } from "node:path";
|
|
2
3
|
import { validQualifiedId } from "../value-guards";
|
|
3
4
|
import { canonicalRuntimeRoot } from "../runtime/paths";
|
|
@@ -523,7 +524,7 @@ function resolveNativeBinaries(values: Values): void {
|
|
|
523
524
|
}
|
|
524
525
|
|
|
525
526
|
function nativeBinary(host: "codex" | "claude"): string {
|
|
526
|
-
const binary =
|
|
527
|
+
const binary = which(host);
|
|
527
528
|
if (!binary)
|
|
528
529
|
throw new InvocationError(
|
|
529
530
|
`selected ${host} executable was not found on PATH; install ${host} or supply --${host}-bin <path>`,
|
package/src/cli/preparation.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { runnerRoot } from "../runner-paths";
|
|
2
2
|
import { fileURLToPath } from "node:url";
|
|
3
3
|
import { configurationRoot } from "../hosts/codex-configuration";
|
|
4
4
|
import {
|
|
@@ -134,7 +134,7 @@ async function invocationProtectedRuntimeRoots(
|
|
|
134
134
|
invocation: Invocation,
|
|
135
135
|
): Promise<string[]> {
|
|
136
136
|
const protectedRoots = [
|
|
137
|
-
|
|
137
|
+
runnerRoot,
|
|
138
138
|
invocation.projectRoot,
|
|
139
139
|
invocation.configRoot,
|
|
140
140
|
invocation.resultsRoot,
|
package/src/cli.ts
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { accessSync, constants, statSync } from "node:fs";
|
|
2
|
+
import { delimiter, resolve } from "node:path";
|
|
3
|
+
|
|
4
|
+
export function which(name: string, path?: string): string | null {
|
|
5
|
+
for (const directory of executablePath(path).split(delimiter)) {
|
|
6
|
+
const candidate = resolve(directory, name);
|
|
7
|
+
try {
|
|
8
|
+
accessSync(candidate, constants.X_OK);
|
|
9
|
+
if (statSync(candidate).isFile()) return candidate;
|
|
10
|
+
} catch {
|
|
11
|
+
/* Continue searching the declared executable path. */
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function executablePath(path: string | undefined): string {
|
|
18
|
+
return path ?? process.env.PATH ?? "";
|
|
19
|
+
}
|
package/src/extension-client.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { spawn, type Subprocess } from "./runtime-process";
|
|
1
2
|
import { randomUUID } from "node:crypto";
|
|
2
3
|
import validExchange from "./generated/extension.cjs";
|
|
3
4
|
import { isRecord, isStringArray } from "./value-guards";
|
|
@@ -71,9 +72,9 @@ function extensionPayload(request: ExtensionRequest): Uint8Array {
|
|
|
71
72
|
function spawnExtension(
|
|
72
73
|
command: string[],
|
|
73
74
|
options: ExchangeOptions,
|
|
74
|
-
):
|
|
75
|
+
): Subprocess {
|
|
75
76
|
try {
|
|
76
|
-
return
|
|
77
|
+
return spawn(command, {
|
|
77
78
|
cwd: options.cwd,
|
|
78
79
|
stdin: "pipe",
|
|
79
80
|
stdout: "pipe",
|
|
@@ -87,22 +88,15 @@ function spawnExtension(
|
|
|
87
88
|
}
|
|
88
89
|
}
|
|
89
90
|
|
|
90
|
-
function extensionWriter(proc:
|
|
91
|
+
function extensionWriter(proc: Subprocess) {
|
|
91
92
|
const stdin = proc.stdin;
|
|
92
93
|
if (!stdin || typeof stdin === "number")
|
|
93
94
|
throw new ExtensionProtocolError("extension pipes are unavailable");
|
|
94
95
|
return stdin;
|
|
95
96
|
}
|
|
96
97
|
|
|
97
|
-
function extensionReaders(proc:
|
|
98
|
+
function extensionReaders(proc: Subprocess) {
|
|
98
99
|
const { stdout, stderr } = proc;
|
|
99
|
-
if (
|
|
100
|
-
!stdout ||
|
|
101
|
-
typeof stdout === "number" ||
|
|
102
|
-
!stderr ||
|
|
103
|
-
typeof stderr === "number"
|
|
104
|
-
)
|
|
105
|
-
throw new ExtensionProtocolError("extension pipes are unavailable");
|
|
106
100
|
return { stdout, stderr };
|
|
107
101
|
}
|
|
108
102
|
|
|
@@ -169,7 +163,7 @@ function assertSuccessfulResponse(
|
|
|
169
163
|
class ExtensionExchange {
|
|
170
164
|
private readonly deadline: ProcessDeadline;
|
|
171
165
|
constructor(
|
|
172
|
-
private readonly proc:
|
|
166
|
+
private readonly proc: Subprocess,
|
|
173
167
|
options: ExchangeOptions,
|
|
174
168
|
timeoutMs: number,
|
|
175
169
|
) {
|
package/src/fixtures/setup.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { spawn, type Subprocess } from "../runtime-process";
|
|
1
2
|
import { mkdir, mkdtemp, rm } from "node:fs/promises";
|
|
2
3
|
import { tmpdir } from "node:os";
|
|
3
4
|
import { delimiter, isAbsolute, join } from "node:path";
|
|
@@ -155,7 +156,7 @@ function executionEnvironment(
|
|
|
155
156
|
}
|
|
156
157
|
|
|
157
158
|
class FixtureSetupExecution {
|
|
158
|
-
private proc:
|
|
159
|
+
private proc: Subprocess | undefined;
|
|
159
160
|
private readonly deadline: ProcessDeadline;
|
|
160
161
|
constructor(
|
|
161
162
|
private readonly setup: FixtureSetup,
|
|
@@ -175,7 +176,7 @@ class FixtureSetupExecution {
|
|
|
175
176
|
}
|
|
176
177
|
|
|
177
178
|
async run(): Promise<void> {
|
|
178
|
-
this.proc =
|
|
179
|
+
this.proc = spawn(this.setup.command, {
|
|
179
180
|
cwd: this.options.workspace,
|
|
180
181
|
env: executionEnvironment(this.setup, this.options, this.home),
|
|
181
182
|
detached: process.platform !== "win32",
|
package/src/git.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { spawn } from "./runtime-process";
|
|
1
2
|
import {
|
|
2
3
|
captureBoundedBytes,
|
|
3
4
|
terminateOwnedProcessGroup,
|
|
@@ -69,7 +70,7 @@ async function gitOutput(
|
|
|
69
70
|
|
|
70
71
|
/** Capture both bounded streams; binary patches remain bytes through stdin. */
|
|
71
72
|
export async function runGit(options: GitOptions): Promise<Buffer> {
|
|
72
|
-
const proc =
|
|
73
|
+
const proc = spawn(gitArguments(options.args), {
|
|
73
74
|
cwd: options.cwd,
|
|
74
75
|
stdin: options.input ?? "ignore",
|
|
75
76
|
stdout: "pipe",
|
package/src/graders/git-head.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { spawn, type Subprocess } from "../runtime-process";
|
|
1
2
|
import { isRecord } from "../value-guards";
|
|
2
3
|
import { lstat } from "node:fs/promises";
|
|
3
4
|
import { join } from "node:path";
|
|
@@ -60,7 +61,7 @@ async function validateGitMetadata(workspace: string): Promise<void> {
|
|
|
60
61
|
class GitHeadExecution {
|
|
61
62
|
private readonly deadline: ProcessDeadline;
|
|
62
63
|
constructor(
|
|
63
|
-
private readonly proc:
|
|
64
|
+
private readonly proc: Subprocess,
|
|
64
65
|
signal: AbortSignal | undefined,
|
|
65
66
|
) {
|
|
66
67
|
this.deadline = new ProcessDeadline({
|
|
@@ -106,7 +107,7 @@ async function git(
|
|
|
106
107
|
): Promise<{ code: number; output: string }> {
|
|
107
108
|
if (signal?.aborted) throw new Error("Git HEAD check cancelled");
|
|
108
109
|
await validateGitMetadata(workspace);
|
|
109
|
-
const proc =
|
|
110
|
+
const proc = spawn(gitArguments(args), {
|
|
110
111
|
cwd: workspace,
|
|
111
112
|
stdin: "ignore",
|
|
112
113
|
stdout: "pipe",
|
package/src/graders/shell.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { spawn, type Subprocess } from "../runtime-process";
|
|
1
2
|
import { runtimeLocalHttpEnabled, runtimeSeedSources } from "../runtime/config";
|
|
2
3
|
import {
|
|
3
4
|
candidateArtifactEnvironment,
|
|
@@ -350,7 +351,7 @@ async function requireShellRuntimeCache(
|
|
|
350
351
|
}
|
|
351
352
|
function shellStdout(
|
|
352
353
|
check: PreparedShellCheck,
|
|
353
|
-
output:
|
|
354
|
+
output: Subprocess["stdout"],
|
|
354
355
|
): ReadableStream<Uint8Array> | null {
|
|
355
356
|
if (!check.captureStdout) return null;
|
|
356
357
|
if (!(output instanceof ReadableStream))
|
|
@@ -358,7 +359,7 @@ function shellStdout(
|
|
|
358
359
|
return output;
|
|
359
360
|
}
|
|
360
361
|
class ShellExecution {
|
|
361
|
-
private proc?:
|
|
362
|
+
private proc?: Subprocess;
|
|
362
363
|
private readonly deadline: ProcessDeadline;
|
|
363
364
|
constructor(
|
|
364
365
|
private check: PreparedShellCheck,
|
|
@@ -396,7 +397,7 @@ class ShellExecution {
|
|
|
396
397
|
}
|
|
397
398
|
}
|
|
398
399
|
private spawn() {
|
|
399
|
-
this.proc =
|
|
400
|
+
this.proc = spawn(this.isolation.argv, {
|
|
400
401
|
cwd: this.options.workspace,
|
|
401
402
|
env: shellEnvironment(this.options, this.runtime),
|
|
402
403
|
detached: true,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { spawn } from "../runtime-process";
|
|
1
2
|
import { existsSync } from "node:fs";
|
|
2
3
|
import {
|
|
3
4
|
MAX_CREDENTIAL_BYTES,
|
|
@@ -38,7 +39,7 @@ async function findItem(
|
|
|
38
39
|
account: string,
|
|
39
40
|
): Promise<Buffer | undefined> {
|
|
40
41
|
requireSecurity();
|
|
41
|
-
const proc =
|
|
42
|
+
const proc = spawn(
|
|
42
43
|
[SECURITY, "find-generic-password", "-a", account, "-s", service, "-w"],
|
|
43
44
|
{ stdout: "pipe", stderr: "ignore" },
|
|
44
45
|
);
|
|
@@ -94,7 +95,7 @@ async function updateItem(
|
|
|
94
95
|
): Promise<void> {
|
|
95
96
|
requireSecurity();
|
|
96
97
|
const { command, stdin } = updateCommand(service, account, bytes);
|
|
97
|
-
const proc =
|
|
98
|
+
const proc = spawn(command, {
|
|
98
99
|
stdin: stdin ?? "ignore",
|
|
99
100
|
stdout: "ignore",
|
|
100
101
|
stderr: "ignore",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { spawn } from "../runtime-process";
|
|
1
2
|
import {
|
|
2
3
|
mkdir,
|
|
3
4
|
mkdtemp,
|
|
@@ -64,7 +65,7 @@ async function requireRefreshCapableClaude(binary: string): Promise<void> {
|
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
async function claudeVersion(binary: string): Promise<number[] | undefined> {
|
|
67
|
-
const proc =
|
|
68
|
+
const proc = spawn([binary, "--version"], {
|
|
68
69
|
stdin: "ignore",
|
|
69
70
|
stdout: "pipe",
|
|
70
71
|
stderr: "ignore",
|
|
@@ -137,7 +138,7 @@ async function runHelper(
|
|
|
137
138
|
binary: string,
|
|
138
139
|
env: Record<string, string>,
|
|
139
140
|
): Promise<number> {
|
|
140
|
-
const proc =
|
|
141
|
+
const proc = spawn([binary, "auth", "login"], {
|
|
141
142
|
env,
|
|
142
143
|
cwd: env.HOME,
|
|
143
144
|
stdin: "ignore",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { setTimeout as sleep } from "node:timers/promises";
|
|
1
2
|
import { mkdir, rmdir, stat, utimes } from "node:fs/promises";
|
|
2
3
|
import { join } from "node:path";
|
|
3
4
|
|
|
@@ -38,7 +39,7 @@ async function acquireLock(lock: string, deadline: number): Promise<void> {
|
|
|
38
39
|
throw new Error(
|
|
39
40
|
"Timed out waiting for another process to refresh the Claude login",
|
|
40
41
|
);
|
|
41
|
-
await
|
|
42
|
+
await sleep(RETRY_MS);
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
45
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { runnerRoot } from "../runner-paths";
|
|
1
2
|
import { isMissingFile } from "../fixtures/tools";
|
|
2
3
|
import { realpath } from "node:fs/promises";
|
|
3
4
|
import { homedir, userInfo } from "node:os";
|
|
4
|
-
import { isAbsolute
|
|
5
|
+
import { isAbsolute } from "node:path";
|
|
5
6
|
import { protectedWorktrees } from "./protected-worktrees";
|
|
6
7
|
import { nativeStateParent } from "../native-transcript-state";
|
|
7
8
|
import { workspaceStateParent } from "../fixtures/workspace-state";
|
|
@@ -23,7 +24,7 @@ async function protectedRootCandidates(options: ProtectedRootsOptions) {
|
|
|
23
24
|
const candidates = [
|
|
24
25
|
await nativeStateParent(),
|
|
25
26
|
await workspaceStateParent(),
|
|
26
|
-
|
|
27
|
+
runnerRoot,
|
|
27
28
|
options.projectRoot,
|
|
28
29
|
options.resultsRoot,
|
|
29
30
|
homedir(),
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { spawn, type Subprocess } from "../runtime-process";
|
|
1
2
|
import { validHostTimeout } from "./native-request";
|
|
2
3
|
import { ProcessDeadline } from "../process-lifecycle";
|
|
3
4
|
import {
|
|
@@ -24,7 +25,7 @@ class HostProcessInterruption extends Error {
|
|
|
24
25
|
|
|
25
26
|
/** Race completion against the host deadline and cancellation, then release listeners. */
|
|
26
27
|
async function awaitHostProcess<T>(
|
|
27
|
-
proc:
|
|
28
|
+
proc: Subprocess,
|
|
28
29
|
completed: Promise<T>,
|
|
29
30
|
options: HostProcessOptions,
|
|
30
31
|
): Promise<T> {
|
|
@@ -123,10 +124,7 @@ export interface HostProcessOptions {
|
|
|
123
124
|
phase?: Phase;
|
|
124
125
|
}
|
|
125
126
|
|
|
126
|
-
async function writeHostInput(
|
|
127
|
-
proc: Bun.Subprocess,
|
|
128
|
-
input?: string,
|
|
129
|
-
): Promise<void> {
|
|
127
|
+
async function writeHostInput(proc: Subprocess, input?: string): Promise<void> {
|
|
130
128
|
if (input === undefined) return;
|
|
131
129
|
if (!proc.stdin || typeof proc.stdin === "number")
|
|
132
130
|
throw new Error("Codex input pipe unavailable");
|
|
@@ -139,7 +137,7 @@ function spawnHostProcess(
|
|
|
139
137
|
capture: HostProcessDiagnostics,
|
|
140
138
|
) {
|
|
141
139
|
try {
|
|
142
|
-
return
|
|
140
|
+
return spawn(options.argv, {
|
|
143
141
|
cwd: options.cwd,
|
|
144
142
|
env: options.env,
|
|
145
143
|
detached: process.platform !== "win32",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { spawnSync } from "../runtime-process";
|
|
1
2
|
import { isMissingFile } from "../fixtures/tools";
|
|
2
3
|
import { lstat, readdir, realpath, stat } from "node:fs/promises";
|
|
3
4
|
import { tmpdir } from "node:os";
|
|
@@ -58,7 +59,7 @@ export async function protectedWorktrees(root: string): Promise<string[]> {
|
|
|
58
59
|
}
|
|
59
60
|
|
|
60
61
|
function listWorktreePaths(repository: string): string[] {
|
|
61
|
-
const result =
|
|
62
|
+
const result = spawnSync(
|
|
62
63
|
["git", "-C", repository, "worktree", "list", "--porcelain", "-z"],
|
|
63
64
|
{
|
|
64
65
|
env: {
|
|
@@ -322,7 +322,7 @@ function validReceiptIdentity(receipt: SkillHookReceipt): boolean {
|
|
|
322
322
|
async function boundedInput(): Promise<unknown> {
|
|
323
323
|
const chunks: Uint8Array[] = [];
|
|
324
324
|
let bytes = 0;
|
|
325
|
-
for await (const chunk of
|
|
325
|
+
for await (const chunk of process.stdin as AsyncIterable<Uint8Array>) {
|
|
326
326
|
bytes += chunk.byteLength;
|
|
327
327
|
if (bytes > MAX_INPUT_BYTES) throw new Error("skill hook input too large");
|
|
328
328
|
chunks.push(chunk);
|
package/src/hosts/skill-hooks.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
1
2
|
import { mkdir, readFile, stat, writeFile } from "node:fs/promises";
|
|
2
3
|
import { join } from "node:path";
|
|
3
4
|
import { shellQuote as quote } from "../shell";
|
|
@@ -43,7 +44,14 @@ export async function prepareSkillTracking(options: {
|
|
|
43
44
|
"-i",
|
|
44
45
|
"PATH=/usr/bin:/bin",
|
|
45
46
|
process.execPath,
|
|
46
|
-
fileURLToPath(
|
|
47
|
+
fileURLToPath(
|
|
48
|
+
new URL(
|
|
49
|
+
import.meta.filename.endsWith(".ts")
|
|
50
|
+
? "./skill-hook-handler.ts"
|
|
51
|
+
: "./skill-hook-handler.js",
|
|
52
|
+
import.meta.url,
|
|
53
|
+
),
|
|
54
|
+
),
|
|
47
55
|
configurationPath,
|
|
48
56
|
]
|
|
49
57
|
.map(quote)
|
|
@@ -140,7 +148,7 @@ function receiptLabels(value: Record<string, unknown>): boolean {
|
|
|
140
148
|
async function receipts(tracking: SkillTracking) {
|
|
141
149
|
const root = tracking.configuration.receipts;
|
|
142
150
|
const result = { events: [] as SkillHookReceipt[], reasons: [] as string[] };
|
|
143
|
-
if (
|
|
151
|
+
if (existsSync(join(root, "partial")))
|
|
144
152
|
result.reasons.push("observer_failure");
|
|
145
153
|
try {
|
|
146
154
|
const path = join(root, "events.jsonl");
|
package/src/provenance.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import { runnerRoot, sourceRuntime } from "./runner-paths";
|
|
2
|
+
import { spawnSync } from "./runtime-process";
|
|
1
3
|
import type { Stats } from "node:fs";
|
|
2
4
|
import { lstat, readFile, readdir, readlink, realpath } from "node:fs/promises";
|
|
3
5
|
import { tmpdir } from "node:os";
|
|
4
6
|
import { dirname, join, relative, resolve, sep } from "node:path";
|
|
5
7
|
import { insideRoot } from "./paths";
|
|
6
8
|
import { pathToFileURL } from "node:url";
|
|
7
|
-
import packageJson from "../package.json";
|
|
9
|
+
import packageJson from "../package.json" with { type: "json" };
|
|
8
10
|
import { hashJson, sha256 } from "./identity";
|
|
9
11
|
import { insideRuntimeRoot } from "./runtime/paths";
|
|
10
12
|
|
|
@@ -49,9 +51,7 @@ class BuildSnapshot {
|
|
|
49
51
|
}
|
|
50
52
|
|
|
51
53
|
/** Digest the packaged runtime and public contract files in path order. */
|
|
52
|
-
export async function packageBuildDigest(
|
|
53
|
-
root = join(import.meta.dir, ".."),
|
|
54
|
-
): Promise<string> {
|
|
54
|
+
export async function packageBuildDigest(root = runnerRoot): Promise<string> {
|
|
55
55
|
const snapshot = new BuildSnapshot(await realpath(root));
|
|
56
56
|
for (const path of [
|
|
57
57
|
"package.json",
|
|
@@ -60,6 +60,7 @@ export async function packageBuildDigest(
|
|
|
60
60
|
"examples",
|
|
61
61
|
"schemas",
|
|
62
62
|
"src",
|
|
63
|
+
...(!sourceRuntime ? ["dist"] : []),
|
|
63
64
|
])
|
|
64
65
|
await snapshot.collect(path);
|
|
65
66
|
return hashJson({
|
|
@@ -138,7 +139,7 @@ export async function projectIdentityDigest(
|
|
|
138
139
|
}
|
|
139
140
|
|
|
140
141
|
function git(root: string, ...arguments_: string[]): Buffer {
|
|
141
|
-
const result =
|
|
142
|
+
const result = spawnSync(["git", "-C", root, ...arguments_], {
|
|
142
143
|
env: { PATH: process.env.PATH ?? "/usr/bin:/bin", LC_ALL: "C" },
|
|
143
144
|
stdout: "pipe",
|
|
144
145
|
stderr: "ignore",
|
|
@@ -308,7 +309,7 @@ export async function runnerProvenance(
|
|
|
308
309
|
checkoutRoot?: string,
|
|
309
310
|
) {
|
|
310
311
|
if (checkoutRoot) {
|
|
311
|
-
const actualRoot = await realpath(
|
|
312
|
+
const actualRoot = await realpath(runnerRoot);
|
|
312
313
|
if ((await realpath(checkoutRoot)) !== actualRoot)
|
|
313
314
|
throw new Error(
|
|
314
315
|
"local Sevro checkout root does not match the running package",
|
package/src/results-lock.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { openLockDatabase } from "./sqlite-lock";
|
|
2
2
|
import { join } from "node:path";
|
|
3
3
|
import { lstat } from "node:fs/promises";
|
|
4
4
|
|
|
@@ -28,10 +28,10 @@ export async function withResultsLock<T>(
|
|
|
28
28
|
/** Hold a root lock while discovering and validating additional nested roots. */
|
|
29
29
|
export async function acquireResultsLock(root: string): Promise<() => void> {
|
|
30
30
|
await retainedFile(join(root, ".retention-lock.sqlite"));
|
|
31
|
-
const database =
|
|
31
|
+
const database = openLockDatabase(join(root, ".retention-lock.sqlite"));
|
|
32
32
|
try {
|
|
33
|
-
database.
|
|
34
|
-
database.
|
|
33
|
+
database.exec("PRAGMA busy_timeout = 5000");
|
|
34
|
+
database.exec("BEGIN IMMEDIATE");
|
|
35
35
|
return () => {
|
|
36
36
|
database.close();
|
|
37
37
|
};
|