@jinn-network/client 0.1.5 → 0.1.6-canary.107ea271
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/dist/adapters/mech/adapter.d.ts +23 -1
- package/dist/adapters/mech/adapter.js +169 -33
- package/dist/adapters/mech/adapter.js.map +1 -1
- package/dist/adapters/mech/contracts.d.ts +1 -0
- package/dist/adapters/mech/contracts.js +1 -0
- 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/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/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 +158 -0
- package/dist/api/codex-doctor-endpoint.js.map +1 -0
- package/dist/api/discovery-endpoint.d.ts +31 -0
- package/dist/api/discovery-endpoint.js +78 -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.js +90 -4
- 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 +70 -0
- 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 +14 -0
- package/dist/api/status-build.js +23 -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 +4 -0
- 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/config.d.ts +51 -0
- package/dist/config.js +49 -2
- 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/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-D_NMfDfV.css → index-DE4qUnzV.css} +1 -1
- package/dist/dashboard/assets/index-Di7xA4eB.js +170 -0
- package/dist/dashboard/index.html +2 -2
- package/dist/discovery/http.js +121 -0
- package/dist/discovery/http.js.map +1 -1
- package/dist/discovery/onchain.d.ts +5 -0
- package/dist/discovery/onchain.js +292 -7
- package/dist/discovery/onchain.js.map +1 -1
- package/dist/discovery/types.d.ts +127 -1
- package/dist/discovery/types.js +8 -10
- package/dist/discovery/types.js.map +1 -1
- package/dist/discovery/with-fallback.js +9 -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 +12 -0
- package/dist/earning/contracts.js +16 -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 +40 -0
- package/dist/harnesses/engine/engine.js +69 -8
- 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 +1 -0
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/eval-runner.js +10 -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 +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 +372 -90
- package/dist/main.js.map +1 -1
- package/dist/mcp/server.js +14 -13
- package/dist/mcp/server.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 +71 -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-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 +19 -6
- 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/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_
|
|
@@ -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,59 @@ 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 reason means the opportunity
|
|
26
|
+
* can NEVER become claimable (terminal, prune it) versus one that could still
|
|
27
|
+
* clear later (transient, keep retrying).
|
|
28
|
+
*
|
|
29
|
+
* A false-keep (re-checking a dead opportunity) only costs one more RPC; a
|
|
30
|
+
* false-prune (dropping a still-claimable opportunity) loses real work — so
|
|
31
|
+
* when in doubt we keep. Anything that does not resolve to a known
|
|
32
|
+
* non-recoverable revert name is treated as transient.
|
|
33
|
+
*/
|
|
34
|
+
function isTerminalEvaluationReason(reason) {
|
|
35
|
+
if (!reason)
|
|
36
|
+
return false;
|
|
37
|
+
// Strip a decoded-argument suffix, e.g. `TCAttemptAlreadyFinalized(1, 0)`.
|
|
38
|
+
const bareName = reason.replace(/\(.*$/s, '').trim();
|
|
39
|
+
return isNonRecoverableInnerRevert(bareName);
|
|
40
|
+
}
|
|
19
41
|
const DEFAULT_ROUTER_LOG_CHUNK_BLOCKS = 9999n;
|
|
20
|
-
|
|
21
|
-
|
|
42
|
+
/**
|
|
43
|
+
* Floor block for the on-chain TaskCreated backlog scan, per chain.
|
|
44
|
+
*
|
|
45
|
+
* A daemon with no joined-SolverNet store cursor (fresh bootstrap) will scan
|
|
46
|
+
* from this block forward. Existing operators with a persisted cursor are
|
|
47
|
+
* unaffected — their cursor is used as long as it's already past this floor.
|
|
48
|
+
*
|
|
49
|
+
* Base Sepolia (84532): 41_510_000 lands at 2026-05-14T19:51Z, ~2h after the
|
|
50
|
+
* fufn validated-pool was rebuilt to `EVAL_SEMANTICS_VERSION='3'` (2026-05-14
|
|
51
|
+
* T17:28Z). Everything created before that rebuild is a "ghost" — admitted
|
|
52
|
+
* under a prior semantics regime that the current evaluators can't score —
|
|
53
|
+
* so a fresh operator should not waste compute claiming them.
|
|
54
|
+
* See gh #300 for the proper fix (symmetric solver-side admission filter and
|
|
55
|
+
* generalised scan-age window).
|
|
56
|
+
*
|
|
57
|
+
* Base mainnet (8453): unchanged at 25_000_000 — Phase 0 era, no v3-rebuild
|
|
58
|
+
* equivalent on mainnet.
|
|
59
|
+
*/
|
|
60
|
+
export const DEFAULT_TASK_DISCOVERY_FROM_BLOCK = {
|
|
61
|
+
84532: 41510000n,
|
|
22
62
|
8453: 25000000n,
|
|
23
63
|
};
|
|
24
64
|
const DEFAULT_MECH_CLAIM_POLICY = {
|
|
@@ -218,6 +258,35 @@ export class MechAdapter {
|
|
|
218
258
|
return;
|
|
219
259
|
this.persistPendingEvaluationSolutions();
|
|
220
260
|
}
|
|
261
|
+
clearPendingDeliveryRecoveryState(requestId) {
|
|
262
|
+
this.originalStates.delete(requestId);
|
|
263
|
+
this.pendingEvaluations.delete(requestId);
|
|
264
|
+
this.requestKinds.delete(requestId);
|
|
265
|
+
}
|
|
266
|
+
recoveryDeliveryExpirySeconds(requestId) {
|
|
267
|
+
const task = this.originalStates.get(requestId) ?? this.pendingEvaluations.get(requestId);
|
|
268
|
+
const claimPolicy = task?.claimPolicy ?? DEFAULT_MECH_CLAIM_POLICY;
|
|
269
|
+
const normalizeTsToSeconds = (value) => {
|
|
270
|
+
if (value == null)
|
|
271
|
+
return undefined;
|
|
272
|
+
return value > 10_000_000_000 ? Math.floor(value / 1000) : value;
|
|
273
|
+
};
|
|
274
|
+
const submissionDeadlineSeconds = normalizeTsToSeconds(claimPolicy.submissionDeadlineTs);
|
|
275
|
+
if (submissionDeadlineSeconds != null)
|
|
276
|
+
return submissionDeadlineSeconds;
|
|
277
|
+
const claimWindowEndSeconds = normalizeTsToSeconds(claimPolicy.claimWindowEndTs ?? task?.window?.endTs);
|
|
278
|
+
if (claimWindowEndSeconds == null)
|
|
279
|
+
return undefined;
|
|
280
|
+
return claimWindowEndSeconds + claimPolicy.claimLeaseTtlSeconds;
|
|
281
|
+
}
|
|
282
|
+
shouldSkipExpiredRecoveryDelivery(requestId, currentChainTimestampSeconds, recoveryExpirySeconds) {
|
|
283
|
+
if (currentChainTimestampSeconds <= recoveryExpirySeconds)
|
|
284
|
+
return false;
|
|
285
|
+
console.error(`[mech] skipping recovery delivery for ${requestId}: ` +
|
|
286
|
+
`submission deadline expired at ${new Date(recoveryExpirySeconds * 1000).toISOString()}`);
|
|
287
|
+
this.clearPendingDeliveryRecoveryState(requestId);
|
|
288
|
+
return true;
|
|
289
|
+
}
|
|
221
290
|
async postTask(state) {
|
|
222
291
|
const restorationState = {
|
|
223
292
|
...state,
|
|
@@ -251,7 +320,7 @@ export class MechAdapter {
|
|
|
251
320
|
task: {
|
|
252
321
|
...restorationState,
|
|
253
322
|
signedTask,
|
|
254
|
-
context: { ...(restorationState.context ?? {}), [
|
|
323
|
+
context: { ...(restorationState.context ?? {}), [SOLUTION_TASK_CID_CONTEXT_KEY]: restorationTaskCid },
|
|
255
324
|
},
|
|
256
325
|
taskCid: restorationTaskCid,
|
|
257
326
|
onchainCreationTx: taskSubmission.txHash,
|
|
@@ -357,8 +426,8 @@ export class MechAdapter {
|
|
|
357
426
|
context: {
|
|
358
427
|
...(params.task.context ?? {}),
|
|
359
428
|
restorationResult: params.resultData,
|
|
360
|
-
[
|
|
361
|
-
[
|
|
429
|
+
[SOLUTION_TASK_CID_CONTEXT_KEY]: params.task.context?.[SOLUTION_TASK_CID_CONTEXT_KEY] ?? params.task.context?.[RESTORATION_TASK_CID_CONTEXT_KEY] ?? params.taskCid,
|
|
430
|
+
[SOLUTION_ENVELOPE_CID_CONTEXT_KEY]: params.solutionEnvelopeCid,
|
|
362
431
|
},
|
|
363
432
|
};
|
|
364
433
|
}
|
|
@@ -418,11 +487,25 @@ export class MechAdapter {
|
|
|
418
487
|
console.error('[mech] task discovery (DiscoveryAPI) failed:', err instanceof Error ? err.message : err);
|
|
419
488
|
return;
|
|
420
489
|
}
|
|
490
|
+
const discoveryFloorBlock = this.onchainTaskDiscoveryFromBlock();
|
|
421
491
|
for (const candidate of candidates) {
|
|
422
492
|
if (!this.isDiscoveryTaskAllowed(candidate.taskId))
|
|
423
493
|
continue;
|
|
424
494
|
if (this.claimedRestorationTaskIds.has(candidate.taskId))
|
|
425
495
|
continue;
|
|
496
|
+
// gh #300 ghost-task floor — same floor as the on-chain TaskCreated
|
|
497
|
+
// backlog scan, applied to the DiscoveryAPI path too. Without this,
|
|
498
|
+
// the Ponder indexer (or onchain floor's listClaimableTasks) returns
|
|
499
|
+
// pre-floor tasks that are still claimable on-chain but unscorable
|
|
500
|
+
// under the current admission regime, defeating the floor's
|
|
501
|
+
// intent. Candidates without `createdAtBlock` are passed through
|
|
502
|
+
// (DiscoveryAPI is allowed to omit that field; we can't filter
|
|
503
|
+
// without it).
|
|
504
|
+
if (discoveryFloorBlock != null &&
|
|
505
|
+
candidate.createdAtBlock != null &&
|
|
506
|
+
BigInt(candidate.createdAtBlock) < discoveryFloorBlock) {
|
|
507
|
+
continue;
|
|
508
|
+
}
|
|
426
509
|
// Verify claimability per backend: HttpSubgraphDiscoveryAPI cannot run
|
|
427
510
|
// canClaimTask (no on-chain simulation), so this check is load-bearing
|
|
428
511
|
// for that path. OnchainDiscoveryAPI already filters internally; this
|
|
@@ -468,22 +551,32 @@ export class MechAdapter {
|
|
|
468
551
|
this.forgetPendingEvaluationSolution(solution.requestId);
|
|
469
552
|
return undefined;
|
|
470
553
|
}
|
|
471
|
-
|
|
554
|
+
// Cheap claimability gate FIRST — before the restoration lookup + IPFS
|
|
555
|
+
// fetch. A backlog of terminal opportunities (finalized / evaluation
|
|
556
|
+
// deadline passed / max verdicts reached) must not pay the expensive
|
|
557
|
+
// restoration-announcement cost on every poll cycle. Terminal reasons are
|
|
558
|
+
// pruned from the working set so the loop never re-scans on-chain history;
|
|
559
|
+
// transient reasons are left in place to be retried next cycle.
|
|
472
560
|
const claimable = await canClaimEvaluation(this.publicClient, this.config.safeAddress, this.config.routerAddress, solution.taskId, solution.attemptIndex, this.config.mechContractAddress);
|
|
473
561
|
if (!claimable.ok) {
|
|
474
|
-
|
|
475
|
-
|
|
562
|
+
const terminal = isTerminalEvaluationReason(claimable.reason);
|
|
563
|
+
console.log(`[mech] skipping evaluation opportunity ${solution.requestId} for task ${solution.taskId}/${solution.attemptIndex}: ${claimable.reason}` +
|
|
564
|
+
(terminal ? ' (terminal — pruned)' : ' (transient — will retry)'));
|
|
565
|
+
if (terminal) {
|
|
566
|
+
this.forgetPendingEvaluationSolution(solution.requestId);
|
|
567
|
+
}
|
|
476
568
|
return undefined;
|
|
477
569
|
}
|
|
478
|
-
const
|
|
479
|
-
const
|
|
570
|
+
const restoration = await this.restorationAnnouncementForTaskId(solution.taskId);
|
|
571
|
+
const solutionEnvelopeCid = await this.deliveryEnvelopeCidForSolution(solution);
|
|
572
|
+
const resultPayload = await fetchFromIpfs(this.config.ipfsGatewayUrl, solutionEnvelopeCid);
|
|
480
573
|
const resultData = resultPayload.data ?? JSON.stringify(resultPayload);
|
|
481
574
|
const evaluationTask = this.buildEvaluationTask({
|
|
482
575
|
task: restoration.task,
|
|
483
576
|
solutionRequestId: solution.requestId,
|
|
484
577
|
attemptIndex: solution.attemptIndex,
|
|
485
578
|
resultData,
|
|
486
|
-
|
|
579
|
+
solutionEnvelopeCid,
|
|
487
580
|
taskCid: restoration.taskCid,
|
|
488
581
|
});
|
|
489
582
|
const opportunityId = `evaluation:${solution.taskId}:${solution.attemptIndex}:${solution.requestId}`;
|
|
@@ -503,15 +596,21 @@ export class MechAdapter {
|
|
|
503
596
|
return announcement;
|
|
504
597
|
}
|
|
505
598
|
async *retryPendingEvaluationSolutions() {
|
|
599
|
+
let processed = 0;
|
|
506
600
|
for (const [requestId, solution] of Array.from(this.pendingEvaluationSolutions)) {
|
|
601
|
+
// Yield to the event loop periodically so a large backlog of pending
|
|
602
|
+
// evaluation solutions can't starve the HTTP API mid-cycle.
|
|
603
|
+
if (processed > 0 && processed % EVALUATION_RETRY_YIELD_EVERY === 0) {
|
|
604
|
+
await new Promise((resolve) => setImmediate(resolve));
|
|
605
|
+
}
|
|
606
|
+
processed++;
|
|
507
607
|
try {
|
|
508
608
|
const announcement = await this.evaluationAnnouncementForSolution(solution);
|
|
509
609
|
if (announcement) {
|
|
510
610
|
yield announcement;
|
|
511
611
|
}
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
}
|
|
612
|
+
// No announcement does NOT mean "forget" — pruning is owned by
|
|
613
|
+
// evaluationAnnouncementForSolution, which only removes terminal cases.
|
|
515
614
|
}
|
|
516
615
|
catch (err) {
|
|
517
616
|
console.error(`[mech] evaluation opportunity retry failed for ${requestId}:`, err);
|
|
@@ -644,9 +743,13 @@ export class MechAdapter {
|
|
|
644
743
|
async submitVerdictDelivery(requestId, verdictDigest, verdictCode) {
|
|
645
744
|
await claimDelivery(this.publicClient, this.walletClient, this.config.safeAddress, this.config.routerAddress, requestId, { variant: 'v3', kind: 'verdict', evidenceHash: verdictDigest, verdictCode }, this.config.evictionRecovery);
|
|
646
745
|
}
|
|
647
|
-
async
|
|
746
|
+
async deliveryClaimForDelivery(requestId, deliveryDataHex) {
|
|
747
|
+
const fallbackKind = this.requestKinds.get(requestId) ?? 'solution';
|
|
648
748
|
if (this.config.routerClaimDeliveryVariant !== 'v2' && this.config.routerClaimDeliveryVariant !== 'v3') {
|
|
649
|
-
return
|
|
749
|
+
return {
|
|
750
|
+
evidenceHash: undefined,
|
|
751
|
+
kind: fallbackKind,
|
|
752
|
+
};
|
|
650
753
|
}
|
|
651
754
|
const deliveryDigest = deliveryDataHex.startsWith('0x')
|
|
652
755
|
? deliveryDataHex.slice(2)
|
|
@@ -654,11 +757,6 @@ export class MechAdapter {
|
|
|
654
757
|
const envelopeCid = `f01551220${deliveryDigest}`;
|
|
655
758
|
const rawEnvelope = await fetchSignedEnvelopeFromIpfs(this.config.ipfsGatewayUrl, envelopeCid);
|
|
656
759
|
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
760
|
const rawSigned = rawEnvelope;
|
|
663
761
|
const { signature: _rawSignature, ...unsignedBody } = rawSigned;
|
|
664
762
|
const signature = parsed.signature;
|
|
@@ -667,22 +765,36 @@ export class MechAdapter {
|
|
|
667
765
|
if (recomputed !== signature.hash) {
|
|
668
766
|
throw new Error(`recomputed hash ${recomputed} !== envelope.signature.hash ${signature.hash}`);
|
|
669
767
|
}
|
|
670
|
-
|
|
768
|
+
const role = normalizeEnvelopeRole(parsed.role);
|
|
769
|
+
if (role === 'capture') {
|
|
770
|
+
throw new Error(`unsupported delivery envelope role=capture for requestId ${requestId}`);
|
|
771
|
+
}
|
|
772
|
+
const kind = role === 'verdict' ? 'verdict' : 'solution';
|
|
773
|
+
const payload = rawSigned['payload'];
|
|
774
|
+
const rawVerdict = payload != null && typeof payload === 'object'
|
|
775
|
+
? payload['verdict']
|
|
776
|
+
: undefined;
|
|
777
|
+
return {
|
|
778
|
+
evidenceHash: recomputed,
|
|
779
|
+
kind,
|
|
780
|
+
verdictCode: kind === 'verdict' ? verdictCodeFromValue(rawVerdict) : undefined,
|
|
781
|
+
};
|
|
671
782
|
}
|
|
672
783
|
async ensureDeliveryClaimed(requestId, deliveryDataHex) {
|
|
673
|
-
let
|
|
784
|
+
let claimOptions;
|
|
674
785
|
try {
|
|
675
|
-
|
|
786
|
+
claimOptions = await this.deliveryClaimForDelivery(requestId, deliveryDataHex);
|
|
676
787
|
}
|
|
677
788
|
catch (err) {
|
|
678
|
-
console.error(`[mech]
|
|
789
|
+
console.error(`[mech] delivery claim metadata derivation failed for ${requestId} — skipping claim, will retry on next loop:`, err);
|
|
679
790
|
return 'retry';
|
|
680
791
|
}
|
|
681
792
|
try {
|
|
682
793
|
await claimDelivery(this.publicClient, this.walletClient, this.config.safeAddress, this.config.routerAddress, requestId, {
|
|
683
794
|
variant: this.config.routerClaimDeliveryVariant,
|
|
684
|
-
kind:
|
|
685
|
-
evidenceHash,
|
|
795
|
+
kind: claimOptions.kind,
|
|
796
|
+
evidenceHash: claimOptions.evidenceHash,
|
|
797
|
+
verdictCode: claimOptions.verdictCode,
|
|
686
798
|
}, this.config.evictionRecovery);
|
|
687
799
|
return 'claimed';
|
|
688
800
|
}
|
|
@@ -711,7 +823,9 @@ export class MechAdapter {
|
|
|
711
823
|
});
|
|
712
824
|
this.deliveryBlockCursor = currentBlock;
|
|
713
825
|
const decoded = decodeDeliverLogs(logs);
|
|
714
|
-
|
|
826
|
+
const blockTimestampSecondsByNumber = new Map();
|
|
827
|
+
let currentBlockTimestampSeconds;
|
|
828
|
+
for (const { requestId, deliveryDataHex, mechAddress, blockNumber } of decoded) {
|
|
715
829
|
// Two concerns, independent:
|
|
716
830
|
// (a) Did this Safe DELIVER this? → claim it (counter credit goes to msg.sender)
|
|
717
831
|
// The Deliver event's mechAddress is mechServiceMultisig (the Safe that owns
|
|
@@ -721,6 +835,30 @@ export class MechAdapter {
|
|
|
721
835
|
const iCreatedRestoration = this.pendingEvaluations.has(requestId);
|
|
722
836
|
if (!iDelivered && !iCreatedRestoration)
|
|
723
837
|
continue;
|
|
838
|
+
if (iCreatedRestoration) {
|
|
839
|
+
const recoveryExpirySeconds = this.recoveryDeliveryExpirySeconds(requestId);
|
|
840
|
+
if (recoveryExpirySeconds != null) {
|
|
841
|
+
let deliveryTimestampSeconds;
|
|
842
|
+
if (blockNumber != null) {
|
|
843
|
+
deliveryTimestampSeconds = blockTimestampSecondsByNumber.get(blockNumber);
|
|
844
|
+
if (deliveryTimestampSeconds == null) {
|
|
845
|
+
const deliveryBlockData = await this.publicClient.getBlock({ blockNumber });
|
|
846
|
+
deliveryTimestampSeconds = Number(deliveryBlockData.timestamp);
|
|
847
|
+
blockTimestampSecondsByNumber.set(blockNumber, deliveryTimestampSeconds);
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
else {
|
|
851
|
+
if (currentBlockTimestampSeconds == null) {
|
|
852
|
+
const currentBlockData = await this.publicClient.getBlock({ blockNumber: currentBlock });
|
|
853
|
+
currentBlockTimestampSeconds = Number(currentBlockData.timestamp);
|
|
854
|
+
}
|
|
855
|
+
deliveryTimestampSeconds = currentBlockTimestampSeconds;
|
|
856
|
+
}
|
|
857
|
+
if (this.shouldSkipExpiredRecoveryDelivery(requestId, deliveryTimestampSeconds, recoveryExpirySeconds)) {
|
|
858
|
+
continue;
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
}
|
|
724
862
|
// (a) Deliverer-side claim path: if this Safe delivered the request,
|
|
725
863
|
// claim it first so router counters credit the deliverer.
|
|
726
864
|
let deliveryClaimStatus;
|
|
@@ -756,9 +894,7 @@ export class MechAdapter {
|
|
|
756
894
|
deliveryMechAddress: mechAddress,
|
|
757
895
|
};
|
|
758
896
|
// Clean up after yielding
|
|
759
|
-
this.
|
|
760
|
-
this.pendingEvaluations.delete(requestId);
|
|
761
|
-
this.requestKinds.delete(requestId);
|
|
897
|
+
this.clearPendingDeliveryRecoveryState(requestId);
|
|
762
898
|
}
|
|
763
899
|
catch (err) {
|
|
764
900
|
console.error(`[mech] Failed to parse delivery ${requestId}:`, err);
|