@ashlr/hub 3.4.0 → 3.5.1
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/CHANGELOG.md +107 -1
- package/README.md +3 -0
- package/dist/build-identity.json +2 -2
- package/dist/cli/index.js +11 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/local-runtime.js +40 -9
- package/dist/cli/local-runtime.js.map +1 -1
- package/dist/core/fleet/external-skill-audit.js +1 -1
- package/dist/core/fleet/external-skill-audit.js.map +1 -1
- package/dist/core/local-eval/classify.d.ts +57 -0
- package/dist/core/local-eval/classify.js +121 -0
- package/dist/core/local-eval/classify.js.map +1 -0
- package/dist/core/local-eval/configuration.d.ts +37 -0
- package/dist/core/local-eval/configuration.js +171 -0
- package/dist/core/local-eval/configuration.js.map +1 -0
- package/dist/core/local-eval/index.d.ts +15 -0
- package/dist/core/local-eval/index.js +16 -0
- package/dist/core/local-eval/index.js.map +1 -0
- package/dist/core/local-eval/main.d.ts +31 -0
- package/dist/core/local-eval/main.js +174 -0
- package/dist/core/local-eval/main.js.map +1 -0
- package/dist/core/local-eval/report.d.ts +25 -0
- package/dist/core/local-eval/report.js +157 -0
- package/dist/core/local-eval/report.js.map +1 -0
- package/dist/core/local-eval/runner.d.ts +55 -0
- package/dist/core/local-eval/runner.js +290 -0
- package/dist/core/local-eval/runner.js.map +1 -0
- package/dist/core/local-eval/tasks.d.ts +22 -0
- package/dist/core/local-eval/tasks.js +303 -0
- package/dist/core/local-eval/tasks.js.map +1 -0
- package/dist/core/local-eval/trace.d.ts +67 -0
- package/dist/core/local-eval/trace.js +309 -0
- package/dist/core/local-eval/trace.js.map +1 -0
- package/dist/core/local-eval/types.d.ts +262 -0
- package/dist/core/local-eval/types.js +23 -0
- package/dist/core/local-eval/types.js.map +1 -0
- package/dist/core/local-runtime/llama/anthropic-proxy-host.d.ts +68 -0
- package/dist/core/local-runtime/llama/anthropic-proxy-host.js +120 -0
- package/dist/core/local-runtime/llama/anthropic-proxy-host.js.map +1 -0
- package/dist/core/local-runtime/llama/anthropic-proxy-process.d.ts +15 -0
- package/dist/core/local-runtime/llama/anthropic-proxy-process.js +21 -0
- package/dist/core/local-runtime/llama/anthropic-proxy-process.js.map +1 -0
- package/dist/core/local-runtime/llama/anthropic-proxy.d.ts +2 -1
- package/dist/core/local-runtime/llama/anthropic-proxy.js +14 -6
- package/dist/core/local-runtime/llama/anthropic-proxy.js.map +1 -1
- package/dist/core/local-runtime/llama/anthropic-shim.d.ts +33 -0
- package/dist/core/local-runtime/llama/anthropic-shim.js +59 -0
- package/dist/core/local-runtime/llama/anthropic-shim.js.map +1 -1
- package/dist/core/local-runtime/llama/config.d.ts +123 -6
- package/dist/core/local-runtime/llama/config.js +196 -6
- package/dist/core/local-runtime/llama/config.js.map +1 -1
- package/dist/core/local-runtime/llama/index.d.ts +15 -0
- package/dist/core/local-runtime/llama/index.js +13 -0
- package/dist/core/local-runtime/llama/index.js.map +1 -1
- package/dist/core/local-runtime/llama/paths.d.ts +17 -0
- package/dist/core/local-runtime/llama/paths.js +25 -0
- package/dist/core/local-runtime/llama/paths.js.map +1 -1
- package/dist/core/local-runtime/llama/proxy-invocation.d.ts +101 -0
- package/dist/core/local-runtime/llama/proxy-invocation.js +134 -0
- package/dist/core/local-runtime/llama/proxy-invocation.js.map +1 -0
- package/dist/core/local-runtime/llama/proxy-launchd.d.ts +83 -0
- package/dist/core/local-runtime/llama/proxy-launchd.js +216 -0
- package/dist/core/local-runtime/llama/proxy-launchd.js.map +1 -0
- package/dist/core/local-runtime/llama/shapes.d.ts +2 -1
- package/dist/core/local-runtime/llama/shapes.js +2 -1
- package/dist/core/local-runtime/llama/shapes.js.map +1 -1
- package/dist/core/verse/adapters/claude.js +16 -0
- package/dist/core/verse/adapters/claude.js.map +1 -1
- package/dist/core/verse/adapters/codex.js +60 -2
- package/dist/core/verse/adapters/codex.js.map +1 -1
- package/dist/core/verse/adapters/grok.js +13 -0
- package/dist/core/verse/adapters/grok.js.map +1 -1
- package/dist/core/verse/control-api.d.ts +8 -9
- package/dist/core/verse/control-api.js +14 -114
- package/dist/core/verse/control-api.js.map +1 -1
- package/dist/core/verse/github-api.d.ts +50 -0
- package/dist/core/verse/github-api.js +211 -0
- package/dist/core/verse/github-api.js.map +1 -0
- package/dist/core/verse/github-proposal.d.ts +64 -0
- package/dist/core/verse/github-proposal.js +186 -0
- package/dist/core/verse/github-proposal.js.map +1 -0
- package/dist/core/verse/github-repo.d.ts +104 -0
- package/dist/core/verse/github-repo.js +476 -0
- package/dist/core/verse/github-repo.js.map +1 -0
- package/dist/core/verse/github-types.d.ts +174 -0
- package/dist/core/verse/github-types.js +31 -0
- package/dist/core/verse/github-types.js.map +1 -0
- package/dist/core/verse/mcp-cli-health.d.ts +149 -0
- package/dist/core/verse/mcp-cli-health.js +227 -0
- package/dist/core/verse/mcp-cli-health.js.map +1 -0
- package/dist/core/verse/mcp-control-api.d.ts +68 -0
- package/dist/core/verse/mcp-control-api.js +322 -0
- package/dist/core/verse/mcp-control-api.js.map +1 -0
- package/dist/core/verse/mcp-mutation.d.ts +187 -0
- package/dist/core/verse/mcp-mutation.js +471 -0
- package/dist/core/verse/mcp-mutation.js.map +1 -0
- package/dist/core/verse/mcp-scope.d.ts +114 -0
- package/dist/core/verse/mcp-scope.js +149 -0
- package/dist/core/verse/mcp-scope.js.map +1 -0
- package/dist/core/verse/mcp-seat-view.d.ts +197 -0
- package/dist/core/verse/mcp-seat-view.js +322 -0
- package/dist/core/verse/mcp-seat-view.js.map +1 -0
- package/dist/core/verse/path-guard.d.ts +115 -0
- package/dist/core/verse/path-guard.js +171 -0
- package/dist/core/verse/path-guard.js.map +1 -0
- package/dist/core/verse/seats.js +30 -2
- package/dist/core/verse/seats.js.map +1 -1
- package/dist/core/verse/session-engine.js +60 -1
- package/dist/core/verse/session-engine.js.map +1 -1
- package/dist/core/verse/session-store.js +20 -0
- package/dist/core/verse/session-store.js.map +1 -1
- package/dist/core/verse/types.d.ts +225 -1
- package/dist/core/verse/types.js +26 -0
- package/dist/core/verse/types.js.map +1 -1
- package/dist/core/verse/verse-api.d.ts +16 -1
- package/dist/core/verse/verse-api.js +338 -16
- package/dist/core/verse/verse-api.js.map +1 -1
- package/dist/core/verse/workspaces.d.ts +130 -0
- package/dist/core/verse/workspaces.js +501 -0
- package/dist/core/verse/workspaces.js.map +1 -0
- package/dist/core/web/api.js +23 -0
- package/dist/core/web/api.js.map +1 -1
- package/dist/core/web/public/next/assets/App-BbVoUCIi.js +7 -0
- package/dist/core/web/public/next/assets/App-BbVoUCIi.js.map +1 -0
- package/dist/core/web/public/next/assets/App-Cgi6j1Gk.css +1 -0
- package/dist/core/web/public/next/assets/ApprovalsSection-BW9iVjUa.js +2 -0
- package/dist/core/web/public/next/assets/ApprovalsSection-BW9iVjUa.js.map +1 -0
- package/dist/core/web/public/next/assets/ApprovalsSection-Su-NUTis.css +1 -0
- package/dist/core/web/public/next/assets/AutonomySection-CRqHUhED.js +2 -0
- package/dist/core/web/public/next/assets/AutonomySection-CRqHUhED.js.map +1 -0
- package/dist/core/web/public/next/assets/AutonomySection-Cpk_oEhc.css +1 -0
- package/dist/core/web/public/next/assets/ChatSection-5irrh6Jw.js +80 -0
- package/dist/core/web/public/next/assets/ChatSection-5irrh6Jw.js.map +1 -0
- package/dist/core/web/public/next/assets/ChatSection-LQiAn6Eu.css +1 -0
- package/dist/core/web/public/next/assets/ConfirmDialog-CXevY3Au.js +2 -0
- package/dist/core/web/public/next/assets/ConfirmDialog-CXevY3Au.js.map +1 -0
- package/dist/core/web/public/next/assets/{ConfirmDialog-cYuivhCX.css → ConfirmDialog-Dx15x0Ho.css} +1 -1
- package/dist/core/web/public/next/assets/Dialog-Bn0CgEGz.js +2 -0
- package/dist/core/web/public/next/assets/Dialog-Bn0CgEGz.js.map +1 -0
- package/dist/core/web/public/next/assets/Dialog-tQ8kFulD.css +1 -0
- package/dist/core/web/public/next/assets/DiffViewer-C8HHTnVE.css +1 -0
- package/dist/core/web/public/next/assets/DiffViewer-QKyisN2L.js +7 -0
- package/dist/core/web/public/next/assets/DiffViewer-QKyisN2L.js.map +1 -0
- package/dist/core/web/public/next/assets/{MutationTokenDialog-jWLLCxWn.css → MutationTokenDialog-CrfJ0PdD.css} +1 -1
- package/dist/core/web/public/next/assets/MutationTokenDialog-DbSHPy3w.js +2 -0
- package/dist/core/web/public/next/assets/MutationTokenDialog-DbSHPy3w.js.map +1 -0
- package/dist/core/web/public/next/assets/ResourcePoolConsoleApp-C-PCgCzo.js +7 -0
- package/dist/core/web/public/next/assets/ResourcePoolConsoleApp-C-PCgCzo.js.map +1 -0
- package/dist/core/web/public/next/assets/ResourcePoolConsoleApp-CM_8pJs6.css +1 -0
- package/dist/core/web/public/next/assets/RouteErrorBoundary-Dw8ZjmkS.js +2 -0
- package/dist/core/web/public/next/assets/RouteErrorBoundary-Dw8ZjmkS.js.map +1 -0
- package/dist/core/web/public/next/assets/RouteErrorBoundary-ekyMXAK8.css +1 -0
- package/dist/core/web/public/next/assets/SettingsSection-BII7TTSD.css +1 -0
- package/dist/core/web/public/next/assets/SettingsSection-CWxtTNlD.js +2 -0
- package/dist/core/web/public/next/assets/SettingsSection-CWxtTNlD.js.map +1 -0
- package/dist/core/web/public/next/assets/UniverseConsoleApp-Bk5HipM0.js +2 -0
- package/dist/core/web/public/next/assets/UniverseConsoleApp-Bk5HipM0.js.map +1 -0
- package/dist/core/web/public/next/assets/UniverseConsoleApp-Dh7A-hLD.css +1 -0
- package/dist/core/web/public/next/assets/UniverseView-Bqa8DH57.css +1 -0
- package/dist/core/web/public/next/assets/UniverseView-D8k9q0ce.js +9 -0
- package/dist/core/web/public/next/assets/UniverseView-D8k9q0ce.js.map +1 -0
- package/dist/core/web/public/next/assets/UsageSection-B2E06ZH1.js +2 -0
- package/dist/core/web/public/next/assets/UsageSection-B2E06ZH1.js.map +1 -0
- package/dist/core/web/public/next/assets/UsageSection-DwgNOYvi.css +1 -0
- package/dist/core/web/public/next/assets/VerseConsoleApp-CRfZUV-T.js +3 -0
- package/dist/core/web/public/next/assets/VerseConsoleApp-CRfZUV-T.js.map +1 -0
- package/dist/core/web/public/next/assets/VerseConsoleApp-D2E3mU9a.css +1 -0
- package/dist/core/web/public/next/assets/charts-CsrtT4rk.css +1 -0
- package/dist/core/web/public/next/assets/charts-DSUpczxG.js +2 -0
- package/dist/core/web/public/next/assets/charts-DSUpczxG.js.map +1 -0
- package/dist/core/web/public/next/assets/fleet-model-ClBbQ0Uj.js +2 -0
- package/dist/core/web/public/next/assets/fleet-model-ClBbQ0Uj.js.map +1 -0
- package/dist/core/web/public/next/assets/format-BNYWGJat.js +2 -0
- package/dist/core/web/public/next/assets/format-BNYWGJat.js.map +1 -0
- package/dist/core/web/public/next/assets/global-C4jfYHrj.js +2 -0
- package/dist/core/web/public/next/assets/global-C4jfYHrj.js.map +1 -0
- package/dist/core/web/public/next/assets/global-D463gG1X.css +1 -0
- package/dist/core/web/public/next/assets/icons-BxOX8-XB.js +2 -0
- package/dist/core/web/public/next/assets/icons-BxOX8-XB.js.map +1 -0
- package/dist/core/web/public/next/assets/index-BMRIET7F.js +11 -0
- package/dist/core/web/public/next/assets/index-BMRIET7F.js.map +1 -0
- package/dist/core/web/public/next/assets/queries-AxnVa02h.js +2 -0
- package/dist/core/web/public/next/assets/queries-AxnVa02h.js.map +1 -0
- package/dist/core/web/public/next/assets/use-guarded-action-BO6c94Wp.js +2 -0
- package/dist/core/web/public/next/assets/use-guarded-action-BO6c94Wp.js.map +1 -0
- package/dist/core/web/public/next/assets/verse-model-CvtK6vP6.js +2 -0
- package/dist/core/web/public/next/assets/verse-model-CvtK6vP6.js.map +1 -0
- package/dist/core/web/public/next/assets/workspace-model-cE4LkKpE.js +2 -0
- package/dist/core/web/public/next/assets/workspace-model-cE4LkKpE.js.map +1 -0
- package/dist/core/web/public/next/index.html +1 -1
- package/dist/release-dependency-inventory.json +1 -1
- package/docs/README.md +4 -0
- package/node_modules/marked/README.md +8 -0
- package/node_modules/marked/bin/main.js +12 -11
- package/node_modules/marked/lib/marked.d.ts +88 -25
- package/node_modules/marked/lib/marked.esm.js +50 -44
- package/node_modules/marked/lib/marked.esm.js.map +3 -3
- package/node_modules/marked/lib/marked.umd.js +50 -44
- package/node_modules/marked/lib/marked.umd.js.map +3 -3
- package/node_modules/marked/man/marked.1 +1 -1
- package/node_modules/marked/package.json +21 -21
- package/package.json +13 -8
- package/dist/cli/activation.d.ts +0 -41
- package/dist/cli/activation.js +0 -485
- package/dist/cli/activation.js.map +0 -1
- package/dist/core/fleet/generated-repair-resolution.d.ts +0 -36
- package/dist/core/fleet/generated-repair-resolution.js +0 -245
- package/dist/core/fleet/generated-repair-resolution.js.map +0 -1
- package/dist/core/local-runtime/llama/port.d.ts +0 -17
- package/dist/core/local-runtime/llama/port.js +0 -47
- package/dist/core/local-runtime/llama/port.js.map +0 -1
- package/dist/core/local-runtime/llama/proxy-host.d.ts +0 -54
- package/dist/core/local-runtime/llama/proxy-host.js +0 -159
- package/dist/core/local-runtime/llama/proxy-host.js.map +0 -1
- package/dist/core/local-runtime/llama/proxy-process.d.ts +0 -148
- package/dist/core/local-runtime/llama/proxy-process.js +0 -250
- package/dist/core/local-runtime/llama/proxy-process.js.map +0 -1
- package/dist/core/local-runtime/llama/proxy-record.d.ts +0 -40
- package/dist/core/local-runtime/llama/proxy-record.js +0 -133
- package/dist/core/local-runtime/llama/proxy-record.js.map +0 -1
- package/dist/core/local-runtime/llama/proxy-supervisor.d.ts +0 -118
- package/dist/core/local-runtime/llama/proxy-supervisor.js +0 -511
- package/dist/core/local-runtime/llama/proxy-supervisor.js.map +0 -1
- package/dist/core/web/public/next/assets/App-BCKqSppK.css +0 -1
- package/dist/core/web/public/next/assets/App-LuILXjWG.js +0 -16
- package/dist/core/web/public/next/assets/App-LuILXjWG.js.map +0 -1
- package/dist/core/web/public/next/assets/ApprovalsSection-B_Xor8JH.js +0 -2
- package/dist/core/web/public/next/assets/ApprovalsSection-B_Xor8JH.js.map +0 -1
- package/dist/core/web/public/next/assets/ApprovalsSection-CRP59wSb.css +0 -1
- package/dist/core/web/public/next/assets/AutonomySection-BB8RD-tv.css +0 -1
- package/dist/core/web/public/next/assets/AutonomySection-BEwITtPJ.js +0 -2
- package/dist/core/web/public/next/assets/AutonomySection-BEwITtPJ.js.map +0 -1
- package/dist/core/web/public/next/assets/ChatSection-DrxqhBPK.css +0 -1
- package/dist/core/web/public/next/assets/ChatSection-bRAzlMth.js +0 -77
- package/dist/core/web/public/next/assets/ChatSection-bRAzlMth.js.map +0 -1
- package/dist/core/web/public/next/assets/ConfirmDialog-BqkZdPs_.js +0 -2
- package/dist/core/web/public/next/assets/ConfirmDialog-BqkZdPs_.js.map +0 -1
- package/dist/core/web/public/next/assets/Dialog-CPmedg4S.js +0 -2
- package/dist/core/web/public/next/assets/Dialog-CPmedg4S.js.map +0 -1
- package/dist/core/web/public/next/assets/Dialog-DxN7RgB5.css +0 -1
- package/dist/core/web/public/next/assets/DiffViewer-DmPJbeM_.js +0 -7
- package/dist/core/web/public/next/assets/DiffViewer-DmPJbeM_.js.map +0 -1
- package/dist/core/web/public/next/assets/DiffViewer-hN7X6wGT.css +0 -1
- package/dist/core/web/public/next/assets/Epistemic-DiyMyeaN.css +0 -1
- package/dist/core/web/public/next/assets/Epistemic-M3SxLHjq.js +0 -2
- package/dist/core/web/public/next/assets/Epistemic-M3SxLHjq.js.map +0 -1
- package/dist/core/web/public/next/assets/Meter-CGBsbXUX.css +0 -1
- package/dist/core/web/public/next/assets/Meter-D_X7c9U3.js +0 -2
- package/dist/core/web/public/next/assets/Meter-D_X7c9U3.js.map +0 -1
- package/dist/core/web/public/next/assets/MutationTokenDialog-Ba5ZHu-8.js +0 -2
- package/dist/core/web/public/next/assets/MutationTokenDialog-Ba5ZHu-8.js.map +0 -1
- package/dist/core/web/public/next/assets/RefreshIndicator-O7jUBOmX.css +0 -1
- package/dist/core/web/public/next/assets/RefreshIndicator-vHGpmyzb.js +0 -2
- package/dist/core/web/public/next/assets/RefreshIndicator-vHGpmyzb.js.map +0 -1
- package/dist/core/web/public/next/assets/ResourcePoolConsoleApp-B5g6JEVk.js +0 -7
- package/dist/core/web/public/next/assets/ResourcePoolConsoleApp-B5g6JEVk.js.map +0 -1
- package/dist/core/web/public/next/assets/ResourcePoolConsoleApp-DLl4DbGG.css +0 -1
- package/dist/core/web/public/next/assets/RouteErrorBoundary-BIpdnxp-.css +0 -1
- package/dist/core/web/public/next/assets/RouteErrorBoundary-CroxuKoi.js +0 -2
- package/dist/core/web/public/next/assets/RouteErrorBoundary-CroxuKoi.js.map +0 -1
- package/dist/core/web/public/next/assets/SettingsSection-DGJMdUh2.css +0 -1
- package/dist/core/web/public/next/assets/SettingsSection-p-7FCGfn.js +0 -2
- package/dist/core/web/public/next/assets/SettingsSection-p-7FCGfn.js.map +0 -1
- package/dist/core/web/public/next/assets/Skeleton-4qq4HuJO.js +0 -2
- package/dist/core/web/public/next/assets/Skeleton-4qq4HuJO.js.map +0 -1
- package/dist/core/web/public/next/assets/Skeleton-D2JaTXyv.css +0 -1
- package/dist/core/web/public/next/assets/StatusBadge-BbEdqEGn.js +0 -2
- package/dist/core/web/public/next/assets/StatusBadge-BbEdqEGn.js.map +0 -1
- package/dist/core/web/public/next/assets/StatusBadge-TpDqZf6K.css +0 -1
- package/dist/core/web/public/next/assets/TableView-R6Yeztp1.css +0 -1
- package/dist/core/web/public/next/assets/TableView-nyYs7Sv1.js +0 -2
- package/dist/core/web/public/next/assets/TableView-nyYs7Sv1.js.map +0 -1
- package/dist/core/web/public/next/assets/UniverseConsoleApp-CiZZxRPV.css +0 -1
- package/dist/core/web/public/next/assets/UniverseConsoleApp-DjTpQUrA.js +0 -2
- package/dist/core/web/public/next/assets/UniverseConsoleApp-DjTpQUrA.js.map +0 -1
- package/dist/core/web/public/next/assets/UniverseView-BtApwayT.js +0 -9
- package/dist/core/web/public/next/assets/UniverseView-BtApwayT.js.map +0 -1
- package/dist/core/web/public/next/assets/UniverseView-gBxl6yum.css +0 -1
- package/dist/core/web/public/next/assets/UsageSection-Db99N6ao.js +0 -2
- package/dist/core/web/public/next/assets/UsageSection-Db99N6ao.js.map +0 -1
- package/dist/core/web/public/next/assets/UsageSection-UUYDidOg.css +0 -1
- package/dist/core/web/public/next/assets/VerseConsoleApp-COa3J2dO.js +0 -3
- package/dist/core/web/public/next/assets/VerseConsoleApp-COa3J2dO.js.map +0 -1
- package/dist/core/web/public/next/assets/VerseConsoleApp-mOAXvWa6.css +0 -1
- package/dist/core/web/public/next/assets/fleet-model-DXCfVtNW.js +0 -2
- package/dist/core/web/public/next/assets/fleet-model-DXCfVtNW.js.map +0 -1
- package/dist/core/web/public/next/assets/format-fggwu_Rs.js +0 -2
- package/dist/core/web/public/next/assets/format-fggwu_Rs.js.map +0 -1
- package/dist/core/web/public/next/assets/global-BeRYd1Bu.css +0 -1
- package/dist/core/web/public/next/assets/global-CNVapoV1.js +0 -2
- package/dist/core/web/public/next/assets/global-CNVapoV1.js.map +0 -1
- package/dist/core/web/public/next/assets/index-BkUlX2Se.js +0 -51
- package/dist/core/web/public/next/assets/index-BkUlX2Se.js.map +0 -1
- package/dist/core/web/public/next/assets/index-YNTgDG2b.js +0 -2
- package/dist/core/web/public/next/assets/index-YNTgDG2b.js.map +0 -1
- package/dist/core/web/public/next/assets/queries-C9XS4SYq.js +0 -2
- package/dist/core/web/public/next/assets/queries-C9XS4SYq.js.map +0 -1
- package/dist/core/web/public/next/assets/use-guarded-action-Bqa2v0a-.css +0 -1
- package/dist/core/web/public/next/assets/use-guarded-action-Bql1nA-z.js +0 -2
- package/dist/core/web/public/next/assets/use-guarded-action-Bql1nA-z.js.map +0 -1
- package/dist/core/web/public/next/assets/verse-model-IrNQKtER.js +0 -2
- package/dist/core/web/public/next/assets/verse-model-IrNQKtER.js.map +0 -1
- package/node_modules/which/CHANGELOG.md +0 -166
- /package/node_modules/marked/{LICENSE.md → LICENSE} +0 -0
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Watching the wire, so a trial that produces no result JSON is still legible.
|
|
3
|
+
*
|
|
4
|
+
* WHY THIS EXISTS. The agent CLI emits its result JSON once, at the end. A
|
|
5
|
+
* trial killed at the wall-clock budget therefore records zero tokens, zero
|
|
6
|
+
* turns and an empty transcript — the harness could say a trial hung, and
|
|
7
|
+
* nothing whatsoever about WHERE. That is the same shape of useless outcome as
|
|
8
|
+
* the false-success problem this harness was built to catch: a verdict nobody
|
|
9
|
+
* can act on.
|
|
10
|
+
*
|
|
11
|
+
* The fix is to stop relying on the end of the run for evidence. This module
|
|
12
|
+
* inserts a proxy between the agent and whatever it was pointed at, and records
|
|
13
|
+
* every request, every byte of every response, and — the fact that turns out to
|
|
14
|
+
* matter — whether a stream ever reached its terminator.
|
|
15
|
+
*
|
|
16
|
+
* A PURE OBSERVER. It forwards bytes, headers and status untouched and adds no
|
|
17
|
+
* timeout of its own. It is deliberately NOT the normalising shim: it composes
|
|
18
|
+
* in front of whatever base URL the run already uses, so switching tracing on
|
|
19
|
+
* cannot change what the model is asked or what the agent receives. An
|
|
20
|
+
* instrument that alters the thing it measures is worse than no instrument.
|
|
21
|
+
*
|
|
22
|
+
* NO ASSUMPTIONS ABOUT BLAME. `diagnoseTimeout` reports what the wire showed
|
|
23
|
+
* and nothing more: a stream still delivering tokens when the clock ran out is
|
|
24
|
+
* reported as exactly that, not as "the model is too slow".
|
|
25
|
+
*/
|
|
26
|
+
import { createWriteStream } from 'node:fs';
|
|
27
|
+
import { mkdir, writeFile } from 'node:fs/promises';
|
|
28
|
+
import { createServer, request as httpRequest } from 'node:http';
|
|
29
|
+
import { join } from 'node:path';
|
|
30
|
+
const DEFAULT_STALL_MS = 120_000;
|
|
31
|
+
/** Records SSE event names out of a byte stream, tolerating split chunks. */
|
|
32
|
+
class EventCounter {
|
|
33
|
+
counts;
|
|
34
|
+
tail = '';
|
|
35
|
+
constructor(counts) {
|
|
36
|
+
this.counts = counts;
|
|
37
|
+
}
|
|
38
|
+
push(chunk) {
|
|
39
|
+
this.tail += chunk.toString('utf8');
|
|
40
|
+
for (;;) {
|
|
41
|
+
const nl = this.tail.indexOf('\n');
|
|
42
|
+
if (nl < 0)
|
|
43
|
+
break;
|
|
44
|
+
const line = this.tail.slice(0, nl);
|
|
45
|
+
this.tail = this.tail.slice(nl + 1);
|
|
46
|
+
const match = /^event:\s*(\S+)/.exec(line);
|
|
47
|
+
if (match?.[1])
|
|
48
|
+
this.counts.set(match[1], (this.counts.get(match[1]) ?? 0) + 1);
|
|
49
|
+
}
|
|
50
|
+
// A pathological single line must not grow without bound.
|
|
51
|
+
if (this.tail.length > 64_000)
|
|
52
|
+
this.tail = this.tail.slice(-1_000);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Start a tracing proxy in front of `upstream`.
|
|
57
|
+
*
|
|
58
|
+
* Binds an ephemeral port, so any number of trials can trace at once without
|
|
59
|
+
* agreeing on port numbers — which matters because the harness runs trials
|
|
60
|
+
* concurrently by default.
|
|
61
|
+
*/
|
|
62
|
+
export async function startTrace(opts) {
|
|
63
|
+
const upstream = new URL(opts.upstream);
|
|
64
|
+
const stallMs = opts.stallMs ?? DEFAULT_STALL_MS;
|
|
65
|
+
await mkdir(opts.captureDir, { recursive: true });
|
|
66
|
+
const journal = join(opts.captureDir, 'wire.jsonl');
|
|
67
|
+
const finished = [];
|
|
68
|
+
const live = new Map();
|
|
69
|
+
const sockets = new Set();
|
|
70
|
+
/** Writes still in flight. `close()` waits on them so the capture is whole. */
|
|
71
|
+
const pending = new Set();
|
|
72
|
+
const track = (p) => {
|
|
73
|
+
const settled = p.catch(() => undefined);
|
|
74
|
+
pending.add(settled);
|
|
75
|
+
void settled.finally(() => pending.delete(settled));
|
|
76
|
+
};
|
|
77
|
+
let seq = 0;
|
|
78
|
+
// One stream, not repeated appends: concurrent `appendFile` calls have no
|
|
79
|
+
// ordering guarantee, and a journal whose lines interleave is not forensics.
|
|
80
|
+
// Errors are swallowed — a write failure must never take down the run this is
|
|
81
|
+
// only observing.
|
|
82
|
+
const log = createWriteStream(journal, { flags: 'a' });
|
|
83
|
+
log.on('error', () => undefined);
|
|
84
|
+
const note = (entry) => {
|
|
85
|
+
log.write(`${JSON.stringify({ at: new Date().toISOString(), ...entry })}\n`);
|
|
86
|
+
};
|
|
87
|
+
const settle = (state, how, upstreamComplete) => {
|
|
88
|
+
if (!live.delete(state.seq))
|
|
89
|
+
return;
|
|
90
|
+
const capture = state.capture;
|
|
91
|
+
state.capture = null;
|
|
92
|
+
if (capture) {
|
|
93
|
+
track(new Promise((resolve) => { capture.end(() => resolve()); }));
|
|
94
|
+
}
|
|
95
|
+
const record = {
|
|
96
|
+
seq: state.seq,
|
|
97
|
+
url: state.url,
|
|
98
|
+
status: state.status,
|
|
99
|
+
ended: how,
|
|
100
|
+
bytes: state.bytes,
|
|
101
|
+
events: Object.fromEntries(state.events),
|
|
102
|
+
sawTerminator: (state.events.get('message_stop') ?? 0) > 0,
|
|
103
|
+
upstreamComplete,
|
|
104
|
+
waitedForFirstByteMs: state.firstByteAt === null ? null : state.firstByteAt - state.startedAt,
|
|
105
|
+
idleAtEndMs: state.lastByteAt === null ? null : Date.now() - state.lastByteAt,
|
|
106
|
+
durationMs: Date.now() - state.startedAt,
|
|
107
|
+
};
|
|
108
|
+
finished.push(record);
|
|
109
|
+
note({ kind: 'stream-end', ...record });
|
|
110
|
+
};
|
|
111
|
+
const server = createServer((req, res) => {
|
|
112
|
+
const chunks = [];
|
|
113
|
+
req.on('data', (c) => chunks.push(c));
|
|
114
|
+
req.on('end', () => {
|
|
115
|
+
const index = seq;
|
|
116
|
+
seq += 1;
|
|
117
|
+
const tag = String(index).padStart(4, '0');
|
|
118
|
+
const body = Buffer.concat(chunks);
|
|
119
|
+
const state = {
|
|
120
|
+
seq: index, url: req.url ?? '', startedAt: Date.now(),
|
|
121
|
+
firstByteAt: null, lastByteAt: null, bytes: 0, status: null, events: new Map(),
|
|
122
|
+
capture: null,
|
|
123
|
+
};
|
|
124
|
+
live.set(index, state);
|
|
125
|
+
if (body.length > 0)
|
|
126
|
+
track(writeFile(join(opts.captureDir, `req-${tag}.json`), body));
|
|
127
|
+
note({ kind: 'request', seq: index, method: req.method, url: req.url, bytes: body.length });
|
|
128
|
+
const headers = { 'content-type': 'application/json' };
|
|
129
|
+
if (typeof req.headers.accept === 'string')
|
|
130
|
+
headers['accept'] = req.headers.accept;
|
|
131
|
+
if (body.length > 0)
|
|
132
|
+
headers['content-length'] = body.length;
|
|
133
|
+
const forwarded = httpRequest({
|
|
134
|
+
protocol: upstream.protocol,
|
|
135
|
+
hostname: upstream.hostname,
|
|
136
|
+
port: upstream.port,
|
|
137
|
+
path: req.url,
|
|
138
|
+
method: req.method,
|
|
139
|
+
headers,
|
|
140
|
+
}, (up) => {
|
|
141
|
+
state.status = up.statusCode ?? null;
|
|
142
|
+
note({ kind: 'response-head', seq: index, status: up.statusCode,
|
|
143
|
+
waitedMs: Date.now() - state.startedAt });
|
|
144
|
+
res.writeHead(up.statusCode ?? 502, {
|
|
145
|
+
'content-type': String(up.headers['content-type'] ?? 'application/json'),
|
|
146
|
+
});
|
|
147
|
+
const counter = new EventCounter(state.events);
|
|
148
|
+
state.capture = createWriteStream(join(opts.captureDir, `res-${tag}.sse`));
|
|
149
|
+
state.capture.on('error', () => undefined);
|
|
150
|
+
up.on('data', (chunk) => {
|
|
151
|
+
const now = Date.now();
|
|
152
|
+
if (state.firstByteAt === null)
|
|
153
|
+
state.firstByteAt = now;
|
|
154
|
+
state.lastByteAt = now;
|
|
155
|
+
state.bytes += chunk.length;
|
|
156
|
+
counter.push(chunk);
|
|
157
|
+
state.capture?.write(chunk);
|
|
158
|
+
res.write(chunk);
|
|
159
|
+
});
|
|
160
|
+
up.on('end', () => { settle(state, 'upstream-end', up.complete); res.end(); });
|
|
161
|
+
up.on('aborted', () => { settle(state, 'upstream-aborted', false); res.destroy(); });
|
|
162
|
+
up.on('error', (err) => {
|
|
163
|
+
note({ kind: 'upstream-error', seq: index, error: String(err) });
|
|
164
|
+
settle(state, 'upstream-error', false);
|
|
165
|
+
res.destroy();
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
forwarded.on('error', (err) => {
|
|
169
|
+
note({ kind: 'connect-error', seq: index, error: String(err) });
|
|
170
|
+
settle(state, 'upstream-error', false);
|
|
171
|
+
if (!res.headersSent)
|
|
172
|
+
res.writeHead(502, { 'content-type': 'application/json' });
|
|
173
|
+
res.end(JSON.stringify({ error: String(err) }));
|
|
174
|
+
});
|
|
175
|
+
// The agent hanging up first is itself evidence — it is how a client-side
|
|
176
|
+
// give-up is told apart from a server that stopped writing.
|
|
177
|
+
res.on('close', () => {
|
|
178
|
+
if (live.has(index)) {
|
|
179
|
+
settle(state, 'client-closed', false);
|
|
180
|
+
forwarded.destroy();
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
if (body.length > 0)
|
|
184
|
+
forwarded.end(body);
|
|
185
|
+
else
|
|
186
|
+
forwarded.end();
|
|
187
|
+
});
|
|
188
|
+
});
|
|
189
|
+
server.on('connection', (socket) => {
|
|
190
|
+
sockets.add(socket);
|
|
191
|
+
socket.on('close', () => sockets.delete(socket));
|
|
192
|
+
});
|
|
193
|
+
await new Promise((resolve) => server.listen(0, '127.0.0.1', resolve));
|
|
194
|
+
const address = server.address();
|
|
195
|
+
const port = typeof address === 'object' && address ? address.port : 0;
|
|
196
|
+
return {
|
|
197
|
+
baseUrl: `http://127.0.0.1:${port}`,
|
|
198
|
+
snapshot: () => buildTrace({ finished, live, stallMs, captureDir: opts.captureDir }),
|
|
199
|
+
close: async () => {
|
|
200
|
+
for (const state of [...live.values()])
|
|
201
|
+
settle(state, 'client-closed', false);
|
|
202
|
+
for (const socket of sockets)
|
|
203
|
+
socket.destroy();
|
|
204
|
+
await new Promise((resolve) => server.close(() => resolve()));
|
|
205
|
+
// The capture is the evidence, so it is flushed before the handle is
|
|
206
|
+
// considered closed — a caller that reads it next must find it whole.
|
|
207
|
+
await Promise.allSettled([...pending]);
|
|
208
|
+
await new Promise((resolve) => log.end(() => resolve()));
|
|
209
|
+
},
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
function buildTrace(args) {
|
|
213
|
+
const now = Date.now();
|
|
214
|
+
const openStreams = [...args.live.values()].map((s) => ({
|
|
215
|
+
seq: s.seq,
|
|
216
|
+
url: s.url,
|
|
217
|
+
status: s.status,
|
|
218
|
+
bytes: s.bytes,
|
|
219
|
+
events: Object.fromEntries(s.events),
|
|
220
|
+
openForMs: now - s.startedAt,
|
|
221
|
+
sinceLastByteMs: s.lastByteAt === null ? null : now - s.lastByteAt,
|
|
222
|
+
waitedForFirstByteMs: s.firstByteAt === null ? null : s.firstByteAt - s.startedAt,
|
|
223
|
+
}));
|
|
224
|
+
return {
|
|
225
|
+
captureDir: args.captureDir,
|
|
226
|
+
requests: args.finished.length + openStreams.length,
|
|
227
|
+
// COPIED, not referenced. The runner reads the trace at the kill and then
|
|
228
|
+
// closes the proxy, which settles every in-flight stream — and a snapshot
|
|
229
|
+
// that aliased the live array would gain those entries afterwards, so the
|
|
230
|
+
// one stream the diagnosis is about would appear as both still-open and
|
|
231
|
+
// already-complete. A snapshot has to be a snapshot.
|
|
232
|
+
streams: [...args.finished],
|
|
233
|
+
openStreams,
|
|
234
|
+
stallMs: args.stallMs,
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Name what the wire was doing when the clock ran out.
|
|
239
|
+
*
|
|
240
|
+
* READ IN ORDER. The first cause that fits wins, because these are not
|
|
241
|
+
* independent: a stream still open explains everything downstream of it, and
|
|
242
|
+
* reporting a stale earlier stream instead would point at the wrong thing.
|
|
243
|
+
*/
|
|
244
|
+
export function diagnoseTimeout(trace) {
|
|
245
|
+
const stalled = trace.openStreams.filter((s) => s.sinceLastByteMs === null || s.sinceLastByteMs >= trace.stallMs);
|
|
246
|
+
const flowing = trace.openStreams.filter((s) => s.sinceLastByteMs !== null && s.sinceLastByteMs < trace.stallMs);
|
|
247
|
+
if (flowing.length > 0) {
|
|
248
|
+
const worst = flowing.reduce((a, b) => (a.openForMs >= b.openForMs ? a : b));
|
|
249
|
+
return {
|
|
250
|
+
kind: 'generating-at-cutoff',
|
|
251
|
+
detail: `request #${worst.seq} was still streaming when the budget expired: `
|
|
252
|
+
+ `${Math.round(worst.openForMs / 1000)}s open, ${worst.bytes} bytes, `
|
|
253
|
+
+ `last token ${Math.round((worst.sinceLastByteMs ?? 0) / 1000)}s before the kill`,
|
|
254
|
+
seq: worst.seq,
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
if (stalled.length > 0) {
|
|
258
|
+
const worst = stalled.reduce((a, b) => (a.openForMs >= b.openForMs ? a : b));
|
|
259
|
+
const never = worst.sinceLastByteMs === null;
|
|
260
|
+
return {
|
|
261
|
+
kind: never ? 'no-first-token' : 'stream-stalled',
|
|
262
|
+
detail: never
|
|
263
|
+
? `request #${worst.seq} was accepted${worst.status === null ? ' but never answered' : ` with status ${worst.status}`} `
|
|
264
|
+
+ `and produced no bytes in ${Math.round(worst.openForMs / 1000)}s`
|
|
265
|
+
: `request #${worst.seq} stopped producing bytes `
|
|
266
|
+
+ `${Math.round((worst.sinceLastByteMs ?? 0) / 1000)}s before the kill and was never closed `
|
|
267
|
+
+ `(${worst.bytes} bytes, events ${JSON.stringify(worst.events)})`,
|
|
268
|
+
seq: worst.seq,
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
// Only completion streams are evidence. The CLI also issues a connectivity
|
|
272
|
+
// probe and a token count against the same base URL, and both close without
|
|
273
|
+
// a `message_stop` because neither is an SSE turn. Counting those would
|
|
274
|
+
// report a missing terminator on every single timeout — a diagnosis that
|
|
275
|
+
// fires always is worth exactly as much as no diagnosis at all.
|
|
276
|
+
const turns = trace.streams.filter((s) => (s.events['message_start'] ?? 0) > 0);
|
|
277
|
+
// And only a turn the SERVER closed is evidence ABOUT the server. The CLI
|
|
278
|
+
// opens a warm-up completion and cancels it a second later; a cancelled turn
|
|
279
|
+
// has no terminator by construction, so reading one as a server fault would
|
|
280
|
+
// blame the runtime for the client's own choice.
|
|
281
|
+
const serverClosed = turns.filter((s) => s.ended === 'upstream-end');
|
|
282
|
+
const last = serverClosed[serverClosed.length - 1];
|
|
283
|
+
if (!last) {
|
|
284
|
+
return {
|
|
285
|
+
kind: 'no-request-reached-the-model',
|
|
286
|
+
detail: turns.length > 0
|
|
287
|
+
? `${turns.length} turn(s) were opened and the agent abandoned every one before the server `
|
|
288
|
+
+ 'closed it — the hang is on the client side of the proxy'
|
|
289
|
+
: `the agent never sent a completion request (${trace.requests} non-streaming request(s) seen) `
|
|
290
|
+
+ '— the hang is on the client side of the proxy',
|
|
291
|
+
seq: null,
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
if (!last.sawTerminator) {
|
|
295
|
+
return {
|
|
296
|
+
kind: 'stream-ended-without-terminator',
|
|
297
|
+
detail: `request #${last.seq} closed (${last.ended}) after ${last.bytes} bytes without a message_stop; `
|
|
298
|
+
+ 'the agent was left waiting on a turn the server considered finished',
|
|
299
|
+
seq: last.seq,
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
return {
|
|
303
|
+
kind: 'idle-between-turns',
|
|
304
|
+
detail: `every request completed — ${serverClosed.length} turn(s), the last one terminated cleanly `
|
|
305
|
+
+ `${Math.round(last.durationMs / 1000)}s long — and the agent then stopped without sending another`,
|
|
306
|
+
seq: last.seq,
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
//# sourceMappingURL=trace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trace.js","sourceRoot":"","sources":["../../../src/core/local-eval/trace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,iBAAiB,EAAoB,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,C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AAC,CAAC,KAAK,KAAK,cAAc,CAAC,CAAC;IACrE,MAAM,IAAI,GAAG,YAAY,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACnD,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO;YACL,IAAI,EAAE,8BAA8B;YACpC,MAAM,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC;gBACtB,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,2EAA2E;sBACxF,yDAAyD;gBAC7D,CAAC,CAAC,8CAA8C,KAAK,CAAC,QAAQ,kCAAkC;sBAC5F,+CAA+C;YACrD,GAAG,EAAE,IAAI;SACV,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;QACxB,OAAO;YACL,IAAI,EAAE,iCAAiC;YACvC,MAAM,EAAE,YAAY,IAAI,CAAC,GAAG,YAAY,IAAI,CAAC,KAAK,WAAW,IAAI,CAAC,KAAK,iCAAiC;kBACpG,qEAAqE;YACzE,GAAG,EAAE,IAAI,CAAC,GAAG;SACd,CAAC;IACJ,CAAC;IACD,OAAO;QACL,IAAI,EAAE,oBAAoB;QAC1B,MAAM,EAAE,6BAA6B,YAAY,CAAC,MAAM,4CAA4C;cAChG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,6DAA6D;QACtG,GAAG,EAAE,IAAI,CAAC,GAAG;KACd,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for the local-agent evaluation harness.
|
|
3
|
+
*
|
|
4
|
+
* WHY THIS EXISTS. Every number we have about the local seat so far is a
|
|
5
|
+
* handful of one-line fixes timed by hand. That is enough to show a prompt-cache
|
|
6
|
+
* bug was costing 23,301 reprocessed tokens a turn, and not nearly enough to
|
|
7
|
+
* answer the only question that matters when tuning: did this change make the
|
|
8
|
+
* agent BETTER at real work, or just faster at failing?
|
|
9
|
+
*
|
|
10
|
+
* Three commitments are encoded in these types, each one a lesson this
|
|
11
|
+
* repository paid for:
|
|
12
|
+
*
|
|
13
|
+
* 1. A verdict is an EXIT CODE, never a model's opinion. `TaskSpec.verify` is
|
|
14
|
+
* a command; its status decides the trial. No model ever judges a model.
|
|
15
|
+
* 2. A result is a DISTRIBUTION, never a sample. `TaskOutcome` carries every
|
|
16
|
+
* trial, because on this hardware turns vary by tens of seconds and one
|
|
17
|
+
* run has already produced a wrong conclusion here.
|
|
18
|
+
* 3. A number without its CONFIGURATION cannot be compared to anything, so
|
|
19
|
+
* `HarnessConfiguration` is captured from the live runtime at run time and
|
|
20
|
+
* stored beside the results rather than written down by hand.
|
|
21
|
+
*/
|
|
22
|
+
/** What the task is asking of the agent, which decides how it is graded. */
|
|
23
|
+
export type TaskExpectation =
|
|
24
|
+
/** The agent should change the tree, and `verify` proves the change correct. */
|
|
25
|
+
'edit'
|
|
26
|
+
/**
|
|
27
|
+
* The agent should decline or ask. `verify` proves the tree is still intact,
|
|
28
|
+
* and the closing message must not assert a change it did not make.
|
|
29
|
+
*/
|
|
30
|
+
| 'refuse';
|
|
31
|
+
/** A single evaluation task. */
|
|
32
|
+
export interface TaskSpec {
|
|
33
|
+
readonly id: string;
|
|
34
|
+
/** Why this task earns a place in the set. Printed in the report. */
|
|
35
|
+
readonly why: string;
|
|
36
|
+
readonly expectation: TaskExpectation;
|
|
37
|
+
/** The instruction handed to the agent verbatim. */
|
|
38
|
+
readonly prompt: string;
|
|
39
|
+
/** Fixture contents, written relative to the trial's working directory. */
|
|
40
|
+
readonly files: Readonly<Record<string, string>>;
|
|
41
|
+
/**
|
|
42
|
+
* Source of the pass check, written OUTSIDE the agent's working directory.
|
|
43
|
+
*
|
|
44
|
+
* This placement is load-bearing, not tidiness. A checker sitting next to the
|
|
45
|
+
* code is itself editable, and "make the failing test pass" has an obvious
|
|
46
|
+
* cheat if the test is in reach. Claude Code confines its file tools to the
|
|
47
|
+
* working directory, so a checker one level above it cannot be rewritten by
|
|
48
|
+
* the agent under evaluation.
|
|
49
|
+
*/
|
|
50
|
+
readonly check: string;
|
|
51
|
+
/**
|
|
52
|
+
* The pass check. Argv, not a shell string: no quoting to get wrong, and
|
|
53
|
+
* nothing a fixture file name could inject into a shell.
|
|
54
|
+
*/
|
|
55
|
+
readonly verify: readonly string[];
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* How a trial failed. `pass` is included so a trial always carries exactly one
|
|
59
|
+
* verdict and callers never have to combine a boolean with an enum.
|
|
60
|
+
*/
|
|
61
|
+
export type FailureMode = 'pass'
|
|
62
|
+
/** THE ONE THAT MATTERS: reported a change, the tree never moved. */
|
|
63
|
+
| 'claimed-change-none-made'
|
|
64
|
+
/** Declined or stopped on a task that was plainly doable. */
|
|
65
|
+
| 'refused-doable-task'
|
|
66
|
+
/** Complied with a request it should have questioned. */
|
|
67
|
+
| 'complied-with-bad-request'
|
|
68
|
+
/** Ended before finishing: cancelled, max turns, or a non-completed stop. */
|
|
69
|
+
| 'stopped-early'
|
|
70
|
+
/** Edited something, but the result is wrong. */
|
|
71
|
+
| 'wrong-edit'
|
|
72
|
+
/** Ran past the wall-clock budget and was killed. */
|
|
73
|
+
| 'timeout'
|
|
74
|
+
/** Hit the model's context limit. */
|
|
75
|
+
| 'context-exhausted'
|
|
76
|
+
/** The CLI or the runtime errored — not the model's fault, and not a pass. */
|
|
77
|
+
| 'harness-error';
|
|
78
|
+
/**
|
|
79
|
+
* One request/response exchange between the agent and the runtime, as seen on
|
|
80
|
+
* the wire by the tracing proxy.
|
|
81
|
+
*
|
|
82
|
+
* `sawTerminator` is the field this whole record exists for. An SSE turn that
|
|
83
|
+
* closes without `message_stop` leaves the agent waiting on a socket the server
|
|
84
|
+
* already considers finished, and that is indistinguishable from a slow model
|
|
85
|
+
* to everything downstream — including the CLI's own result JSON, which an
|
|
86
|
+
* aborted turn is documented to report as COMPLETED.
|
|
87
|
+
*/
|
|
88
|
+
export interface StreamRecord {
|
|
89
|
+
readonly seq: number;
|
|
90
|
+
readonly url: string;
|
|
91
|
+
readonly status: number | null;
|
|
92
|
+
/** Which side ended it, and how. */
|
|
93
|
+
readonly ended: 'upstream-end' | 'upstream-aborted' | 'upstream-error' | 'client-closed';
|
|
94
|
+
readonly bytes: number;
|
|
95
|
+
/** SSE event names to counts, e.g. `{ content_block_delta: 512 }`. */
|
|
96
|
+
readonly events: Readonly<Record<string, number>>;
|
|
97
|
+
/** Whether a `message_stop` event ever arrived. */
|
|
98
|
+
readonly sawTerminator: boolean;
|
|
99
|
+
/** Node's own view of whether the response body arrived in full. */
|
|
100
|
+
readonly upstreamComplete: boolean;
|
|
101
|
+
readonly waitedForFirstByteMs: number | null;
|
|
102
|
+
/** Silence between the last byte and the close. Null when no byte arrived. */
|
|
103
|
+
readonly idleAtEndMs: number | null;
|
|
104
|
+
readonly durationMs: number;
|
|
105
|
+
}
|
|
106
|
+
/** A stream that had not finished when the trace was read. */
|
|
107
|
+
export interface OpenStreamRecord {
|
|
108
|
+
readonly seq: number;
|
|
109
|
+
readonly url: string;
|
|
110
|
+
readonly status: number | null;
|
|
111
|
+
readonly bytes: number;
|
|
112
|
+
readonly events: Readonly<Record<string, number>>;
|
|
113
|
+
readonly openForMs: number;
|
|
114
|
+
/** Null when not one byte has arrived yet. */
|
|
115
|
+
readonly sinceLastByteMs: number | null;
|
|
116
|
+
readonly waitedForFirstByteMs: number | null;
|
|
117
|
+
}
|
|
118
|
+
/** Everything the tracing proxy saw during one trial. */
|
|
119
|
+
export interface TrialTrace {
|
|
120
|
+
/** Where the raw request bodies and response streams were written. */
|
|
121
|
+
readonly captureDir: string;
|
|
122
|
+
readonly requests: number;
|
|
123
|
+
readonly streams: readonly StreamRecord[];
|
|
124
|
+
readonly openStreams: readonly OpenStreamRecord[];
|
|
125
|
+
/** Silence longer than this is reported as a stall rather than as slowness. */
|
|
126
|
+
readonly stallMs: number;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* WHY a trial ran out of clock.
|
|
130
|
+
*
|
|
131
|
+
* Each value names a different thing to go and fix, which is the entire point:
|
|
132
|
+
* "timeout" alone is the same non-answer as a pass rate with no failure modes.
|
|
133
|
+
*/
|
|
134
|
+
export type TimeoutDiagnosisKind =
|
|
135
|
+
/** Tokens were still arriving when the budget expired. The model was working. */
|
|
136
|
+
'generating-at-cutoff'
|
|
137
|
+
/** A stream went silent and was never closed. The socket outlived the turn. */
|
|
138
|
+
| 'stream-stalled'
|
|
139
|
+
/** A request was accepted and never produced a single byte. */
|
|
140
|
+
| 'no-first-token'
|
|
141
|
+
/** The last stream closed with no `message_stop`; the agent waited forever. */
|
|
142
|
+
| 'stream-ended-without-terminator'
|
|
143
|
+
/** Every stream completed cleanly and the agent simply stopped. Client-side. */
|
|
144
|
+
| 'idle-between-turns'
|
|
145
|
+
/** The agent never reached the runtime at all. */
|
|
146
|
+
| 'no-request-reached-the-model';
|
|
147
|
+
export interface TimeoutDiagnosis {
|
|
148
|
+
readonly kind: TimeoutDiagnosisKind;
|
|
149
|
+
/** One sentence naming the evidence, safe to print in a report. */
|
|
150
|
+
readonly detail: string;
|
|
151
|
+
/** The request the verdict is about, when there is one. */
|
|
152
|
+
readonly seq: number | null;
|
|
153
|
+
}
|
|
154
|
+
/** Token counts for one trial, as reported by the agent CLI. */
|
|
155
|
+
export interface TrialTokens {
|
|
156
|
+
readonly input: number;
|
|
157
|
+
readonly output: number;
|
|
158
|
+
readonly cacheRead: number;
|
|
159
|
+
readonly cacheCreation: number;
|
|
160
|
+
}
|
|
161
|
+
/** One attempt at one task. */
|
|
162
|
+
export interface TrialResult {
|
|
163
|
+
readonly taskId: string;
|
|
164
|
+
readonly trial: number;
|
|
165
|
+
readonly mode: FailureMode;
|
|
166
|
+
readonly passed: boolean;
|
|
167
|
+
/** Wall clock for the agent turn, milliseconds. */
|
|
168
|
+
readonly wallMs: number;
|
|
169
|
+
readonly tokens: TrialTokens;
|
|
170
|
+
/** Exit status of the agent CLI. */
|
|
171
|
+
readonly agentExit: number | null;
|
|
172
|
+
/** Exit status of the `verify` command; null when it was never reached. */
|
|
173
|
+
readonly verifyExit: number | null;
|
|
174
|
+
/** Files the agent actually changed, counted from the git diff. */
|
|
175
|
+
readonly changedFiles: number | null;
|
|
176
|
+
/** The agent's closing message, as classified by completion-claims. */
|
|
177
|
+
readonly claim: string;
|
|
178
|
+
readonly integrity: string;
|
|
179
|
+
/** Number of assistant turns the CLI reported. */
|
|
180
|
+
readonly turns: number | null;
|
|
181
|
+
/** Short human-readable note, e.g. the first line of a crash. */
|
|
182
|
+
readonly note: string;
|
|
183
|
+
/**
|
|
184
|
+
* What the wire was doing when the clock ran out. Null for every trial that
|
|
185
|
+
* did not time out — and never null for one that did, which is the guarantee
|
|
186
|
+
* this field was added to make.
|
|
187
|
+
*/
|
|
188
|
+
readonly timeoutDiagnosis: TimeoutDiagnosis | null;
|
|
189
|
+
/**
|
|
190
|
+
* The wire summary, present whenever tracing was on. Kept on the trial rather
|
|
191
|
+
* than only in a log file so a recorded baseline stays diagnosable after the
|
|
192
|
+
* temporary directory it ran in is gone.
|
|
193
|
+
*/
|
|
194
|
+
readonly trace: TrialTrace | null;
|
|
195
|
+
}
|
|
196
|
+
/** Every trial for one task, plus the aggregate that answers "did this help?". */
|
|
197
|
+
export interface TaskOutcome {
|
|
198
|
+
readonly taskId: string;
|
|
199
|
+
readonly why: string;
|
|
200
|
+
readonly expectation: TaskExpectation;
|
|
201
|
+
readonly trials: readonly TrialResult[];
|
|
202
|
+
readonly passes: number;
|
|
203
|
+
readonly total: number;
|
|
204
|
+
readonly passRate: number;
|
|
205
|
+
readonly medianWallMs: number;
|
|
206
|
+
readonly meanWallMs: number;
|
|
207
|
+
/** Failure modes seen, most frequent first. Empty when every trial passed. */
|
|
208
|
+
readonly modes: readonly {
|
|
209
|
+
readonly mode: FailureMode;
|
|
210
|
+
readonly count: number;
|
|
211
|
+
}[];
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* The configuration a result is only meaningful against.
|
|
215
|
+
*
|
|
216
|
+
* Read from the live runtime rather than accepted as an argument wherever
|
|
217
|
+
* possible: a hand-written record of what was running is exactly the thing that
|
|
218
|
+
* goes stale and silently invalidates a comparison.
|
|
219
|
+
*/
|
|
220
|
+
export interface HarnessConfiguration {
|
|
221
|
+
/** Resolved model reference, e.g. `qwen3.8:27b-q8_0`. */
|
|
222
|
+
readonly model: string;
|
|
223
|
+
/** The on-disk blob actually loaded, which is what `model` is derived from. */
|
|
224
|
+
readonly modelPath: string;
|
|
225
|
+
readonly quantization: string;
|
|
226
|
+
readonly slots: number;
|
|
227
|
+
/** Context per slot, which is the number that bounds a single agent. */
|
|
228
|
+
readonly contextPerSlot: number;
|
|
229
|
+
/** Total context across all slots, i.e. llama-server's `-c`. */
|
|
230
|
+
readonly contextTotal: number;
|
|
231
|
+
readonly samplingParams: Readonly<Record<string, unknown>>;
|
|
232
|
+
/** The base URL the agent was pointed at. */
|
|
233
|
+
readonly baseUrl: string;
|
|
234
|
+
/** Whether that base URL is the normalising proxy or llama-server directly. */
|
|
235
|
+
readonly proxy: 'on' | 'off';
|
|
236
|
+
/**
|
|
237
|
+
* Whether the tracing proxy was inserted in front of `baseUrl`.
|
|
238
|
+
*
|
|
239
|
+
* Recorded because it changes what a timed-out trial can say about itself,
|
|
240
|
+
* and a baseline that predates tracing must not be mistaken for one where
|
|
241
|
+
* tracing found nothing.
|
|
242
|
+
*/
|
|
243
|
+
readonly tracing: 'on' | 'off';
|
|
244
|
+
/** What is actually serving the proxy port, when that could be determined. */
|
|
245
|
+
readonly proxyImplementation: string;
|
|
246
|
+
readonly agentCli: string;
|
|
247
|
+
readonly llamaServerArgv: readonly string[];
|
|
248
|
+
readonly capturedAt: string;
|
|
249
|
+
}
|
|
250
|
+
/** A complete harness run: the configuration, and what it scored. */
|
|
251
|
+
export interface EvalReport {
|
|
252
|
+
readonly configuration: HarnessConfiguration;
|
|
253
|
+
readonly trialsPerTask: number;
|
|
254
|
+
readonly concurrency: number;
|
|
255
|
+
readonly outcomes: readonly TaskOutcome[];
|
|
256
|
+
readonly overallPassRate: number;
|
|
257
|
+
readonly totalPasses: number;
|
|
258
|
+
readonly totalTrials: number;
|
|
259
|
+
readonly startedAt: string;
|
|
260
|
+
readonly finishedAt: string;
|
|
261
|
+
readonly wallMs: number;
|
|
262
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for the local-agent evaluation harness.
|
|
3
|
+
*
|
|
4
|
+
* WHY THIS EXISTS. Every number we have about the local seat so far is a
|
|
5
|
+
* handful of one-line fixes timed by hand. That is enough to show a prompt-cache
|
|
6
|
+
* bug was costing 23,301 reprocessed tokens a turn, and not nearly enough to
|
|
7
|
+
* answer the only question that matters when tuning: did this change make the
|
|
8
|
+
* agent BETTER at real work, or just faster at failing?
|
|
9
|
+
*
|
|
10
|
+
* Three commitments are encoded in these types, each one a lesson this
|
|
11
|
+
* repository paid for:
|
|
12
|
+
*
|
|
13
|
+
* 1. A verdict is an EXIT CODE, never a model's opinion. `TaskSpec.verify` is
|
|
14
|
+
* a command; its status decides the trial. No model ever judges a model.
|
|
15
|
+
* 2. A result is a DISTRIBUTION, never a sample. `TaskOutcome` carries every
|
|
16
|
+
* trial, because on this hardware turns vary by tens of seconds and one
|
|
17
|
+
* run has already produced a wrong conclusion here.
|
|
18
|
+
* 3. A number without its CONFIGURATION cannot be compared to anything, so
|
|
19
|
+
* `HarnessConfiguration` is captured from the live runtime at run time and
|
|
20
|
+
* stored beside the results rather than written down by hand.
|
|
21
|
+
*/
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/core/local-eval/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG"}
|