@jinn-network/client 0.1.7 → 0.1.8-canary.09a3b2f6
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/README.md +67 -1
- package/dist/adapters/mech/adapter.d.ts +39 -2
- package/dist/adapters/mech/adapter.js +178 -20
- package/dist/adapters/mech/adapter.js.map +1 -1
- package/dist/adapters/mech/contracts.d.ts +22 -1
- package/dist/adapters/mech/contracts.js +96 -52
- package/dist/adapters/mech/contracts.js.map +1 -1
- package/dist/adapters/mech/safe-revert.d.ts +4 -0
- package/dist/adapters/mech/safe-revert.js +5 -1
- package/dist/adapters/mech/safe-revert.js.map +1 -1
- package/dist/adapters/mech/safe.d.ts +1 -1
- package/dist/adapters/mech/safe.js +10 -4
- package/dist/adapters/mech/safe.js.map +1 -1
- package/dist/adapters/mech/types.d.ts +6 -1
- package/dist/adapters/mech/types.js.map +1 -1
- package/dist/agent/operator-claude.js +8 -0
- package/dist/agent/operator-claude.js.map +1 -1
- package/dist/api/activity-events-endpoint.d.ts +14 -0
- package/dist/api/activity-events-endpoint.js +59 -0
- package/dist/api/activity-events-endpoint.js.map +1 -0
- package/dist/api/bootstrap-endpoint.d.ts +1 -2
- package/dist/api/bootstrap-endpoint.js +42 -24
- package/dist/api/bootstrap-endpoint.js.map +1 -1
- package/dist/api/codex-doctor-endpoint.d.ts +22 -5
- package/dist/api/codex-doctor-endpoint.js +136 -17
- package/dist/api/codex-doctor-endpoint.js.map +1 -1
- package/dist/api/debug-report-endpoint.d.ts +27 -0
- package/dist/api/debug-report-endpoint.js +157 -0
- package/dist/api/debug-report-endpoint.js.map +1 -0
- package/dist/api/discovery-endpoint.d.ts +1 -0
- package/dist/api/discovery-endpoint.js +24 -0
- package/dist/api/discovery-endpoint.js.map +1 -1
- package/dist/api/fleet-build.d.ts +1 -7
- package/dist/api/fleet-build.js +0 -7
- package/dist/api/fleet-build.js.map +1 -1
- package/dist/api/gather-status.d.ts +39 -0
- package/dist/api/gather-status.js +181 -84
- package/dist/api/gather-status.js.map +1 -1
- package/dist/api/hermes-doctor-endpoint.d.ts +15 -7
- package/dist/api/hermes-doctor-endpoint.js +56 -19
- package/dist/api/hermes-doctor-endpoint.js.map +1 -1
- package/dist/api/launcher-status.d.ts +4 -2
- package/dist/api/launcher-status.js +11 -10
- package/dist/api/launcher-status.js.map +1 -1
- package/dist/api/launcher-tasks.d.ts +1 -1
- package/dist/api/launcher-tasks.js +12 -8
- package/dist/api/launcher-tasks.js.map +1 -1
- package/dist/api/loop-completion-build.d.ts +79 -0
- package/dist/api/loop-completion-build.js +155 -0
- package/dist/api/loop-completion-build.js.map +1 -0
- package/dist/api/operator-artifacts-endpoint.js +73 -6
- package/dist/api/operator-artifacts-endpoint.js.map +1 -1
- package/dist/api/portfolio-v0-build.d.ts +7 -1
- package/dist/api/portfolio-v0-build.js +6 -2
- package/dist/api/portfolio-v0-build.js.map +1 -1
- package/dist/api/prediction-v1-build.d.ts +6 -0
- package/dist/api/prediction-v1-build.js +3 -1
- package/dist/api/prediction-v1-build.js.map +1 -1
- package/dist/api/server.d.ts +17 -0
- package/dist/api/server.js +40 -1
- package/dist/api/server.js.map +1 -1
- package/dist/api/setup-endpoints.d.ts +13 -9
- package/dist/api/setup-endpoints.js +50 -173
- package/dist/api/setup-endpoints.js.map +1 -1
- package/dist/api/solvernets-endpoints.js +33 -63
- package/dist/api/solvernets-endpoints.js.map +1 -1
- package/dist/api/status-build.d.ts +140 -17
- package/dist/api/status-build.js +47 -34
- package/dist/api/status-build.js.map +1 -1
- package/dist/api/status-harness-rollup.d.ts +35 -0
- package/dist/api/status-harness-rollup.js +45 -0
- package/dist/api/status-harness-rollup.js.map +1 -0
- package/dist/api/status-rollup-build.d.ts +0 -4
- package/dist/api/status-rollup-build.js +0 -4
- package/dist/api/status-rollup-build.js.map +1 -1
- package/dist/api/task-runs-build.d.ts +8 -0
- package/dist/api/task-runs-build.js +5 -1
- package/dist/api/task-runs-build.js.map +1 -1
- package/dist/build-info.json +4 -4
- package/dist/build-meta.json +1 -1
- package/dist/captures/live-publisher.js +24 -4
- package/dist/captures/live-publisher.js.map +1 -1
- package/dist/captures/publish.d.ts +1 -1
- package/dist/chain-read-errors.d.ts +12 -0
- package/dist/chain-read-errors.js +26 -1
- package/dist/chain-read-errors.js.map +1 -1
- package/dist/cli/commands/codedigest-revert-check.d.ts +33 -0
- package/dist/cli/commands/codedigest-revert-check.js +253 -0
- package/dist/cli/commands/codedigest-revert-check.js.map +1 -0
- package/dist/cli/commands/doctor.d.ts +3 -0
- package/dist/cli/commands/doctor.js +35 -0
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/eval.d.ts +76 -0
- package/dist/cli/commands/eval.js +401 -0
- package/dist/cli/commands/eval.js.map +1 -0
- package/dist/cli/commands/rewards.d.ts +2 -0
- package/dist/cli/commands/rewards.js +27 -0
- package/dist/cli/commands/rewards.js.map +1 -1
- package/dist/cli/commands/solver-nets.d.ts +1 -0
- package/dist/cli/commands/solver-nets.js +245 -22
- package/dist/cli/commands/solver-nets.js.map +1 -1
- package/dist/cli/commands/solver-plugins-block.d.ts +33 -0
- package/dist/cli/commands/solver-plugins-block.js +118 -0
- package/dist/cli/commands/solver-plugins-block.js.map +1 -0
- package/dist/cli/commands/solver-plugins-feedback.d.ts +72 -0
- package/dist/cli/commands/solver-plugins-feedback.js +262 -0
- package/dist/cli/commands/solver-plugins-feedback.js.map +1 -0
- package/dist/cli/commands/solver-plugins-read.d.ts +54 -0
- package/dist/cli/commands/solver-plugins-read.js +259 -0
- package/dist/cli/commands/solver-plugins-read.js.map +1 -0
- package/dist/cli/commands/solver-plugins.d.ts +35 -0
- package/dist/cli/commands/solver-plugins.js +399 -2
- package/dist/cli/commands/solver-plugins.js.map +1 -1
- package/dist/cli/commands/status.js +0 -1
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/commands/tasks.js +15 -2
- package/dist/cli/commands/tasks.js.map +1 -1
- package/dist/cli/index.js +4 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/task-native-readiness.d.ts +7 -0
- package/dist/cli/task-native-readiness.js +7 -5
- package/dist/cli/task-native-readiness.js.map +1 -1
- package/dist/config.d.ts +206 -232
- package/dist/config.js +289 -107
- package/dist/config.js.map +1 -1
- package/dist/daemon/ai-units-gate.d.ts +54 -0
- package/dist/daemon/ai-units-gate.js +83 -0
- package/dist/daemon/ai-units-gate.js.map +1 -0
- package/dist/daemon/creator.js +13 -0
- package/dist/daemon/creator.js.map +1 -1
- package/dist/daemon/daemon.d.ts +10 -0
- package/dist/daemon/daemon.js +205 -30
- package/dist/daemon/daemon.js.map +1 -1
- package/dist/daemon/eviction-loop.d.ts +7 -0
- package/dist/daemon/eviction-loop.js +16 -0
- package/dist/daemon/eviction-loop.js.map +1 -1
- package/dist/daemon/gate-logger.d.ts +9 -0
- package/dist/daemon/gate-logger.js +2 -0
- package/dist/daemon/gate-logger.js.map +1 -0
- package/dist/daemon/jinn-claim-loop.js +22 -4
- package/dist/daemon/jinn-claim-loop.js.map +1 -1
- package/dist/daemon/readiness-gate.d.ts +1 -4
- package/dist/daemon/readiness-gate.js.map +1 -1
- package/dist/daemon/spend-cap-gate.d.ts +40 -0
- package/dist/daemon/spend-cap-gate.js +46 -0
- package/dist/daemon/spend-cap-gate.js.map +1 -0
- package/dist/dashboard/assets/index-3quVQqik.js +167 -0
- package/dist/dashboard/assets/index-BVAWkLwY.css +1 -0
- package/dist/dashboard/index.html +2 -2
- package/dist/discovery/http.d.ts +7 -0
- package/dist/discovery/http.js +567 -24
- package/dist/discovery/http.js.map +1 -1
- package/dist/discovery/onchain.js +197 -5
- package/dist/discovery/onchain.js.map +1 -1
- package/dist/discovery/types.d.ts +235 -0
- package/dist/discovery/types.js +40 -0
- package/dist/discovery/types.js.map +1 -1
- package/dist/discovery/with-fallback.js +41 -0
- package/dist/discovery/with-fallback.js.map +1 -1
- package/dist/earning/bootstrap.d.ts +31 -3
- package/dist/earning/bootstrap.js +94 -22
- package/dist/earning/bootstrap.js.map +1 -1
- package/dist/earning/faucet.d.ts +1 -1
- package/dist/earning/faucet.js +2 -2
- package/dist/earning/faucet.js.map +1 -1
- package/dist/earning/safe-adapter.js +34 -11
- package/dist/earning/safe-adapter.js.map +1 -1
- package/dist/earning/types.d.ts +6 -6
- package/dist/earning/viem-clients.d.ts +11 -4
- package/dist/earning/viem-clients.js +14 -5
- package/dist/earning/viem-clients.js.map +1 -1
- package/dist/erc8004/identity.d.ts +19 -3
- package/dist/erc8004/identity.js +38 -11
- package/dist/erc8004/identity.js.map +1 -1
- package/dist/erc8004/index.d.ts +1 -1
- package/dist/erc8004/index.js.map +1 -1
- package/dist/eval/eval-harness-run.d.ts +63 -0
- package/dist/eval/eval-harness-run.js +123 -0
- package/dist/eval/eval-harness-run.js.map +1 -0
- package/dist/eval/orchestrator.d.ts +163 -0
- package/dist/eval/orchestrator.js +232 -0
- package/dist/eval/orchestrator.js.map +1 -0
- package/dist/eval/paired.d.ts +68 -0
- package/dist/eval/paired.js +93 -0
- package/dist/eval/paired.js.map +1 -0
- package/dist/eval/resolve-slate-tasks.d.ts +35 -0
- package/dist/eval/resolve-slate-tasks.js +56 -0
- package/dist/eval/resolve-slate-tasks.js.map +1 -0
- package/dist/eval/screen-discovery.d.ts +22 -0
- package/dist/eval/screen-discovery.js +71 -0
- package/dist/eval/screen-discovery.js.map +1 -0
- package/dist/eval/screen-progress.d.ts +41 -0
- package/dist/eval/screen-progress.js +60 -0
- package/dist/eval/screen-progress.js.map +1 -0
- package/dist/eval/screen-runner.d.ts +30 -0
- package/dist/eval/screen-runner.js +289 -0
- package/dist/eval/screen-runner.js.map +1 -0
- package/dist/eval/screen.d.ts +107 -0
- package/dist/eval/screen.js +159 -0
- package/dist/eval/screen.js.map +1 -0
- package/dist/eval/slope.d.ts +29 -0
- package/dist/eval/slope.js +46 -0
- package/dist/eval/slope.js.map +1 -0
- package/dist/eval/train-sequence.d.ts +35 -0
- package/dist/eval/train-sequence.js +59 -0
- package/dist/eval/train-sequence.js.map +1 -0
- package/dist/eval/wilson.d.ts +45 -0
- package/dist/eval/wilson.js +48 -0
- package/dist/eval/wilson.js.map +1 -0
- package/dist/events/types.d.ts +2 -2
- package/dist/harnesses/cost-estimates.d.ts +10 -31
- package/dist/harnesses/cost-estimates.js +11 -43
- package/dist/harnesses/cost-estimates.js.map +1 -1
- package/dist/harnesses/engine/canonical-json.js +5 -3
- package/dist/harnesses/engine/canonical-json.js.map +1 -1
- package/dist/harnesses/engine/engine.d.ts +37 -4
- package/dist/harnesses/engine/engine.js +151 -20
- package/dist/harnesses/engine/engine.js.map +1 -1
- package/dist/harnesses/engine/persistence.d.ts +38 -4
- package/dist/harnesses/engine/persistence.js +71 -6
- package/dist/harnesses/engine/persistence.js.map +1 -1
- package/dist/harnesses/engine/state.d.ts +9 -0
- package/dist/harnesses/engine/state.js +23 -10
- package/dist/harnesses/engine/state.js.map +1 -1
- package/dist/harnesses/impls/hermes-agent/adapter.d.ts +2 -0
- package/dist/harnesses/impls/hermes-agent/adapter.js +8 -5
- package/dist/harnesses/impls/hermes-agent/adapter.js.map +1 -1
- package/dist/harnesses/impls/hermes-agent/bootstrap.d.ts +1 -0
- package/dist/harnesses/impls/hermes-agent/bootstrap.js +10 -3
- package/dist/harnesses/impls/hermes-agent/bootstrap.js.map +1 -1
- package/dist/harnesses/impls/hermes-agent/config-builder.d.ts +1 -1
- package/dist/harnesses/impls/hermes-agent/config-builder.js +4 -2
- package/dist/harnesses/impls/hermes-agent/config-builder.js.map +1 -1
- package/dist/harnesses/impls/hermes-agent/harness.d.ts +31 -3
- package/dist/harnesses/impls/hermes-agent/harness.js +84 -7
- package/dist/harnesses/impls/hermes-agent/harness.js.map +1 -1
- package/dist/harnesses/impls/hermes-agent/prompt.d.ts +6 -6
- package/dist/harnesses/impls/hermes-agent/prompt.js +6 -6
- package/dist/harnesses/impls/index.d.ts +2 -0
- package/dist/harnesses/impls/index.js +2 -0
- package/dist/harnesses/impls/index.js.map +1 -1
- package/dist/harnesses/impls/learner/adapters/claude-code.d.ts +17 -0
- package/dist/harnesses/impls/learner/adapters/claude-code.js +118 -14
- package/dist/harnesses/impls/learner/adapters/claude-code.js.map +1 -1
- package/dist/harnesses/impls/learner/adapters/codex-code.d.ts +9 -0
- package/dist/harnesses/impls/learner/adapters/codex-code.js +30 -8
- package/dist/harnesses/impls/learner/adapters/codex-code.js.map +1 -1
- package/dist/harnesses/impls/learner/harness.d.ts +41 -1
- package/dist/harnesses/impls/learner/harness.js +78 -4
- package/dist/harnesses/impls/learner/harness.js.map +1 -1
- package/dist/harnesses/impls/learner/harvest.d.ts +3 -1
- package/dist/harnesses/impls/learner/harvest.js +30 -6
- package/dist/harnesses/impls/learner/harvest.js.map +1 -1
- package/dist/harnesses/impls/learner/plugin-path.js +1 -0
- package/dist/harnesses/impls/learner/plugin-path.js.map +1 -1
- package/dist/harnesses/impls/learner/restoration-patch.d.ts +2 -2
- package/dist/harnesses/impls/learner/restoration-patch.js +25 -6
- package/dist/harnesses/impls/learner/restoration-patch.js.map +1 -1
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/eval-runner.js +21 -1
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/eval-runner.js.map +1 -1
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/harness.js +3 -1
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/harness.js.map +1 -1
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/hf-fetcher.d.ts +74 -5
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/hf-fetcher.js +103 -32
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/hf-fetcher.js.map +1 -1
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/index.d.ts +2 -2
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/index.js +3 -1
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/index.js.map +1 -1
- package/dist/harnesses/readiness-registry.d.ts +7 -0
- package/dist/harnesses/readiness-registry.js +9 -0
- package/dist/harnesses/readiness-registry.js.map +1 -1
- package/dist/harnesses/types.d.ts +14 -0
- package/dist/learner/revert-decision.d.ts +74 -0
- package/dist/learner/revert-decision.js +73 -0
- package/dist/learner/revert-decision.js.map +1 -0
- package/dist/learner/revert-stats.d.ts +38 -0
- package/dist/learner/revert-stats.js +86 -0
- package/dist/learner/revert-stats.js.map +1 -0
- package/dist/local-provider-url.d.ts +3 -0
- package/dist/local-provider-url.js +28 -0
- package/dist/local-provider-url.js.map +1 -0
- package/dist/main.js +199 -104
- package/dist/main.js.map +1 -1
- package/dist/mcp/get-codedigest-reward.d.ts +13 -0
- package/dist/mcp/get-codedigest-reward.js +23 -0
- package/dist/mcp/get-codedigest-reward.js.map +1 -0
- package/dist/mcp/server.js +23 -0
- package/dist/mcp/server.js.map +1 -1
- package/dist/observability/debug-report-assemble.d.ts +43 -0
- package/dist/observability/debug-report-assemble.js +80 -0
- package/dist/observability/debug-report-assemble.js.map +1 -0
- package/dist/observability/emit-event.d.ts +9 -2
- package/dist/observability/emit-event.js +36 -2
- package/dist/observability/emit-event.js.map +1 -1
- package/dist/observability/file-logger.d.ts +69 -0
- package/dist/observability/file-logger.js +177 -0
- package/dist/observability/file-logger.js.map +1 -0
- package/dist/observability/redact-secrets.d.ts +65 -0
- package/dist/observability/redact-secrets.js +300 -0
- package/dist/observability/redact-secrets.js.map +1 -0
- package/dist/observability/tar.d.ts +30 -0
- package/dist/observability/tar.js +102 -0
- package/dist/observability/tar.js.map +1 -0
- package/dist/plugins/learner/.claude-plugin/plugin.json +1 -1
- package/dist/plugins/learner/.codex-plugin/plugin.json +1 -1
- package/dist/plugins/learner/hooks/session-start +30 -1
- package/dist/plugins/learner/skills/learn/consolidator-prompt.md +22 -1
- package/dist/plugins/learner/skills/learn/promoter-prompt.md +72 -1
- package/dist/preflight/deployment-readiness.d.ts +147 -0
- package/dist/preflight/deployment-readiness.js +366 -0
- package/dist/preflight/deployment-readiness.js.map +1 -0
- package/dist/preflight/pidfile-liveness.d.ts +50 -0
- package/dist/preflight/pidfile-liveness.js +117 -0
- package/dist/preflight/pidfile-liveness.js.map +1 -0
- package/dist/preflight/rpc-network.d.ts +40 -0
- package/dist/preflight/rpc-network.js +67 -1
- package/dist/preflight/rpc-network.js.map +1 -1
- package/dist/rpc/transport.d.ts +145 -0
- package/dist/rpc/transport.js +319 -0
- package/dist/rpc/transport.js.map +1 -0
- package/dist/scripts/donation-consumption-acceptance.js +7 -28
- package/dist/scripts/donation-consumption-acceptance.js.map +1 -1
- package/dist/scripts/swe-rebench-v2-pytest-missing.json +16 -0
- package/dist/solver-nets/prediction-operator-ux.d.ts +1 -2
- package/dist/solver-nets/prediction-operator-ux.js +56 -53
- package/dist/solver-nets/prediction-operator-ux.js.map +1 -1
- package/dist/solver-nets/registry.d.ts +19 -1
- package/dist/solver-nets/registry.js +37 -24
- package/dist/solver-nets/registry.js.map +1 -1
- package/dist/solver-types/_swe-rebench-v2-held-out-slate.d.ts +76 -0
- package/dist/solver-types/_swe-rebench-v2-held-out-slate.js +156 -0
- package/dist/solver-types/_swe-rebench-v2-held-out-slate.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-pool-recovery.d.ts +81 -0
- package/dist/solver-types/_swe-rebench-v2-pool-recovery.js +116 -0
- package/dist/solver-types/_swe-rebench-v2-pool-recovery.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-pool.d.ts +9 -2
- package/dist/solver-types/_swe-rebench-v2-pool.js +15 -20
- package/dist/solver-types/_swe-rebench-v2-pool.js.map +1 -1
- package/dist/solver-types/_swe-rebench-v2-state.d.ts +24 -0
- package/dist/solver-types/_swe-rebench-v2-state.js +33 -0
- package/dist/solver-types/_swe-rebench-v2-state.js.map +1 -1
- package/dist/solver-types/_swe-rebench-v2-validated-pool.d.ts +116 -2
- package/dist/solver-types/_swe-rebench-v2-validated-pool.js +296 -21
- package/dist/solver-types/_swe-rebench-v2-validated-pool.js.map +1 -1
- package/dist/solver-types/slates/held-out-slate.swe-rebench-v2.v1.json +20 -0
- package/dist/solver-types/slates/held-out-slate.swe-rebench-v2.v2.json +19 -0
- package/dist/solver-types/slates/held-out-slate.swe-rebench-v2.v2.screening-report.json +628 -0
- package/dist/solver-types/solver-type.d.ts +8 -0
- package/dist/solver-types/swe-rebench-v2-auto.d.ts +20 -11
- package/dist/solver-types/swe-rebench-v2-auto.js +64 -19
- package/dist/solver-types/swe-rebench-v2-auto.js.map +1 -1
- package/dist/solver-types/swe-rebench-v2.d.ts +10 -2
- package/dist/solver-types/swe-rebench-v2.js +233 -13
- package/dist/solver-types/swe-rebench-v2.js.map +1 -1
- package/dist/solvernets/daemon-init.d.ts +1 -1
- package/dist/solvernets/daemon-init.js +19 -4
- package/dist/solvernets/daemon-init.js.map +1 -1
- package/dist/solvernets/launched-record-dispatcher.d.ts +7 -0
- package/dist/solvernets/launched-record-dispatcher.js +10 -4
- package/dist/solvernets/launched-record-dispatcher.js.map +1 -1
- package/dist/solvernets/registry-client-erc8004.js +40 -37
- package/dist/solvernets/registry-client-erc8004.js.map +1 -1
- package/dist/solvernets/registry-client.d.ts +6 -0
- package/dist/solvernets/store.d.ts +2 -2
- package/dist/solvernets/store.js +7 -2
- package/dist/solvernets/store.js.map +1 -1
- package/dist/spend/ai-units-config.d.ts +49 -0
- package/dist/spend/ai-units-config.js +34 -0
- package/dist/spend/ai-units-config.js.map +1 -0
- package/dist/spend/ai-units.d.ts +140 -0
- package/dist/spend/ai-units.js +229 -0
- package/dist/spend/ai-units.js.map +1 -0
- package/dist/spend/cost-surface-status.d.ts +12 -0
- package/dist/spend/cost-surface-status.js +24 -0
- package/dist/spend/cost-surface-status.js.map +1 -0
- package/dist/spend/credential.d.ts +39 -0
- package/dist/spend/credential.js +71 -0
- package/dist/spend/credential.js.map +1 -0
- package/dist/spend/daemon-config.d.ts +13 -0
- package/dist/spend/daemon-config.js +24 -0
- package/dist/spend/daemon-config.js.map +1 -0
- package/dist/spend/pricing.d.ts +16 -0
- package/dist/spend/pricing.js +26 -0
- package/dist/spend/pricing.js.map +1 -0
- package/dist/spend/record.d.ts +13 -0
- package/dist/spend/record.js +43 -0
- package/dist/spend/record.js.map +1 -0
- package/dist/spend/usage.d.ts +27 -0
- package/dist/spend/usage.js +113 -0
- package/dist/spend/usage.js.map +1 -0
- package/dist/store/store.d.ts +187 -0
- package/dist/store/store.js +467 -4
- package/dist/store/store.js.map +1 -1
- package/dist/trajectory/transcript-parsers/codex-session.d.ts +12 -6
- package/dist/trajectory/transcript-parsers/codex-session.js +114 -13
- package/dist/trajectory/transcript-parsers/codex-session.js.map +1 -1
- package/dist/trajectory/transcript-parsers/types.d.ts +8 -8
- package/dist/trajectory/transcript-session-dirs.d.ts +18 -0
- package/dist/trajectory/transcript-session-dirs.js +85 -0
- package/dist/trajectory/transcript-session-dirs.js.map +1 -0
- package/dist/trajectory/transcript-watcher.d.ts +20 -1
- package/dist/trajectory/transcript-watcher.js +108 -32
- package/dist/trajectory/transcript-watcher.js.map +1 -1
- package/dist/tx-retry.d.ts +25 -0
- package/dist/tx-retry.js +95 -7
- package/dist/tx-retry.js.map +1 -1
- package/dist/types/payloads/portfolio-v0.d.ts +3 -3
- package/dist/types/payloads/prediction-apy-v0.d.ts +3 -3
- package/dist/types/payloads/prediction-v0.d.ts +12 -12
- package/dist/vendor/@jinn-network/sdk/dist/payloads/swe-rebench-v2.d.ts +108 -1
- package/dist/vendor/@jinn-network/sdk/dist/payloads/swe-rebench-v2.js +25 -1
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/swe-rebench-v2-held-out-slate.d.ts +65 -0
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/swe-rebench-v2-held-out-slate.js +123 -0
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/swe-rebench-v2.d.ts +2 -2
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/swe-rebench-v2.js +1 -1
- package/dist/vendor/@jinn-network/sdk/package.json +4 -0
- package/docker-compose.yml +3 -2
- package/package.json +30 -18
- package/plugins/learner/.claude-plugin/plugin.json +1 -1
- package/plugins/learner/.codex-plugin/plugin.json +1 -1
- package/plugins/learner/hooks/session-start +30 -1
- package/plugins/learner/skills/learn/consolidator-prompt.md +22 -1
- package/plugins/learner/skills/learn/promoter-prompt.md +72 -1
- package/plugins/swe-rebench-v2-diffmin/README.md +10 -9
- package/plugins/swe-rebench-v2-diffmin/jinn.plugin.json +1 -1
- package/plugins/swe-rebench-v2-diffmin/skills/diffmin/SKILL.md +15 -10
- package/plugins/swe-rebench-v2-diffmin/skills/test-map/SKILL.md +10 -12
- package/plugins/swe-rebench-v2-runtime/.claude-plugin/plugin.json +1 -1
- package/plugins/swe-rebench-v2-runtime/.codex-plugin/plugin.json +3 -3
- package/plugins/swe-rebench-v2-runtime/README.md +6 -6
- package/plugins/swe-rebench-v2-runtime/hooks/hooks.json +16 -0
- package/plugins/swe-rebench-v2-runtime/hooks/session-start +74 -0
- package/plugins/swe-rebench-v2-runtime/jinn.plugin.json +2 -3
- package/plugins/swe-rebench-v2-runtime/skills/task/SKILL.md +81 -0
- package/dist/dashboard/assets/index-BUlE8F3Y.js +0 -330
- package/dist/dashboard/assets/index-blqc7eqq.css +0 -32
- package/plugins/swe-rebench-v2-runtime/skills/orient/SKILL.md +0 -29
- package/plugins/swe-rebench-v2-runtime/skills/plan/SKILL.md +0 -53
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { CLAUDE_CODE_HARNESS, CODEX_HARNESS, canonicalHarnessName } from '../harnesses/names.js';
|
|
4
|
+
import { estimateModelCost } from '../harnesses/cost-estimates.js';
|
|
5
|
+
import { priceTokens } from './pricing.js';
|
|
6
|
+
/** USD attributed to a task whose model has no known price. */
|
|
7
|
+
export const UNKNOWN_MODEL_FALLBACK_USD = 1.0;
|
|
8
|
+
/** Parse Claude Code `--output-format stream-json` output for the terminal result. */
|
|
9
|
+
export function parseClaudeCodeUsage(stdoutJsonl) {
|
|
10
|
+
let result = null;
|
|
11
|
+
for (const line of stdoutJsonl.split('\n')) {
|
|
12
|
+
const trimmed = line.trim();
|
|
13
|
+
if (!trimmed)
|
|
14
|
+
continue;
|
|
15
|
+
let obj;
|
|
16
|
+
try {
|
|
17
|
+
obj = JSON.parse(trimmed);
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
if (obj['type'] === 'result' && typeof obj['total_cost_usd'] === 'number') {
|
|
23
|
+
const usage = obj['usage'];
|
|
24
|
+
result = {
|
|
25
|
+
costUsd: obj['total_cost_usd'],
|
|
26
|
+
inputTokens: typeof usage?.['input_tokens'] === 'number' ? usage['input_tokens'] : undefined,
|
|
27
|
+
outputTokens: typeof usage?.['output_tokens'] === 'number' ? usage['output_tokens'] : undefined,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return result;
|
|
32
|
+
}
|
|
33
|
+
/** Parse Codex `--json` output for the last turn.completed token usage. */
|
|
34
|
+
export function parseCodexUsage(stdoutJsonl) {
|
|
35
|
+
let result = null;
|
|
36
|
+
for (const line of stdoutJsonl.split('\n')) {
|
|
37
|
+
const trimmed = line.trim();
|
|
38
|
+
if (!trimmed)
|
|
39
|
+
continue;
|
|
40
|
+
let obj;
|
|
41
|
+
try {
|
|
42
|
+
obj = JSON.parse(trimmed);
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
if (obj['type'] === 'turn.completed' && obj['usage']) {
|
|
48
|
+
const usage = obj['usage'];
|
|
49
|
+
const inT = usage['input_tokens'];
|
|
50
|
+
const outT = usage['output_tokens'];
|
|
51
|
+
if (typeof inT === 'number' && typeof outT === 'number') {
|
|
52
|
+
result = { inputTokens: inT, outputTokens: outT };
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return result;
|
|
57
|
+
}
|
|
58
|
+
function heuristicUsage(model) {
|
|
59
|
+
const est = model ? estimateModelCost(model) : null;
|
|
60
|
+
return {
|
|
61
|
+
model: model ?? 'unknown',
|
|
62
|
+
costUsd: est?.usd ?? UNKNOWN_MODEL_FALLBACK_USD,
|
|
63
|
+
estimated: true,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Determine the USD cost of a finished harness run. Reads the harness's own
|
|
68
|
+
* output file for observed usage; falls back to a heuristic on any failure.
|
|
69
|
+
* Always returns a HarnessUsage — never throws.
|
|
70
|
+
*/
|
|
71
|
+
export function harvestHarnessUsage(harness, workingDir, model) {
|
|
72
|
+
try {
|
|
73
|
+
const canonical = canonicalHarnessName(harness);
|
|
74
|
+
if (canonical === CLAUDE_CODE_HARNESS) {
|
|
75
|
+
const raw = readFileSync(join(workingDir, '.claude-code', 'stdout.jsonl'), 'utf8');
|
|
76
|
+
const parsed = parseClaudeCodeUsage(raw);
|
|
77
|
+
if (parsed) {
|
|
78
|
+
return {
|
|
79
|
+
model: model ?? 'unknown',
|
|
80
|
+
costUsd: parsed.costUsd,
|
|
81
|
+
estimated: false,
|
|
82
|
+
inputTokens: parsed.inputTokens,
|
|
83
|
+
outputTokens: parsed.outputTokens,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
return heuristicUsage(model);
|
|
87
|
+
}
|
|
88
|
+
if (canonical === CODEX_HARNESS) {
|
|
89
|
+
const raw = readFileSync(join(workingDir, '.codex-code', 'stdout.jsonl'), 'utf8');
|
|
90
|
+
const parsed = parseCodexUsage(raw);
|
|
91
|
+
// When there is no model id, parsed token counts cannot be priced —
|
|
92
|
+
// discard them and fall back to the heuristic (per spec).
|
|
93
|
+
if (parsed && model) {
|
|
94
|
+
const usd = priceTokens(model, parsed);
|
|
95
|
+
if (usd != null) {
|
|
96
|
+
return {
|
|
97
|
+
model,
|
|
98
|
+
costUsd: usd,
|
|
99
|
+
estimated: false,
|
|
100
|
+
inputTokens: parsed.inputTokens,
|
|
101
|
+
outputTokens: parsed.outputTokens,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return heuristicUsage(model);
|
|
106
|
+
}
|
|
107
|
+
return heuristicUsage(model);
|
|
108
|
+
}
|
|
109
|
+
catch {
|
|
110
|
+
return heuristicUsage(model);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=usage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage.js","sourceRoot":"","sources":["../../src/spend/usage.ts"],"names":[],"mappings":"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"}
|
package/dist/store/store.d.ts
CHANGED
|
@@ -10,6 +10,17 @@ export interface ActivityEventInput {
|
|
|
10
10
|
solverType?: string | null;
|
|
11
11
|
outcome?: string | null;
|
|
12
12
|
detail?: string | null;
|
|
13
|
+
credentialId?: string | null;
|
|
14
|
+
costUsdMicros?: number | null;
|
|
15
|
+
model?: string | null;
|
|
16
|
+
/** Projected AI units debited at claim time (issue #815). Estimates are the gate input; never recomputed. */
|
|
17
|
+
aiUnits?: number | null;
|
|
18
|
+
/** Lifecycle stamp on the per-request row: 'claimed' | 'claim_failed' | 'delivered'. */
|
|
19
|
+
claimStatus?: string | null;
|
|
20
|
+
/** USD estimate captured at claim time (micros). Distinct from `actualCostUsdMicros` filled on completion. */
|
|
21
|
+
estimatedCostUsdMicros?: number | null;
|
|
22
|
+
/** USD actually billed (micros) — filled by the completion path; null until then. */
|
|
23
|
+
actualCostUsdMicros?: number | null;
|
|
13
24
|
}
|
|
14
25
|
export interface ActivityEventRow {
|
|
15
26
|
id: number;
|
|
@@ -21,6 +32,13 @@ export interface ActivityEventRow {
|
|
|
21
32
|
solverType: string | null;
|
|
22
33
|
outcome: string | null;
|
|
23
34
|
detail: string | null;
|
|
35
|
+
credentialId: string | null;
|
|
36
|
+
costUsdMicros: number | null;
|
|
37
|
+
model: string | null;
|
|
38
|
+
aiUnits: number | null;
|
|
39
|
+
claimStatus: string | null;
|
|
40
|
+
estimatedCostUsdMicros: number | null;
|
|
41
|
+
actualCostUsdMicros: number | null;
|
|
24
42
|
}
|
|
25
43
|
export interface RewardClaimInput {
|
|
26
44
|
ts: string;
|
|
@@ -148,6 +166,22 @@ export interface NetworkArtifactMetadataRow {
|
|
|
148
166
|
lastUsedAt: string;
|
|
149
167
|
peerCatalogId: string | null;
|
|
150
168
|
}
|
|
169
|
+
export interface Erc8004AnchorInput {
|
|
170
|
+
envelopeId: string;
|
|
171
|
+
envelopeCid: string;
|
|
172
|
+
contentKind: string;
|
|
173
|
+
metadataKey: string;
|
|
174
|
+
agentId: string;
|
|
175
|
+
chainId: number;
|
|
176
|
+
identityRegistryAddress: string;
|
|
177
|
+
txHash: string;
|
|
178
|
+
blockNumber: number | null;
|
|
179
|
+
payloadHex: string;
|
|
180
|
+
anchoredAt: number;
|
|
181
|
+
}
|
|
182
|
+
export interface Erc8004AnchorRow extends Erc8004AnchorInput {
|
|
183
|
+
id: number;
|
|
184
|
+
}
|
|
151
185
|
export type TaskPostingPolicyType = 'once_per_safe' | 'once_per_bucket' | 'interval';
|
|
152
186
|
type LauncherTaskProjectionState = 'open' | 'claims-in-flight' | 'fully-claimed' | 'settled' | 'failed';
|
|
153
187
|
export interface TaskPostRecord {
|
|
@@ -185,6 +219,8 @@ export declare class Store {
|
|
|
185
219
|
private ensureTaskPostsTaskCoordinatorColumns;
|
|
186
220
|
/** Older local DBs may have the projection table from before Task grouping fields landed. */
|
|
187
221
|
private ensureEnvelopeProjectionColumns;
|
|
222
|
+
/** Older local DBs predate the per-credential spend-ledger columns on activity_events. */
|
|
223
|
+
private ensureActivityEventCostColumns;
|
|
188
224
|
/**
|
|
189
225
|
* Task-native startup ignores the retired request-first `restoration_intents`
|
|
190
226
|
* table. Keep a one-time local marker when old in-flight rows are present so
|
|
@@ -194,6 +230,14 @@ export declare class Store {
|
|
|
194
230
|
/** Idempotent: older DBs before idx_reward_claims_tx may lack the unique index. */
|
|
195
231
|
private ensureRewardClaimsTxIndex;
|
|
196
232
|
recordOwnActivity(requestId: string, role: 'created' | 'claimed' | 'delivered' | 'evaluated'): void;
|
|
233
|
+
/**
|
|
234
|
+
* Membership-only variant of `recordOwnActivity`: writes the
|
|
235
|
+
* `own_activity` row but does NOT emit a generic `activity_events`
|
|
236
|
+
* row. Used by paths that emit their own enriched activity event
|
|
237
|
+
* (e.g. issue #815's claim path attaches credentialId / aiUnits /
|
|
238
|
+
* estimatedCostUsdMicros / claimStatus to the row).
|
|
239
|
+
*/
|
|
240
|
+
markOwnActivity(requestId: string, role: 'created' | 'claimed' | 'delivered' | 'evaluated'): void;
|
|
197
241
|
isOwnActivity(requestId: string): boolean;
|
|
198
242
|
setShutdownState(state: 'clean' | 'running'): void;
|
|
199
243
|
getShutdownState(): string | null;
|
|
@@ -279,8 +323,106 @@ export declare class Store {
|
|
|
279
323
|
since?: string;
|
|
280
324
|
cursor?: string;
|
|
281
325
|
}): ActivityEventRow[];
|
|
326
|
+
/**
|
|
327
|
+
* Total cost in micro-dollars recorded against a credential since the most
|
|
328
|
+
* recent UTC midnight. Backs the daily spend cap.
|
|
329
|
+
*/
|
|
330
|
+
spentTodayMicros(credentialId: string, now?: Date): number;
|
|
331
|
+
/**
|
|
332
|
+
* Sum of `ai_units` for a credential within the current 6h UTC-aligned
|
|
333
|
+
* block (00:00 / 06:00 / 12:00 / 18:00 boundaries). Reads only rows whose
|
|
334
|
+
* `claim_status = 'claimed'` or `'delivered'` so failed-claim rows
|
|
335
|
+
* (`ai_units = 0`, `claim_status = 'claim_failed'`) don't muddy the sum
|
|
336
|
+
* even though their contribution is already zero.
|
|
337
|
+
*
|
|
338
|
+
* Issue #815. Backs the per-block AI-units ceiling gate.
|
|
339
|
+
*/
|
|
340
|
+
aiUnitsThisBlock(credentialId: string, now?: Date): number;
|
|
341
|
+
/**
|
|
342
|
+
* Sum of `ai_units` for a credential within the trailing 7-day rolling
|
|
343
|
+
* window from `now`. Backs the per-week AI-units safety-net ceiling.
|
|
344
|
+
* Issue #815.
|
|
345
|
+
*/
|
|
346
|
+
aiUnitsThisWeek(credentialId: string, now?: Date): number;
|
|
347
|
+
/**
|
|
348
|
+
* Actual-spend accumulator for the current 6h UTC block (issue #1004).
|
|
349
|
+
*
|
|
350
|
+
* Sums `COALESCE(actual_cost_usd_micros, estimated_cost_usd_micros, 0)`
|
|
351
|
+
* over rows whose `claim_status` is `'claimed'` or `'delivered'`:
|
|
352
|
+
* - delivered rows contribute the real harvested cost (`actual_*`),
|
|
353
|
+
* - in-flight claimed rows contribute their estimate so a burst of
|
|
354
|
+
* concurrent claims cannot slip the cap before any of them deliver,
|
|
355
|
+
* - failed claims (status `'claim_failed'`) are excluded.
|
|
356
|
+
*
|
|
357
|
+
* `estimated` is true iff the summed figure includes any estimate-backed
|
|
358
|
+
* cost: an in-flight `claimed` row with no `actual_cost_usd_micros` yet,
|
|
359
|
+
* OR a `delivered` row whose actual cost is itself a heuristic
|
|
360
|
+
* (`actual_cost_estimated = 1` — a telemetry-less harness such as Hermes).
|
|
361
|
+
* It is false only when every contributing row is harvested actual
|
|
362
|
+
* telemetry. The gate surfaces this so an estimate-backed figure is not
|
|
363
|
+
* presented as metered. Block boundaries mirror `aiUnitsThisBlock`.
|
|
364
|
+
*/
|
|
365
|
+
usdMicrosThisBlock(credentialId: string, now?: Date): {
|
|
366
|
+
usdMicros: number;
|
|
367
|
+
estimated: boolean;
|
|
368
|
+
};
|
|
369
|
+
/**
|
|
370
|
+
* Actual-spend accumulator for the trailing 7-day rolling window from
|
|
371
|
+
* `now` (issue #1004). Same COALESCE + claim_status filter + `estimated`
|
|
372
|
+
* semantics as {@link usdMicrosThisBlock}.
|
|
373
|
+
*/
|
|
374
|
+
usdMicrosThisWeek(credentialId: string, now?: Date): {
|
|
375
|
+
usdMicros: number;
|
|
376
|
+
estimated: boolean;
|
|
377
|
+
};
|
|
378
|
+
/** Shared COALESCE-sum + estimate-flag query for the USD accumulators. */
|
|
379
|
+
private sumUsdMicros;
|
|
380
|
+
/**
|
|
381
|
+
* True iff an `ai_units_cap_reached` row exists for the given
|
|
382
|
+
* (credentialId, window, blockId). Used by the daemon to hydrate the
|
|
383
|
+
* AI-units gate's in-memory pause memo across restarts so the
|
|
384
|
+
* "exactly one event per (credential, window, block-id)" guarantee
|
|
385
|
+
* holds across process boundaries (issue #815, finding 1).
|
|
386
|
+
*
|
|
387
|
+
* Lookup is by `credential_id` + `kind` + the `[block=...][window=...]`
|
|
388
|
+
* markers that `daemon.ts` embeds in the row's `detail` string.
|
|
389
|
+
*/
|
|
390
|
+
hasAiUnitsCapReachedFor(credentialId: string, window: 'block' | 'week', blockId: string): boolean;
|
|
391
|
+
/**
|
|
392
|
+
* Mark the per-request `claimed` row as `delivered` and record
|
|
393
|
+
* `actual_cost_usd_micros` (issue #1004 — the gate's accumulator now
|
|
394
|
+
* reads this column via COALESCE, so a delivered row's real harvested
|
|
395
|
+
* cost replaces its claim-time estimate in the running total). The
|
|
396
|
+
* `ai_units` projection captured at claim time is intentionally NOT
|
|
397
|
+
* recomputed — it remains the per-task estimate for the legacy unit
|
|
398
|
+
* surfaces. For subscription credentials the resulting USD figure is a
|
|
399
|
+
* *proxy* budget, not an exact bound on the provider's plan quota.
|
|
400
|
+
*
|
|
401
|
+
* `actualCostEstimated` (issue #1004, AC4) records whether the actual
|
|
402
|
+
* cost is itself a heuristic — true for a telemetry-less harness such as
|
|
403
|
+
* Hermes whose `harvestHarnessUsage` falls back to an a-priori estimate,
|
|
404
|
+
* false when the figure is harvested telemetry. The gate reads it so a
|
|
405
|
+
* delivered-but-heuristic row reports `estimated: true` rather than being
|
|
406
|
+
* presented as metered. Idempotent: a no-op when no `claimed` row exists.
|
|
407
|
+
*/
|
|
408
|
+
finalizeClaimDelivered(requestId: string, actualCostUsdMicros: number, actualCostEstimated: boolean): void;
|
|
282
409
|
/** Newer events first, then ascending id for `jinn logs --follow` (oldest in batch printed first in caller). */
|
|
283
410
|
getActivityEventsAfterId(afterId: number, limit: number): ActivityEventRow[];
|
|
411
|
+
/**
|
|
412
|
+
* Filtered, id-cursored page of activity events for the dedicated Events
|
|
413
|
+
* page. Newest-first.
|
|
414
|
+
*
|
|
415
|
+
* Cursors on `id` rather than `ts` so startup/shutdown rows with null
|
|
416
|
+
* timestamps remain reachable.
|
|
417
|
+
*/
|
|
418
|
+
getActivityEventsPage(opts?: {
|
|
419
|
+
kinds?: string[];
|
|
420
|
+
outcome?: string;
|
|
421
|
+
requestId?: string;
|
|
422
|
+
beforeId?: number;
|
|
423
|
+
limit?: number;
|
|
424
|
+
}): ActivityEventRow[];
|
|
425
|
+
getActivityEventById(id: number): ActivityEventRow | null;
|
|
284
426
|
getActivityCountsByKind(): Record<string, number>;
|
|
285
427
|
getLastEventAtForService(serviceIndex: number): string | null;
|
|
286
428
|
getActivityCountsForService(serviceIndex: number): Record<string, number>;
|
|
@@ -398,6 +540,51 @@ export declare class Store {
|
|
|
398
540
|
}>;
|
|
399
541
|
saveEnvelopeProjection(projection: EnvelopeProjection): void;
|
|
400
542
|
queryEnvelopeProjections(query?: EnvelopeProjectionQuery): EnvelopeProjection[];
|
|
543
|
+
saveErc8004Anchor(input: Erc8004AnchorInput): void;
|
|
544
|
+
listErc8004AnchorsByEnvelopeCids(envelopeCids: readonly string[]): Erc8004AnchorRow[];
|
|
545
|
+
/**
|
|
546
|
+
* Upsert one held-out eval result (issue #818). PK is
|
|
547
|
+
* `(checkpoint_cid, slate_version, instance_id)` so a re-run overwrites.
|
|
548
|
+
* `passed` is null for `unscorable` rows.
|
|
549
|
+
*/
|
|
550
|
+
recordEvalResult(args: EvalResultRecord): void;
|
|
551
|
+
/**
|
|
552
|
+
* Aggregate the eval results for a (checkpoint, slate version):
|
|
553
|
+
* `scorable` = rows with `unscorable = 0`; `passed` = scorable rows with
|
|
554
|
+
* `passed = 1`. Unscorable rows are counted separately and never enter the
|
|
555
|
+
* denominator. A checkpoint with no rows yields all-zero (the orchestrator
|
|
556
|
+
* reads this to detect a not-yet-evaluated parent).
|
|
557
|
+
*/
|
|
558
|
+
getEvalAggregate(checkpoint_cid: string, slate_version: string): EvalAggregate;
|
|
559
|
+
/**
|
|
560
|
+
* Distinct `slate_hash` values recorded for a (checkpoint, slate version).
|
|
561
|
+
* The eval orchestrator reads this to detect slate-content drift under a
|
|
562
|
+
* stable version label — the held-out exam is only an honest before/after
|
|
563
|
+
* when the parent and child were scored on the SAME slate content (defeating
|
|
564
|
+
* confounder #1, task-selection). Empty when the checkpoint has no rows.
|
|
565
|
+
*/
|
|
566
|
+
getEvalSlateHashes(checkpoint_cid: string, slate_version: string): string[];
|
|
567
|
+
/** Per-task eval results for a (checkpoint, slate version), ordered by instance_id. */
|
|
568
|
+
getEvalResults(checkpoint_cid: string, slate_version: string): EvalResultRow[];
|
|
401
569
|
close(): void;
|
|
402
570
|
}
|
|
571
|
+
export interface EvalResultRecord {
|
|
572
|
+
checkpoint_cid: string;
|
|
573
|
+
slate_hash: string;
|
|
574
|
+
slate_version: string;
|
|
575
|
+
instance_id: string;
|
|
576
|
+
/** Pass/fail; ignored (stored NULL) when `unscorable` is true. */
|
|
577
|
+
passed: boolean | null;
|
|
578
|
+
unscorable: boolean;
|
|
579
|
+
code_digest: string;
|
|
580
|
+
run_at_ms: number;
|
|
581
|
+
test_log_excerpt?: string | null;
|
|
582
|
+
}
|
|
583
|
+
/** A persisted eval result read back from the store (same shape as the record written). */
|
|
584
|
+
export type EvalResultRow = EvalResultRecord;
|
|
585
|
+
export interface EvalAggregate {
|
|
586
|
+
passed: number;
|
|
587
|
+
scorable: number;
|
|
588
|
+
unscorable: number;
|
|
589
|
+
}
|
|
403
590
|
export {};
|