@jinn-network/client 0.1.8 → 0.1.9-canary.01623b98
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +2 -2
- package/README.md +6 -0
- package/deployments/deployment-phase1b-mech-baseSepolia-fast.json +3 -3
- package/deployments/deployment-stolas-l2-baseSepolia-fast.json +23 -3
- package/deployments/deployment-task-coordinator-router-v3-baseSepolia-fast.json +34 -6
- package/dist/adapters/mech/adapter.d.ts +31 -1
- package/dist/adapters/mech/adapter.js +129 -54
- package/dist/adapters/mech/adapter.js.map +1 -1
- package/dist/adapters/mech/contracts.d.ts +174 -13
- package/dist/adapters/mech/contracts.js +99 -49
- 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.js +77 -1
- package/dist/adapters/mech/safe.js.map +1 -1
- package/dist/adapters/mech/types.d.ts +5 -130
- package/dist/adapters/mech/types.js +9 -65
- package/dist/adapters/mech/types.js.map +1 -1
- package/dist/adapters/mech/verdict-code.js +1 -1
- package/dist/adapters/mech/verdict-code.js.map +1 -1
- package/dist/api/bootstrap-endpoint.d.ts +19 -3
- package/dist/api/bootstrap-endpoint.js +4 -0
- package/dist/api/bootstrap-endpoint.js.map +1 -1
- 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 +49 -17
- package/dist/api/gather-status.js +94 -530
- package/dist/api/gather-status.js.map +1 -1
- package/dist/api/harness-auth-status-endpoint.d.ts +21 -0
- package/dist/api/harness-auth-status-endpoint.js +17 -0
- package/dist/api/harness-auth-status-endpoint.js.map +1 -0
- package/dist/api/launcher-endpoints.js +6 -1
- package/dist/api/launcher-endpoints.js.map +1 -1
- package/dist/api/launcher-status.d.ts +2 -0
- package/dist/api/launcher-status.js.map +1 -1
- package/dist/api/launcher-tasks.d.ts +47 -0
- package/dist/api/launcher-tasks.js +88 -3
- 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 +154 -0
- package/dist/api/loop-completion-build.js.map +1 -0
- package/dist/api/operator-artifacts-endpoint.js +1 -1
- package/dist/api/operator-artifacts-endpoint.js.map +1 -1
- package/dist/api/portfolio-v0-build.d.ts +2 -1
- package/dist/api/portfolio-v0-build.js +5 -7
- package/dist/api/portfolio-v0-build.js.map +1 -1
- package/dist/api/prediction-v1-build.d.ts +2 -2
- package/dist/api/prediction-v1-build.js +5 -7
- package/dist/api/prediction-v1-build.js.map +1 -1
- package/dist/api/rewards-build.d.ts +8 -1
- package/dist/api/rewards-build.js +32 -4
- package/dist/api/rewards-build.js.map +1 -1
- package/dist/api/rewards-endpoint.d.ts +12 -0
- package/dist/api/rewards-endpoint.js +46 -0
- package/dist/api/rewards-endpoint.js.map +1 -0
- package/dist/api/run-outcome.d.ts +49 -0
- package/dist/api/run-outcome.js +65 -0
- package/dist/api/run-outcome.js.map +1 -0
- package/dist/api/server.d.ts +6 -16
- package/dist/api/server.js +36 -26
- package/dist/api/server.js.map +1 -1
- package/dist/api/setup-endpoints.d.ts +45 -0
- package/dist/api/setup-endpoints.js +271 -52
- package/dist/api/setup-endpoints.js.map +1 -1
- package/dist/api/solvernets-endpoints.js +4 -1
- package/dist/api/solvernets-endpoints.js.map +1 -1
- package/dist/api/status-build.d.ts +71 -94
- package/dist/api/status-build.js +12 -81
- package/dist/api/status-build.js.map +1 -1
- 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/stop-hook.d.ts +1 -1
- package/dist/api/stop-hook.js +1 -1
- package/dist/api/stop-hook.js.map +1 -1
- package/dist/api/task-run-routing.d.ts +1 -1
- package/dist/api/task-runs-build.d.ts +21 -2
- package/dist/api/task-runs-build.js +27 -7
- package/dist/api/task-runs-build.js.map +1 -1
- package/dist/bin/jinn-distill-mcp.js +813 -0
- package/dist/bin/jinn-layer.js +14057 -0
- package/dist/build-info.json +4 -4
- package/dist/build-meta.json +1 -1
- package/dist/captures/distil-export.d.ts +54 -0
- package/dist/captures/distil-export.js +135 -0
- package/dist/captures/distil-export.js.map +1 -0
- package/dist/captures/ingest.d.ts +21 -0
- package/dist/captures/ingest.js +144 -0
- package/dist/captures/ingest.js.map +1 -0
- package/dist/captures/live-publisher.d.ts +9 -0
- package/dist/captures/live-publisher.js +5 -3
- package/dist/captures/live-publisher.js.map +1 -1
- package/dist/captures/publish.d.ts +15 -0
- package/dist/captures/publish.js +17 -7
- package/dist/captures/publish.js.map +1 -1
- package/dist/cli/commands/codedigest-revert-check.js +6 -2
- package/dist/cli/commands/codedigest-revert-check.js.map +1 -1
- package/dist/cli/commands/doctor.d.ts +3 -0
- package/dist/cli/commands/doctor.js +36 -4
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/eval.d.ts +87 -0
- package/dist/cli/commands/eval.js +481 -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 +39 -10
- package/dist/cli/commands/rewards.js.map +1 -1
- package/dist/cli/commands/solver-nets.d.ts +6 -0
- package/dist/cli/commands/solver-nets.js +177 -0
- package/dist/cli/commands/solver-nets.js.map +1 -1
- package/dist/cli/commands/solver-plugins.js +2 -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/update.js +8 -0
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/commands/version.js +4 -0
- package/dist/cli/commands/version.js.map +1 -1
- package/dist/cli/execution-context.js +2 -1
- package/dist/cli/execution-context.js.map +1 -1
- package/dist/cli/index.js +2 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/introspection-context.js +0 -3
- package/dist/cli/introspection-context.js.map +1 -1
- package/dist/config.d.ts +235 -541
- package/dist/config.js +278 -197
- package/dist/config.js.map +1 -1
- package/dist/contracts/abis.d.ts +100 -0
- package/dist/contracts/abis.js +58 -0
- package/dist/contracts/abis.js.map +1 -0
- package/dist/contracts/addresses.d.ts +36 -0
- package/dist/contracts/addresses.js +60 -0
- package/dist/contracts/addresses.js.map +1 -0
- package/dist/corpus/acquire.d.ts +7 -6
- package/dist/corpus/acquire.js +10 -10
- package/dist/corpus/acquire.js.map +1 -1
- package/dist/corpus/fetch-artifact.d.ts +21 -0
- package/dist/corpus/fetch-artifact.js +33 -0
- package/dist/corpus/fetch-artifact.js.map +1 -0
- package/dist/corpus/index.d.ts +2 -2
- package/dist/corpus/onchain-query.d.ts +0 -1
- package/dist/corpus/onchain-query.js +2 -5
- package/dist/corpus/onchain-query.js.map +1 -1
- package/dist/corpus/route-resolver.d.ts +3 -3
- package/dist/corpus/route-resolver.js +3 -3
- package/dist/daemon/ai-units-gate.d.ts +6 -6
- package/dist/daemon/ai-units-gate.js +11 -10
- package/dist/daemon/ai-units-gate.js.map +1 -1
- package/dist/daemon/balance-topup-loop.js +27 -9
- package/dist/daemon/balance-topup-loop.js.map +1 -1
- package/dist/daemon/checkpoint-loop.js +2 -2
- package/dist/daemon/creator.d.ts +1 -0
- package/dist/daemon/creator.js +39 -25
- package/dist/daemon/creator.js.map +1 -1
- package/dist/daemon/daemon.d.ts +22 -10
- package/dist/daemon/daemon.js +133 -43
- package/dist/daemon/daemon.js.map +1 -1
- package/dist/daemon/delivery-watcher.d.ts +9 -0
- package/dist/daemon/delivery-watcher.js +24 -1
- package/dist/daemon/delivery-watcher.js.map +1 -1
- package/dist/daemon/eviction-loop.d.ts +10 -0
- package/dist/daemon/eviction-loop.js +22 -3
- package/dist/daemon/eviction-loop.js.map +1 -1
- package/dist/daemon/harvest-loop.d.ts +63 -0
- package/dist/daemon/harvest-loop.js +449 -0
- package/dist/daemon/harvest-loop.js.map +1 -0
- package/dist/daemon/join-applier.d.ts +35 -0
- package/dist/daemon/join-applier.js +49 -0
- package/dist/daemon/join-applier.js.map +1 -0
- package/dist/daemon/loop-heartbeat.d.ts +95 -0
- package/dist/daemon/loop-heartbeat.js +80 -0
- package/dist/daemon/loop-heartbeat.js.map +1 -0
- package/dist/{api/peers.js → daemon/peer-sync.js} +3 -1
- package/dist/daemon/peer-sync.js.map +1 -0
- package/dist/daemon/reward-claim-loop.js +28 -10
- package/dist/daemon/reward-claim-loop.js.map +1 -1
- package/dist/daemon/skip-log-dedup.d.ts +1 -1
- package/dist/daemon/skip-log-dedup.js +3 -0
- package/dist/daemon/skip-log-dedup.js.map +1 -1
- package/dist/daemon/spend-cap-gate.d.ts +0 -6
- package/dist/daemon/spend-cap-gate.js +1 -8
- package/dist/daemon/spend-cap-gate.js.map +1 -1
- package/dist/daemon/watchdog-loop.d.ts +84 -0
- package/dist/daemon/watchdog-loop.js +91 -0
- package/dist/daemon/watchdog-loop.js.map +1 -0
- package/dist/dashboard/assets/index-CwclFsAm.js +95 -0
- package/dist/dashboard/assets/index-D7rvJRNa.css +1 -0
- package/dist/dashboard/index.html +2 -2
- package/dist/discovery/http.d.ts +17 -0
- package/dist/discovery/http.js +459 -26
- package/dist/discovery/http.js.map +1 -1
- package/dist/discovery/onchain.js +185 -10
- package/dist/discovery/onchain.js.map +1 -1
- package/dist/discovery/types.d.ts +188 -0
- package/dist/discovery/types.js +40 -0
- package/dist/discovery/types.js.map +1 -1
- package/dist/discovery/with-fallback.js +33 -0
- package/dist/discovery/with-fallback.js.map +1 -1
- package/dist/earning/bootstrap-run.d.ts +25 -0
- package/dist/earning/bootstrap-run.js +315 -0
- package/dist/earning/bootstrap-run.js.map +1 -0
- package/dist/earning/bootstrap.d.ts +31 -11
- package/dist/earning/bootstrap.js +124 -223
- package/dist/earning/bootstrap.js.map +1 -1
- package/dist/earning/contracts.d.ts +2 -232
- package/dist/earning/contracts.js +16 -205
- package/dist/earning/contracts.js.map +1 -1
- package/dist/earning/faucet-topup-store.d.ts +41 -0
- package/dist/earning/faucet-topup-store.js +89 -0
- package/dist/earning/faucet-topup-store.js.map +1 -0
- 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/master-gas.d.ts +10 -0
- package/dist/earning/master-gas.js +11 -0
- package/dist/earning/master-gas.js.map +1 -0
- package/dist/earning/safe-adapter.js +12 -45
- package/dist/earning/safe-adapter.js.map +1 -1
- package/dist/earning/steps/context.d.ts +42 -0
- package/dist/earning/steps/context.js +4 -0
- package/dist/earning/steps/context.js.map +1 -0
- package/dist/earning/steps/fleet-identity-register.d.ts +4 -0
- package/dist/earning/steps/fleet-identity-register.js +65 -0
- package/dist/earning/steps/fleet-identity-register.js.map +1 -0
- package/dist/earning/steps/fleet-safe-deploy.d.ts +4 -0
- package/dist/earning/steps/fleet-safe-deploy.js +62 -0
- package/dist/earning/steps/fleet-safe-deploy.js.map +1 -0
- package/dist/earning/steps/fleet-safe-predict.d.ts +4 -0
- package/dist/earning/steps/fleet-safe-predict.js +18 -0
- package/dist/earning/steps/fleet-safe-predict.js.map +1 -0
- package/dist/earning/steps/receipt-parsing.d.ts +12 -0
- package/dist/earning/steps/receipt-parsing.js +71 -0
- package/dist/earning/steps/receipt-parsing.js.map +1 -0
- package/dist/earning/stolas-claim.js +8 -8
- package/dist/earning/stolas-claim.js.map +1 -1
- package/dist/earning/{jinn-rewards.d.ts → stolas-staking.d.ts} +4 -8
- package/dist/earning/{jinn-rewards.js → stolas-staking.js} +25 -23
- package/dist/earning/stolas-staking.js.map +1 -0
- package/dist/earning/testnet-setup-migration.d.ts +1 -0
- package/dist/earning/testnet-setup-migration.js +7 -2
- package/dist/earning/testnet-setup-migration.js.map +1 -1
- package/dist/earning/types.d.ts +9 -9
- package/dist/earning/types.js +1 -1
- package/dist/earning/types.js.map +1 -1
- package/dist/earning/viem-clients.d.ts +3 -19
- package/dist/earning/viem-clients.js +4 -31
- package/dist/earning/viem-clients.js.map +1 -1
- package/dist/erc8004/addresses.d.ts +6 -5
- package/dist/erc8004/addresses.js +7 -5
- package/dist/erc8004/addresses.js.map +1 -1
- package/dist/erc8004/identity.d.ts +12 -1
- package/dist/erc8004/identity.js +31 -0
- package/dist/erc8004/identity.js.map +1 -1
- package/dist/erc8004/index.d.ts +1 -1
- package/dist/erc8004/index.js +1 -1
- package/dist/erc8004/index.js.map +1 -1
- package/dist/erc8004/reputation.js +16 -12
- package/dist/erc8004/reputation.js.map +1 -1
- package/dist/erc8004/validation.js +5 -4
- package/dist/erc8004/validation.js.map +1 -1
- package/dist/eval/capability-slate.d.ts +54 -0
- package/dist/eval/capability-slate.js +116 -0
- package/dist/eval/capability-slate.js.map +1 -0
- package/dist/eval/capability-stats.d.ts +39 -0
- package/dist/eval/capability-stats.js +123 -0
- package/dist/eval/capability-stats.js.map +1 -0
- package/dist/eval/contested-band.d.ts +18 -0
- package/dist/eval/contested-band.js +19 -0
- package/dist/eval/contested-band.js.map +1 -0
- package/dist/eval/corpus-index.d.ts +21 -0
- package/dist/eval/corpus-index.js +55 -0
- package/dist/eval/corpus-index.js.map +1 -0
- package/dist/eval/disjointness.d.ts +26 -0
- package/dist/eval/disjointness.js +67 -0
- package/dist/eval/disjointness.js.map +1 -0
- 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/mcnemar-power.d.ts +14 -0
- package/dist/eval/mcnemar-power.js +40 -0
- package/dist/eval/mcnemar-power.js.map +1 -0
- package/dist/eval/orchestrator.d.ts +224 -0
- package/dist/eval/orchestrator.js +250 -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 +1 -1
- package/dist/events/types.js +1 -1
- package/dist/events/types.js.map +1 -1
- package/dist/harnesses/auth-source.d.ts +51 -0
- package/dist/harnesses/auth-source.js +155 -0
- package/dist/harnesses/auth-source.js.map +1 -0
- 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 +40 -1
- package/dist/harnesses/engine/engine.js +100 -11
- package/dist/harnesses/engine/engine.js.map +1 -1
- package/dist/harnesses/engine/packaging.js +5 -5
- package/dist/harnesses/engine/packaging.js.map +1 -1
- package/dist/harnesses/engine/persistence.d.ts +19 -61
- package/dist/harnesses/engine/persistence.js +28 -0
- package/dist/harnesses/engine/persistence.js.map +1 -1
- package/dist/harnesses/impls/_evaluator-base.d.ts +48 -0
- package/dist/harnesses/impls/_evaluator-base.js +35 -0
- package/dist/harnesses/impls/_evaluator-base.js.map +1 -0
- package/dist/harnesses/impls/claude-mcp-hyperliquid/mcp-tools.d.ts +1 -1
- package/dist/harnesses/impls/claude-mcp-hyperliquid/mcp-tools.js +1 -1
- package/dist/harnesses/impls/claude-mcp-hyperliquid/mcp-tools.js.map +1 -1
- package/dist/harnesses/impls/claude-mcp-prediction/index.d.ts +2 -3
- package/dist/harnesses/impls/claude-mcp-prediction/index.js +29 -99
- package/dist/harnesses/impls/claude-mcp-prediction/index.js.map +1 -1
- package/dist/harnesses/impls/claude-mcp-prediction/mcp-tools.js +4 -21
- package/dist/harnesses/impls/claude-mcp-prediction/mcp-tools.js.map +1 -1
- package/dist/harnesses/impls/claude-mcp-prediction/session-orchestrator.d.ts +2 -0
- package/dist/harnesses/impls/claude-mcp-prediction/session-orchestrator.js +1 -1
- package/dist/harnesses/impls/claude-mcp-prediction/session-orchestrator.js.map +1 -1
- package/dist/harnesses/impls/claude-mcp-prediction-apy/index.js +30 -79
- package/dist/harnesses/impls/claude-mcp-prediction-apy/index.js.map +1 -1
- package/dist/harnesses/impls/claude-mcp-prediction-apy/mcp-tools.js +4 -19
- package/dist/harnesses/impls/claude-mcp-prediction-apy/mcp-tools.js.map +1 -1
- package/dist/harnesses/impls/claude-mcp-prediction-apy/session-orchestrator.d.ts +2 -0
- package/dist/harnesses/impls/claude-mcp-prediction-apy/session-orchestrator.js +1 -1
- package/dist/harnesses/impls/claude-mcp-prediction-apy/session-orchestrator.js.map +1 -1
- package/dist/harnesses/impls/claude-mcp-shared/mcp-server-script.d.ts +39 -0
- package/dist/harnesses/impls/claude-mcp-shared/mcp-server-script.js +62 -0
- package/dist/harnesses/impls/claude-mcp-shared/mcp-server-script.js.map +1 -0
- package/dist/harnesses/impls/claude-mcp-shared/mcp-server.d.ts +40 -0
- package/dist/harnesses/impls/claude-mcp-shared/mcp-server.js +44 -0
- package/dist/harnesses/impls/claude-mcp-shared/mcp-server.js.map +1 -0
- package/dist/harnesses/impls/claude-mcp-shared/single-session-harness.d.ts +56 -0
- package/dist/harnesses/impls/claude-mcp-shared/single-session-harness.js +79 -0
- package/dist/harnesses/impls/claude-mcp-shared/single-session-harness.js.map +1 -0
- package/dist/harnesses/impls/hermes-agent/adapter.d.ts +2 -0
- package/dist/harnesses/impls/hermes-agent/adapter.js +9 -6
- 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 +6 -1
- package/dist/harnesses/impls/hermes-agent/bootstrap.js.map +1 -1
- package/dist/harnesses/impls/hermes-agent/harness.d.ts +25 -3
- package/dist/harnesses/impls/hermes-agent/harness.js +89 -5
- package/dist/harnesses/impls/hermes-agent/harness.js.map +1 -1
- package/dist/harnesses/impls/index.d.ts +2 -0
- package/dist/harnesses/impls/index.js +10 -1
- package/dist/harnesses/impls/index.js.map +1 -1
- package/dist/harnesses/impls/jinn-repo-evaluator/eval-runner.d.ts +34 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/eval-runner.js +111 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/eval-runner.js.map +1 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/evaluator.d.ts +24 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/evaluator.js +19 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/evaluator.js.map +1 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/harness.d.ts +64 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/harness.js +125 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/harness.js.map +1 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/repro.d.ts +32 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/repro.js +73 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/repro.js.map +1 -0
- package/dist/harnesses/impls/learner/adapters/claude-code.js +5 -0
- package/dist/harnesses/impls/learner/adapters/claude-code.js.map +1 -1
- package/dist/harnesses/impls/learner/adapters/codex-code.d.ts +11 -1
- package/dist/harnesses/impls/learner/adapters/codex-code.js +130 -15
- package/dist/harnesses/impls/learner/adapters/codex-code.js.map +1 -1
- package/dist/harnesses/impls/learner/harness.d.ts +29 -1
- package/dist/harnesses/impls/learner/harness.js +93 -1
- package/dist/harnesses/impls/learner/harness.js.map +1 -1
- package/dist/harnesses/impls/learner/harvest.d.ts +2 -0
- package/dist/harnesses/impls/learner/harvest.js +51 -1
- 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/portfolio-v0-evaluator/index.d.ts +5 -15
- package/dist/harnesses/impls/portfolio-v0-evaluator/index.js +10 -29
- package/dist/harnesses/impls/portfolio-v0-evaluator/index.js.map +1 -1
- package/dist/harnesses/impls/prediction-apy-v0-evaluator/index.d.ts +5 -15
- package/dist/harnesses/impls/prediction-apy-v0-evaluator/index.js +10 -23
- package/dist/harnesses/impls/prediction-apy-v0-evaluator/index.js.map +1 -1
- package/dist/harnesses/impls/prediction-v0-evaluator/index.d.ts +5 -15
- package/dist/harnesses/impls/prediction-v0-evaluator/index.js +10 -25
- package/dist/harnesses/impls/prediction-v0-evaluator/index.js.map +1 -1
- package/dist/harnesses/impls/stub.d.ts +2 -2
- package/dist/harnesses/impls/stub.js +2 -2
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/eval-runner.js +16 -2
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/eval-runner.js.map +1 -1
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/harness.d.ts +50 -6
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/harness.js +505 -35
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/harness.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/impls/swe-rebench-v2-evaluator/routing-task-row-fetcher.d.ts +37 -0
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/routing-task-row-fetcher.js +59 -0
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/routing-task-row-fetcher.js.map +1 -0
- package/dist/harnesses/readiness-registry.d.ts +16 -0
- package/dist/harnesses/readiness-registry.js +28 -6
- package/dist/harnesses/readiness-registry.js.map +1 -1
- package/dist/harnesses/types.d.ts +26 -0
- package/dist/learner/revert-decision.d.ts +16 -1
- package/dist/learner/revert-decision.js +38 -18
- package/dist/learner/revert-decision.js.map +1 -1
- package/dist/learner/revert-stats.d.ts +14 -0
- package/dist/learner/revert-stats.js +42 -0
- package/dist/learner/revert-stats.js.map +1 -1
- package/dist/learner/verification-gate.d.ts +53 -0
- package/dist/learner/verification-gate.js +80 -0
- package/dist/learner/verification-gate.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 +236 -569
- package/dist/main.js.map +1 -1
- package/dist/mcp/acquire-artifact.d.ts +3 -3
- package/dist/mcp/acquire-artifact.js +3 -3
- package/dist/mcp/operator-server.js +1 -1
- package/dist/mcp/operator-server.js.map +1 -1
- package/dist/mcp/server.js +5 -6
- package/dist/mcp/server.js.map +1 -1
- package/dist/monitoring/net-liveness.d.ts +143 -0
- package/dist/monitoring/net-liveness.js +301 -0
- package/dist/monitoring/net-liveness.js.map +1 -0
- package/dist/observability/emit-event.d.ts +1 -1
- package/dist/observability/emit-event.js +1 -4
- package/dist/observability/emit-event.js.map +1 -1
- package/dist/observability/progress.d.ts +11 -0
- package/dist/observability/progress.js +16 -0
- package/dist/observability/progress.js.map +1 -0
- package/dist/pilot/arm-homes.d.ts +39 -0
- package/dist/pilot/arm-homes.js +104 -0
- package/dist/pilot/arm-homes.js.map +1 -0
- package/dist/pilot/cost.d.ts +19 -0
- package/dist/pilot/cost.js +31 -0
- package/dist/pilot/cost.js.map +1 -0
- package/dist/pilot/instance.d.ts +26 -0
- package/dist/pilot/instance.js +53 -0
- package/dist/pilot/instance.js.map +1 -0
- package/dist/pilot/pipeline.d.ts +17 -0
- package/dist/pilot/pipeline.js +35 -0
- package/dist/pilot/pipeline.js.map +1 -0
- package/dist/pilot/repo.d.ts +37 -0
- package/dist/pilot/repo.js +65 -0
- package/dist/pilot/repo.js.map +1 -0
- package/dist/pilot/resume.d.ts +101 -0
- package/dist/pilot/resume.js +204 -0
- package/dist/pilot/resume.js.map +1 -0
- package/dist/pilot/solve.d.ts +23 -0
- package/dist/pilot/solve.js +37 -0
- package/dist/pilot/solve.js.map +1 -0
- package/dist/pilot/tally.d.ts +42 -0
- package/dist/pilot/tally.js +100 -0
- package/dist/pilot/tally.js.map +1 -0
- package/dist/pilot/task-selection.d.ts +27 -0
- package/dist/pilot/task-selection.js +112 -0
- package/dist/pilot/task-selection.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 +4 -0
- package/dist/plugins/local-trace-distiller/.claude-plugin/plugin.json +9 -0
- package/dist/plugins/local-trace-distiller/.codex-plugin/plugin.json +41 -0
- package/dist/plugins/local-trace-distiller/.mcp.json +8 -0
- package/dist/plugins/local-trace-distiller/README.md +27 -0
- package/dist/plugins/local-trace-distiller/jinn.plugin.json +36 -0
- package/dist/plugins/local-trace-distiller/skills/distill/SKILL.md +51 -0
- package/dist/plugins/resolvers.js +7 -4
- package/dist/plugins/resolvers.js.map +1 -1
- package/dist/plugins/types.d.ts +8 -0
- package/dist/preflight/deployment-readiness.d.ts +127 -0
- package/dist/preflight/deployment-readiness.js +308 -0
- package/dist/preflight/deployment-readiness.js.map +1 -0
- package/dist/preflight/pidfile-liveness.d.ts +7 -1
- package/dist/preflight/pidfile-liveness.js +14 -0
- package/dist/preflight/pidfile-liveness.js.map +1 -1
- package/dist/preflight/rpc-network.d.ts +10 -3
- package/dist/preflight/rpc-network.js +46 -13
- package/dist/preflight/rpc-network.js.map +1 -1
- package/dist/preflight/stable-cwd.d.ts +29 -0
- package/dist/preflight/stable-cwd.js +98 -0
- package/dist/preflight/stable-cwd.js.map +1 -0
- package/dist/rpc/transport.d.ts +43 -5
- package/dist/rpc/transport.js +131 -30
- package/dist/rpc/transport.js.map +1 -1
- package/dist/scripts/swe-rebench-v2-evaluator.bundle.v1.patch +79 -0
- package/dist/scripts/swe-rebench-v2-seed-pool.json +2 -1
- package/dist/solver-nets/registry.d.ts +19 -0
- package/dist/solver-nets/registry.js +95 -66
- package/dist/solver-nets/registry.js.map +1 -1
- package/dist/solver-types/_jinn-repo-pool.d.ts +27 -0
- package/dist/solver-types/_jinn-repo-pool.js +27 -0
- package/dist/solver-types/_jinn-repo-pool.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-commit-echo-git.d.ts +46 -0
- package/dist/solver-types/_swe-rebench-v2-commit-echo-git.js +192 -0
- package/dist/solver-types/_swe-rebench-v2-commit-echo-git.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-commit-echo.d.ts +57 -0
- package/dist/solver-types/_swe-rebench-v2-commit-echo.js +57 -0
- package/dist/solver-types/_swe-rebench-v2-commit-echo.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-differential-admission.d.ts +395 -0
- package/dist/solver-types/_swe-rebench-v2-differential-admission.js +231 -0
- package/dist/solver-types/_swe-rebench-v2-differential-admission.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-empirical-tests.d.ts +47 -0
- package/dist/solver-types/_swe-rebench-v2-empirical-tests.js +67 -0
- package/dist/solver-types/_swe-rebench-v2-empirical-tests.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-escrow.d.ts +2 -0
- package/dist/solver-types/_swe-rebench-v2-escrow.js +13 -0
- package/dist/solver-types/_swe-rebench-v2-escrow.js.map +1 -1
- package/dist/solver-types/_swe-rebench-v2-guards.d.ts +42 -0
- package/dist/solver-types/_swe-rebench-v2-guards.js +111 -0
- package/dist/solver-types/_swe-rebench-v2-guards.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-harvest-state.d.ts +191 -0
- package/dist/solver-types/_swe-rebench-v2-harvest-state.js +349 -0
- package/dist/solver-types/_swe-rebench-v2-harvest-state.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-harvest.d.ts +92 -0
- package/dist/solver-types/_swe-rebench-v2-harvest.js +456 -0
- package/dist/solver-types/_swe-rebench-v2-harvest.js.map +1 -0
- 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-hunk-echo.d.ts +28 -0
- package/dist/solver-types/_swe-rebench-v2-hunk-echo.js +32 -0
- package/dist/solver-types/_swe-rebench-v2-hunk-echo.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-lookup-tripwire.d.ts +16 -0
- package/dist/solver-types/_swe-rebench-v2-lookup-tripwire.js +18 -0
- package/dist/solver-types/_swe-rebench-v2-lookup-tripwire.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-mint-cli.d.ts +73 -0
- package/dist/solver-types/_swe-rebench-v2-mint-cli.js +388 -0
- package/dist/solver-types/_swe-rebench-v2-mint-cli.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-minted-environment-verifier.d.ts +25 -0
- package/dist/solver-types/_swe-rebench-v2-minted-environment-verifier.js +101 -0
- package/dist/solver-types/_swe-rebench-v2-minted-environment-verifier.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-minted-pool.d.ts +144 -0
- package/dist/solver-types/_swe-rebench-v2-minted-pool.js +353 -0
- package/dist/solver-types/_swe-rebench-v2-minted-pool.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-state.d.ts +9 -0
- package/dist/solver-types/_swe-rebench-v2-state.js +14 -0
- package/dist/solver-types/_swe-rebench-v2-state.js.map +1 -1
- package/dist/solver-types/_swe-rebench-v2-substrate.d.ts +11 -0
- package/dist/solver-types/_swe-rebench-v2-substrate.js +24 -0
- package/dist/solver-types/_swe-rebench-v2-substrate.js.map +1 -1
- package/dist/solver-types/_swe-rebench-v2-synthetic-claim.d.ts +9 -0
- package/dist/solver-types/_swe-rebench-v2-synthetic-claim.js +16 -0
- package/dist/solver-types/_swe-rebench-v2-synthetic-claim.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-validated-pool.d.ts +88 -1
- package/dist/solver-types/_swe-rebench-v2-validated-pool.js +202 -14
- package/dist/solver-types/_swe-rebench-v2-validated-pool.js.map +1 -1
- package/dist/solver-types/_swe-rebench-v2-yield-report-data.d.ts +5 -0
- package/dist/solver-types/_swe-rebench-v2-yield-report-data.js +16 -0
- package/dist/solver-types/_swe-rebench-v2-yield-report-data.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-yield.d.ts +51 -0
- package/dist/solver-types/_swe-rebench-v2-yield.js +53 -0
- package/dist/solver-types/_swe-rebench-v2-yield.js.map +1 -0
- package/dist/solver-types/index.js +2 -0
- package/dist/solver-types/index.js.map +1 -1
- package/dist/solver-types/jinn-repo-admit.d.ts +17 -0
- package/dist/solver-types/jinn-repo-admit.js +16 -0
- package/dist/solver-types/jinn-repo-admit.js.map +1 -0
- package/dist/solver-types/jinn-repo-auto.d.ts +60 -0
- package/dist/solver-types/jinn-repo-auto.js +163 -0
- package/dist/solver-types/jinn-repo-auto.js.map +1 -0
- package/dist/solver-types/jinn-repo-definition.d.ts +15 -0
- package/dist/solver-types/jinn-repo-definition.js +34 -0
- package/dist/solver-types/jinn-repo-definition.js.map +1 -0
- package/dist/solver-types/jinn-repo-extract.d.ts +16 -0
- package/dist/solver-types/jinn-repo-extract.js +32 -0
- package/dist/solver-types/jinn-repo-extract.js.map +1 -0
- package/dist/solver-types/jinn-repo.d.ts +21 -0
- package/dist/solver-types/jinn-repo.js +23 -0
- package/dist/solver-types/jinn-repo.js.map +1 -0
- package/dist/solver-types/learner-loop-test.js +1 -1
- package/dist/solver-types/learner-loop-test.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/slates/held-out-slate.swe-rebench-v2.v3.json +34 -0
- package/dist/solver-types/slates/held-out-slate.swe-rebench-v2.v3.quality-screen.json +186 -0
- package/dist/solver-types/slates/held-out-slate.swe-rebench-v2.v3.screening-report.json +488 -0
- package/dist/solver-types/solver-type.d.ts +8 -0
- package/dist/solver-types/swe-rebench-v2-auto.d.ts +13 -0
- package/dist/solver-types/swe-rebench-v2-auto.js +36 -1
- package/dist/solver-types/swe-rebench-v2-auto.js.map +1 -1
- package/dist/solver-types/swe-rebench-v2.d.ts +2 -0
- package/dist/solver-types/swe-rebench-v2.js +153 -12
- package/dist/solver-types/swe-rebench-v2.js.map +1 -1
- package/dist/solvernets/launched-record-dispatcher.d.ts +5 -0
- package/dist/solvernets/launched-record-dispatcher.js +14 -1
- package/dist/solvernets/launched-record-dispatcher.js.map +1 -1
- package/dist/solvernets/registry-client-erc8004.js +29 -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 +1 -1
- package/dist/solvernets/store.js +8 -3
- package/dist/solvernets/store.js.map +1 -1
- package/dist/spend/ai-units-config.d.ts +10 -0
- package/dist/spend/ai-units-config.js +7 -1
- package/dist/spend/ai-units-config.js.map +1 -1
- package/dist/spend/ai-units.d.ts +51 -0
- package/dist/spend/ai-units.js +73 -0
- package/dist/spend/ai-units.js.map +1 -1
- package/dist/spend/credential.d.ts +2 -2
- package/dist/spend/credential.js +9 -3
- package/dist/spend/credential.js.map +1 -1
- package/dist/spend/record.js +12 -5
- package/dist/spend/record.js.map +1 -1
- package/dist/spend/spend-cap.d.ts +10 -0
- package/dist/spend/spend-cap.js +13 -0
- package/dist/spend/spend-cap.js.map +1 -0
- package/dist/spend/usage.js +39 -3
- package/dist/spend/usage.js.map +1 -1
- package/dist/store/store.d.ts +106 -5
- package/dist/store/store.js +194 -8
- package/dist/store/store.js.map +1 -1
- package/dist/task-creator/environment/adapters.d.ts +139 -0
- package/dist/task-creator/environment/adapters.js +446 -0
- package/dist/task-creator/environment/adapters.js.map +1 -0
- package/dist/task-creator/environment/build.d.ts +5 -0
- package/dist/task-creator/environment/build.js +53 -0
- package/dist/task-creator/environment/build.js.map +1 -0
- package/dist/task-creator/environment/contracts.d.ts +1338 -0
- package/dist/task-creator/environment/contracts.js +207 -0
- package/dist/task-creator/environment/contracts.js.map +1 -0
- package/dist/task-creator/environment/github.d.ts +25 -0
- package/dist/task-creator/environment/github.js +67 -0
- package/dist/task-creator/environment/github.js.map +1 -0
- package/dist/task-creator/environment/interfaces.d.ts +60 -0
- package/dist/task-creator/environment/interfaces.js +3 -0
- package/dist/task-creator/environment/interfaces.js.map +1 -0
- package/dist/task-creator/environment/jinn-differential-policy.d.ts +22 -0
- package/dist/task-creator/environment/jinn-differential-policy.js +73 -0
- package/dist/task-creator/environment/jinn-differential-policy.js.map +1 -0
- package/dist/task-creator/environment/policy.d.ts +38 -0
- package/dist/task-creator/environment/policy.js +51 -0
- package/dist/task-creator/environment/policy.js.map +1 -0
- package/dist/task-creator/environment/publication.d.ts +39 -0
- package/dist/task-creator/environment/publication.js +139 -0
- package/dist/task-creator/environment/publication.js.map +1 -0
- package/dist/task-creator/environment/publish-cli.d.ts +427 -0
- package/dist/task-creator/environment/publish-cli.js +180 -0
- package/dist/task-creator/environment/publish-cli.js.map +1 -0
- package/dist/task-creator/environment/recipes.d.ts +19 -0
- package/dist/task-creator/environment/recipes.js +122 -0
- package/dist/task-creator/environment/recipes.js.map +1 -0
- package/dist/task-creator/environment/resolver.d.ts +53 -0
- package/dist/task-creator/environment/resolver.js +57 -0
- package/dist/task-creator/environment/resolver.js.map +1 -0
- package/dist/task-creator/proofs/differential-receipt-bound-proof.d.ts +27 -0
- package/dist/task-creator/proofs/differential-receipt-bound-proof.js +86 -0
- package/dist/task-creator/proofs/differential-receipt-bound-proof.js.map +1 -0
- package/dist/task-creator/proofs/ipfs-cid.d.ts +7 -0
- package/dist/task-creator/proofs/ipfs-cid.js +98 -0
- package/dist/task-creator/proofs/ipfs-cid.js.map +1 -0
- package/dist/task-creator/proofs/live-proof.d.ts +99 -0
- package/dist/task-creator/proofs/live-proof.js +419 -0
- package/dist/task-creator/proofs/live-proof.js.map +1 -0
- package/dist/task-creator/proofs/public-repo-fixtures.d.ts +53 -0
- package/dist/task-creator/proofs/public-repo-fixtures.js +93 -0
- package/dist/task-creator/proofs/public-repo-fixtures.js.map +1 -0
- package/dist/task-creator/proofs/vitest-json-fixture.d.ts +40 -0
- package/dist/task-creator/proofs/vitest-json-fixture.js +115 -0
- package/dist/task-creator/proofs/vitest-json-fixture.js.map +1 -0
- package/dist/trajectory/emit.d.ts +6 -0
- package/dist/trajectory/emit.js +9 -1
- package/dist/trajectory/emit.js.map +1 -1
- package/dist/trajectory/harness-bundle-schema.d.ts +1 -1
- package/dist/trajectory/harness-bundle-schema.js +1 -1
- package/dist/trajectory/harness-bundle-schema.js.map +1 -1
- package/dist/trajectory/processors/identity-scrub.js +22 -3
- package/dist/trajectory/processors/identity-scrub.js.map +1 -1
- package/dist/trajectory/schema.d.ts +9 -1
- package/dist/trajectory/schema.js +5 -1
- package/dist/trajectory/schema.js.map +1 -1
- package/dist/trajectory/scrub/build.d.ts +49 -0
- package/dist/trajectory/scrub/build.js +89 -0
- package/dist/trajectory/scrub/build.js.map +1 -0
- package/dist/trajectory/scrub/emit-scrub.d.ts +41 -0
- package/dist/trajectory/scrub/emit-scrub.js +88 -0
- package/dist/trajectory/scrub/emit-scrub.js.map +1 -0
- package/dist/trajectory/scrub/key-policy.d.ts +20 -0
- package/dist/trajectory/scrub/key-policy.js +43 -0
- package/dist/trajectory/scrub/key-policy.js.map +1 -0
- package/dist/trajectory/scrub/layer2.d.ts +23 -0
- package/dist/trajectory/scrub/layer2.js +33 -0
- package/dist/trajectory/scrub/layer2.js.map +1 -0
- package/dist/trajectory/scrub/mineable-trace-gate.d.ts +9 -0
- package/dist/trajectory/scrub/mineable-trace-gate.js +33 -0
- package/dist/trajectory/scrub/mineable-trace-gate.js.map +1 -0
- package/dist/trajectory/scrub/ml-pii-stage.d.ts +24 -0
- package/dist/trajectory/scrub/ml-pii-stage.js +43 -0
- package/dist/trajectory/scrub/ml-pii-stage.js.map +1 -0
- package/dist/trajectory/scrub/openredaction-stage.d.ts +178 -0
- package/dist/trajectory/scrub/openredaction-stage.js +269 -0
- package/dist/trajectory/scrub/openredaction-stage.js.map +1 -0
- package/dist/trajectory/scrub/pii-build.d.ts +31 -0
- package/dist/trajectory/scrub/pii-build.js +64 -0
- package/dist/trajectory/scrub/pii-build.js.map +1 -0
- package/dist/trajectory/scrub/pipeline.d.ts +37 -0
- package/dist/trajectory/scrub/pipeline.js +83 -0
- package/dist/trajectory/scrub/pipeline.js.map +1 -0
- package/dist/trajectory/scrub/plain-patterns-stage.d.ts +31 -0
- package/dist/trajectory/scrub/plain-patterns-stage.js +85 -0
- package/dist/trajectory/scrub/plain-patterns-stage.js.map +1 -0
- package/dist/trajectory/scrub/secretlint-stage.d.ts +35 -0
- package/dist/trajectory/scrub/secretlint-stage.js +250 -0
- package/dist/trajectory/scrub/secretlint-stage.js.map +1 -0
- package/dist/trajectory/scrub/transformers-detector.d.ts +35 -0
- package/dist/trajectory/scrub/transformers-detector.js +68 -0
- package/dist/trajectory/scrub/transformers-detector.js.map +1 -0
- package/dist/trajectory/scrub/types.d.ts +25 -0
- package/dist/trajectory/scrub/types.js +2 -0
- package/dist/trajectory/scrub/types.js.map +1 -0
- package/dist/trajectory/transcript-parsers/types.d.ts +1 -1
- package/dist/trajectory/transcript-parsers/types.js +1 -1
- package/dist/trajectory/transcript-parsers/types.js.map +1 -1
- package/dist/trajectory/transcript-watcher.d.ts +26 -0
- package/dist/trajectory/transcript-watcher.js +33 -0
- package/dist/trajectory/transcript-watcher.js.map +1 -1
- package/dist/tx-retry.d.ts +12 -0
- package/dist/tx-retry.js +41 -12
- package/dist/tx-retry.js.map +1 -1
- package/dist/types/envelope.d.ts +45 -1
- package/dist/types/envelope.js +1 -1
- package/dist/types/envelope.js.map +1 -1
- package/dist/types/payloads/index.d.ts +1 -1
- package/dist/types/payloads/index.js +7 -1
- package/dist/types/payloads/index.js.map +1 -1
- package/dist/types/payloads/portfolio-v0.d.ts +1 -1
- package/dist/types/payloads/portfolio-v0.js +1 -1
- package/dist/types/payloads/portfolio-v0.js.map +1 -1
- package/dist/types/payloads/prediction-apy-v0.d.ts +1 -1
- package/dist/types/payloads/prediction-apy-v0.js +1 -1
- package/dist/types/payloads/prediction-apy-v0.js.map +1 -1
- package/dist/types/payloads/prediction-v0.d.ts +1 -1
- package/dist/types/payloads/prediction-v0.js +1 -1
- package/dist/types/payloads/prediction-v0.js.map +1 -1
- package/dist/types/portfolio.d.ts +1 -1
- package/dist/types/portfolio.js +1 -1
- package/dist/types/portfolio.js.map +1 -1
- package/dist/types/prediction-apy.d.ts +1 -1
- package/dist/types/prediction-apy.js +1 -1
- package/dist/types/prediction-apy.js.map +1 -1
- package/dist/types/prediction.d.ts +1 -1
- package/dist/types/prediction.js +1 -1
- package/dist/types/prediction.js.map +1 -1
- package/dist/types/session-provenance.d.ts +9 -1
- package/dist/types/session-provenance.js +5 -1
- package/dist/types/session-provenance.js.map +1 -1
- package/dist/types/skill-artifact.d.ts +442 -0
- package/dist/types/skill-artifact.js +137 -0
- package/dist/types/skill-artifact.js.map +1 -0
- package/dist/types/task-document.d.ts +315 -1
- package/dist/types/task-document.js +9 -1
- package/dist/types/task-document.js.map +1 -1
- package/dist/types/task-run-read-model.d.ts +21 -0
- package/dist/types/task-run-read-model.js +2 -0
- package/dist/types/task-run-read-model.js.map +1 -0
- package/dist/types/task-run.d.ts +75 -0
- package/dist/types/task-run.js +2 -0
- package/dist/types/task-run.js.map +1 -0
- package/dist/types/task.d.ts +29 -1
- package/dist/types/task.js +1 -1
- package/dist/types/task.js.map +1 -1
- package/dist/types/window.d.ts +1 -1
- package/dist/types/window.js +1 -1
- package/dist/types/window.js.map +1 -1
- package/dist/util/redact-rpc-urls.d.ts +1 -1
- package/dist/util/redact-rpc-urls.js +57 -2
- package/dist/util/redact-rpc-urls.js.map +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/checkpoint.d.ts +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/checkpoint.js +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/contracts.d.ts +3 -2
- package/dist/vendor/@jinn-network/sdk/dist/contracts.js +49 -0
- package/dist/vendor/@jinn-network/sdk/dist/jinn-repo.d.ts +44 -0
- package/dist/vendor/@jinn-network/sdk/dist/jinn-repo.js +25 -0
- package/dist/vendor/@jinn-network/sdk/dist/json-schema.d.ts +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/json-schema.js +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/payloads/jinn-repo.d.ts +38 -0
- package/dist/vendor/@jinn-network/sdk/dist/payloads/jinn-repo.js +22 -0
- package/dist/vendor/@jinn-network/sdk/dist/payloads/prediction-v1.d.ts +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/payloads/prediction-v1.js +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/payloads/session-derived.d.ts +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/payloads/session-derived.js +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/payloads/swe-rebench-v2.d.ts +109 -2
- package/dist/vendor/@jinn-network/sdk/dist/payloads/swe-rebench-v2.js +26 -2
- package/dist/vendor/@jinn-network/sdk/dist/prediction-v1.d.ts +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/prediction-v1.js +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/jinn-repo.d.ts +4 -0
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/jinn-repo.js +2 -0
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/manifest-schema.d.ts +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/manifest-schema.js +1 -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/dist/swe-rebench-v2.d.ts +34 -6
- package/dist/vendor/@jinn-network/sdk/dist/swe-rebench-v2.js +28 -5
- package/dist/vendor/@jinn-network/sdk/package.json +9 -1
- package/docker-compose.yml +3 -2
- package/package.json +58 -29
- package/plugins/jinn-repo-runtime/.claude-plugin/plugin.json +5 -0
- package/plugins/jinn-repo-runtime/.codex-plugin/plugin.json +39 -0
- package/plugins/jinn-repo-runtime/README.md +27 -0
- package/plugins/jinn-repo-runtime/hooks/hooks.json +16 -0
- package/plugins/jinn-repo-runtime/hooks/session-start +73 -0
- package/plugins/jinn-repo-runtime/jinn.plugin.json +11 -0
- package/plugins/jinn-repo-runtime/skills/task/SKILL.md +92 -0
- 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 +4 -0
- package/plugins/local-trace-distiller/.claude-plugin/plugin.json +9 -0
- package/plugins/local-trace-distiller/.codex-plugin/plugin.json +41 -0
- package/plugins/local-trace-distiller/.mcp.json +8 -0
- package/plugins/local-trace-distiller/README.md +27 -0
- package/plugins/local-trace-distiller/jinn.plugin.json +36 -0
- package/plugins/local-trace-distiller/skills/distill/SKILL.md +51 -0
- package/plugins/swe-rebench-v2-runtime/hooks/hooks.json +16 -0
- package/plugins/swe-rebench-v2-runtime/hooks/session-start +74 -0
- package/deployments/deployment-jinn-mvi-l1-sepolia-fast.json +0 -55
- package/deployments/deployment-jinn-mvi-l1-sepolia.json +0 -55
- package/deployments/deployment-jinn-mvi-l2-baseSepolia.json +0 -13
- package/deployments/deployment-jinn-testnet-faucet-baseSepolia-fast.json +0 -15
- package/dist/api/peers.js.map +0 -1
- package/dist/daemon/jinn-claim-loop-canonical.d.ts +0 -207
- package/dist/daemon/jinn-claim-loop-canonical.js +0 -296
- package/dist/daemon/jinn-claim-loop-canonical.js.map +0 -1
- package/dist/daemon/jinn-claim-loop-mock.d.ts +0 -61
- package/dist/daemon/jinn-claim-loop-mock.js +0 -122
- package/dist/daemon/jinn-claim-loop-mock.js.map +0 -1
- package/dist/daemon/jinn-claim-loop-wiring.d.ts +0 -33
- package/dist/daemon/jinn-claim-loop-wiring.js +0 -40
- package/dist/daemon/jinn-claim-loop-wiring.js.map +0 -1
- package/dist/daemon/jinn-claim-loop.d.ts +0 -130
- package/dist/daemon/jinn-claim-loop.js +0 -328
- package/dist/daemon/jinn-claim-loop.js.map +0 -1
- package/dist/dashboard/assets/index-CzKxvMcU.css +0 -32
- package/dist/dashboard/assets/index-yVemxHot.js +0 -351
- package/dist/earning/jinn-rewards.js.map +0 -1
- package/dist/scripts/donation-consumption-acceptance.d.ts +0 -85
- package/dist/scripts/donation-consumption-acceptance.js +0 -1382
- package/dist/scripts/donation-consumption-acceptance.js.map +0 -1
- package/dist/x402/acquire.d.ts +0 -17
- package/dist/x402/acquire.js +0 -49
- package/dist/x402/acquire.js.map +0 -1
- package/dist/x402/facilitator.d.ts +0 -11
- package/dist/x402/facilitator.js +0 -52
- package/dist/x402/facilitator.js.map +0 -1
- package/dist/x402/handler.d.ts +0 -27
- package/dist/x402/handler.js +0 -236
- package/dist/x402/handler.js.map +0 -1
- /package/dist/{api/peers.d.ts → daemon/peer-sync.d.ts} +0 -0
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Best-effort status collection for GET /v1/status (RPC + earning store + SQLite).
|
|
3
3
|
*/
|
|
4
|
-
import { createPublicClient,
|
|
5
|
-
import { existsSync, readFileSync } from 'node:fs';
|
|
4
|
+
import { createPublicClient, http } from 'viem';
|
|
5
|
+
import { existsSync, readFileSync, statSync } from 'node:fs';
|
|
6
6
|
import { join } from 'node:path';
|
|
7
7
|
import { base, baseSepolia } from 'viem/chains';
|
|
8
|
-
import { isOverSpendCap } from '../
|
|
9
|
-
import { blockResetsAtUtc, weekResetsAtUtc } from '../spend/ai-units.js';
|
|
8
|
+
import { isOverSpendCap } from '../spend/spend-cap.js';
|
|
9
|
+
import { blockResetsAtUtc, weekResetsAtUtc, GPT_5_4_MINI_USD_PER_BLOCK } from '../spend/ai-units.js';
|
|
10
10
|
import { FleetStateStore } from '../earning/store.js';
|
|
11
|
-
import {
|
|
12
|
-
import { createJinnL1PublicClient } from '../earning/viem-clients.js';
|
|
11
|
+
import { getChainConfig, } from '../earning/contracts.js';
|
|
13
12
|
import { stage1MinMasterEth } from '../earning/bootstrap.js';
|
|
14
|
-
import { JINN_STAKING_ABI } from '../earning/
|
|
13
|
+
import { JINN_STAKING_ABI } from '../earning/stolas-staking.js';
|
|
15
14
|
import { displayFleetServiceIndex } from '../earning/fleet-display-index.js';
|
|
16
|
-
import { assembleStatusV1,
|
|
15
|
+
import { assembleStatusV1, resolveMasterDailyEstimateWei, } from './status-build.js';
|
|
17
16
|
import { listStolasClaimTargets } from '../earning/stolas-claim.js';
|
|
18
17
|
import { gatherPortfolioV0Status, DEFAULT_ENGINE_WORKING_DIR_ROOT, } from './portfolio-v0-build.js';
|
|
19
18
|
import { gatherPredictionV1Status, } from './prediction-v1-build.js';
|
|
20
|
-
import { gatherTaskRunsStatus } from './task-runs-build.js';
|
|
19
|
+
import { gatherTaskRunsStatus, applyOutcomes } from './task-runs-build.js';
|
|
20
|
+
import { gatherLoopCompletion, gatherImplStateCadence } from './loop-completion-build.js';
|
|
21
21
|
import { buildPredictionOperatorStatus, } from '../solver-nets/prediction-operator-ux.js';
|
|
22
|
-
import { findJoinedByName, rolesFromJoinedConfig, solverTypeFromJoinedContract, } from '../solver-nets/registry.js';
|
|
22
|
+
import { findJoinedByName, joinedDisplayName, rolesFromJoinedConfig, solverTypeFromJoinedContract, } from '../solver-nets/registry.js';
|
|
23
23
|
import { buildHarnessRollup } from './status-harness-rollup.js';
|
|
24
24
|
const ERC20_BALANCE_OF_ABI = [
|
|
25
25
|
{
|
|
@@ -30,81 +30,6 @@ const ERC20_BALANCE_OF_ABI = [
|
|
|
30
30
|
outputs: [{ name: '', type: 'uint256' }],
|
|
31
31
|
},
|
|
32
32
|
];
|
|
33
|
-
const JINN_DISTRIBUTOR_CLAIMED_ABI = [
|
|
34
|
-
{
|
|
35
|
-
type: 'function',
|
|
36
|
-
name: 'totalClaimedOperator',
|
|
37
|
-
stateMutability: 'view',
|
|
38
|
-
inputs: [{ name: 'serviceId', type: 'uint256' }],
|
|
39
|
-
outputs: [{ name: '', type: 'uint256' }],
|
|
40
|
-
},
|
|
41
|
-
];
|
|
42
|
-
/**
|
|
43
|
-
* `Claimed` event item for `getLogs({ event, args })`. Matches the
|
|
44
|
-
* Solidity signature in
|
|
45
|
-
* `contracts/src/jinn/distribution/JinnDistributor.sol` so the operator
|
|
46
|
-
* 24h-minted sum can be computed without a separate indexer.
|
|
47
|
-
*/
|
|
48
|
-
const JINN_DISTRIBUTOR_CLAIMED_EVENT = parseAbiItem('event Claimed(uint256 indexed serviceId, address indexed multisig, uint256 operatorMinted, uint256 daoMinted, uint256 totalEntitledOperator, uint256 totalEntitledDao)');
|
|
49
|
-
const TJINN_BALANCE_CACHE_TTL_MS = 30_000;
|
|
50
|
-
const TJINN_BALANCE_TIMEOUT_MS = 6_000;
|
|
51
|
-
/**
|
|
52
|
-
* Approximate Sepolia blocks per 24 hours. The chain produces a block every
|
|
53
|
-
* ~12s; 86_400 / 12 = 7_200. We pad to 7_500 to absorb the occasional
|
|
54
|
-
* slower block and keep the window comfortably within the common 10k-block
|
|
55
|
-
* `eth_getLogs` cap.
|
|
56
|
-
*/
|
|
57
|
-
const SEPOLIA_BLOCKS_PER_24H = 7500n;
|
|
58
|
-
/**
|
|
59
|
-
* tJINN token address + chain id resolved from the bundled JINN MVI L1
|
|
60
|
-
* deployment artifact — the single source of truth. Used only when the caller
|
|
61
|
-
* (`main.ts`) does not thread explicit values through `StatusGatherConfig`
|
|
62
|
-
* (e.g. test callers, sqlite-only introspection without config). Lazy + cached
|
|
63
|
-
* so the artifact read happens at most once per process.
|
|
64
|
-
*/
|
|
65
|
-
let cachedTjinnArtifactIdentity;
|
|
66
|
-
function defaultTjinnIdentity() {
|
|
67
|
-
if (!cachedTjinnArtifactIdentity) {
|
|
68
|
-
let tokenAddress;
|
|
69
|
-
let chainId;
|
|
70
|
-
try {
|
|
71
|
-
const mvi = loadJinnMviConfig({ l1ArtifactPath: DEFAULT_TESTNET_ARTIFACTS.jinnMviL1 });
|
|
72
|
-
tokenAddress = mvi.jinn;
|
|
73
|
-
chainId = mvi.l1ChainId;
|
|
74
|
-
}
|
|
75
|
-
catch {
|
|
76
|
-
// Fall through to the hard defaults below if the artifact is unreadable.
|
|
77
|
-
}
|
|
78
|
-
cachedTjinnArtifactIdentity = {
|
|
79
|
-
tokenAddress: tokenAddress ?? '0x0bc0B2f733bF4229FD58Baaac5ebFEf2AEc83C4A',
|
|
80
|
-
chainId: chainId ?? 11155111,
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
return cachedTjinnArtifactIdentity;
|
|
84
|
-
}
|
|
85
|
-
function resolveTjinnIdentity(status) {
|
|
86
|
-
const fallback = defaultTjinnIdentity();
|
|
87
|
-
return {
|
|
88
|
-
tokenAddress: status?.tjinnTokenAddress ?? fallback.tokenAddress,
|
|
89
|
-
chainId: status?.tjinnChainId ?? fallback.chainId,
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
/** Fill a fresh errors Map with `TJINN_PUBLIC_READ_ERROR` for every key. */
|
|
93
|
-
function errorsForAllKeys(keys) {
|
|
94
|
-
const errors = new Map();
|
|
95
|
-
for (const key of keys) {
|
|
96
|
-
errors.set(key, TJINN_PUBLIC_READ_ERROR);
|
|
97
|
-
}
|
|
98
|
-
return errors;
|
|
99
|
-
}
|
|
100
|
-
function errorsForAllServiceIds(serviceIds) {
|
|
101
|
-
const errors = new Map();
|
|
102
|
-
for (const serviceId of serviceIds) {
|
|
103
|
-
errors.set(serviceId, TJINN_PUBLIC_READ_ERROR);
|
|
104
|
-
}
|
|
105
|
-
return errors;
|
|
106
|
-
}
|
|
107
|
-
const tjinnBalanceCache = new Map();
|
|
108
33
|
function readDaemonRuntime(earningDir) {
|
|
109
34
|
if (!earningDir)
|
|
110
35
|
return undefined;
|
|
@@ -124,24 +49,22 @@ function readDaemonRuntime(earningDir) {
|
|
|
124
49
|
return { pidPath, pid, alive: false, stale: true };
|
|
125
50
|
}
|
|
126
51
|
}
|
|
127
|
-
const predictionOperatorStatusCache = new WeakMap();
|
|
128
52
|
/**
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
* observed `getStakingState === 2` for the service. Cleared as soon as the
|
|
133
|
-
* service is no longer reported evicted, so a successful auto-restake (or a
|
|
134
|
-
* manual one) immediately resets the window.
|
|
135
|
-
*
|
|
136
|
-
* Lives at module scope intentionally: gather-status is invoked on every
|
|
137
|
-
* status read and we need state to persist across reads. The daemon is
|
|
138
|
-
* single-process; no cross-instance coordination required.
|
|
53
|
+
* Resolve `security.lastPasswordRotationAt` from the password provenance
|
|
54
|
+
* descriptor. File mtime is read at request time. Never throws: a missing,
|
|
55
|
+
* unreadable, or env-sourced password yields `null` (issue #441).
|
|
139
56
|
*/
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
57
|
+
function resolvePasswordRotationAt(cfg) {
|
|
58
|
+
if (!cfg || cfg.source === 'env' || !cfg.filePath)
|
|
59
|
+
return null;
|
|
60
|
+
try {
|
|
61
|
+
return statSync(cfg.filePath).mtime.toISOString();
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
144
66
|
}
|
|
67
|
+
const predictionOperatorStatusCache = new WeakMap();
|
|
145
68
|
/**
|
|
146
69
|
* Drop any cached prediction operator status for `config`.
|
|
147
70
|
*
|
|
@@ -162,18 +85,20 @@ function chainKey(network) {
|
|
|
162
85
|
/**
|
|
163
86
|
* Derive the SolverNet name to use for the prediction operator diagnostic.
|
|
164
87
|
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
88
|
+
* Only a joined entry whose `contract.id === 'prediction'` names the
|
|
89
|
+
* prediction SolverNet — returns its `name` (or, if unnamed, its manifestCid
|
|
90
|
+
* map key). If the operator has joined no prediction SolverNet (the normal
|
|
91
|
+
* case post-deprecation), returns the literal `'prediction'` rather than
|
|
92
|
+
* mislabeling some other joined net (#446).
|
|
167
93
|
*
|
|
168
94
|
* Post-issue-#421 the legacy `solverNets` config block has been retired; the
|
|
169
95
|
* operator's participation choices live in `joinedSolverNets` keyed by
|
|
170
|
-
* manifestCid
|
|
96
|
+
* manifestCid, with migrated-legacy entries carrying a populated `contract`.
|
|
171
97
|
*/
|
|
172
|
-
function derivePredictionSolverNetName(config) {
|
|
173
|
-
const
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
return entry.name ?? cid;
|
|
98
|
+
export function derivePredictionSolverNetName(config) {
|
|
99
|
+
for (const [cid, entry] of Object.entries(config.joinedSolverNets ?? {})) {
|
|
100
|
+
if (entry.contract?.id === 'prediction')
|
|
101
|
+
return joinedDisplayName(cid, entry);
|
|
177
102
|
}
|
|
178
103
|
return 'prediction';
|
|
179
104
|
}
|
|
@@ -296,159 +221,7 @@ function predictionV1Unavailable(operator, operatorError) {
|
|
|
296
221
|
function errorMessage(error) {
|
|
297
222
|
return error instanceof Error ? error.message : String(error);
|
|
298
223
|
}
|
|
299
|
-
function
|
|
300
|
-
return [
|
|
301
|
-
ethereumRpcUrl,
|
|
302
|
-
distributorAddress ?? '',
|
|
303
|
-
[...safeKeys].sort().join(','),
|
|
304
|
-
[...serviceIds].sort((a, b) => a - b).join(','),
|
|
305
|
-
].join('\0');
|
|
306
|
-
}
|
|
307
|
-
function timeoutError(message) {
|
|
308
|
-
const error = new Error(message);
|
|
309
|
-
error.name = 'TimeoutError';
|
|
310
|
-
return error;
|
|
311
|
-
}
|
|
312
|
-
function withTimeout(promise, timeoutMs, message) {
|
|
313
|
-
return new Promise((resolve, reject) => {
|
|
314
|
-
const timer = setTimeout(() => reject(timeoutError(message)), timeoutMs);
|
|
315
|
-
promise
|
|
316
|
-
.then(resolve, reject)
|
|
317
|
-
.finally(() => clearTimeout(timer));
|
|
318
|
-
});
|
|
319
|
-
}
|
|
320
|
-
async function readTjinnBalances(ethereumRpcUrl, tokenAddress, distributorAddress, expectedChainId, safeToAddress, serviceIds) {
|
|
321
|
-
const safeEntries = [...safeToAddress.entries()];
|
|
322
|
-
const client = createJinnL1PublicClient(ethereumRpcUrl, 'sepolia');
|
|
323
|
-
const chainId = await client.getChainId();
|
|
324
|
-
const balances = new Map();
|
|
325
|
-
const operatorClaimedByService = new Map();
|
|
326
|
-
const operatorMintedLast24hByService = new Map();
|
|
327
|
-
if (chainId !== expectedChainId) {
|
|
328
|
-
return {
|
|
329
|
-
chainId,
|
|
330
|
-
balances,
|
|
331
|
-
operatorClaimedByService,
|
|
332
|
-
operatorMintedLast24hByService,
|
|
333
|
-
errors: errorsForAllKeys(safeToAddress.keys()),
|
|
334
|
-
claimedErrors: errorsForAllServiceIds(serviceIds),
|
|
335
|
-
claimedLast24hError: TJINN_PUBLIC_READ_ERROR,
|
|
336
|
-
};
|
|
337
|
-
}
|
|
338
|
-
const errors = new Map();
|
|
339
|
-
// Single multicall3 round-trip (Sepolia has multicall3). `allowFailure: true`
|
|
340
|
-
// preserves the per-Safe partial-failure handling — a failed entry yields a
|
|
341
|
-
// `{ status: 'failure' }` result rather than rejecting the whole batch.
|
|
342
|
-
const results = await client.multicall({
|
|
343
|
-
allowFailure: true,
|
|
344
|
-
contracts: safeEntries.map(([, safeAddress]) => ({
|
|
345
|
-
address: tokenAddress,
|
|
346
|
-
abi: ERC20_BALANCE_OF_ABI,
|
|
347
|
-
functionName: 'balanceOf',
|
|
348
|
-
args: [safeAddress],
|
|
349
|
-
})),
|
|
350
|
-
});
|
|
351
|
-
for (let i = 0; i < results.length; i++) {
|
|
352
|
-
const result = results[i];
|
|
353
|
-
const key = safeEntries[i]?.[0];
|
|
354
|
-
if (!key)
|
|
355
|
-
continue;
|
|
356
|
-
if (result.status === 'success') {
|
|
357
|
-
balances.set(key, result.result.toString());
|
|
358
|
-
}
|
|
359
|
-
else {
|
|
360
|
-
errors.set(key, TJINN_PUBLIC_READ_ERROR);
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
const claimedErrors = new Map();
|
|
364
|
-
if (distributorAddress && serviceIds.length > 0) {
|
|
365
|
-
const claimedResults = await client.multicall({
|
|
366
|
-
allowFailure: true,
|
|
367
|
-
contracts: serviceIds.map((serviceId) => ({
|
|
368
|
-
address: distributorAddress,
|
|
369
|
-
abi: JINN_DISTRIBUTOR_CLAIMED_ABI,
|
|
370
|
-
functionName: 'totalClaimedOperator',
|
|
371
|
-
args: [BigInt(serviceId)],
|
|
372
|
-
})),
|
|
373
|
-
});
|
|
374
|
-
for (let i = 0; i < claimedResults.length; i++) {
|
|
375
|
-
const serviceId = serviceIds[i];
|
|
376
|
-
if (serviceId === undefined)
|
|
377
|
-
continue;
|
|
378
|
-
const result = claimedResults[i];
|
|
379
|
-
if (result.status === 'success') {
|
|
380
|
-
operatorClaimedByService.set(serviceId, result.result.toString());
|
|
381
|
-
}
|
|
382
|
-
else {
|
|
383
|
-
claimedErrors.set(serviceId, TJINN_PUBLIC_READ_ERROR);
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
let claimedLast24hError = null;
|
|
388
|
-
if (distributorAddress && serviceIds.length > 0) {
|
|
389
|
-
try {
|
|
390
|
-
const latest = await client.getBlockNumber();
|
|
391
|
-
const fromBlock = latest > SEPOLIA_BLOCKS_PER_24H ? latest - SEPOLIA_BLOCKS_PER_24H : 0n;
|
|
392
|
-
const logs = await client.getLogs({
|
|
393
|
-
address: distributorAddress,
|
|
394
|
-
event: JINN_DISTRIBUTOR_CLAIMED_EVENT,
|
|
395
|
-
args: { serviceId: serviceIds.map((id) => BigInt(id)) },
|
|
396
|
-
fromBlock,
|
|
397
|
-
toBlock: latest,
|
|
398
|
-
});
|
|
399
|
-
const sums = new Map();
|
|
400
|
-
for (const log of logs) {
|
|
401
|
-
const args = log.args;
|
|
402
|
-
if (args.serviceId === undefined || args.operatorMinted === undefined)
|
|
403
|
-
continue;
|
|
404
|
-
const id = Number(args.serviceId);
|
|
405
|
-
sums.set(id, (sums.get(id) ?? 0n) + args.operatorMinted);
|
|
406
|
-
}
|
|
407
|
-
for (const serviceId of serviceIds) {
|
|
408
|
-
operatorMintedLast24hByService.set(serviceId, (sums.get(serviceId) ?? 0n).toString());
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
catch {
|
|
412
|
-
claimedLast24hError = TJINN_PUBLIC_READ_ERROR;
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
return {
|
|
416
|
-
chainId,
|
|
417
|
-
balances,
|
|
418
|
-
operatorClaimedByService,
|
|
419
|
-
operatorMintedLast24hByService,
|
|
420
|
-
errors,
|
|
421
|
-
claimedErrors,
|
|
422
|
-
claimedLast24hError,
|
|
423
|
-
};
|
|
424
|
-
}
|
|
425
|
-
async function getCachedTjinnBalances(ethereumRpcUrl, tokenAddress, distributorAddress, expectedChainId, safeToAddress, serviceIds) {
|
|
426
|
-
const safeKeys = [...safeToAddress.keys()].sort();
|
|
427
|
-
const sortedServiceIds = [...serviceIds].sort((a, b) => a - b);
|
|
428
|
-
const cacheKey = tJinnBalanceCacheKey(ethereumRpcUrl, distributorAddress, safeKeys, sortedServiceIds);
|
|
429
|
-
const now = Date.now();
|
|
430
|
-
const cached = tjinnBalanceCache.get(cacheKey);
|
|
431
|
-
if (cached && cached.expiresAt > now) {
|
|
432
|
-
return cached.promise;
|
|
433
|
-
}
|
|
434
|
-
const promise = withTimeout(readTjinnBalances(ethereumRpcUrl, tokenAddress, distributorAddress, expectedChainId, safeToAddress, sortedServiceIds), TJINN_BALANCE_TIMEOUT_MS, 'tJINN balance collection timed out').catch(() => {
|
|
435
|
-
return {
|
|
436
|
-
chainId: expectedChainId,
|
|
437
|
-
balances: new Map(),
|
|
438
|
-
operatorClaimedByService: new Map(),
|
|
439
|
-
operatorMintedLast24hByService: new Map(),
|
|
440
|
-
errors: errorsForAllKeys(safeKeys),
|
|
441
|
-
claimedErrors: errorsForAllServiceIds(sortedServiceIds),
|
|
442
|
-
claimedLast24hError: TJINN_PUBLIC_READ_ERROR,
|
|
443
|
-
};
|
|
444
|
-
});
|
|
445
|
-
tjinnBalanceCache.set(cacheKey, {
|
|
446
|
-
expiresAt: now + TJINN_BALANCE_CACHE_TTL_MS,
|
|
447
|
-
promise,
|
|
448
|
-
});
|
|
449
|
-
return promise;
|
|
450
|
-
}
|
|
451
|
-
async function sumPendingStakingRewards(rpcUrl, network, fleet) {
|
|
224
|
+
export async function sumPendingStakingRewards(rpcUrl, network, fleet) {
|
|
452
225
|
const targets = listStolasClaimTargets(fleet.services);
|
|
453
226
|
if (targets.length === 0) {
|
|
454
227
|
return { sum: '0', pendingByService: {} };
|
|
@@ -499,158 +272,6 @@ async function sumPendingStakingRewards(rpcUrl, network, fleet) {
|
|
|
499
272
|
return { error: e instanceof Error ? e.message : String(e) };
|
|
500
273
|
}
|
|
501
274
|
}
|
|
502
|
-
/**
|
|
503
|
-
* Resolve the public error string for a tJINN status with at least one error.
|
|
504
|
-
*
|
|
505
|
-
* Flattened from a 3-deep nested ternary into guard clauses:
|
|
506
|
-
* - partial success (some balances read) → PARTIAL
|
|
507
|
-
* - only invalid-Safe errors → INVALID_SAFE
|
|
508
|
-
* - otherwise (RPC read failures) → READ_ERROR
|
|
509
|
-
*
|
|
510
|
-
* Caller must only invoke this when `hasInvalidSafe || hasReadError` is true.
|
|
511
|
-
*/
|
|
512
|
-
function tjinnPublicError(opts) {
|
|
513
|
-
if (opts.hasAnyBalance)
|
|
514
|
-
return TJINN_PUBLIC_PARTIAL_ERROR;
|
|
515
|
-
if (opts.hasInvalidSafe && !opts.hasReadError)
|
|
516
|
-
return TJINN_PUBLIC_INVALID_SAFE_ERROR;
|
|
517
|
-
return TJINN_PUBLIC_READ_ERROR;
|
|
518
|
-
}
|
|
519
|
-
async function gatherTjinnStatus(ethereumRpcUrl, tokenAddress, distributorAddress, chainId, fleet) {
|
|
520
|
-
if (!fleet) {
|
|
521
|
-
return pendingTjinnStatus(tokenAddress, chainId);
|
|
522
|
-
}
|
|
523
|
-
const services = [];
|
|
524
|
-
const safeToAddress = new Map();
|
|
525
|
-
const serviceIds = new Set();
|
|
526
|
-
for (const svc of fleet.services) {
|
|
527
|
-
const index = displayFleetServiceIndex(svc);
|
|
528
|
-
const serviceId = svc.service_id ?? null;
|
|
529
|
-
if (serviceId !== null) {
|
|
530
|
-
serviceIds.add(serviceId);
|
|
531
|
-
}
|
|
532
|
-
const safeAddress = svc.safe_address;
|
|
533
|
-
if (!safeAddress) {
|
|
534
|
-
services.push({
|
|
535
|
-
index,
|
|
536
|
-
serviceId,
|
|
537
|
-
safeAddress: null,
|
|
538
|
-
balanceWei: null,
|
|
539
|
-
operatorClaimedWei: null,
|
|
540
|
-
state: 'pending',
|
|
541
|
-
error: null,
|
|
542
|
-
});
|
|
543
|
-
continue;
|
|
544
|
-
}
|
|
545
|
-
try {
|
|
546
|
-
const checksum = getAddress(safeAddress);
|
|
547
|
-
const key = checksum.toLowerCase();
|
|
548
|
-
services.push({
|
|
549
|
-
index,
|
|
550
|
-
serviceId,
|
|
551
|
-
safeAddress: checksum,
|
|
552
|
-
balanceWei: null,
|
|
553
|
-
operatorClaimedWei: null,
|
|
554
|
-
state: 'pending',
|
|
555
|
-
error: null,
|
|
556
|
-
});
|
|
557
|
-
safeToAddress.set(key, checksum);
|
|
558
|
-
}
|
|
559
|
-
catch {
|
|
560
|
-
services.push({
|
|
561
|
-
index,
|
|
562
|
-
serviceId,
|
|
563
|
-
safeAddress,
|
|
564
|
-
balanceWei: null,
|
|
565
|
-
operatorClaimedWei: null,
|
|
566
|
-
state: 'error',
|
|
567
|
-
error: TJINN_PUBLIC_INVALID_SAFE_ERROR,
|
|
568
|
-
});
|
|
569
|
-
}
|
|
570
|
-
}
|
|
571
|
-
const safeCount = safeToAddress.size;
|
|
572
|
-
if (safeCount === 0) {
|
|
573
|
-
const invalid = services.find((svc) => svc.state === 'error')?.error;
|
|
574
|
-
return pendingTjinnStatus(tokenAddress, chainId, {
|
|
575
|
-
state: invalid ? 'error' : 'pending',
|
|
576
|
-
safeCount,
|
|
577
|
-
services,
|
|
578
|
-
error: invalid ?? null,
|
|
579
|
-
});
|
|
580
|
-
}
|
|
581
|
-
if (!ethereumRpcUrl) {
|
|
582
|
-
return pendingTjinnStatus(tokenAddress, chainId, { safeCount, services });
|
|
583
|
-
}
|
|
584
|
-
const snapshot = await getCachedTjinnBalances(ethereumRpcUrl, tokenAddress, distributorAddress, chainId, safeToAddress, [...serviceIds]);
|
|
585
|
-
let total = 0n;
|
|
586
|
-
for (const balance of snapshot.balances.values()) {
|
|
587
|
-
total += BigInt(balance);
|
|
588
|
-
}
|
|
589
|
-
const allClaimedReadsAvailable = !!distributorAddress &&
|
|
590
|
-
serviceIds.size > 0 &&
|
|
591
|
-
snapshot.claimedErrors.size === 0 &&
|
|
592
|
-
[...serviceIds].every((serviceId) => snapshot.operatorClaimedByService.has(serviceId));
|
|
593
|
-
let operatorClaimedWei = null;
|
|
594
|
-
if (allClaimedReadsAvailable) {
|
|
595
|
-
let claimedTotal = 0n;
|
|
596
|
-
for (const serviceId of serviceIds) {
|
|
597
|
-
claimedTotal += BigInt(snapshot.operatorClaimedByService.get(serviceId) ?? '0');
|
|
598
|
-
}
|
|
599
|
-
operatorClaimedWei = claimedTotal.toString();
|
|
600
|
-
}
|
|
601
|
-
// 24h-window sum: null when the log query errored or there are no services.
|
|
602
|
-
let operatorMintedLast24hWei = null;
|
|
603
|
-
if (!!distributorAddress &&
|
|
604
|
-
serviceIds.size > 0 &&
|
|
605
|
-
snapshot.claimedLast24hError === null) {
|
|
606
|
-
let last24hTotal = 0n;
|
|
607
|
-
for (const serviceId of serviceIds) {
|
|
608
|
-
last24hTotal += BigInt(snapshot.operatorMintedLast24hByService.get(serviceId) ?? '0');
|
|
609
|
-
}
|
|
610
|
-
operatorMintedLast24hWei = last24hTotal.toString();
|
|
611
|
-
}
|
|
612
|
-
const hasInvalidSafe = services.some((svc) => svc.error === TJINN_PUBLIC_INVALID_SAFE_ERROR);
|
|
613
|
-
const hasReadError = snapshot.errors.size > 0;
|
|
614
|
-
const hasAnyError = hasInvalidSafe || hasReadError;
|
|
615
|
-
const hasAnyBalance = snapshot.balances.size > 0;
|
|
616
|
-
const publicError = hasAnyError
|
|
617
|
-
? tjinnPublicError({ hasInvalidSafe, hasReadError, hasAnyBalance })
|
|
618
|
-
: null;
|
|
619
|
-
return pendingTjinnStatus(tokenAddress, snapshot.chainId, {
|
|
620
|
-
state: hasAnyError ? 'error' : 'ready',
|
|
621
|
-
safeBalanceWei: hasAnyBalance ? total.toString() : null,
|
|
622
|
-
operatorClaimedWei,
|
|
623
|
-
operatorMintedLast24hWei,
|
|
624
|
-
safeCount,
|
|
625
|
-
services: services.map((svc) => {
|
|
626
|
-
const operatorClaimedForService = svc.serviceId !== null
|
|
627
|
-
? (snapshot.operatorClaimedByService.get(svc.serviceId) ?? null)
|
|
628
|
-
: null;
|
|
629
|
-
if (!svc.safeAddress)
|
|
630
|
-
return { ...svc, operatorClaimedWei: operatorClaimedForService };
|
|
631
|
-
if (svc.state === 'error')
|
|
632
|
-
return { ...svc, operatorClaimedWei: operatorClaimedForService };
|
|
633
|
-
const key = svc.safeAddress.toLowerCase();
|
|
634
|
-
const balance = snapshot.balances.get(key);
|
|
635
|
-
if (balance !== undefined) {
|
|
636
|
-
return {
|
|
637
|
-
...svc,
|
|
638
|
-
state: 'ready',
|
|
639
|
-
balanceWei: balance,
|
|
640
|
-
operatorClaimedWei: operatorClaimedForService,
|
|
641
|
-
error: null,
|
|
642
|
-
};
|
|
643
|
-
}
|
|
644
|
-
return {
|
|
645
|
-
...svc,
|
|
646
|
-
state: 'error',
|
|
647
|
-
operatorClaimedWei: operatorClaimedForService,
|
|
648
|
-
error: snapshot.errors.get(key) ?? TJINN_PUBLIC_READ_ERROR,
|
|
649
|
-
};
|
|
650
|
-
}),
|
|
651
|
-
error: publicError,
|
|
652
|
-
});
|
|
653
|
-
}
|
|
654
275
|
function hasUsefulCacheValues(entry, isAgentRole) {
|
|
655
276
|
if (isAgentRole)
|
|
656
277
|
return entry.nativeWei != null;
|
|
@@ -772,23 +393,43 @@ export async function gatherGatheredStatusRaw(store, status) {
|
|
|
772
393
|
outcome: row.outcome,
|
|
773
394
|
}));
|
|
774
395
|
const lastRewardClaimTickAt = store.getConfigValue('last_reward_claim_tick_at');
|
|
396
|
+
const taskRunReadModel = store.taskRunReadModel();
|
|
775
397
|
const daily = resolveMasterDailyEstimateWei(status?.masterEthDailyEstimateWei, status?.pollIntervalMs ?? 5000);
|
|
776
|
-
const tjinnIdentity = resolveTjinnIdentity(status);
|
|
777
398
|
// portfolio.v0 lifecycle data — best-effort, never throws
|
|
778
399
|
let portfolioV0;
|
|
779
400
|
try {
|
|
780
|
-
portfolioV0 = gatherPortfolioV0Status(store, status?.engine?.workingDirRoot ?? DEFAULT_ENGINE_WORKING_DIR_ROOT);
|
|
401
|
+
portfolioV0 = gatherPortfolioV0Status(taskRunReadModel, store, status?.engine?.workingDirRoot ?? DEFAULT_ENGINE_WORKING_DIR_ROOT);
|
|
781
402
|
}
|
|
782
403
|
catch {
|
|
783
404
|
portfolioV0 = undefined;
|
|
784
405
|
}
|
|
785
406
|
let taskRuns;
|
|
786
407
|
try {
|
|
787
|
-
taskRuns = gatherTaskRunsStatus(
|
|
408
|
+
taskRuns = gatherTaskRunsStatus(taskRunReadModel);
|
|
788
409
|
}
|
|
789
410
|
catch {
|
|
790
411
|
taskRuns = undefined;
|
|
791
412
|
}
|
|
413
|
+
// Enrich task-relative outcomes from the network's verdict tallies
|
|
414
|
+
// (spec/2026-05-22-run-outcome.md). DISPLAY signal — degrade silently to
|
|
415
|
+
// null on any discovery failure; never surface a wrong 'fail'.
|
|
416
|
+
if (taskRuns && status?.discovery) {
|
|
417
|
+
try {
|
|
418
|
+
const solveTaskIds = [
|
|
419
|
+
...new Set([...taskRuns.recentTasks, ...taskRuns.inFlight]
|
|
420
|
+
.filter((r) => r.taskRole !== 'evaluation' && r.state === 'COMPLETE' && r.taskId)
|
|
421
|
+
.map((r) => r.taskId)),
|
|
422
|
+
];
|
|
423
|
+
const tallies = solveTaskIds.length
|
|
424
|
+
? await status.discovery.getVerdictTallies({ taskIds: solveTaskIds })
|
|
425
|
+
: new Map();
|
|
426
|
+
applyOutcomes(taskRuns.recentTasks, tallies);
|
|
427
|
+
applyOutcomes(taskRuns.inFlight, tallies);
|
|
428
|
+
}
|
|
429
|
+
catch {
|
|
430
|
+
// Outcomes stay null → SPA renders '—'/'awaiting'.
|
|
431
|
+
}
|
|
432
|
+
}
|
|
792
433
|
let harnessRollup;
|
|
793
434
|
try {
|
|
794
435
|
const hr = status?.harnessReadiness?.();
|
|
@@ -814,7 +455,7 @@ export async function gatherGatheredStatusRaw(store, status) {
|
|
|
814
455
|
}
|
|
815
456
|
let predictionV1;
|
|
816
457
|
try {
|
|
817
|
-
predictionV1 = gatherPredictionV1Status(
|
|
458
|
+
predictionV1 = gatherPredictionV1Status(taskRunReadModel, {
|
|
818
459
|
operator: predictionOperator,
|
|
819
460
|
operatorError: predictionOperatorError,
|
|
820
461
|
});
|
|
@@ -829,6 +470,7 @@ export async function gatherGatheredStatusRaw(store, status) {
|
|
|
829
470
|
shutdownState,
|
|
830
471
|
daemonRuntime: readDaemonRuntime(status?.earningDir),
|
|
831
472
|
daemonStartedAt,
|
|
473
|
+
passwordRotationAt: resolvePasswordRotationAt(status?.passwordRotation),
|
|
832
474
|
dbPath: store.path,
|
|
833
475
|
earningDir: status?.earningDir,
|
|
834
476
|
activityCounts,
|
|
@@ -846,9 +488,7 @@ export async function gatherGatheredStatusRaw(store, status) {
|
|
|
846
488
|
serviceBalances: {},
|
|
847
489
|
pendingByService: {},
|
|
848
490
|
claimedByService: store.getClaimedRewardsByService(),
|
|
849
|
-
|
|
850
|
-
tjinnChainId: tjinnIdentity.chainId,
|
|
851
|
-
tjinnDistributorAddress: status?.tjinnDistributorAddress,
|
|
491
|
+
claimedStakingRewardsLast24hWei: store.getClaimedRewardsLast24hWei(),
|
|
852
492
|
harnessRollup,
|
|
853
493
|
};
|
|
854
494
|
if (!status) {
|
|
@@ -864,11 +504,6 @@ export async function gatherGatheredStatusRaw(store, status) {
|
|
|
864
504
|
testnetMechDeploymentPath: status.testnetMechDeploymentPath,
|
|
865
505
|
testnetStolasDeploymentPath: status.testnetStolasDeploymentPath,
|
|
866
506
|
});
|
|
867
|
-
// Start the Sepolia tJINN read up front so it overlaps the Base-RPC fan-out
|
|
868
|
-
// below for free. `gatherTjinnStatus` is internally error-safe (it catches
|
|
869
|
-
// and returns a snapshot), so the promise never rejects — it is awaited at
|
|
870
|
-
// the point its result is assigned to `raw.tJinn`.
|
|
871
|
-
const tJinnPromise = gatherTjinnStatus(status.network === 'testnet' ? status.config?.ethereumRpcUrl : undefined, tjinnIdentity.tokenAddress, status.tjinnDistributorAddress, tjinnIdentity.chainId, fleet);
|
|
872
507
|
const raw = {
|
|
873
508
|
...baseRaw,
|
|
874
509
|
fleet,
|
|
@@ -902,8 +537,7 @@ export async function gatherGatheredStatusRaw(store, status) {
|
|
|
902
537
|
// that predicate changes (evictionCheckIntervalMs > 0 && stakingMode ===
|
|
903
538
|
// 'standard' && !!CHAIN_CONFIG.distributorAddress), this one must change
|
|
904
539
|
// too. `stOlasDistributorAddress` is the same on-chain artifact threaded
|
|
905
|
-
// through `StatusGatherConfig
|
|
906
|
-
// (different contract on a different chain).
|
|
540
|
+
// through `StatusGatherConfig`.
|
|
907
541
|
const evictionIntervalMs = status.config?.evictionCheckIntervalMs ?? 0;
|
|
908
542
|
raw.evictionCheckIntervalMs = evictionIntervalMs;
|
|
909
543
|
raw.autoRestakeEnabled =
|
|
@@ -949,99 +583,6 @@ export async function gatherGatheredStatusRaw(store, status) {
|
|
|
949
583
|
};
|
|
950
584
|
}
|
|
951
585
|
}
|
|
952
|
-
if (fleet && raw.rpc.ok) {
|
|
953
|
-
const pr = await sumPendingStakingRewards(status.rpcUrl, status.network, fleet);
|
|
954
|
-
if ('sum' in pr) {
|
|
955
|
-
raw.pendingStakingRewardsWei = pr.sum;
|
|
956
|
-
raw.pendingByService = pr.pendingByService;
|
|
957
|
-
if (pr.nextCheckpointAt)
|
|
958
|
-
raw.nextCheckpointAt = pr.nextCheckpointAt;
|
|
959
|
-
}
|
|
960
|
-
else {
|
|
961
|
-
raw.pendingRewardsError = pr.error;
|
|
962
|
-
}
|
|
963
|
-
// Eviction state + inactivity — best-effort; never blocks the rest of status assembly.
|
|
964
|
-
try {
|
|
965
|
-
const evictedByServiceIndex = {};
|
|
966
|
-
const inactivityByServiceIndex = {};
|
|
967
|
-
await Promise.all(fleet.services.map(async (svc) => {
|
|
968
|
-
const serviceId = svc.service_id;
|
|
969
|
-
const stakingProxy = svc.staking_address;
|
|
970
|
-
if (!serviceId || !stakingProxy)
|
|
971
|
-
return;
|
|
972
|
-
const di = displayFleetServiceIndex(svc);
|
|
973
|
-
try {
|
|
974
|
-
const [state, info] = await Promise.all([
|
|
975
|
-
client.readContract({
|
|
976
|
-
address: stakingProxy,
|
|
977
|
-
abi: JINN_STAKING_ABI,
|
|
978
|
-
functionName: 'getStakingState',
|
|
979
|
-
args: [BigInt(serviceId)],
|
|
980
|
-
}),
|
|
981
|
-
client.readContract({
|
|
982
|
-
address: stakingProxy,
|
|
983
|
-
abi: JINN_STAKING_ABI,
|
|
984
|
-
functionName: 'getServiceInfo',
|
|
985
|
-
args: [BigInt(serviceId)],
|
|
986
|
-
}).catch(() => null),
|
|
987
|
-
]);
|
|
988
|
-
// getStakingState returns uint8; 2 = Evicted enum value
|
|
989
|
-
evictedByServiceIndex[di] = Number(state) === 2;
|
|
990
|
-
// getServiceInfo returns a struct — inactivity is seconds of accumulated inactivity
|
|
991
|
-
if (info != null) {
|
|
992
|
-
const inactivity = info.inactivity;
|
|
993
|
-
if (typeof inactivity === 'bigint') {
|
|
994
|
-
inactivityByServiceIndex[di] = Number(inactivity);
|
|
995
|
-
}
|
|
996
|
-
}
|
|
997
|
-
}
|
|
998
|
-
catch {
|
|
999
|
-
// Transient RPC errors: skip silently; evicted defaults to false
|
|
1000
|
-
}
|
|
1001
|
-
}));
|
|
1002
|
-
raw.evictedByServiceIndex = evictedByServiceIndex;
|
|
1003
|
-
raw.inactivityByServiceIndex = inactivityByServiceIndex;
|
|
1004
|
-
// First-seen tracker for the suppression window (issue #651).
|
|
1005
|
-
// Key by `${chain}:${serviceId}` to survive multi-chain fleet layouts.
|
|
1006
|
-
const nowMs = Date.now();
|
|
1007
|
-
const chainKey = fleet.chain;
|
|
1008
|
-
const evictedSinceByServiceIndex = {};
|
|
1009
|
-
for (const svc of fleet.services) {
|
|
1010
|
-
const di = displayFleetServiceIndex(svc);
|
|
1011
|
-
const sid = svc.service_id;
|
|
1012
|
-
if (sid == null)
|
|
1013
|
-
continue;
|
|
1014
|
-
const key = `${chainKey}:${sid}`;
|
|
1015
|
-
// Three-way: `true` → start/preserve window; `false` → clear it;
|
|
1016
|
-
// `undefined` (read failed) → leave prior state untouched so a
|
|
1017
|
-
// transient RPC flap does not reset the suppression window
|
|
1018
|
-
// (issue #651 review Finding B).
|
|
1019
|
-
if (evictedByServiceIndex[di] === true) {
|
|
1020
|
-
let firstSeen = evictionFirstSeenMs.get(key);
|
|
1021
|
-
if (firstSeen === undefined) {
|
|
1022
|
-
firstSeen = nowMs;
|
|
1023
|
-
evictionFirstSeenMs.set(key, firstSeen);
|
|
1024
|
-
}
|
|
1025
|
-
evictedSinceByServiceIndex[di] = new Date(firstSeen).toISOString();
|
|
1026
|
-
}
|
|
1027
|
-
else if (evictedByServiceIndex[di] === false) {
|
|
1028
|
-
evictionFirstSeenMs.delete(key);
|
|
1029
|
-
}
|
|
1030
|
-
else {
|
|
1031
|
-
// Read failed — preserve any prior `evictedSince` so the next
|
|
1032
|
-
// successful read does not bump the timestamp.
|
|
1033
|
-
const firstSeen = evictionFirstSeenMs.get(key);
|
|
1034
|
-
if (firstSeen !== undefined) {
|
|
1035
|
-
evictedSinceByServiceIndex[di] = new Date(firstSeen).toISOString();
|
|
1036
|
-
}
|
|
1037
|
-
}
|
|
1038
|
-
}
|
|
1039
|
-
raw.evictedSinceByServiceIndex = evictedSinceByServiceIndex;
|
|
1040
|
-
}
|
|
1041
|
-
catch {
|
|
1042
|
-
// Non-fatal: staking state reads should not prevent status from returning
|
|
1043
|
-
}
|
|
1044
|
-
}
|
|
1045
586
|
if (fleet) {
|
|
1046
587
|
const per = {};
|
|
1047
588
|
for (const svc of fleet.services) {
|
|
@@ -1058,16 +599,17 @@ export async function gatherGatheredStatusRaw(store, status) {
|
|
|
1058
599
|
raw.serviceBalanceErrors = bal.errorsByDisplay;
|
|
1059
600
|
}
|
|
1060
601
|
}
|
|
1061
|
-
// The tJINN read started up front (overlapping the Base-RPC fan-out). It is
|
|
1062
|
-
// awaited here, as late as possible — after ALL other awaited Base-chain work
|
|
1063
|
-
// — so the up-to-4s tJINN timeout never serializes the Base fan-out behind it.
|
|
1064
|
-
// `gatherTjinnStatus` is internally error-safe, so a plain await is safe.
|
|
1065
|
-
raw.tJinn = await tJinnPromise;
|
|
1066
602
|
return raw;
|
|
1067
603
|
}
|
|
1068
604
|
export async function gatherStatusForApi(store, status) {
|
|
1069
605
|
const raw = await gatherGatheredStatusRaw(store, status);
|
|
1070
606
|
const body = assembleStatusV1(raw);
|
|
607
|
+
// Loop-completion + impl-state commit cadence (#959). Both are read-only and
|
|
608
|
+
// degrade to zeroes / an empty list — they never throw the status endpoint.
|
|
609
|
+
body.loopCompletion = gatherLoopCompletion(store.taskRunReadModel());
|
|
610
|
+
if (status?.engine?.implStateDirRoot) {
|
|
611
|
+
body.implStateCadence = gatherImplStateCadence(status.engine.implStateDirRoot);
|
|
612
|
+
}
|
|
1071
613
|
const caps = status?.spendCaps;
|
|
1072
614
|
if (caps && Object.keys(caps).length > 0) {
|
|
1073
615
|
const now = new Date();
|
|
@@ -1087,18 +629,40 @@ export async function gatherStatusForApi(store, status) {
|
|
|
1087
629
|
// Dedupe credentials across manifests — multiple SolverNets on the same
|
|
1088
630
|
// credential share one row.
|
|
1089
631
|
const uniqueCredentials = new Set(Object.values(aiUnitsCfg.manifestCredentials));
|
|
632
|
+
// Peg: usd_micros = units / 100 * GPT_5_4_MINI_USD_PER_BLOCK * 1e6.
|
|
633
|
+
// Inverse (USD micros -> units) for the legacy unit surface (#1006).
|
|
634
|
+
const usdMicrosToUnits = (usdMicros) => (usdMicros / 1_000_000 / GPT_5_4_MINI_USD_PER_BLOCK) * 100;
|
|
1090
635
|
body.aiUnits = {
|
|
1091
636
|
credentials: [...uniqueCredentials].map((credentialId) => {
|
|
1092
|
-
const
|
|
1093
|
-
const
|
|
1094
|
-
const paused =
|
|
637
|
+
const block = store.usdMicrosThisBlock(credentialId, now);
|
|
638
|
+
const week = store.usdMicrosThisWeek(credentialId, now);
|
|
639
|
+
const paused = block.usdMicros >= aiUnitsCfg.capPerBlockUsdMicros ||
|
|
640
|
+
week.usdMicros >= aiUnitsCfg.capPerWeekUsdMicros;
|
|
1095
641
|
return {
|
|
1096
642
|
credentialId,
|
|
1097
|
-
|
|
1098
|
-
|
|
643
|
+
// #1006: legacy unit fields, derived from USD via the peg.
|
|
644
|
+
unitsThisBlock: usdMicrosToUnits(block.usdMicros),
|
|
645
|
+
unitsThisWeek: usdMicrosToUnits(week.usdMicros),
|
|
1099
646
|
capPerBlock: aiUnitsCfg.capPerBlock,
|
|
1100
647
|
capPerWeek: aiUnitsCfg.capPerWeek,
|
|
648
|
+
// USD fields (issue #1004).
|
|
649
|
+
usdMicrosThisBlock: block.usdMicros,
|
|
650
|
+
usdMicrosThisWeek: week.usdMicros,
|
|
651
|
+
capPerBlockUsdMicros: aiUnitsCfg.capPerBlockUsdMicros,
|
|
652
|
+
capPerWeekUsdMicros: aiUnitsCfg.capPerWeekUsdMicros,
|
|
653
|
+
// estimated = the summed figure includes any estimate-backed cost
|
|
654
|
+
// (a telemetry-less/heuristic harness such as Hermes, or an
|
|
655
|
+
// in-flight claimed row not yet harvested); false only when every
|
|
656
|
+
// contributing row is harvested actual telemetry (issue #1004 AC4).
|
|
657
|
+
estimated: block.estimated || week.estimated,
|
|
1101
658
|
paused,
|
|
659
|
+
// active = this credential has spend in the current 7d window, so it
|
|
660
|
+
// is the one actually being worked against (distinguishes a
|
|
661
|
+
// configured-but-idle credential from the live one — issue #891).
|
|
662
|
+
// Cold-start caveat: a working harness reads active=false until its
|
|
663
|
+
// first cost row lands in the window (fresh node or just-reset 7d
|
|
664
|
+
// window), so this can transiently under-report the live credential.
|
|
665
|
+
active: week.usdMicros > 0,
|
|
1102
666
|
blockResetsAt,
|
|
1103
667
|
weekResetsAt,
|
|
1104
668
|
};
|