@jinn-network/client 0.1.5 → 0.1.6-canary.092089a9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +131 -0
- package/deployments/deployment-jinn-mvi-l1-sepolia-fast.json +23 -4
- package/deployments/deployment-jinn-mvi-l1-sepolia.json +23 -4
- package/deployments/deployment-jinn-mvi-l2-baseSepolia.json +5 -4
- package/dist/adapters/mech/adapter.d.ts +23 -1
- package/dist/adapters/mech/adapter.js +171 -33
- package/dist/adapters/mech/adapter.js.map +1 -1
- package/dist/adapters/mech/contracts.d.ts +17 -4
- package/dist/adapters/mech/contracts.js +8 -2
- package/dist/adapters/mech/contracts.js.map +1 -1
- package/dist/adapters/mech/ipfs-pinfile.d.ts +22 -0
- package/dist/adapters/mech/ipfs-pinfile.js +54 -0
- package/dist/adapters/mech/ipfs-pinfile.js.map +1 -0
- package/dist/adapters/mech/ipfs.d.ts +1 -0
- package/dist/adapters/mech/ipfs.js +24 -1
- package/dist/adapters/mech/ipfs.js.map +1 -1
- package/dist/adapters/mech/safe-revert.d.ts +20 -0
- package/dist/adapters/mech/safe-revert.js +12 -4
- package/dist/adapters/mech/safe-revert.js.map +1 -1
- package/dist/adapters/mech/verdict-code.d.ts +1 -0
- package/dist/adapters/mech/verdict-code.js +18 -0
- package/dist/adapters/mech/verdict-code.js.map +1 -1
- package/dist/api/admin-endpoint.d.ts +15 -3
- package/dist/api/admin-endpoint.js +24 -2
- package/dist/api/admin-endpoint.js.map +1 -1
- package/dist/api/bootstrap-endpoint.js +63 -1
- package/dist/api/bootstrap-endpoint.js.map +1 -1
- package/dist/api/codex-doctor-endpoint.d.ts +73 -0
- package/dist/api/codex-doctor-endpoint.js +177 -0
- package/dist/api/codex-doctor-endpoint.js.map +1 -0
- package/dist/api/discovery-endpoint.d.ts +32 -0
- package/dist/api/discovery-endpoint.js +104 -0
- package/dist/api/discovery-endpoint.js.map +1 -0
- package/dist/api/fleet-build.d.ts +8 -0
- package/dist/api/fleet-build.js +8 -2
- package/dist/api/fleet-build.js.map +1 -1
- package/dist/api/gather-status.d.ts +9 -0
- package/dist/api/gather-status.js +330 -7
- package/dist/api/gather-status.js.map +1 -1
- package/dist/api/harness-readiness-endpoint.d.ts +25 -0
- package/dist/api/harness-readiness-endpoint.js +24 -0
- package/dist/api/harness-readiness-endpoint.js.map +1 -0
- package/dist/api/hermes-doctor-endpoint.d.ts +66 -0
- package/dist/api/hermes-doctor-endpoint.js +75 -0
- package/dist/api/hermes-doctor-endpoint.js.map +1 -0
- package/dist/api/portfolio-v0-build.d.ts +10 -0
- package/dist/api/portfolio-v0-build.js +24 -5
- package/dist/api/portfolio-v0-build.js.map +1 -1
- package/dist/api/prediction-v1-build.d.ts +9 -0
- package/dist/api/prediction-v1-build.js +6 -1
- package/dist/api/prediction-v1-build.js.map +1 -1
- package/dist/api/server.d.ts +74 -1
- package/dist/api/server.js +107 -1
- package/dist/api/server.js.map +1 -1
- package/dist/api/setup-endpoints.d.ts +21 -0
- package/dist/api/setup-endpoints.js +101 -8
- package/dist/api/setup-endpoints.js.map +1 -1
- package/dist/api/setup-retry-endpoint.d.ts +19 -0
- package/dist/api/setup-retry-endpoint.js +32 -0
- package/dist/api/setup-retry-endpoint.js.map +1 -0
- package/dist/api/solvernets-endpoints.js +8 -1
- package/dist/api/solvernets-endpoints.js.map +1 -1
- package/dist/api/status-build.d.ts +64 -0
- package/dist/api/status-build.js +72 -18
- package/dist/api/status-build.js.map +1 -1
- package/dist/api/task-run-routing.d.ts +7 -0
- package/dist/api/task-run-routing.js +12 -0
- package/dist/api/task-run-routing.js.map +1 -0
- package/dist/api/task-runs-build.d.ts +20 -0
- package/dist/api/task-runs-build.js +13 -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/chain-read-errors.d.ts +10 -0
- package/dist/chain-read-errors.js +15 -0
- package/dist/chain-read-errors.js.map +1 -1
- package/dist/cli/commands/auth.js +3 -1
- package/dist/cli/commands/auth.js.map +1 -1
- package/dist/cli/commands/create.d.ts +5 -3
- package/dist/cli/commands/create.js +102 -36
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/solver-nets.d.ts +19 -0
- package/dist/cli/commands/solver-nets.js +164 -11
- package/dist/cli/commands/solver-nets.js.map +1 -1
- package/dist/cli/commands/solver-plugins-publish.d.ts +31 -0
- package/dist/cli/commands/solver-plugins-publish.js +169 -0
- package/dist/cli/commands/solver-plugins-publish.js.map +1 -0
- package/dist/cli/commands/solver-plugins-revoke.d.ts +15 -0
- package/dist/cli/commands/solver-plugins-revoke.js +91 -0
- package/dist/cli/commands/solver-plugins-revoke.js.map +1 -0
- package/dist/cli/commands/solver-plugins.d.ts +50 -6
- package/dist/cli/commands/solver-plugins.js +205 -68
- package/dist/cli/commands/solver-plugins.js.map +1 -1
- package/dist/cli/commands/update.d.ts +10 -0
- package/dist/cli/commands/update.js +36 -0
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/introspection-context.js +5 -0
- package/dist/cli/introspection-context.js.map +1 -1
- package/dist/config.d.ts +79 -5
- package/dist/config.js +85 -9
- package/dist/config.js.map +1 -1
- package/dist/conformance/checks/hash-signature.js +6 -2
- package/dist/conformance/checks/hash-signature.js.map +1 -1
- package/dist/conformance/checks/payload.js +4 -2
- package/dist/conformance/checks/payload.js.map +1 -1
- package/dist/conformance/checks/verdict.d.ts +10 -10
- package/dist/conformance/checks/verdict.js +16 -15
- package/dist/conformance/checks/verdict.js.map +1 -1
- package/dist/conformance/harness.d.ts +1 -1
- package/dist/conformance/harness.js +16 -9
- package/dist/conformance/harness.js.map +1 -1
- package/dist/conformance/types.d.ts +10 -3
- package/dist/conformance/types.js.map +1 -1
- package/dist/corpus/acquire.d.ts +1 -3
- package/dist/corpus/acquire.js.map +1 -1
- package/dist/corpus/envelope-projection.d.ts +1 -1
- package/dist/corpus/envelope-projection.js +14 -7
- package/dist/corpus/envelope-projection.js.map +1 -1
- package/dist/corpus/index.d.ts +2 -1
- package/dist/corpus/index.js.map +1 -1
- package/dist/corpus/prediction-brier-scoreboard-report.js +1 -1
- package/dist/corpus/prediction-brier-scoreboard-report.js.map +1 -1
- package/dist/corpus/prediction-brier-scoreboard.js +3 -1
- package/dist/corpus/prediction-brier-scoreboard.js.map +1 -1
- package/dist/corpus/types.d.ts +2 -2
- package/dist/daemon/daemon.d.ts +26 -1
- package/dist/daemon/daemon.js +63 -1
- package/dist/daemon/daemon.js.map +1 -1
- package/dist/daemon/eviction-loop.d.ts +40 -0
- package/dist/daemon/eviction-loop.js +67 -0
- package/dist/daemon/eviction-loop.js.map +1 -0
- package/dist/daemon/freeze-fence.js +6 -3
- package/dist/daemon/freeze-fence.js.map +1 -1
- package/dist/daemon/jinn-claim-loop-wiring.d.ts +33 -0
- package/dist/daemon/jinn-claim-loop-wiring.js +40 -0
- package/dist/daemon/jinn-claim-loop-wiring.js.map +1 -0
- package/dist/daemon/jinn-claim-loop.d.ts +24 -17
- package/dist/daemon/jinn-claim-loop.js +63 -21
- package/dist/daemon/jinn-claim-loop.js.map +1 -1
- package/dist/daemon/readiness-gate.d.ts +30 -0
- package/dist/daemon/readiness-gate.js +31 -0
- package/dist/daemon/readiness-gate.js.map +1 -0
- package/dist/daemon/skip-log-dedup.d.ts +69 -0
- package/dist/daemon/skip-log-dedup.js +106 -0
- package/dist/daemon/skip-log-dedup.js.map +1 -0
- package/dist/dashboard/assets/index-CODvRk_l.js +294 -0
- package/dist/dashboard/assets/index-CV4x-_zC.css +32 -0
- package/dist/dashboard/index.html +2 -2
- package/dist/discovery/http.js +235 -0
- package/dist/discovery/http.js.map +1 -1
- package/dist/discovery/onchain.d.ts +5 -0
- package/dist/discovery/onchain.js +411 -8
- package/dist/discovery/onchain.js.map +1 -1
- package/dist/discovery/types.d.ts +157 -1
- package/dist/discovery/types.js +8 -10
- package/dist/discovery/types.js.map +1 -1
- package/dist/discovery/with-fallback.js +12 -0
- package/dist/discovery/with-fallback.js.map +1 -1
- package/dist/earning/agent-wallet-binding.d.ts +20 -1
- package/dist/earning/agent-wallet-binding.js +54 -16
- package/dist/earning/agent-wallet-binding.js.map +1 -1
- package/dist/earning/bootstrap.d.ts +178 -0
- package/dist/earning/bootstrap.js +628 -57
- package/dist/earning/bootstrap.js.map +1 -1
- package/dist/earning/contracts.d.ts +14 -0
- package/dist/earning/contracts.js +18 -1
- package/dist/earning/contracts.js.map +1 -1
- package/dist/earning/funding-plan.js +15 -2
- package/dist/earning/funding-plan.js.map +1 -1
- package/dist/earning/jinn-rewards.d.ts +46 -0
- package/dist/earning/jinn-rewards.js +32 -0
- package/dist/earning/jinn-rewards.js.map +1 -1
- package/dist/earning/store.d.ts +8 -0
- package/dist/earning/store.js +48 -1
- package/dist/earning/store.js.map +1 -1
- package/dist/earning/testnet-setup-migration.d.ts +12 -0
- package/dist/earning/testnet-setup-migration.js +27 -1
- package/dist/earning/testnet-setup-migration.js.map +1 -1
- package/dist/earning/types.d.ts +45 -0
- package/dist/earning/types.js +37 -0
- package/dist/earning/types.js.map +1 -1
- package/dist/erc8004/abis.d.ts +64 -0
- package/dist/erc8004/abis.js +48 -0
- package/dist/erc8004/abis.js.map +1 -1
- package/dist/erc8004/plugin-registry.d.ts +102 -0
- package/dist/erc8004/plugin-registry.js +165 -0
- package/dist/erc8004/plugin-registry.js.map +1 -0
- package/dist/erc8004/reputation.d.ts +8 -0
- package/dist/erc8004/reputation.js +22 -3
- package/dist/erc8004/reputation.js.map +1 -1
- package/dist/events/types.d.ts +2 -2
- package/dist/harnesses/cost-estimates.d.ts +145 -0
- package/dist/harnesses/cost-estimates.js +297 -0
- package/dist/harnesses/cost-estimates.js.map +1 -0
- package/dist/harnesses/engine/engine.d.ts +72 -0
- package/dist/harnesses/engine/engine.js +109 -11
- package/dist/harnesses/engine/engine.js.map +1 -1
- package/dist/harnesses/engine/envelope-assembly.d.ts +2 -2
- package/dist/harnesses/engine/envelope-assembly.js +4 -2
- package/dist/harnesses/engine/envelope-assembly.js.map +1 -1
- package/dist/harnesses/engine/persistence.d.ts +21 -0
- package/dist/harnesses/engine/persistence.js +39 -0
- package/dist/harnesses/engine/persistence.js.map +1 -1
- package/dist/harnesses/engine/work-dir-reaper.d.ts +65 -0
- package/dist/harnesses/engine/work-dir-reaper.js +100 -0
- package/dist/harnesses/engine/work-dir-reaper.js.map +1 -0
- package/dist/harnesses/freeze.d.ts +4 -1
- package/dist/harnesses/freeze.js +12 -2
- package/dist/harnesses/freeze.js.map +1 -1
- package/dist/harnesses/impls/claude-mcp-prediction/index.d.ts +4 -1
- package/dist/harnesses/impls/claude-mcp-prediction/index.js +7 -2
- package/dist/harnesses/impls/claude-mcp-prediction/index.js.map +1 -1
- package/dist/harnesses/impls/claude-mcp-prediction-apy/index.d.ts +4 -1
- package/dist/harnesses/impls/claude-mcp-prediction-apy/index.js +7 -2
- package/dist/harnesses/impls/claude-mcp-prediction-apy/index.js.map +1 -1
- package/dist/harnesses/impls/evaluation-context.d.ts +15 -4
- package/dist/harnesses/impls/evaluation-context.js +24 -8
- package/dist/harnesses/impls/evaluation-context.js.map +1 -1
- package/dist/harnesses/impls/hermes-agent/adapter.d.ts +34 -0
- package/dist/harnesses/impls/hermes-agent/adapter.js +205 -0
- package/dist/harnesses/impls/hermes-agent/adapter.js.map +1 -0
- package/dist/harnesses/impls/hermes-agent/bootstrap.d.ts +18 -0
- package/dist/harnesses/impls/hermes-agent/bootstrap.js +231 -0
- package/dist/harnesses/impls/hermes-agent/bootstrap.js.map +1 -0
- package/dist/harnesses/impls/hermes-agent/config-builder.d.ts +49 -0
- package/dist/harnesses/impls/hermes-agent/config-builder.js +132 -0
- package/dist/harnesses/impls/hermes-agent/config-builder.js.map +1 -0
- package/dist/harnesses/impls/hermes-agent/harness.d.ts +58 -0
- package/dist/harnesses/impls/hermes-agent/harness.js +118 -0
- package/dist/harnesses/impls/hermes-agent/harness.js.map +1 -0
- package/dist/harnesses/impls/hermes-agent/index.d.ts +5 -0
- package/dist/harnesses/impls/hermes-agent/index.js +7 -0
- package/dist/harnesses/impls/hermes-agent/index.js.map +1 -0
- package/dist/harnesses/impls/hermes-agent/prompt.d.ts +15 -0
- package/dist/harnesses/impls/hermes-agent/prompt.js +37 -0
- package/dist/harnesses/impls/hermes-agent/prompt.js.map +1 -0
- package/dist/harnesses/impls/index.d.ts +13 -0
- package/dist/harnesses/impls/index.js +32 -4
- package/dist/harnesses/impls/index.js.map +1 -1
- package/dist/harnesses/impls/learner/adapters/claude-code.js.map +1 -0
- package/dist/harnesses/impls/{claude-code-learner → learner}/adapters/codex-code.js +13 -34
- package/dist/harnesses/impls/learner/adapters/codex-code.js.map +1 -0
- package/dist/harnesses/impls/learner/adapters/codex-workspace.js.map +1 -0
- package/dist/harnesses/impls/learner/harness.d.ts +62 -0
- package/dist/harnesses/impls/learner/harness.js +179 -0
- package/dist/harnesses/impls/learner/harness.js.map +1 -0
- package/dist/harnesses/impls/{claude-code-learner → learner}/harvest.js +15 -3
- package/dist/harnesses/impls/learner/harvest.js.map +1 -0
- package/dist/harnesses/impls/{claude-code-learner → learner}/index.d.ts +5 -5
- package/dist/harnesses/impls/{claude-code-learner → learner}/index.js +4 -4
- package/dist/harnesses/impls/learner/index.js.map +1 -0
- package/dist/harnesses/impls/{claude-code-learner → learner}/plugin-path.d.ts +4 -4
- package/dist/harnesses/impls/{claude-code-learner → learner}/plugin-path.js +7 -7
- package/dist/harnesses/impls/learner/plugin-path.js.map +1 -0
- package/dist/harnesses/impls/{claude-code-learner → learner}/restoration-patch.js +3 -1
- package/dist/harnesses/impls/learner/restoration-patch.js.map +1 -0
- package/dist/harnesses/impls/learner/test-utils/fake-plugin-outputs.js.map +1 -0
- package/dist/harnesses/impls/learner/test-utils/noop-adapter.js.map +1 -0
- package/dist/harnesses/impls/{claude-code-learner → learner}/types.d.ts +23 -2
- package/dist/harnesses/impls/learner/types.js.map +1 -0
- package/dist/harnesses/impls/portfolio-v0-evaluator/index.js +13 -12
- package/dist/harnesses/impls/portfolio-v0-evaluator/index.js.map +1 -1
- package/dist/harnesses/impls/prediction-apy-v0-evaluator/index.js +7 -7
- package/dist/harnesses/impls/prediction-apy-v0-evaluator/index.js.map +1 -1
- package/dist/harnesses/impls/prediction-apy-v0-evaluator/parse-submission.d.ts +3 -3
- package/dist/harnesses/impls/prediction-apy-v0-evaluator/parse-submission.js +7 -6
- package/dist/harnesses/impls/prediction-apy-v0-evaluator/parse-submission.js.map +1 -1
- package/dist/harnesses/impls/prediction-v0-evaluator/checks/integrity.js +1 -1
- package/dist/harnesses/impls/prediction-v0-evaluator/checks/integrity.js.map +1 -1
- package/dist/harnesses/impls/prediction-v0-evaluator/index.js +11 -10
- package/dist/harnesses/impls/prediction-v0-evaluator/index.js.map +1 -1
- package/dist/harnesses/impls/prediction-v1-evaluator/index.js +11 -10
- package/dist/harnesses/impls/prediction-v1-evaluator/index.js.map +1 -1
- package/dist/harnesses/impls/stub.d.ts +58 -0
- package/dist/harnesses/impls/stub.js +89 -0
- package/dist/harnesses/impls/stub.js.map +1 -0
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/eval-runner.d.ts +48 -50
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/eval-runner.js +92 -84
- 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 +24 -5
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/harness.js +104 -4
- 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 +9 -0
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/hf-fetcher.js +25 -1
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/hf-fetcher.js.map +1 -1
- package/dist/harnesses/names.d.ts +1 -0
- package/dist/harnesses/names.js +3 -0
- package/dist/harnesses/names.js.map +1 -1
- package/dist/harnesses/readiness-registry.d.ts +48 -0
- package/dist/harnesses/readiness-registry.js +144 -0
- package/dist/harnesses/readiness-registry.js.map +1 -0
- package/dist/harnesses/types.d.ts +7 -0
- package/dist/main.d.ts +14 -0
- package/dist/main.js +417 -116
- package/dist/main.js.map +1 -1
- package/dist/mcp/server.js +14 -13
- package/dist/mcp/server.js.map +1 -1
- package/dist/observability/emit-event.d.ts +1 -1
- package/dist/observability/emit-event.js.map +1 -1
- package/dist/operator-errors.d.ts +7 -0
- package/dist/operator-errors.js +26 -2
- package/dist/operator-errors.js.map +1 -1
- package/dist/preflight/claude-auth.d.ts +18 -0
- package/dist/preflight/claude-auth.js +38 -0
- package/dist/preflight/claude-auth.js.map +1 -1
- package/dist/restart-daemon.d.ts +79 -0
- package/dist/restart-daemon.js +82 -0
- package/dist/restart-daemon.js.map +1 -0
- package/dist/scripts/donation-consumption-acceptance.js +1 -1
- package/dist/scripts/donation-consumption-acceptance.js.map +1 -1
- package/dist/scripts/swe-rebench-v2-known-bad.json +12 -0
- package/dist/scripts/swe-rebench-v2-seed-pool.json +26 -0
- package/dist/setup/halt-mode.d.ts +14 -0
- package/dist/setup/halt-mode.js +17 -0
- package/dist/setup/halt-mode.js.map +1 -0
- package/dist/solver-nets/prediction-operator-ux.js +43 -3
- package/dist/solver-nets/prediction-operator-ux.js.map +1 -1
- package/dist/solver-nets/registry.d.ts +1 -0
- package/dist/solver-nets/registry.js +1 -1
- package/dist/solver-nets/registry.js.map +1 -1
- package/dist/solver-types/_swe-rebench-v2-pool-cache.d.ts +58 -0
- package/dist/solver-types/_swe-rebench-v2-pool-cache.js +87 -0
- package/dist/solver-types/_swe-rebench-v2-pool-cache.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-substrate.d.ts +52 -0
- package/dist/solver-types/_swe-rebench-v2-substrate.js +76 -0
- package/dist/solver-types/_swe-rebench-v2-substrate.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-validated-pool.d.ts +38 -12
- package/dist/solver-types/_swe-rebench-v2-validated-pool.js +136 -27
- package/dist/solver-types/_swe-rebench-v2-validated-pool.js.map +1 -1
- package/dist/solver-types/swe-rebench-v2-auto.d.ts +6 -0
- package/dist/solver-types/swe-rebench-v2-auto.js.map +1 -1
- package/dist/solver-types/swe-rebench-v2.d.ts +1 -0
- package/dist/solver-types/swe-rebench-v2.js +42 -17
- package/dist/solver-types/swe-rebench-v2.js.map +1 -1
- package/dist/solvernets/daemon-init.d.ts +10 -2
- package/dist/solvernets/daemon-init.js +22 -2
- package/dist/solvernets/daemon-init.js.map +1 -1
- package/dist/store/store.js +12 -4
- package/dist/store/store.js.map +1 -1
- package/dist/templates/plugins/runtime-plugin/.mcp.json.tmpl +8 -0
- package/dist/templates/plugins/runtime-plugin/README.md.tmpl +30 -0
- package/dist/templates/plugins/runtime-plugin/gitignore.tmpl +3 -0
- package/dist/templates/plugins/runtime-plugin/jinn.plugin.json.tmpl +21 -0
- package/dist/templates/plugins/runtime-plugin/mcp/server.mjs.tmpl +33 -0
- package/dist/templates/plugins/runtime-plugin/package.json.tmpl +15 -0
- package/dist/templates/plugins/runtime-plugin/test/plugin.test.ts.tmpl +35 -0
- package/dist/templates/plugins/runtime-plugin/tsconfig.json.tmpl +11 -0
- package/dist/templates/plugins/solver-type-plugin/README.md.tmpl +35 -0
- package/dist/templates/plugins/solver-type-plugin/gitignore.tmpl +3 -0
- package/dist/templates/plugins/solver-type-plugin/jinn.plugin.json.tmpl +11 -0
- package/dist/templates/plugins/solver-type-plugin/package.json.tmpl +15 -0
- package/dist/templates/plugins/solver-type-plugin/skills/example/SKILL.md.tmpl +10 -0
- package/dist/templates/plugins/solver-type-plugin/test/plugin.test.ts.tmpl +25 -0
- package/dist/templates/plugins/solver-type-plugin/tsconfig.json.tmpl +11 -0
- package/dist/tx-retry.d.ts +13 -0
- package/dist/tx-retry.js +22 -0
- package/dist/tx-retry.js.map +1 -1
- package/dist/types/envelope.d.ts +28 -21
- package/dist/types/envelope.js +8 -3
- package/dist/types/envelope.js.map +1 -1
- package/dist/types/payloads/index.d.ts +2 -2
- package/dist/types/payloads/index.js +13 -12
- package/dist/types/payloads/index.js.map +1 -1
- package/dist/types/payloads/portfolio-v0.d.ts +60 -10
- package/dist/types/payloads/portfolio-v0.js +16 -6
- package/dist/types/payloads/portfolio-v0.js.map +1 -1
- package/dist/types/payloads/prediction-apy-v0.d.ts +56 -14
- package/dist/types/payloads/prediction-apy-v0.js +16 -6
- package/dist/types/payloads/prediction-apy-v0.js.map +1 -1
- package/dist/types/payloads/prediction-v0.d.ts +53 -14
- package/dist/types/payloads/prediction-v0.js +16 -6
- package/dist/types/payloads/prediction-v0.js.map +1 -1
- package/dist/util/extract-tx-hash.d.ts +14 -0
- package/dist/util/extract-tx-hash.js +19 -0
- package/dist/util/extract-tx-hash.js.map +1 -0
- package/dist/vendor/@jinn-network/sdk/dist/payloads/prediction-v1.d.ts +45 -6
- package/dist/vendor/@jinn-network/sdk/dist/payloads/prediction-v1.js +16 -6
- package/dist/x402/handler.js +51 -20
- package/dist/x402/handler.js.map +1 -1
- package/package.json +38 -13
- package/plugins/swe-rebench-v2-diffmin/.claude-plugin/plugin.json +5 -0
- package/plugins/swe-rebench-v2-diffmin/.mcp.json +8 -0
- package/plugins/swe-rebench-v2-diffmin/README.md +69 -0
- package/plugins/swe-rebench-v2-diffmin/jinn.plugin.json +12 -0
- package/plugins/swe-rebench-v2-diffmin/mcp/diff-stats-server.mjs +72 -0
- package/plugins/swe-rebench-v2-diffmin/mcp/diff-stats.mjs +48 -0
- package/plugins/swe-rebench-v2-diffmin/package.json +19 -0
- package/plugins/swe-rebench-v2-diffmin/skills/diffmin/SKILL.md +116 -0
- package/plugins/swe-rebench-v2-diffmin/skills/test-map/SKILL.md +126 -0
- package/plugins/swe-rebench-v2-diffmin/test/diff-stats.test.ts +62 -0
- package/plugins/swe-rebench-v2-diffmin/test/manifest.test.ts +53 -0
- package/plugins/swe-rebench-v2-diffmin/tsconfig.json +12 -0
- package/plugins/swe-rebench-v2-runtime/README.md +13 -0
- package/plugins/swe-rebench-v2-runtime/skills/orient/SKILL.md +7 -3
- package/plugins/swe-rebench-v2-runtime/skills/plan/SKILL.md +6 -17
- package/templates/plugins/runtime-plugin/.mcp.json.tmpl +8 -0
- package/templates/plugins/runtime-plugin/README.md.tmpl +30 -0
- package/templates/plugins/runtime-plugin/gitignore.tmpl +3 -0
- package/templates/plugins/runtime-plugin/jinn.plugin.json.tmpl +21 -0
- package/templates/plugins/runtime-plugin/mcp/server.mjs.tmpl +33 -0
- package/templates/plugins/runtime-plugin/package.json.tmpl +15 -0
- package/templates/plugins/runtime-plugin/test/plugin.test.ts.tmpl +35 -0
- package/templates/plugins/runtime-plugin/tsconfig.json.tmpl +11 -0
- package/templates/plugins/solver-type-plugin/README.md.tmpl +35 -0
- package/templates/plugins/solver-type-plugin/gitignore.tmpl +3 -0
- package/templates/plugins/solver-type-plugin/jinn.plugin.json.tmpl +11 -0
- package/templates/plugins/solver-type-plugin/package.json.tmpl +15 -0
- package/templates/plugins/solver-type-plugin/skills/example/SKILL.md.tmpl +10 -0
- package/templates/plugins/solver-type-plugin/test/plugin.test.ts.tmpl +25 -0
- package/templates/plugins/solver-type-plugin/tsconfig.json.tmpl +11 -0
- package/dist/dashboard/assets/index-BjtltOGc.js +0 -76
- package/dist/dashboard/assets/index-D_NMfDfV.css +0 -32
- package/dist/harnesses/impls/claude-code-learner/adapters/claude-code.js.map +0 -1
- package/dist/harnesses/impls/claude-code-learner/adapters/codex-code.js.map +0 -1
- package/dist/harnesses/impls/claude-code-learner/adapters/codex-workspace.js.map +0 -1
- package/dist/harnesses/impls/claude-code-learner/harness.d.ts +0 -22
- package/dist/harnesses/impls/claude-code-learner/harness.js +0 -62
- package/dist/harnesses/impls/claude-code-learner/harness.js.map +0 -1
- package/dist/harnesses/impls/claude-code-learner/harvest.js.map +0 -1
- package/dist/harnesses/impls/claude-code-learner/index.js.map +0 -1
- package/dist/harnesses/impls/claude-code-learner/plugin-path.js.map +0 -1
- package/dist/harnesses/impls/claude-code-learner/restoration-patch.js.map +0 -1
- package/dist/harnesses/impls/claude-code-learner/test-utils/fake-plugin-outputs.js.map +0 -1
- package/dist/harnesses/impls/claude-code-learner/test-utils/noop-adapter.js.map +0 -1
- package/dist/harnesses/impls/claude-code-learner/types.js.map +0 -1
- package/dist/preflight/claude-required.d.ts +0 -8
- package/dist/preflight/claude-required.js +0 -17
- package/dist/preflight/claude-required.js.map +0 -1
- /package/dist/harnesses/impls/{claude-code-learner → learner}/adapters/claude-code.d.ts +0 -0
- /package/dist/harnesses/impls/{claude-code-learner → learner}/adapters/claude-code.js +0 -0
- /package/dist/harnesses/impls/{claude-code-learner → learner}/adapters/codex-code.d.ts +0 -0
- /package/dist/harnesses/impls/{claude-code-learner → learner}/adapters/codex-workspace.d.ts +0 -0
- /package/dist/harnesses/impls/{claude-code-learner → learner}/adapters/codex-workspace.js +0 -0
- /package/dist/harnesses/impls/{claude-code-learner → learner}/harvest.d.ts +0 -0
- /package/dist/harnesses/impls/{claude-code-learner → learner}/restoration-patch.d.ts +0 -0
- /package/dist/harnesses/impls/{claude-code-learner → learner}/test-utils/fake-plugin-outputs.d.ts +0 -0
- /package/dist/harnesses/impls/{claude-code-learner → learner}/test-utils/fake-plugin-outputs.js +0 -0
- /package/dist/harnesses/impls/{claude-code-learner → learner}/test-utils/noop-adapter.d.ts +0 -0
- /package/dist/harnesses/impls/{claude-code-learner → learner}/test-utils/noop-adapter.js +0 -0
- /package/dist/harnesses/impls/{claude-code-learner → learner}/types.js +0 -0
- /package/plugins/{claude-code-learner → learner}/.claude-plugin/plugin.json +0 -0
- /package/plugins/{claude-code-learner → learner}/.codex-plugin/plugin.json +0 -0
- /package/plugins/{claude-code-learner → learner}/AGENTS.md +0 -0
- /package/plugins/{claude-code-learner → learner}/CLAUDE.md +0 -0
- /package/plugins/{claude-code-learner → learner}/README.md +0 -0
- /package/plugins/{claude-code-learner → learner}/hooks/hooks.json +0 -0
- /package/plugins/{claude-code-learner → learner}/hooks/session-start +0 -0
- /package/plugins/{claude-code-learner → learner}/skills/learn/SKILL.md +0 -0
- /package/plugins/{claude-code-learner → learner}/skills/learn/analyst-prompt.md +0 -0
- /package/plugins/{claude-code-learner → learner}/skills/learn/consolidator-prompt.md +0 -0
- /package/plugins/{claude-code-learner → learner}/skills/learn/explorer-prompt.md +0 -0
- /package/plugins/{claude-code-learner → learner}/skills/learn/planner-prompt.md +0 -0
- /package/plugins/{claude-code-learner → learner}/skills/learn/promoter-prompt.md +0 -0
- /package/plugins/{claude-code-learner → learner}/skills/learn/step-worker-prompt.md +0 -0
- /package/plugins/{claude-code-learner → learner}/skills/learn/strategist-prompt.md +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,137 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
### Embedded agent surface hidden by default (issue #326)
|
|
6
|
+
|
|
7
|
+
- **The embedded Claude agent chat surface no longer renders in the operator
|
|
8
|
+
app by default.** The right-rail agent panel (running mode) and the
|
|
9
|
+
"Ask Claude" panel (onboarding) are hidden. The 2026-05-19 v0.1.6 dogfood
|
|
10
|
+
found the surface isn't robust enough for first-time operators — it is the
|
|
11
|
+
only daemon-side surface that strictly requires Claude auth, and its
|
|
12
|
+
action-authority / plugin-scope shape is still in design (#177 / #178).
|
|
13
|
+
- **Feature flag: `JINN_ENABLE_EMBEDDED_AGENT`.** Set
|
|
14
|
+
`JINN_ENABLE_EMBEDDED_AGENT=1` (also accepts `true`) to re-enable the
|
|
15
|
+
surface for development. Default is off. When off, the daemon does not
|
|
16
|
+
mount the `/api/agent/ws` bridge and the SPA renders no agent panel; when
|
|
17
|
+
on, the dev-time path works end-to-end as before. (Issue #367: the SPA now
|
|
18
|
+
reads this flag through the injected `window.__JINN_FEATURES__`, the same
|
|
19
|
+
channel as the plug-in builder UI flag — no behaviour change for operators.)
|
|
20
|
+
- **Claude-Code-as-a-solver-harness is unaffected.** Operators can still pick
|
|
21
|
+
Claude Code as their SolverNet harness — that path is independent of the
|
|
22
|
+
embedded chat surface and its WebSocket bridge.
|
|
23
|
+
|
|
24
|
+
### Operator app
|
|
25
|
+
|
|
26
|
+
- **Plug-in builder UI surfaces hidden by default (issue #327).** The `/build`
|
|
27
|
+
route and the Build top-tab no longer appear in the operator app. Hitting
|
|
28
|
+
`/build` by direct URL redirects to `/overview`. The plug-in substrate stays
|
|
29
|
+
fully live — `jinn solver-plugins publish` / `revoke`, the Ponder indexer,
|
|
30
|
+
the Discovery API endpoints, and the `client/docs/build/` tree are
|
|
31
|
+
unchanged, so direct-CLI builders following the docs are not blocked. The
|
|
32
|
+
surfaces are gated to keep the operator-app first-run UX focused; they will
|
|
33
|
+
be re-promoted once that UX is solid and plug-in indexing is end-to-end
|
|
34
|
+
populated. Set `JINN_ENABLE_PLUGIN_BUILDER_UI=1` on the daemon to re-enable
|
|
35
|
+
the full builder surface for development and design work — the daemon injects
|
|
36
|
+
the flag into the SPA via `window.__JINN_FEATURES__`.
|
|
37
|
+
|
|
38
|
+
### SWE-rebench v2 admission
|
|
39
|
+
|
|
40
|
+
- **Admission semantics bumped from `'2'` → `'3'`.** Operators running the
|
|
41
|
+
public/launched generator MUST re-validate before posting resumes:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
jinn solver-nets validate-pool swe-rebench-v2 --seed-positive --known-bad
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Expected duration: ~1-2h (one gold-patch eval per seed instance).
|
|
48
|
+
Until re-validation runs, the launched generator posts no new tasks
|
|
49
|
+
(admission required; `jinn doctor` reports the pool as stale).
|
|
50
|
+
Note: the seed pool contains 20 instances from common Python repos; typical
|
|
51
|
+
admission rates are 25-40%, so expect 5-8 scorable entries after re-validation.
|
|
52
|
+
Operators can extend the seed list via PR over time.
|
|
53
|
+
- **Required admission mode is now the default for launched generators.**
|
|
54
|
+
Local/dev users running `admissionMode: 'python-floor'` keep today's
|
|
55
|
+
behaviour. `jinn doctor` reports pool freshness and prints the exact
|
|
56
|
+
re-validation command when stale.
|
|
57
|
+
- **Verdict-time substrate recheck** catches drift between admission and
|
|
58
|
+
grading. Any mismatch (rowHash, imageDigest, HF outage) skips the verdict
|
|
59
|
+
rather than emitting a misclassified FAIL.
|
|
60
|
+
|
|
61
|
+
## v0.1.5 — Operator App
|
|
62
|
+
|
|
63
|
+
_Released 2026-05-13_
|
|
64
|
+
|
|
65
|
+
# v0.1.5 — "Operator App"
|
|
66
|
+
2026-05-13 · Suggested bump: patch (first npm `@latest` cut that ships the app-first operator experience)
|
|
67
|
+
|
|
68
|
+
## Highlights
|
|
69
|
+
|
|
70
|
+
- Release plumbing fixed so the cut can actually ship. `npm-publish.yml` now installs `contracts/` before the operator gate, the Docker/GHCR workflow accepts the new `v<semver>` tag format alongside legacy `client-v*`, and the CHANGELOG mirror writes through a PR (no more failed direct push to protected `main`).
|
|
71
|
+
- SWE-rebench v2 verdict path is structurally correct end-to-end. The eval loop no longer emits verdicts on non-gradeable evals (uy6v.8), the daemon's `verdictCode` default is `Invalid`, not `Pass` (uy6v.7), evaluator-side gating now surfaces a real verdict so the reputation feedback hook fires (uy6v.10), and the `evaluation:<cid>` MetadataSet is published on verdict delivery (n93o).
|
|
72
|
+
- Per-operator disks no longer fill in a couple of weeks. The SWE-rebench v2 eval-image cache is bounded by an in-process LRU (uy6v.11).
|
|
73
|
+
- Operator app feedback on issue 188 addressed across overview / launcher / catalog / configuration / shell, with dashboard tests refreshed.
|
|
74
|
+
- Daemon execution envelope now carries the executor model (`gbut`), giving downstream consumers the model that produced each Solution / Verdict.
|
|
75
|
+
- Discovery API no longer 404s for just-launched manifests when no subgraph is configured (#170) — important for fresh launcher records.
|
|
76
|
+
|
|
77
|
+
## Recovery context
|
|
78
|
+
|
|
79
|
+
v0.1.4 published as a GitHub Release at `fa8da678` but the npm-publish workflow failed before publish in `release:operator-gate` because contracts dependencies were not installed in the clean Actions checkout. The fix landed as PR #187 *after* the v0.1.4 tag was created, so the v0.1.4 release commit could not retry publish. v0.1.5 cuts from current `main` (`56e84952`) which includes that fix; `@jinn-network/client@latest` becomes `0.1.5` (replacing the stale `0.1.2`). v0.1.4 remains as a Build Notes Release; no `0.1.4` npm artifact exists.
|
|
80
|
+
|
|
81
|
+
## Changes
|
|
82
|
+
|
|
83
|
+
### feat
|
|
84
|
+
- (#189) feat(uy6v.11): bound swe-rebench-v2 eval-image cache with in-process LRU — @ritsuKai2000
|
|
85
|
+
- (#194) feat(gbut): publish executor.model in jinn.execution.v1 envelope — @ritsuKai2000
|
|
86
|
+
|
|
87
|
+
### fix
|
|
88
|
+
- (#170) fix: /v1/solvernets/registry/:cid 404s for just-launched manifests when no subgraph is configured — @ritsuKai2000
|
|
89
|
+
- (#183) fix(uy6v.8): SWE-rebench v2 eval loop — no verdicts on non-gradeable evals; source-only patches — @ritsuKai2000
|
|
90
|
+
- (#185) fix(release): unblock v0.1.4 publish — @ritsuKai2000
|
|
91
|
+
- (#187) fix(release): install contracts before operator gate — @ritsuKai2000
|
|
92
|
+
- (#190) fix(uy6v.10): emit verdict in swe-rebench-v2 gating so reputation hook fires — @ritsuKai2000
|
|
93
|
+
- (#193) fix(uy6v.7): daemon verdictCode default — Invalid not Pass — @ritsuKai2000
|
|
94
|
+
- (#197) fix(n93o): publish evaluation:<cid> MetadataSet on verdict delivery — @ritsuKai2000
|
|
95
|
+
|
|
96
|
+
### chore
|
|
97
|
+
- (#208) chore(2cl.20): bump client/package.json to 0.1.5 — @ritsuKai2000
|
|
98
|
+
|
|
99
|
+
### docs
|
|
100
|
+
- (#165) docs: clarify terminal unresolved verdicts — @ritsuKai2000
|
|
101
|
+
- (#195) docs(uy6v.6): DR — keep self-eval bypass on testnet; revert is a mainnet gate — @ritsuKai2000
|
|
102
|
+
|
|
103
|
+
### test
|
|
104
|
+
- (#168) test: Real-daemon Playwright e2e: lifecycle + operator catalog + empty states + crash recovery (scenarios 2-5) — scenarios 2-4 — @ritsuKai2000
|
|
105
|
+
- (#207) test: align verdict code fallback expectation — @ritsuKai2000
|
|
106
|
+
|
|
107
|
+
### other
|
|
108
|
+
- (#192) [codex] address operator dashboard issue 188 feedback — @ritsuKai2000
|
|
109
|
+
|
|
110
|
+
## Closed this week
|
|
111
|
+
|
|
112
|
+
- jinn-mono-uy6v.8 (SWE-rebench v2 eval loop — verdicts on non-gradeable evals)
|
|
113
|
+
- jinn-mono-uy6v.6 (DR — keep self-eval bypass on testnet)
|
|
114
|
+
- jinn-mono-uy6v.9 (Unscorable instances in dataset — quantified)
|
|
115
|
+
- jinn-mono-2cl.20.1 (Discovery-stack scope mismatch before release draft)
|
|
116
|
+
|
|
117
|
+
## Stats
|
|
118
|
+
|
|
119
|
+
- Window: v0.1.4 → HEAD (2026-05-13)
|
|
120
|
+
- 14 commits · 72 files changed, 4444 insertions(+), 772 deletions(-) · 15 PRs · 1 contributor
|
|
121
|
+
|
|
122
|
+
## Known issues
|
|
123
|
+
|
|
124
|
+
- jinn-mono-uy6v.7 (Live verdict-success + JINN reward distribution): in_progress. Verdict path is now structurally correct and emitting, but live observation of JINN reward distribution to operator wallets is still gating the v1 public-testnet ship (separate from this Build Notes cut).
|
|
125
|
+
- jinn-mono-uy6v.10 (Reputation-feedback hook): PR #190 makes the feedback hook fire on swe-rebench v2 verdicts; live on-chain registry update observation still pending closure.
|
|
126
|
+
- jinn-mono-uy6v.11 (Eval-image cache): PR #189 bounded the cache via in-process LRU; long-running operator disk validation still pending closure.
|
|
127
|
+
|
|
128
|
+
<!-- jinn-release-evidence:v1
|
|
129
|
+
release-tag=v0.1.5
|
|
130
|
+
release-commit=56e849525ebdbc8efc5a99a8255cead613ef7d80
|
|
131
|
+
release-client-prepare=passed
|
|
132
|
+
donation-consumption=passed
|
|
133
|
+
app-first-testnet-acceptance=passed
|
|
134
|
+
-->
|
|
135
|
+
|
|
5
136
|
## v0.1.4 — Shipping Machine
|
|
6
137
|
|
|
7
138
|
_Released 2026-05-12_
|
|
@@ -20,8 +20,13 @@
|
|
|
20
20
|
},
|
|
21
21
|
"messenger": {
|
|
22
22
|
"mode": "mock",
|
|
23
|
-
"address": "
|
|
24
|
-
"owner": "
|
|
23
|
+
"address": "0xd229A2C20333B747675090Ce38B8a1Fb2dafe6AC",
|
|
24
|
+
"owner": "0x15e78734481bD31F6e183dad05225505a45ACd07",
|
|
25
|
+
"previousAddress": "0x30E2f1A5691a999053A54e8DAf9496CD7ccF2DFD",
|
|
26
|
+
"rotatedAt": "2026-05-20T17:14:48.591Z",
|
|
27
|
+
"deployTxHash": "0x44c0fc6f92e1c8247304dceb195b8cfa1ae114a79e7a6ce1305e4305de45b9af",
|
|
28
|
+
"setMessengerTxHash": "0x13313c9cc29ae9d7ce1e13ca78472359fdb6213b5d1d936d73f89ca051867c00",
|
|
29
|
+
"rotationBlockNumber": 10886858
|
|
25
30
|
},
|
|
26
31
|
"handover": {
|
|
27
32
|
"renounceAdmin": false
|
|
@@ -31,6 +36,20 @@
|
|
|
31
36
|
"TimelockController": "0x5CE9c7E24f0509490a91a1cD285DDFF70A9C058D",
|
|
32
37
|
"JinnGovernor": "0xbbc43A1B5AC699de09577dAE4A1007a3bA704D9E",
|
|
33
38
|
"JinnDistributor": "0xaC9CD847660d05e77D82A3684aFC4EbFd94fBfe6",
|
|
34
|
-
"Messenger": "
|
|
35
|
-
|
|
39
|
+
"Messenger": "0xd229A2C20333B747675090Ce38B8a1Fb2dafe6AC",
|
|
40
|
+
"MockMessenger": "0xd229A2C20333B747675090Ce38B8a1Fb2dafe6AC"
|
|
41
|
+
},
|
|
42
|
+
"rotations": [
|
|
43
|
+
{
|
|
44
|
+
"type": "mock-messenger",
|
|
45
|
+
"previousMessenger": "0x30E2f1A5691a999053A54e8DAf9496CD7ccF2DFD",
|
|
46
|
+
"newMessenger": "0xd229A2C20333B747675090Ce38B8a1Fb2dafe6AC",
|
|
47
|
+
"owner": "0x15e78734481bD31F6e183dad05225505a45ACd07",
|
|
48
|
+
"distributor": "0xaC9CD847660d05e77D82A3684aFC4EbFd94fBfe6",
|
|
49
|
+
"deployTxHash": "0x44c0fc6f92e1c8247304dceb195b8cfa1ae114a79e7a6ce1305e4305de45b9af",
|
|
50
|
+
"setMessengerTxHash": "0x13313c9cc29ae9d7ce1e13ca78472359fdb6213b5d1d936d73f89ca051867c00",
|
|
51
|
+
"blockNumber": 10886858,
|
|
52
|
+
"rotatedAt": "2026-05-20T17:14:48.591Z"
|
|
53
|
+
}
|
|
54
|
+
]
|
|
36
55
|
}
|
|
@@ -20,8 +20,13 @@
|
|
|
20
20
|
},
|
|
21
21
|
"messenger": {
|
|
22
22
|
"mode": "mock",
|
|
23
|
-
"address": "
|
|
24
|
-
"owner": "
|
|
23
|
+
"address": "0xd229A2C20333B747675090Ce38B8a1Fb2dafe6AC",
|
|
24
|
+
"owner": "0x15e78734481bD31F6e183dad05225505a45ACd07",
|
|
25
|
+
"previousAddress": "0x30E2f1A5691a999053A54e8DAf9496CD7ccF2DFD",
|
|
26
|
+
"rotatedAt": "2026-05-20T17:14:48.591Z",
|
|
27
|
+
"deployTxHash": "0x44c0fc6f92e1c8247304dceb195b8cfa1ae114a79e7a6ce1305e4305de45b9af",
|
|
28
|
+
"setMessengerTxHash": "0x13313c9cc29ae9d7ce1e13ca78472359fdb6213b5d1d936d73f89ca051867c00",
|
|
29
|
+
"rotationBlockNumber": 10886858
|
|
25
30
|
},
|
|
26
31
|
"handover": {
|
|
27
32
|
"renounceAdmin": false
|
|
@@ -31,6 +36,20 @@
|
|
|
31
36
|
"TimelockController": "0x5CE9c7E24f0509490a91a1cD285DDFF70A9C058D",
|
|
32
37
|
"JinnGovernor": "0xbbc43A1B5AC699de09577dAE4A1007a3bA704D9E",
|
|
33
38
|
"JinnDistributor": "0xaC9CD847660d05e77D82A3684aFC4EbFd94fBfe6",
|
|
34
|
-
"Messenger": "
|
|
35
|
-
|
|
39
|
+
"Messenger": "0xd229A2C20333B747675090Ce38B8a1Fb2dafe6AC",
|
|
40
|
+
"MockMessenger": "0xd229A2C20333B747675090Ce38B8a1Fb2dafe6AC"
|
|
41
|
+
},
|
|
42
|
+
"rotations": [
|
|
43
|
+
{
|
|
44
|
+
"type": "mock-messenger",
|
|
45
|
+
"previousMessenger": "0x30E2f1A5691a999053A54e8DAf9496CD7ccF2DFD",
|
|
46
|
+
"newMessenger": "0xd229A2C20333B747675090Ce38B8a1Fb2dafe6AC",
|
|
47
|
+
"owner": "0x15e78734481bD31F6e183dad05225505a45ACd07",
|
|
48
|
+
"distributor": "0xaC9CD847660d05e77D82A3684aFC4EbFd94fBfe6",
|
|
49
|
+
"deployTxHash": "0x44c0fc6f92e1c8247304dceb195b8cfa1ae114a79e7a6ce1305e4305de45b9af",
|
|
50
|
+
"setMessengerTxHash": "0x13313c9cc29ae9d7ce1e13ca78472359fdb6213b5d1d936d73f89ca051867c00",
|
|
51
|
+
"blockNumber": 10886858,
|
|
52
|
+
"rotatedAt": "2026-05-20T17:14:48.591Z"
|
|
53
|
+
}
|
|
54
|
+
]
|
|
36
55
|
}
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
"network": "baseSepolia",
|
|
3
3
|
"chainId": 84532,
|
|
4
4
|
"deployer": "0x15e78734481bD31F6e183dad05225505a45ACd07",
|
|
5
|
-
"deployedAt": "2026-
|
|
5
|
+
"deployedAt": "2026-05-20T15:23:10.000Z",
|
|
6
|
+
"deployBlock": 41761151,
|
|
7
|
+
"txHash": "0x97524384c024a2bcfe11b3699bad53e8533bc25f43e64101ce1e0e4170491f9b",
|
|
6
8
|
"contracts": {
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"JinnRouterV2": "0x13dae57a54A7DF862113BcA8Ee2fd3dEf6a6A94A",
|
|
9
|
+
"TaskClaimEmitter": "0xF60055534E377F4020eEA80356C0643E02f4f307",
|
|
10
|
+
"TaskActivityCheckerV3": "0x0e1B5f264F4FAdcFAA950fb00c58d9A39C040f70",
|
|
10
11
|
"ServiceRegistry": "0x31D3202d8744B16A120117A053459DDFAE93c855"
|
|
11
12
|
}
|
|
12
13
|
}
|
|
@@ -4,6 +4,25 @@ import type { Task, RequestId, PostedTask, TaskAnnouncement, TaskRequest, TaskRe
|
|
|
4
4
|
import { type MechAdapterConfig } from './types.js';
|
|
5
5
|
import { VerdictCode } from './verdict-code.js';
|
|
6
6
|
import type { Store } from '../../store/store.js';
|
|
7
|
+
/**
|
|
8
|
+
* Floor block for the on-chain TaskCreated backlog scan, per chain.
|
|
9
|
+
*
|
|
10
|
+
* A daemon with no joined-SolverNet store cursor (fresh bootstrap) will scan
|
|
11
|
+
* from this block forward. Existing operators with a persisted cursor are
|
|
12
|
+
* unaffected — their cursor is used as long as it's already past this floor.
|
|
13
|
+
*
|
|
14
|
+
* Base Sepolia (84532): 41_510_000 lands at 2026-05-14T19:51Z, ~2h after the
|
|
15
|
+
* fufn validated-pool was rebuilt to `EVAL_SEMANTICS_VERSION='3'` (2026-05-14
|
|
16
|
+
* T17:28Z). Everything created before that rebuild is a "ghost" — admitted
|
|
17
|
+
* under a prior semantics regime that the current evaluators can't score —
|
|
18
|
+
* so a fresh operator should not waste compute claiming them.
|
|
19
|
+
* See gh #300 for the proper fix (symmetric solver-side admission filter and
|
|
20
|
+
* generalised scan-age window).
|
|
21
|
+
*
|
|
22
|
+
* Base mainnet (8453): unchanged at 25_000_000 — Phase 0 era, no v3-rebuild
|
|
23
|
+
* equivalent on mainnet.
|
|
24
|
+
*/
|
|
25
|
+
export declare const DEFAULT_TASK_DISCOVERY_FROM_BLOCK: Record<number, bigint>;
|
|
7
26
|
export declare class MechAdapter implements ExecutionAdapter {
|
|
8
27
|
readonly name = "mech";
|
|
9
28
|
private publicClient;
|
|
@@ -32,6 +51,9 @@ export declare class MechAdapter implements ExecutionAdapter {
|
|
|
32
51
|
private persistPendingEvaluationSolutions;
|
|
33
52
|
private rememberPendingEvaluationSolution;
|
|
34
53
|
private forgetPendingEvaluationSolution;
|
|
54
|
+
private clearPendingDeliveryRecoveryState;
|
|
55
|
+
private recoveryDeliveryExpirySeconds;
|
|
56
|
+
private shouldSkipExpiredRecoveryDelivery;
|
|
35
57
|
postTask(state: Task): Promise<PostedTask>;
|
|
36
58
|
private signTaskDocument;
|
|
37
59
|
private contractPolicyForTask;
|
|
@@ -55,7 +77,7 @@ export declare class MechAdapter implements ExecutionAdapter {
|
|
|
55
77
|
}>;
|
|
56
78
|
submitSolutionDelivery(requestId: RequestId, solutionDigest: Hex): Promise<void>;
|
|
57
79
|
submitVerdictDelivery(requestId: RequestId, verdictDigest: Hex, verdictCode: VerdictCode): Promise<void>;
|
|
58
|
-
private
|
|
80
|
+
private deliveryClaimForDelivery;
|
|
59
81
|
private ensureDeliveryClaimed;
|
|
60
82
|
watchForDeliveries(): AsyncIterable<DeliveredResult>;
|
|
61
83
|
stop(): Promise<void>;
|
|
@@ -6,19 +6,61 @@ import { PermanentError, parseTask } from '../../types/index.js';
|
|
|
6
6
|
import { createClients } from './safe.js';
|
|
7
7
|
import { buildResultPayload, uploadToIpfs, cidToDigestHex, fetchFromIpfs, fetchSignedTaskFromIpfs, fetchSignedEnvelopeFromIpfs, } from './ipfs.js';
|
|
8
8
|
import { canonicalJson } from '../../harnesses/engine/canonical-json.js';
|
|
9
|
-
import { SignedEnvelopeSchema } from '../../types/envelope.js';
|
|
9
|
+
import { normalizeEnvelopeRole, SignedEnvelopeSchema } from '../../types/envelope.js';
|
|
10
10
|
import { submitTask, claimTask as claimTaskOnchain, claimEvaluation as claimEvaluationOnchain, claimDelivery, getMechDeliveryRate, getTimeoutBounds, decodeTaskCreatedLogs, decodeSolutionDeliveryClaimedLogs, decodeDeliverLogs, findLatestDeliveryDataHexForRequest, getMarketplaceRequestDeliveryMech, getTaskCidDigest, callDeliverToMarketplace, canClaimTask, canClaimEvaluation, } from './contracts.js';
|
|
11
|
+
import { isNonRecoverableInnerRevert } from './safe-revert.js';
|
|
12
|
+
import { verdictCodeFromValue } from './verdict-code.js';
|
|
11
13
|
import { manifestDigestForCid } from './digest.js';
|
|
12
14
|
import { withRecoverableRetry } from '../../tx-retry.js';
|
|
13
15
|
import { formatRpcError } from '../../rpc-error-context.js';
|
|
14
|
-
import {
|
|
16
|
+
import { SOLUTION_ENVELOPE_CID_CONTEXT_KEY, SOLUTION_TASK_CID_CONTEXT_KEY, RESTORATION_TASK_CID_CONTEXT_KEY, } from '../../harnesses/impls/evaluation-context.js';
|
|
15
17
|
import { signTaskV1 } from '../../tasks/signing.js';
|
|
16
18
|
const ROUTER_REQUEST_CURSOR_CONFIG_KEY = 'mech_router_request_block_cursor_v1';
|
|
17
19
|
const PENDING_EVALUATION_SOLUTIONS_CONFIG_KEY = 'mech_pending_evaluation_solutions_v1';
|
|
18
20
|
const DEFAULT_MECH_DELIVER_BACKFILL_LOOKBACK_BLOCKS = 100000n;
|
|
21
|
+
/** Yield to the event loop every N evaluation opportunities so a large retry
|
|
22
|
+
* backlog can't starve the HTTP API mid-cycle. */
|
|
23
|
+
const EVALUATION_RETRY_YIELD_EVERY = 10;
|
|
24
|
+
/**
|
|
25
|
+
* Decide whether a `canClaimEvaluation` failure means the opportunity can NEVER
|
|
26
|
+
* become claimable (terminal, prune it) versus one that could still clear later
|
|
27
|
+
* (transient, keep retrying).
|
|
28
|
+
*
|
|
29
|
+
* Classification is done on the *structured* `revertName` decoded straight from
|
|
30
|
+
* the inner revert data — not by regex-unformatting the operator-facing `reason`
|
|
31
|
+
* string. The format→regex round-trip was fragile: an arg value containing a
|
|
32
|
+
* `(` corrupted the strip, and the `flattenErrorMessage` fallback produced
|
|
33
|
+
* arbitrary text the regex mangled, silently mis-classifying opportunities.
|
|
34
|
+
*
|
|
35
|
+
* A false-keep (re-checking a dead opportunity) only costs one more RPC; a
|
|
36
|
+
* false-prune (dropping a still-claimable opportunity) loses real work — so
|
|
37
|
+
* when in doubt we keep. Anything without a known non-recoverable revert name
|
|
38
|
+
* is treated as transient.
|
|
39
|
+
*/
|
|
40
|
+
function isTerminalEvaluationReason(revertName) {
|
|
41
|
+
return isNonRecoverableInnerRevert(revertName);
|
|
42
|
+
}
|
|
19
43
|
const DEFAULT_ROUTER_LOG_CHUNK_BLOCKS = 9999n;
|
|
20
|
-
|
|
21
|
-
|
|
44
|
+
/**
|
|
45
|
+
* Floor block for the on-chain TaskCreated backlog scan, per chain.
|
|
46
|
+
*
|
|
47
|
+
* A daemon with no joined-SolverNet store cursor (fresh bootstrap) will scan
|
|
48
|
+
* from this block forward. Existing operators with a persisted cursor are
|
|
49
|
+
* unaffected — their cursor is used as long as it's already past this floor.
|
|
50
|
+
*
|
|
51
|
+
* Base Sepolia (84532): 41_510_000 lands at 2026-05-14T19:51Z, ~2h after the
|
|
52
|
+
* fufn validated-pool was rebuilt to `EVAL_SEMANTICS_VERSION='3'` (2026-05-14
|
|
53
|
+
* T17:28Z). Everything created before that rebuild is a "ghost" — admitted
|
|
54
|
+
* under a prior semantics regime that the current evaluators can't score —
|
|
55
|
+
* so a fresh operator should not waste compute claiming them.
|
|
56
|
+
* See gh #300 for the proper fix (symmetric solver-side admission filter and
|
|
57
|
+
* generalised scan-age window).
|
|
58
|
+
*
|
|
59
|
+
* Base mainnet (8453): unchanged at 25_000_000 — Phase 0 era, no v3-rebuild
|
|
60
|
+
* equivalent on mainnet.
|
|
61
|
+
*/
|
|
62
|
+
export const DEFAULT_TASK_DISCOVERY_FROM_BLOCK = {
|
|
63
|
+
84532: 41510000n,
|
|
22
64
|
8453: 25000000n,
|
|
23
65
|
};
|
|
24
66
|
const DEFAULT_MECH_CLAIM_POLICY = {
|
|
@@ -218,6 +260,35 @@ export class MechAdapter {
|
|
|
218
260
|
return;
|
|
219
261
|
this.persistPendingEvaluationSolutions();
|
|
220
262
|
}
|
|
263
|
+
clearPendingDeliveryRecoveryState(requestId) {
|
|
264
|
+
this.originalStates.delete(requestId);
|
|
265
|
+
this.pendingEvaluations.delete(requestId);
|
|
266
|
+
this.requestKinds.delete(requestId);
|
|
267
|
+
}
|
|
268
|
+
recoveryDeliveryExpirySeconds(requestId) {
|
|
269
|
+
const task = this.originalStates.get(requestId) ?? this.pendingEvaluations.get(requestId);
|
|
270
|
+
const claimPolicy = task?.claimPolicy ?? DEFAULT_MECH_CLAIM_POLICY;
|
|
271
|
+
const normalizeTsToSeconds = (value) => {
|
|
272
|
+
if (value == null)
|
|
273
|
+
return undefined;
|
|
274
|
+
return value > 10_000_000_000 ? Math.floor(value / 1000) : value;
|
|
275
|
+
};
|
|
276
|
+
const submissionDeadlineSeconds = normalizeTsToSeconds(claimPolicy.submissionDeadlineTs);
|
|
277
|
+
if (submissionDeadlineSeconds != null)
|
|
278
|
+
return submissionDeadlineSeconds;
|
|
279
|
+
const claimWindowEndSeconds = normalizeTsToSeconds(claimPolicy.claimWindowEndTs ?? task?.window?.endTs);
|
|
280
|
+
if (claimWindowEndSeconds == null)
|
|
281
|
+
return undefined;
|
|
282
|
+
return claimWindowEndSeconds + claimPolicy.claimLeaseTtlSeconds;
|
|
283
|
+
}
|
|
284
|
+
shouldSkipExpiredRecoveryDelivery(requestId, currentChainTimestampSeconds, recoveryExpirySeconds) {
|
|
285
|
+
if (currentChainTimestampSeconds <= recoveryExpirySeconds)
|
|
286
|
+
return false;
|
|
287
|
+
console.error(`[mech] skipping recovery delivery for ${requestId}: ` +
|
|
288
|
+
`submission deadline expired at ${new Date(recoveryExpirySeconds * 1000).toISOString()}`);
|
|
289
|
+
this.clearPendingDeliveryRecoveryState(requestId);
|
|
290
|
+
return true;
|
|
291
|
+
}
|
|
221
292
|
async postTask(state) {
|
|
222
293
|
const restorationState = {
|
|
223
294
|
...state,
|
|
@@ -251,7 +322,7 @@ export class MechAdapter {
|
|
|
251
322
|
task: {
|
|
252
323
|
...restorationState,
|
|
253
324
|
signedTask,
|
|
254
|
-
context: { ...(restorationState.context ?? {}), [
|
|
325
|
+
context: { ...(restorationState.context ?? {}), [SOLUTION_TASK_CID_CONTEXT_KEY]: restorationTaskCid },
|
|
255
326
|
},
|
|
256
327
|
taskCid: restorationTaskCid,
|
|
257
328
|
onchainCreationTx: taskSubmission.txHash,
|
|
@@ -357,8 +428,8 @@ export class MechAdapter {
|
|
|
357
428
|
context: {
|
|
358
429
|
...(params.task.context ?? {}),
|
|
359
430
|
restorationResult: params.resultData,
|
|
360
|
-
[
|
|
361
|
-
[
|
|
431
|
+
[SOLUTION_TASK_CID_CONTEXT_KEY]: params.task.context?.[SOLUTION_TASK_CID_CONTEXT_KEY] ?? params.task.context?.[RESTORATION_TASK_CID_CONTEXT_KEY] ?? params.taskCid,
|
|
432
|
+
[SOLUTION_ENVELOPE_CID_CONTEXT_KEY]: params.solutionEnvelopeCid,
|
|
362
433
|
},
|
|
363
434
|
};
|
|
364
435
|
}
|
|
@@ -418,11 +489,25 @@ export class MechAdapter {
|
|
|
418
489
|
console.error('[mech] task discovery (DiscoveryAPI) failed:', err instanceof Error ? err.message : err);
|
|
419
490
|
return;
|
|
420
491
|
}
|
|
492
|
+
const discoveryFloorBlock = this.onchainTaskDiscoveryFromBlock();
|
|
421
493
|
for (const candidate of candidates) {
|
|
422
494
|
if (!this.isDiscoveryTaskAllowed(candidate.taskId))
|
|
423
495
|
continue;
|
|
424
496
|
if (this.claimedRestorationTaskIds.has(candidate.taskId))
|
|
425
497
|
continue;
|
|
498
|
+
// gh #300 ghost-task floor — same floor as the on-chain TaskCreated
|
|
499
|
+
// backlog scan, applied to the DiscoveryAPI path too. Without this,
|
|
500
|
+
// the Ponder indexer (or onchain floor's listClaimableTasks) returns
|
|
501
|
+
// pre-floor tasks that are still claimable on-chain but unscorable
|
|
502
|
+
// under the current admission regime, defeating the floor's
|
|
503
|
+
// intent. Candidates without `createdAtBlock` are passed through
|
|
504
|
+
// (DiscoveryAPI is allowed to omit that field; we can't filter
|
|
505
|
+
// without it).
|
|
506
|
+
if (discoveryFloorBlock != null &&
|
|
507
|
+
candidate.createdAtBlock != null &&
|
|
508
|
+
BigInt(candidate.createdAtBlock) < discoveryFloorBlock) {
|
|
509
|
+
continue;
|
|
510
|
+
}
|
|
426
511
|
// Verify claimability per backend: HttpSubgraphDiscoveryAPI cannot run
|
|
427
512
|
// canClaimTask (no on-chain simulation), so this check is load-bearing
|
|
428
513
|
// for that path. OnchainDiscoveryAPI already filters internally; this
|
|
@@ -468,22 +553,32 @@ export class MechAdapter {
|
|
|
468
553
|
this.forgetPendingEvaluationSolution(solution.requestId);
|
|
469
554
|
return undefined;
|
|
470
555
|
}
|
|
471
|
-
|
|
556
|
+
// Cheap claimability gate FIRST — before the restoration lookup + IPFS
|
|
557
|
+
// fetch. A backlog of terminal opportunities (finalized / evaluation
|
|
558
|
+
// deadline passed / max verdicts reached) must not pay the expensive
|
|
559
|
+
// restoration-announcement cost on every poll cycle. Terminal reasons are
|
|
560
|
+
// pruned from the working set so the loop never re-scans on-chain history;
|
|
561
|
+
// transient reasons are left in place to be retried next cycle.
|
|
472
562
|
const claimable = await canClaimEvaluation(this.publicClient, this.config.safeAddress, this.config.routerAddress, solution.taskId, solution.attemptIndex, this.config.mechContractAddress);
|
|
473
563
|
if (!claimable.ok) {
|
|
474
|
-
|
|
475
|
-
|
|
564
|
+
const terminal = isTerminalEvaluationReason(claimable.revertName);
|
|
565
|
+
console.log(`[mech] skipping evaluation opportunity ${solution.requestId} for task ${solution.taskId}/${solution.attemptIndex}: ${claimable.reason}` +
|
|
566
|
+
(terminal ? ' (terminal — pruned)' : ' (transient — will retry)'));
|
|
567
|
+
if (terminal) {
|
|
568
|
+
this.forgetPendingEvaluationSolution(solution.requestId);
|
|
569
|
+
}
|
|
476
570
|
return undefined;
|
|
477
571
|
}
|
|
478
|
-
const
|
|
479
|
-
const
|
|
572
|
+
const restoration = await this.restorationAnnouncementForTaskId(solution.taskId);
|
|
573
|
+
const solutionEnvelopeCid = await this.deliveryEnvelopeCidForSolution(solution);
|
|
574
|
+
const resultPayload = await fetchFromIpfs(this.config.ipfsGatewayUrl, solutionEnvelopeCid);
|
|
480
575
|
const resultData = resultPayload.data ?? JSON.stringify(resultPayload);
|
|
481
576
|
const evaluationTask = this.buildEvaluationTask({
|
|
482
577
|
task: restoration.task,
|
|
483
578
|
solutionRequestId: solution.requestId,
|
|
484
579
|
attemptIndex: solution.attemptIndex,
|
|
485
580
|
resultData,
|
|
486
|
-
|
|
581
|
+
solutionEnvelopeCid,
|
|
487
582
|
taskCid: restoration.taskCid,
|
|
488
583
|
});
|
|
489
584
|
const opportunityId = `evaluation:${solution.taskId}:${solution.attemptIndex}:${solution.requestId}`;
|
|
@@ -503,15 +598,21 @@ export class MechAdapter {
|
|
|
503
598
|
return announcement;
|
|
504
599
|
}
|
|
505
600
|
async *retryPendingEvaluationSolutions() {
|
|
601
|
+
let processed = 0;
|
|
506
602
|
for (const [requestId, solution] of Array.from(this.pendingEvaluationSolutions)) {
|
|
603
|
+
// Yield to the event loop periodically so a large backlog of pending
|
|
604
|
+
// evaluation solutions can't starve the HTTP API mid-cycle.
|
|
605
|
+
if (processed > 0 && processed % EVALUATION_RETRY_YIELD_EVERY === 0) {
|
|
606
|
+
await new Promise((resolve) => setImmediate(resolve));
|
|
607
|
+
}
|
|
608
|
+
processed++;
|
|
507
609
|
try {
|
|
508
610
|
const announcement = await this.evaluationAnnouncementForSolution(solution);
|
|
509
611
|
if (announcement) {
|
|
510
612
|
yield announcement;
|
|
511
613
|
}
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
}
|
|
614
|
+
// No announcement does NOT mean "forget" — pruning is owned by
|
|
615
|
+
// evaluationAnnouncementForSolution, which only removes terminal cases.
|
|
515
616
|
}
|
|
516
617
|
catch (err) {
|
|
517
618
|
console.error(`[mech] evaluation opportunity retry failed for ${requestId}:`, err);
|
|
@@ -644,9 +745,13 @@ export class MechAdapter {
|
|
|
644
745
|
async submitVerdictDelivery(requestId, verdictDigest, verdictCode) {
|
|
645
746
|
await claimDelivery(this.publicClient, this.walletClient, this.config.safeAddress, this.config.routerAddress, requestId, { variant: 'v3', kind: 'verdict', evidenceHash: verdictDigest, verdictCode }, this.config.evictionRecovery);
|
|
646
747
|
}
|
|
647
|
-
async
|
|
748
|
+
async deliveryClaimForDelivery(requestId, deliveryDataHex) {
|
|
749
|
+
const fallbackKind = this.requestKinds.get(requestId) ?? 'solution';
|
|
648
750
|
if (this.config.routerClaimDeliveryVariant !== 'v2' && this.config.routerClaimDeliveryVariant !== 'v3') {
|
|
649
|
-
return
|
|
751
|
+
return {
|
|
752
|
+
evidenceHash: undefined,
|
|
753
|
+
kind: fallbackKind,
|
|
754
|
+
};
|
|
650
755
|
}
|
|
651
756
|
const deliveryDigest = deliveryDataHex.startsWith('0x')
|
|
652
757
|
? deliveryDataHex.slice(2)
|
|
@@ -654,11 +759,6 @@ export class MechAdapter {
|
|
|
654
759
|
const envelopeCid = `f01551220${deliveryDigest}`;
|
|
655
760
|
const rawEnvelope = await fetchSignedEnvelopeFromIpfs(this.config.ipfsGatewayUrl, envelopeCid);
|
|
656
761
|
const parsed = SignedEnvelopeSchema.parse(rawEnvelope);
|
|
657
|
-
// Strip signature to recompute the hash over the unsigned body.
|
|
658
|
-
//
|
|
659
|
-
// Important: compute over the fetched wire object, not over the parsed
|
|
660
|
-
// schema result. The schema normalizes some nested objects and may strip
|
|
661
|
-
// extension metadata that was present when the envelope was signed.
|
|
662
762
|
const rawSigned = rawEnvelope;
|
|
663
763
|
const { signature: _rawSignature, ...unsignedBody } = rawSigned;
|
|
664
764
|
const signature = parsed.signature;
|
|
@@ -667,22 +767,36 @@ export class MechAdapter {
|
|
|
667
767
|
if (recomputed !== signature.hash) {
|
|
668
768
|
throw new Error(`recomputed hash ${recomputed} !== envelope.signature.hash ${signature.hash}`);
|
|
669
769
|
}
|
|
670
|
-
|
|
770
|
+
const role = normalizeEnvelopeRole(parsed.role);
|
|
771
|
+
if (role === 'capture') {
|
|
772
|
+
throw new Error(`unsupported delivery envelope role=capture for requestId ${requestId}`);
|
|
773
|
+
}
|
|
774
|
+
const kind = role === 'verdict' ? 'verdict' : 'solution';
|
|
775
|
+
const payload = rawSigned['payload'];
|
|
776
|
+
const rawVerdict = payload != null && typeof payload === 'object'
|
|
777
|
+
? payload['verdict']
|
|
778
|
+
: undefined;
|
|
779
|
+
return {
|
|
780
|
+
evidenceHash: recomputed,
|
|
781
|
+
kind,
|
|
782
|
+
verdictCode: kind === 'verdict' ? verdictCodeFromValue(rawVerdict) : undefined,
|
|
783
|
+
};
|
|
671
784
|
}
|
|
672
785
|
async ensureDeliveryClaimed(requestId, deliveryDataHex) {
|
|
673
|
-
let
|
|
786
|
+
let claimOptions;
|
|
674
787
|
try {
|
|
675
|
-
|
|
788
|
+
claimOptions = await this.deliveryClaimForDelivery(requestId, deliveryDataHex);
|
|
676
789
|
}
|
|
677
790
|
catch (err) {
|
|
678
|
-
console.error(`[mech]
|
|
791
|
+
console.error(`[mech] delivery claim metadata derivation failed for ${requestId} — skipping claim, will retry on next loop:`, err);
|
|
679
792
|
return 'retry';
|
|
680
793
|
}
|
|
681
794
|
try {
|
|
682
795
|
await claimDelivery(this.publicClient, this.walletClient, this.config.safeAddress, this.config.routerAddress, requestId, {
|
|
683
796
|
variant: this.config.routerClaimDeliveryVariant,
|
|
684
|
-
kind:
|
|
685
|
-
evidenceHash,
|
|
797
|
+
kind: claimOptions.kind,
|
|
798
|
+
evidenceHash: claimOptions.evidenceHash,
|
|
799
|
+
verdictCode: claimOptions.verdictCode,
|
|
686
800
|
}, this.config.evictionRecovery);
|
|
687
801
|
return 'claimed';
|
|
688
802
|
}
|
|
@@ -711,7 +825,9 @@ export class MechAdapter {
|
|
|
711
825
|
});
|
|
712
826
|
this.deliveryBlockCursor = currentBlock;
|
|
713
827
|
const decoded = decodeDeliverLogs(logs);
|
|
714
|
-
|
|
828
|
+
const blockTimestampSecondsByNumber = new Map();
|
|
829
|
+
let currentBlockTimestampSeconds;
|
|
830
|
+
for (const { requestId, deliveryDataHex, mechAddress, blockNumber } of decoded) {
|
|
715
831
|
// Two concerns, independent:
|
|
716
832
|
// (a) Did this Safe DELIVER this? → claim it (counter credit goes to msg.sender)
|
|
717
833
|
// The Deliver event's mechAddress is mechServiceMultisig (the Safe that owns
|
|
@@ -721,6 +837,30 @@ export class MechAdapter {
|
|
|
721
837
|
const iCreatedRestoration = this.pendingEvaluations.has(requestId);
|
|
722
838
|
if (!iDelivered && !iCreatedRestoration)
|
|
723
839
|
continue;
|
|
840
|
+
if (iCreatedRestoration) {
|
|
841
|
+
const recoveryExpirySeconds = this.recoveryDeliveryExpirySeconds(requestId);
|
|
842
|
+
if (recoveryExpirySeconds != null) {
|
|
843
|
+
let deliveryTimestampSeconds;
|
|
844
|
+
if (blockNumber != null) {
|
|
845
|
+
deliveryTimestampSeconds = blockTimestampSecondsByNumber.get(blockNumber);
|
|
846
|
+
if (deliveryTimestampSeconds == null) {
|
|
847
|
+
const deliveryBlockData = await this.publicClient.getBlock({ blockNumber });
|
|
848
|
+
deliveryTimestampSeconds = Number(deliveryBlockData.timestamp);
|
|
849
|
+
blockTimestampSecondsByNumber.set(blockNumber, deliveryTimestampSeconds);
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
else {
|
|
853
|
+
if (currentBlockTimestampSeconds == null) {
|
|
854
|
+
const currentBlockData = await this.publicClient.getBlock({ blockNumber: currentBlock });
|
|
855
|
+
currentBlockTimestampSeconds = Number(currentBlockData.timestamp);
|
|
856
|
+
}
|
|
857
|
+
deliveryTimestampSeconds = currentBlockTimestampSeconds;
|
|
858
|
+
}
|
|
859
|
+
if (this.shouldSkipExpiredRecoveryDelivery(requestId, deliveryTimestampSeconds, recoveryExpirySeconds)) {
|
|
860
|
+
continue;
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
}
|
|
724
864
|
// (a) Deliverer-side claim path: if this Safe delivered the request,
|
|
725
865
|
// claim it first so router counters credit the deliverer.
|
|
726
866
|
let deliveryClaimStatus;
|
|
@@ -756,9 +896,7 @@ export class MechAdapter {
|
|
|
756
896
|
deliveryMechAddress: mechAddress,
|
|
757
897
|
};
|
|
758
898
|
// Clean up after yielding
|
|
759
|
-
this.
|
|
760
|
-
this.pendingEvaluations.delete(requestId);
|
|
761
|
-
this.requestKinds.delete(requestId);
|
|
899
|
+
this.clearPendingDeliveryRecoveryState(requestId);
|
|
762
900
|
}
|
|
763
901
|
catch (err) {
|
|
764
902
|
console.error(`[mech] Failed to parse delivery ${requestId}:`, err);
|