@jinn-network/client 0.1.5 → 0.1.6-canary.0b4ff7f9
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 +98 -0
- package/dist/adapters/mech/adapter.js +7 -7
- package/dist/adapters/mech/adapter.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/api/bootstrap-endpoint.js +2 -0
- package/dist/api/bootstrap-endpoint.js.map +1 -1
- package/dist/api/discovery-endpoint.d.ts +18 -0
- package/dist/api/discovery-endpoint.js +65 -0
- package/dist/api/discovery-endpoint.js.map +1 -0
- package/dist/api/fleet-build.d.ts +7 -0
- package/dist/api/fleet-build.js +6 -1
- package/dist/api/fleet-build.js.map +1 -1
- package/dist/api/harness-readiness-endpoint.d.ts +13 -0
- package/dist/api/harness-readiness-endpoint.js +15 -0
- package/dist/api/harness-readiness-endpoint.js.map +1 -0
- package/dist/api/hermes-doctor-endpoint.d.ts +26 -0
- package/dist/api/hermes-doctor-endpoint.js +29 -0
- package/dist/api/hermes-doctor-endpoint.js.map +1 -0
- package/dist/api/server.d.ts +21 -0
- package/dist/api/server.js +22 -0
- package/dist/api/server.js.map +1 -1
- package/dist/build-info.json +4 -4
- package/dist/build-meta.json +1 -1
- package/dist/cli/commands/create.d.ts +5 -3
- package/dist/cli/commands/create.js +101 -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 +140 -2
- 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/config.d.ts +27 -0
- package/dist/config.js +24 -0
- 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 +17 -1
- package/dist/daemon/daemon.js +15 -0
- package/dist/daemon/daemon.js.map +1 -1
- 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/dashboard/assets/{index-D_NMfDfV.css → index-B4sTrvQD.css} +1 -1
- package/dist/dashboard/assets/index-C5j0ZJWS.js +140 -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.js +11 -0
- package/dist/discovery/onchain.js.map +1 -1
- package/dist/discovery/types.d.ts +112 -0
- 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 +55 -0
- package/dist/earning/bootstrap.js +376 -20
- package/dist/earning/bootstrap.js.map +1 -1
- package/dist/earning/store.js +48 -1
- package/dist/earning/store.js.map +1 -1
- package/dist/earning/types.d.ts +30 -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/harnesses/engine/engine.js +15 -3
- 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/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 +184 -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 +104 -0
- package/dist/harnesses/impls/hermes-agent/config-builder.js.map +1 -0
- package/dist/harnesses/impls/hermes-agent/harness.d.ts +30 -0
- package/dist/harnesses/impls/hermes-agent/harness.js +52 -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 +6 -0
- package/dist/harnesses/impls/index.js +17 -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/{claude-code-learner → learner}/harness.d.ts +9 -3
- package/dist/harnesses/impls/{claude-code-learner → learner}/harness.js +24 -1
- 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 +12 -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/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 +136 -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 +70 -35
- package/dist/main.js.map +1 -1
- package/dist/mcp/server.js +14 -13
- package/dist/mcp/server.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/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/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/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/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 +52 -10
- 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 +49 -10
- package/dist/types/payloads/prediction-v0.js +16 -6
- package/dist/types/payloads/prediction-v0.js.map +1 -1
- 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 +8 -3
- 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.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jinn-network/client",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6-canary.0b4ff7f9",
|
|
4
4
|
"description": "Jinn protocol client — headless daemon for the restoration training loop",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "yarn@4.13.0",
|
|
@@ -40,11 +40,12 @@
|
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"postinstall": "node dist/scripts/fix-node-pty.mjs 2>/dev/null || node scripts/fix-node-pty.mjs 2>/dev/null || true",
|
|
43
|
-
"e2e:
|
|
43
|
+
"e2e:cold-start-builder": "vitest run --config vitest.acceptance.config.ts",
|
|
44
|
+
"e2e:full-cycle": "tsx test/e2e/learner-full-cycle.ts",
|
|
44
45
|
"jinn": "tsx src/bin/jinn.ts",
|
|
45
46
|
"dev": "yarn build && node dist/bin/jinn.js",
|
|
46
47
|
"build:sdk": "yarn --cwd ../packages/sdk install --immutable && yarn --cwd ../packages/sdk build",
|
|
47
|
-
"build": "yarn build:sdk && yarn build:spa && tsc && chmod +x dist/bin/jinn.js && rm -rf dist/dashboard && mkdir -p dist/dashboard && cp -R src/dashboard/spa/dist/. dist/dashboard/ && rm -rf dist/templates && cp -R templates dist/templates && mkdir -p dist/scripts && cp scripts/fix-node-pty.mjs dist/scripts/ && node scripts/vendor-sdk.mjs && node scripts/write-dist-build-meta.mjs",
|
|
48
|
+
"build": "yarn build:sdk && yarn build:spa && tsc && chmod +x dist/bin/jinn.js && rm -rf dist/dashboard && mkdir -p dist/dashboard && cp -R src/dashboard/spa/dist/. dist/dashboard/ && rm -rf dist/templates && cp -R templates dist/templates && mkdir -p dist/scripts && cp scripts/fix-node-pty.mjs scripts/swe-rebench-v2-seed-pool.json scripts/swe-rebench-v2-known-bad.json dist/scripts/ && node scripts/vendor-sdk.mjs && node scripts/write-dist-build-meta.mjs",
|
|
48
49
|
"typecheck": "yarn build:sdk && tsc --noEmit",
|
|
49
50
|
"test": "yarn build:sdk && vitest run",
|
|
50
51
|
"test:watch": "vitest",
|
|
@@ -68,9 +69,12 @@
|
|
|
68
69
|
"e2e:task-first-local": "tsx test/e2e/task-first-local.ts",
|
|
69
70
|
"e2e:claude-code-learner": "tsx test/e2e/claude-code-learner-portfolio-v0.ts",
|
|
70
71
|
"e2e:prediction": "tsx test/e2e/prediction-v1.ts",
|
|
72
|
+
"e2e:corpus": "yarn build:sdk && tsx test/e2e/corpus-x402.ts",
|
|
71
73
|
"e2e:freeze-mode": "tsx test/e2e/freeze-mode.test.ts",
|
|
72
74
|
"e2e:checkpoint-flow": "tsx test/e2e/checkpoint-flow.test.ts",
|
|
73
75
|
"e2e:swe-rebench-v2": "tsx test/e2e/swe-rebench-v2.test.ts",
|
|
76
|
+
"e2e:hermes": "tsx test/e2e/hermes-agent-full-cycle.ts",
|
|
77
|
+
"e2e:daemon-harness": "tsx test/e2e/daemon-harness-cycle.ts",
|
|
74
78
|
"e2e:capture": "tsx scripts/e2e-capture-validate.ts",
|
|
75
79
|
"staking": "tsx test/e2e/staking.ts",
|
|
76
80
|
"stolas": "tsx test/e2e/stolas.ts",
|
|
@@ -118,6 +122,7 @@
|
|
|
118
122
|
"semver": "^7.7.4",
|
|
119
123
|
"viem": "^2.0.0",
|
|
120
124
|
"ws": "^8.20.0",
|
|
125
|
+
"yaml": "^2.8.4",
|
|
121
126
|
"zod": "^3.22.0"
|
|
122
127
|
},
|
|
123
128
|
"optionalDependencies": {
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# swe-rebench-v2-diffmin
|
|
2
|
+
|
|
3
|
+
Minimal-diff discipline and PASS\_TO\_PASS test-mapping skills for the
|
|
4
|
+
`swe-rebench-v2.v1` SolverNet. This plugin competes on a different vertical
|
|
5
|
+
than `swe-rebench-v2-runtime`: where the runtime plugin teaches the solver to
|
|
6
|
+
orient and plan, this plugin constrains how the solver patches — keeping diffs
|
|
7
|
+
small, renames absent, and PASS\_TO\_PASS coverage explicit before the first
|
|
8
|
+
line of code is written.
|
|
9
|
+
|
|
10
|
+
## What the skills do
|
|
11
|
+
|
|
12
|
+
- **`swe-rebench-v2-diffmin`** — Minimal-diff discipline. Heuristics: single-hunk
|
|
13
|
+
preference, single-file preference, no-rename rule, function-scope
|
|
14
|
+
containment, dead-code-deletion last resort. Includes a worked
|
|
15
|
+
`unidata/netcdf-c-1925` example. Uses the bundled `diff_stats` MCP tool
|
|
16
|
+
(`mcp__diff-stats__diff_stats`) to validate hunk count, file count, and
|
|
17
|
+
rename absence before submitting.
|
|
18
|
+
|
|
19
|
+
- **`swe-rebench-v2-test-map`** — PASS\_TO\_PASS test mapping. Greps test names
|
|
20
|
+
to source files, computes test-to-source coverage ratios, pre-loads the call
|
|
21
|
+
graph for the function under fix. Produces an edit-constraint list before
|
|
22
|
+
the Execute phase begins.
|
|
23
|
+
|
|
24
|
+
Both skills reference real SWE-rebench v2 mechanics (`FAIL_TO_PASS`,
|
|
25
|
+
`PASS_TO_PASS`, `base_commit`, `instance_id`, `goal.spec`). They read like a
|
|
26
|
+
Hermes-migrator can use them on day 1.
|
|
27
|
+
|
|
28
|
+
## Already shipping a Hermes skill?
|
|
29
|
+
|
|
30
|
+
Drop it under `skills/<name>/SKILL.md`, add a `jinn.plugin.json` like this
|
|
31
|
+
one, `yarn pack`, `jinn solver-plugins publish`. Your existing skill becomes
|
|
32
|
+
discoverable and attributable on the SolverNet — no other changes required.
|
|
33
|
+
|
|
34
|
+
## Stacking with swe-rebench-v2-runtime
|
|
35
|
+
|
|
36
|
+
The two plugins are designed to stack. An operator loads both and the solver
|
|
37
|
+
gets the full set of skills:
|
|
38
|
+
|
|
39
|
+
| Plugin | Skills |
|
|
40
|
+
|--------|--------|
|
|
41
|
+
| `swe-rebench-v2-runtime` | `supports: ["swe-rebench-v2.v1"]` — orient, plan |
|
|
42
|
+
| `swe-rebench-v2-diffmin` | `supports: ["swe-rebench-v2.v1"]` — diffmin, test-map |
|
|
43
|
+
|
|
44
|
+
The harness loads skills from all plugins that declare `swe-rebench-v2.v1`
|
|
45
|
+
support. Adding this plugin alongside the runtime plugin gives the solver four
|
|
46
|
+
complementary skills for a single task: orient → plan → test-map → diffmin.
|
|
47
|
+
|
|
48
|
+
## Bundled MCP tool: diff_stats
|
|
49
|
+
|
|
50
|
+
The `.mcp.json` in this package declares one MCP server, `diff-stats`, with one
|
|
51
|
+
tool `diff_stats(patch: string)`. It parses a unified diff and returns:
|
|
52
|
+
|
|
53
|
+
```json
|
|
54
|
+
{
|
|
55
|
+
"hunks": 1,
|
|
56
|
+
"filesTouched": 1,
|
|
57
|
+
"addedLines": 3,
|
|
58
|
+
"removedLines": 2,
|
|
59
|
+
"hasRenames": false
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
The diffmin skill calls this tool before submitting. The server is a ~50-line
|
|
64
|
+
pure Node.js script with no runtime dependencies — it starts in under 50 ms
|
|
65
|
+
and does not touch the network.
|
|
66
|
+
|
|
67
|
+
## License
|
|
68
|
+
|
|
69
|
+
MIT.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "swe-rebench-v2-diffmin",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"jinn": {
|
|
5
|
+
"supports": ["swe-rebench-v2.v1"],
|
|
6
|
+
"skills": [
|
|
7
|
+
"skills/diffmin/SKILL.md",
|
|
8
|
+
"skills/test-map/SKILL.md"
|
|
9
|
+
],
|
|
10
|
+
"description": "Minimal-diff discipline + PASS_TO_PASS test-mapping skills for swe-rebench-v2.v1. Complementary to swe-rebench-v2-runtime's orient/plan skills; the two stack."
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* diff-stats MCP server — exposes one tool, diff_stats(patch: string),
|
|
4
|
+
* that parses a unified diff and returns hunk/line/file/rename statistics.
|
|
5
|
+
*
|
|
6
|
+
* Designed to be invoked as a stdio MCP server by Claude Code or any other
|
|
7
|
+
* MCP-compatible host. No runtime dependencies beyond @modelcontextprotocol/sdk
|
|
8
|
+
* (already present in @jinn-network/client's node_modules).
|
|
9
|
+
*/
|
|
10
|
+
import { pathToFileURL } from 'node:url';
|
|
11
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
12
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
13
|
+
import { z } from 'zod';
|
|
14
|
+
import { computeDiffStats } from './diff-stats.mjs';
|
|
15
|
+
|
|
16
|
+
const DiffArgsShape = {
|
|
17
|
+
patch: z.string().min(1).describe(
|
|
18
|
+
'A unified diff string (git-format or standard format). ' +
|
|
19
|
+
'Pass the complete diff including --- and +++ headers and @@ hunk markers.',
|
|
20
|
+
),
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
function ok(data) {
|
|
24
|
+
return {
|
|
25
|
+
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function toolErr(code, message) {
|
|
30
|
+
return {
|
|
31
|
+
content: [{ type: 'text', text: JSON.stringify({ error: true, code, message }) }],
|
|
32
|
+
isError: true,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function createDiffStatsServer() {
|
|
37
|
+
const server = new McpServer({ name: 'diff-stats', version: '0.1.0' });
|
|
38
|
+
|
|
39
|
+
server.tool(
|
|
40
|
+
'diff_stats',
|
|
41
|
+
'Parse a unified diff and return statistics: hunks, filesTouched, addedLines, removedLines, hasRenames. ' +
|
|
42
|
+
'Call this before submitting a patch to verify it meets minimal-diff discipline (hunks <= 3, filesTouched <= 2, hasRenames === false).',
|
|
43
|
+
DiffArgsShape,
|
|
44
|
+
async (args) => {
|
|
45
|
+
try {
|
|
46
|
+
const stats = computeDiffStats(args.patch);
|
|
47
|
+
return ok(stats);
|
|
48
|
+
} catch (err) {
|
|
49
|
+
return toolErr('DIFF_PARSE_FAILED', err instanceof Error ? err.message : String(err));
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
return server;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export async function startMcpServer() {
|
|
58
|
+
const server = createDiffStatsServer();
|
|
59
|
+
const transport = new StdioServerTransport();
|
|
60
|
+
await server.connect(transport);
|
|
61
|
+
await new Promise((resolve) => {
|
|
62
|
+
process.stdin.on('close', resolve);
|
|
63
|
+
process.stdin.on('end', resolve);
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
|
|
68
|
+
startMcpServer().catch((err) => {
|
|
69
|
+
console.error(err instanceof Error ? err.stack ?? err.message : String(err));
|
|
70
|
+
process.exit(1);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* diff-stats library — parse a unified diff into per-file statistics.
|
|
3
|
+
*
|
|
4
|
+
* Pure function, no dependencies. Usable directly in tests and by the
|
|
5
|
+
* diff-stats-server.mjs MCP server.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @typedef {{ hunks: number; filesTouched: number; addedLines: number; removedLines: number; hasRenames: boolean }} DiffStats
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Parse a unified diff string and return statistics.
|
|
14
|
+
*
|
|
15
|
+
* @param {string} patch - A unified diff string (git-format or standard format).
|
|
16
|
+
* @returns {DiffStats}
|
|
17
|
+
* @throws {Error} if patch is empty.
|
|
18
|
+
*/
|
|
19
|
+
export function computeDiffStats(patch) {
|
|
20
|
+
if (typeof patch !== 'string' || patch.trim().length === 0) {
|
|
21
|
+
throw new Error('empty patch — pass a unified diff string');
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const lines = patch.split('\n');
|
|
25
|
+
let hunks = 0;
|
|
26
|
+
let addedLines = 0;
|
|
27
|
+
let removedLines = 0;
|
|
28
|
+
let hasRenames = false;
|
|
29
|
+
const files = new Set();
|
|
30
|
+
|
|
31
|
+
for (const line of lines) {
|
|
32
|
+
if (line.startsWith('@@ ')) {
|
|
33
|
+
hunks++;
|
|
34
|
+
} else if (line.startsWith('+++') && !line.startsWith('+++ /dev/null')) {
|
|
35
|
+
// Match both `+++ b/path` (git format) and `+++ path` (standard format)
|
|
36
|
+
const m = /^\+{3}\s+(?:b\/)?(.+)$/.exec(line);
|
|
37
|
+
if (m) files.add(m[1].trim());
|
|
38
|
+
} else if (line.startsWith('rename from ') || line.startsWith('rename to ')) {
|
|
39
|
+
hasRenames = true;
|
|
40
|
+
} else if (line.startsWith('+') && !line.startsWith('+++')) {
|
|
41
|
+
addedLines++;
|
|
42
|
+
} else if (line.startsWith('-') && !line.startsWith('---')) {
|
|
43
|
+
removedLines++;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return { hunks, filesTouched: files.size, addedLines, removedLines, hasRenames };
|
|
48
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "swe-rebench-v2-diffmin",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"private": true,
|
|
6
|
+
"description": "Reference competing plug-in for swe-rebench-v2.v1 — minimal-diff + test-mapping angle.",
|
|
7
|
+
"files": [
|
|
8
|
+
"jinn.plugin.json",
|
|
9
|
+
".claude-plugin/",
|
|
10
|
+
".mcp.json",
|
|
11
|
+
"skills/",
|
|
12
|
+
"mcp/",
|
|
13
|
+
"README.md"
|
|
14
|
+
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"test": "vitest run"
|
|
17
|
+
},
|
|
18
|
+
"license": "MIT"
|
|
19
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: swe-rebench-v2-diffmin
|
|
3
|
+
description: Bias the patch toward the smallest change that flips FAIL_TO_PASS without disturbing PASS_TO_PASS. Use diff_stats to validate hunk count, file count, and rename absence before submitting.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Minimal-diff discipline for SWE-rebench v2
|
|
7
|
+
|
|
8
|
+
This skill keeps your patch as small as possible. Smaller diffs are easier to
|
|
9
|
+
verify, less likely to introduce regressions, and align with how maintainers
|
|
10
|
+
actually ship fixes. Apply it after the Orient phase has identified the root
|
|
11
|
+
cause and before writing the patch in the Execute phase.
|
|
12
|
+
|
|
13
|
+
## Core heuristics
|
|
14
|
+
|
|
15
|
+
### 1. Single-hunk preference
|
|
16
|
+
|
|
17
|
+
Prefer a patch that touches one contiguous code block in one file. A single
|
|
18
|
+
hunk means the diff is self-contained: reviewers can read it in isolation and
|
|
19
|
+
test runners can bisect it easily. If you find yourself adding a second hunk,
|
|
20
|
+
stop and ask whether the second change is strictly required to flip
|
|
21
|
+
`FAIL_TO_PASS`. Often the first hunk is the fix; the second hunk is cleanup
|
|
22
|
+
that can be deferred.
|
|
23
|
+
|
|
24
|
+
### 2. Single-file preference
|
|
25
|
+
|
|
26
|
+
When the root cause is clearly in one file, do not touch other files to make
|
|
27
|
+
tests pass. Fixes that spread across files indicate either (a) the root cause
|
|
28
|
+
analysis was incomplete, or (b) a larger refactor is being smuggled in. Neither
|
|
29
|
+
belongs in a minimal-diff submission.
|
|
30
|
+
|
|
31
|
+
If two files genuinely must change (e.g. a struct definition and one call
|
|
32
|
+
site), verify that both changes are causally required: remove one and confirm
|
|
33
|
+
that `FAIL_TO_PASS` fails again.
|
|
34
|
+
|
|
35
|
+
### 3. No-rename rule
|
|
36
|
+
|
|
37
|
+
Never rename functions, variables, or files to fix a bug. Renames change every
|
|
38
|
+
call site and inflate the diff with changes that are semantically neutral to
|
|
39
|
+
the failing test but risky for `PASS_TO_PASS` tests. If you feel a rename
|
|
40
|
+
would help, file a note in the solution cost field and ship the fix without the
|
|
41
|
+
rename.
|
|
42
|
+
|
|
43
|
+
### 4. Function-scope containment
|
|
44
|
+
|
|
45
|
+
Limit edits to the function or method that the failing test exercises. Check
|
|
46
|
+
the call graph: if the test calls `parse_netcdf_header()`, your change should
|
|
47
|
+
live inside `parse_netcdf_header()` or a helper it directly calls — not in a
|
|
48
|
+
shared utility ten layers up that happens to also be called by unrelated code.
|
|
49
|
+
|
|
50
|
+
### 5. Dead-code deletion last resort
|
|
51
|
+
|
|
52
|
+
Deleting dead code (unreachable branches, commented-out blocks) is tempting
|
|
53
|
+
but risky: it inflates the diff with changes unrelated to `FAIL_TO_PASS` and
|
|
54
|
+
can break `PASS_TO_PASS` if the "dead" code was actually reachable in some
|
|
55
|
+
path. Delete dead code only when it is the direct cause of the failing test
|
|
56
|
+
(e.g. an always-false guard that prevents a required code path from running).
|
|
57
|
+
|
|
58
|
+
## Using the diff_stats MCP tool
|
|
59
|
+
|
|
60
|
+
Before submitting, call `mcp__diff-stats__diff_stats` with your complete
|
|
61
|
+
unified diff string. The tool returns:
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"hunks": 1,
|
|
66
|
+
"filesTouched": 1,
|
|
67
|
+
"addedLines": 3,
|
|
68
|
+
"removedLines": 2,
|
|
69
|
+
"hasRenames": false
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Reject and revise your patch if:
|
|
74
|
+
- `hunks > 3` — almost always indicates scope creep
|
|
75
|
+
- `filesTouched > 2` — consider whether both files are causally required
|
|
76
|
+
- `hasRenames === true` — strip the rename and fix in place
|
|
77
|
+
- `addedLines + removedLines > 50` — verify against single-hunk and single-file rules
|
|
78
|
+
|
|
79
|
+
Accept the patch if all checks pass and `FAIL_TO_PASS` flips while
|
|
80
|
+
`PASS_TO_PASS` stays green.
|
|
81
|
+
|
|
82
|
+
## Worked example: unidata/netcdf-c-1925
|
|
83
|
+
|
|
84
|
+
**Instance:** `unidata__netcdf-c-1925`
|
|
85
|
+
**Problem:** `nc_get_var_string()` returns garbage when the variable has a
|
|
86
|
+
fill value because `NC_EEMPTY` was tested with `!=` instead of `==`.
|
|
87
|
+
|
|
88
|
+
**Bad patch (17 hunks, 3 files, 200 lines):**
|
|
89
|
+
Refactors the fill-value handling layer to share a common helper, moves the
|
|
90
|
+
check into a new function, renames `nc_fill_string` to `nc_fill_str`. Correct
|
|
91
|
+
in intent but violates every heuristic.
|
|
92
|
+
|
|
93
|
+
**Minimal patch (1 hunk, 1 file, 2 lines):**
|
|
94
|
+
```diff
|
|
95
|
+
--- a/libsrc/var.c
|
|
96
|
+
+++ b/libsrc/var.c
|
|
97
|
+
@@ -402,7 +402,7 @@ nc_get_var_string(int ncid, int varid, char **sp)
|
|
98
|
+
- if (stat != NC_EEMPTY) {
|
|
99
|
+
+ if (stat == NC_EEMPTY) {
|
|
100
|
+
```
|
|
101
|
+
`diff_stats` returns `{ hunks: 1, filesTouched: 1, addedLines: 1, removedLines: 1, hasRenames: false }`.
|
|
102
|
+
All checks pass. The `FAIL_TO_PASS` test now sees a proper empty string
|
|
103
|
+
instead of garbage; `PASS_TO_PASS` tests are untouched.
|
|
104
|
+
|
|
105
|
+
## Integration with the Plan skill
|
|
106
|
+
|
|
107
|
+
The `swe-rebench-v2-plan` skill from `swe-rebench-v2-runtime` sketches the
|
|
108
|
+
edit list. Run this diffmin skill after Plan and before submitting:
|
|
109
|
+
|
|
110
|
+
1. Plan produces: "change line 402 in `libsrc/var.c` from `!=` to `==`."
|
|
111
|
+
2. Execute writes the patch.
|
|
112
|
+
3. **This skill validates:** call `mcp__diff-stats__diff_stats` on the patch,
|
|
113
|
+
confirm `hunks: 1, filesTouched: 1, hasRenames: false`.
|
|
114
|
+
4. Submit via `submit_typed_payload` only after validation passes.
|
|
115
|
+
|
|
116
|
+
If validation fails, trim the patch and re-validate before submitting.
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: swe-rebench-v2-test-map
|
|
3
|
+
description: Walk PASS_TO_PASS test names to their source files via repo grep, identify the test-to-source ratio, and pre-load the relevant call graph into context before writing the patch.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# PASS_TO_PASS test mapping for SWE-rebench v2
|
|
7
|
+
|
|
8
|
+
Before writing a single line of fix code, map the test names you must preserve
|
|
9
|
+
(`PASS_TO_PASS`) to their source files. This gives you an accurate picture of
|
|
10
|
+
the call graph your patch must not disturb, which is the information needed to
|
|
11
|
+
apply minimal-diff discipline correctly.
|
|
12
|
+
|
|
13
|
+
## Why this matters
|
|
14
|
+
|
|
15
|
+
`PASS_TO_PASS` names are the regressions you cannot afford. A patch that fixes
|
|
16
|
+
`FAIL_TO_PASS` but breaks five `PASS_TO_PASS` tests scores zero on the
|
|
17
|
+
`brier-loss.v1` evaluator. The test map shows you exactly which functions,
|
|
18
|
+
structs, and files are exercised by those tests — a constraint that shapes
|
|
19
|
+
where you can safely edit.
|
|
20
|
+
|
|
21
|
+
## Steps
|
|
22
|
+
|
|
23
|
+
### Step 1: Extract PASS_TO_PASS names from the task spec
|
|
24
|
+
|
|
25
|
+
The task body includes `goal.spec.PASS_TO_PASS`, a list of test identifiers
|
|
26
|
+
in the form `<module>::<function>` or `<file>::<class>::<method>`. Example:
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
goal.spec.PASS_TO_PASS = [
|
|
30
|
+
"test_nc_get_var_string::test_basic_string_read",
|
|
31
|
+
"test_fill_value::test_default_fill",
|
|
32
|
+
"test_fill_value::test_custom_fill"
|
|
33
|
+
]
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Step 2: Grep test names to source files
|
|
37
|
+
|
|
38
|
+
For each `PASS_TO_PASS` test name, grep the repo for the function or class
|
|
39
|
+
definition. Use the filesystem tools or bash to run:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
grep -r "test_basic_string_read" <repo_root> --include="*.c" --include="*.py" -l
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Build a map: `test name → test file → source file under test`.
|
|
46
|
+
|
|
47
|
+
Identify the source file by reading the test: find the `#include`, `import`,
|
|
48
|
+
or `open()` call that loads the module under test. This is the source file your
|
|
49
|
+
patch may not break.
|
|
50
|
+
|
|
51
|
+
### Step 3: Compute the test-to-source ratio
|
|
52
|
+
|
|
53
|
+
Count the number of `PASS_TO_PASS` test functions that exercise each source
|
|
54
|
+
file. A high ratio (e.g. 8 tests → 1 source file) means the file is heavily
|
|
55
|
+
covered and every edit carries regression risk. A low ratio means fewer hidden
|
|
56
|
+
dependencies.
|
|
57
|
+
|
|
58
|
+
Annotate your edit plan: "source file `libsrc/var.c` is exercised by 3
|
|
59
|
+
PASS_TO_PASS tests; edits must not change the function signature or remove any
|
|
60
|
+
branch reachable from `test_fill_value`."
|
|
61
|
+
|
|
62
|
+
### Step 4: Pre-load the call graph for the affected function
|
|
63
|
+
|
|
64
|
+
Read the function you intend to edit (identified by the Orient skill). Trace:
|
|
65
|
+
- Which sub-functions does it call?
|
|
66
|
+
- Which of those sub-functions appear in the PASS_TO_PASS test map?
|
|
67
|
+
|
|
68
|
+
If a sub-function appears in the test map, your patch must not change its
|
|
69
|
+
behaviour. If it does not appear, it may be safe to touch — confirm with
|
|
70
|
+
step 3's ratio.
|
|
71
|
+
|
|
72
|
+
### Step 5: Write the edit constraint list
|
|
73
|
+
|
|
74
|
+
Output a structured list before starting Execute:
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
Edit constraint list:
|
|
78
|
+
- File: libsrc/var.c
|
|
79
|
+
- Function: nc_get_var_string
|
|
80
|
+
- Lines: 400-410
|
|
81
|
+
- PASS_TO_PASS coverage: 3 tests depend on this function
|
|
82
|
+
- Sub-functions NOT to touch: nc_fill_string (covered by test_fill_value::test_default_fill)
|
|
83
|
+
- Safe to change: local variable stat comparison on line 402
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Pass this list to the Plan/Execute phase.
|
|
87
|
+
|
|
88
|
+
## Worked example: org__repo-42 (fictional)
|
|
89
|
+
|
|
90
|
+
**Instance:** `org__repo-42`
|
|
91
|
+
**FAIL_TO_PASS:** `test_parser::test_malformed_json`
|
|
92
|
+
**PASS_TO_PASS:** `test_parser::test_valid_json`, `test_parser::test_empty_object`, `test_roundtrip::test_encode_decode`
|
|
93
|
+
|
|
94
|
+
**Step 1:** Extract names — three tests to preserve.
|
|
95
|
+
|
|
96
|
+
**Step 2:** Grep reveals:
|
|
97
|
+
- `test_valid_json` and `test_empty_object` live in `tests/test_parser.py`, which imports `src/parser.py`.
|
|
98
|
+
- `test_encode_decode` lives in `tests/test_roundtrip.py`, which imports both `src/parser.py` and `src/encoder.py`.
|
|
99
|
+
|
|
100
|
+
**Step 3:** Ratio for `src/parser.py`: 3 tests. Ratio for `src/encoder.py`: 1 test. `src/parser.py` is more risky.
|
|
101
|
+
|
|
102
|
+
**Step 4:** The function to fix is `parse_json()` in `src/parser.py`. It calls `_tokenize()` and `_validate_token()`. `_validate_token()` appears in `test_valid_json` (it is called on valid JSON). Do not change `_validate_token()`; it is covered. `_tokenize()` does not appear — lower risk.
|
|
103
|
+
|
|
104
|
+
**Step 5:** Edit constraint list:
|
|
105
|
+
```
|
|
106
|
+
- File: src/parser.py
|
|
107
|
+
- Function: parse_json
|
|
108
|
+
- PASS_TO_PASS coverage: 3 tests via parse_json + _validate_token
|
|
109
|
+
- Sub-functions NOT to touch: _validate_token (PASS_TO_PASS coverage)
|
|
110
|
+
- Sub-functions safe to touch: _tokenize (no direct PASS_TO_PASS coverage)
|
|
111
|
+
- Preferred: fix on lines 88-92 where malformed JSON triggers early return
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
This constraint list feeds directly into the diffmin skill's heuristics: one
|
|
115
|
+
hunk, one file, no renames, no changes to `_validate_token`.
|
|
116
|
+
|
|
117
|
+
## Integration with the diffmin skill
|
|
118
|
+
|
|
119
|
+
Run this test-map skill in parallel with the Orient skill. By the time Plan
|
|
120
|
+
begins, you should have:
|
|
121
|
+
1. The Orient summary (hypothesis + target function).
|
|
122
|
+
2. The test-map constraint list (which sub-functions are covered by PASS_TO_PASS).
|
|
123
|
+
|
|
124
|
+
Both feed into the Plan phase. After Execute produces the patch, run
|
|
125
|
+
`mcp__diff-stats__diff_stats` via the diffmin skill to confirm the diff
|
|
126
|
+
satisfies the hunk and file count constraints before submitting.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { computeDiffStats } from '../mcp/diff-stats.mjs';
|
|
3
|
+
|
|
4
|
+
const ONE_LINE_FIX = `--- a/src/foo.c
|
|
5
|
+
+++ b/src/foo.c
|
|
6
|
+
@@ -1 +1 @@
|
|
7
|
+
-broken
|
|
8
|
+
+fixed
|
|
9
|
+
`;
|
|
10
|
+
|
|
11
|
+
const MULTI_HUNK_TWO_FILES = `--- a/src/foo.c
|
|
12
|
+
+++ b/src/foo.c
|
|
13
|
+
@@ -1,3 +1,3 @@
|
|
14
|
+
line1
|
|
15
|
+
-bad
|
|
16
|
+
+good
|
|
17
|
+
line3
|
|
18
|
+
@@ -10 +10 @@
|
|
19
|
+
-also bad
|
|
20
|
+
+also good
|
|
21
|
+
--- a/test/test_foo.c
|
|
22
|
+
+++ b/test/test_foo.c
|
|
23
|
+
@@ -5 +5 @@
|
|
24
|
+
-old
|
|
25
|
+
+new
|
|
26
|
+
`;
|
|
27
|
+
|
|
28
|
+
const RENAME_PATCH = `diff --git a/src/old.c b/src/new.c
|
|
29
|
+
similarity index 90%
|
|
30
|
+
rename from src/old.c
|
|
31
|
+
rename to src/new.c
|
|
32
|
+
--- a/src/old.c
|
|
33
|
+
+++ b/src/new.c
|
|
34
|
+
@@ -1 +1 @@
|
|
35
|
+
-old
|
|
36
|
+
+new
|
|
37
|
+
`;
|
|
38
|
+
|
|
39
|
+
describe('computeDiffStats (r83r diff-stats library)', () => {
|
|
40
|
+
it('returns 1 hunk / 1 file / 1 add / 1 remove for the one-line fix', () => {
|
|
41
|
+
expect(computeDiffStats(ONE_LINE_FIX)).toEqual({
|
|
42
|
+
hunks: 1, filesTouched: 1, addedLines: 1, removedLines: 1, hasRenames: false,
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('returns 3 hunks / 2 files for the multi-hunk patch', () => {
|
|
47
|
+
const s = computeDiffStats(MULTI_HUNK_TWO_FILES);
|
|
48
|
+
expect(s.hunks).toBe(3);
|
|
49
|
+
expect(s.filesTouched).toBe(2);
|
|
50
|
+
expect(s.addedLines).toBe(3);
|
|
51
|
+
expect(s.removedLines).toBe(3);
|
|
52
|
+
expect(s.hasRenames).toBe(false);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it('flags hasRenames: true when a rename header is present', () => {
|
|
56
|
+
expect(computeDiffStats(RENAME_PATCH).hasRenames).toBe(true);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it('rejects an empty patch with a sensible error', () => {
|
|
60
|
+
expect(() => computeDiffStats('')).toThrow(/empty patch/i);
|
|
61
|
+
});
|
|
62
|
+
});
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
3
|
+
import { join, dirname } from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
import { loadSolverPluginManifest } from '../../../src/plugins/manifest.js';
|
|
6
|
+
import { digestDirectory } from '../../../src/plugins/digest.js';
|
|
7
|
+
|
|
8
|
+
const ROOT = join(dirname(fileURLToPath(import.meta.url)), '..');
|
|
9
|
+
|
|
10
|
+
describe('swe-rebench-v2-diffmin manifest (r83r)', () => {
|
|
11
|
+
it('has a valid jinn.plugin.json that loadSolverPluginManifest parses', () => {
|
|
12
|
+
const { manifest } = loadSolverPluginManifest(ROOT);
|
|
13
|
+
expect(manifest.name).toBe('swe-rebench-v2-diffmin');
|
|
14
|
+
expect(manifest.jinn.supports).toContain('swe-rebench-v2.v1');
|
|
15
|
+
expect(manifest.jinn.skills?.length ?? 0).toBeGreaterThanOrEqual(2);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('passes the SolverType-plugin validator (no jinn.runtime in supports)', () => {
|
|
19
|
+
const { manifest } = loadSolverPluginManifest(ROOT);
|
|
20
|
+
// SolverType mode: supports must not include 'jinn.runtime'
|
|
21
|
+
expect(manifest.jinn.supports).not.toContain('jinn.runtime');
|
|
22
|
+
// Every entry must be a SolverType identifier
|
|
23
|
+
for (const entry of manifest.jinn.supports) {
|
|
24
|
+
expect(typeof entry).toBe('string');
|
|
25
|
+
expect(entry.length).toBeGreaterThan(0);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it('declares an .mcp.json that points at the bundled diff-stats server', () => {
|
|
30
|
+
const mcp = JSON.parse(readFileSync(join(ROOT, '.mcp.json'), 'utf8'));
|
|
31
|
+
expect(mcp.mcpServers).toBeDefined();
|
|
32
|
+
expect(mcp.mcpServers['diff-stats']).toBeDefined();
|
|
33
|
+
expect(mcp.mcpServers['diff-stats'].command).toBe('node');
|
|
34
|
+
expect(mcp.mcpServers['diff-stats'].args?.[0]).toContain('mcp/diff-stats-server.mjs');
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('every declared skill file exists with non-empty frontmatter', () => {
|
|
38
|
+
const manifest = JSON.parse(readFileSync(join(ROOT, 'jinn.plugin.json'), 'utf8'));
|
|
39
|
+
for (const skill of manifest.jinn.skills) {
|
|
40
|
+
const p = join(ROOT, skill);
|
|
41
|
+
expect(existsSync(p), `missing skill file: ${skill}`).toBe(true);
|
|
42
|
+
const body = readFileSync(p, 'utf8');
|
|
43
|
+
expect(body, `empty skill: ${skill}`).toMatch(/^---[\s\S]+name:\s*\S+[\s\S]+description:\s*\S+[\s\S]+---/);
|
|
44
|
+
// Reject placeholder content — this plug-in must be real.
|
|
45
|
+
expect(body, `placeholder content in ${skill}`).not.toMatch(/Replace this body|placeholder/i);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it('digestDirectory produces a stable sha256 for the package contents', () => {
|
|
50
|
+
const digest = digestDirectory(ROOT);
|
|
51
|
+
expect(digest).toMatch(/^[0-9a-f]{64}$/);
|
|
52
|
+
});
|
|
53
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"module": "ESNext",
|
|
4
|
+
"moduleResolution": "Bundler",
|
|
5
|
+
"target": "ES2022",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"types": ["node", "vitest/globals"]
|
|
10
|
+
},
|
|
11
|
+
"include": ["test/**/*.ts", "mcp/**/*.mjs"]
|
|
12
|
+
}
|
|
@@ -9,3 +9,16 @@ This plugin bundles two skills:
|
|
|
9
9
|
The plugin is loaded automatically when an operator's daemon has the `swe-rebench-v2.v1` SolverNet enabled, per the SDK's `defaultRuntimePlugins: ['bundled:swe-rebench-v2-runtime']`.
|
|
10
10
|
|
|
11
11
|
License: MIT.
|
|
12
|
+
|
|
13
|
+
## See also
|
|
14
|
+
|
|
15
|
+
- `client/plugins/swe-rebench-v2-diffmin/` — complementary minimal-diff +
|
|
16
|
+
test-mapping skills. Stacks with this plug-in: a daemon can load both for
|
|
17
|
+
the same SolverNet. The two plug-ins cover different angles:
|
|
18
|
+
`swe-rebench-v2-runtime` orients + plans; `swe-rebench-v2-diffmin` enforces
|
|
19
|
+
minimal-diff discipline and pre-loads the PASS_TO_PASS call-graph.
|
|
20
|
+
|
|
21
|
+
Already shipping a Hermes skill? Drop it under `skills/<name>/SKILL.md`, add
|
|
22
|
+
a `jinn.plugin.json` targeting `swe-rebench-v2.v1`, `yarn pack`, then
|
|
23
|
+
`jinn solver-plugins publish`. See `swe-rebench-v2-diffmin/README.md` for
|
|
24
|
+
the Hermes-migrator quickstart.
|