@jinn-network/client 0.1.9 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +2 -2
- package/README.md +13 -2
- package/deployments/deployment-phase1b-mech-baseSepolia-fast.json +3 -3
- package/deployments/deployment-stolas-l2-baseSepolia-fast.json +23 -3
- package/deployments/deployment-task-coordinator-router-v3-baseSepolia-fast.json +34 -6
- package/dist/adapters/mech/adapter.d.ts +30 -0
- package/dist/adapters/mech/adapter.js +198 -54
- package/dist/adapters/mech/adapter.js.map +1 -1
- package/dist/adapters/mech/contracts.d.ts +174 -13
- package/dist/adapters/mech/contracts.js +37 -21
- package/dist/adapters/mech/contracts.js.map +1 -1
- package/dist/adapters/mech/ipfs.d.ts +15 -27
- package/dist/adapters/mech/ipfs.js +39 -102
- package/dist/adapters/mech/ipfs.js.map +1 -1
- package/dist/adapters/mech/safe.js +74 -2
- package/dist/adapters/mech/safe.js.map +1 -1
- package/dist/adapters/mech/types.d.ts +15 -130
- package/dist/adapters/mech/types.js +9 -65
- package/dist/adapters/mech/types.js.map +1 -1
- package/dist/api/bootstrap-endpoint.d.ts +19 -3
- package/dist/api/bootstrap-endpoint.js +4 -0
- package/dist/api/bootstrap-endpoint.js.map +1 -1
- package/dist/api/gather-status.d.ts +49 -15
- package/dist/api/gather-status.js +115 -417
- package/dist/api/gather-status.js.map +1 -1
- package/dist/api/harness-auth-status-endpoint.d.ts +21 -0
- package/dist/api/harness-auth-status-endpoint.js +17 -0
- package/dist/api/harness-auth-status-endpoint.js.map +1 -0
- package/dist/api/launcher-endpoints.js +6 -1
- package/dist/api/launcher-endpoints.js.map +1 -1
- package/dist/api/launcher-status.d.ts +2 -0
- package/dist/api/launcher-status.js.map +1 -1
- package/dist/api/launcher-tasks.d.ts +47 -0
- package/dist/api/launcher-tasks.js +88 -3
- package/dist/api/launcher-tasks.js.map +1 -1
- package/dist/api/loop-completion-build.d.ts +2 -2
- package/dist/api/loop-completion-build.js +2 -3
- package/dist/api/loop-completion-build.js.map +1 -1
- package/dist/api/operator-artifacts-endpoint.js +1 -1
- package/dist/api/operator-artifacts-endpoint.js.map +1 -1
- package/dist/api/portfolio-v0-build.d.ts +2 -1
- package/dist/api/portfolio-v0-build.js +5 -7
- package/dist/api/portfolio-v0-build.js.map +1 -1
- package/dist/api/prediction-v1-build.d.ts +2 -2
- package/dist/api/prediction-v1-build.js +5 -7
- package/dist/api/prediction-v1-build.js.map +1 -1
- package/dist/api/rewards-build.d.ts +8 -1
- package/dist/api/rewards-build.js +32 -4
- package/dist/api/rewards-build.js.map +1 -1
- package/dist/api/rewards-endpoint.d.ts +12 -0
- package/dist/api/rewards-endpoint.js +46 -0
- package/dist/api/rewards-endpoint.js.map +1 -0
- package/dist/api/run-outcome.d.ts +49 -0
- package/dist/api/run-outcome.js +65 -0
- package/dist/api/run-outcome.js.map +1 -0
- package/dist/api/server.d.ts +6 -16
- package/dist/api/server.js +36 -26
- package/dist/api/server.js.map +1 -1
- package/dist/api/setup-endpoints.d.ts +32 -0
- package/dist/api/setup-endpoints.js +232 -32
- package/dist/api/setup-endpoints.js.map +1 -1
- package/dist/api/solvernets-endpoints.js +1 -1
- package/dist/api/solvernets-endpoints.js.map +1 -1
- package/dist/api/status-build.d.ts +74 -64
- package/dist/api/status-build.js +31 -55
- package/dist/api/status-build.js.map +1 -1
- package/dist/api/stop-hook.d.ts +1 -1
- package/dist/api/stop-hook.js +1 -1
- package/dist/api/stop-hook.js.map +1 -1
- package/dist/api/task-run-routing.d.ts +1 -1
- package/dist/api/task-runs-build.d.ts +21 -2
- package/dist/api/task-runs-build.js +27 -7
- package/dist/api/task-runs-build.js.map +1 -1
- package/dist/build-info.json +4 -4
- package/dist/build-meta.json +1 -1
- package/dist/captures/ingest.d.ts +21 -0
- package/dist/captures/ingest.js +133 -0
- package/dist/captures/ingest.js.map +1 -0
- package/dist/captures/live-publisher.d.ts +9 -0
- package/dist/captures/live-publisher.js +5 -3
- package/dist/captures/live-publisher.js.map +1 -1
- package/dist/captures/publish.d.ts +25 -0
- package/dist/captures/publish.js +17 -7
- package/dist/captures/publish.js.map +1 -1
- package/dist/cli/commands/backfill-failed-deliveries.d.ts +40 -0
- package/dist/cli/commands/backfill-failed-deliveries.js +172 -0
- package/dist/cli/commands/backfill-failed-deliveries.js.map +1 -0
- package/dist/cli/commands/doctor.js +4 -7
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/eval.d.ts +11 -0
- package/dist/cli/commands/eval.js +103 -23
- package/dist/cli/commands/eval.js.map +1 -1
- package/dist/cli/commands/kill.d.ts +14 -0
- package/dist/cli/commands/kill.js +141 -0
- package/dist/cli/commands/kill.js.map +1 -0
- package/dist/cli/commands/rewards.js +17 -15
- package/dist/cli/commands/rewards.js.map +1 -1
- package/dist/cli/commands/run.js +18 -4
- package/dist/cli/commands/run.js.map +1 -1
- package/dist/cli/commands/solver-nets.d.ts +6 -0
- package/dist/cli/commands/solver-nets.js +145 -2
- package/dist/cli/commands/solver-nets.js.map +1 -1
- package/dist/cli/commands/solver-plugins.js +2 -2
- package/dist/cli/commands/solver-plugins.js.map +1 -1
- package/dist/cli/commands/stop.js +97 -21
- package/dist/cli/commands/stop.js.map +1 -1
- package/dist/cli/commands/update.js +8 -0
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/commands/version.js +4 -0
- package/dist/cli/commands/version.js.map +1 -1
- package/dist/cli/execution-context.js +2 -1
- package/dist/cli/execution-context.js.map +1 -1
- package/dist/cli/index.js +4 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/introspection-context.js +0 -3
- package/dist/cli/introspection-context.js.map +1 -1
- package/dist/cli/ui-auto-open-gate.d.ts +22 -0
- package/dist/cli/ui-auto-open-gate.js +24 -0
- package/dist/cli/ui-auto-open-gate.js.map +1 -0
- package/dist/config.d.ts +258 -540
- package/dist/config.js +280 -193
- package/dist/config.js.map +1 -1
- package/dist/conformance/execution-envelope-authenticator.d.ts +2 -0
- package/dist/conformance/execution-envelope-authenticator.js +38 -0
- package/dist/conformance/execution-envelope-authenticator.js.map +1 -0
- package/dist/contracts/abis.d.ts +100 -0
- package/dist/contracts/abis.js +58 -0
- package/dist/contracts/abis.js.map +1 -0
- package/dist/contracts/addresses.d.ts +36 -0
- package/dist/contracts/addresses.js +60 -0
- package/dist/contracts/addresses.js.map +1 -0
- package/dist/corpus/acquire.d.ts +1 -40
- package/dist/corpus/acquire.js +1 -212
- package/dist/corpus/acquire.js.map +1 -1
- package/dist/corpus/cache.d.ts +1 -14
- package/dist/corpus/cache.js +1 -17
- package/dist/corpus/cache.js.map +1 -1
- package/dist/corpus/fetch-artifact.d.ts +1 -0
- package/dist/corpus/fetch-artifact.js +2 -0
- package/dist/corpus/fetch-artifact.js.map +1 -0
- package/dist/corpus/fetch.d.ts +3 -7
- package/dist/corpus/fetch.js +9 -22
- package/dist/corpus/fetch.js.map +1 -1
- package/dist/corpus/index.d.ts +2 -3
- package/dist/corpus/index.js +19 -110
- package/dist/corpus/index.js.map +1 -1
- package/dist/corpus/onchain-query.d.ts +0 -1
- package/dist/corpus/onchain-query.js +2 -5
- package/dist/corpus/onchain-query.js.map +1 -1
- package/dist/corpus/route-resolver.d.ts +1 -16
- package/dist/corpus/route-resolver.js +1 -19
- package/dist/corpus/route-resolver.js.map +1 -1
- package/dist/corpus/types.d.ts +1 -17
- package/dist/corpus/types.js +1 -34
- package/dist/corpus/types.js.map +1 -1
- package/dist/daemon/balance-topup-loop.js +27 -9
- package/dist/daemon/balance-topup-loop.js.map +1 -1
- package/dist/daemon/checkpoint-loop.js +2 -2
- package/dist/daemon/creator.d.ts +1 -0
- package/dist/daemon/creator.js +39 -25
- package/dist/daemon/creator.js.map +1 -1
- package/dist/daemon/daemon.d.ts +31 -12
- package/dist/daemon/daemon.js +138 -32
- package/dist/daemon/daemon.js.map +1 -1
- package/dist/daemon/delivery-watcher.d.ts +9 -0
- package/dist/daemon/delivery-watcher.js +24 -1
- package/dist/daemon/delivery-watcher.js.map +1 -1
- package/dist/daemon/eviction-loop.d.ts +3 -0
- package/dist/daemon/eviction-loop.js +7 -4
- package/dist/daemon/eviction-loop.js.map +1 -1
- package/dist/daemon/harvest-loop.d.ts +72 -0
- package/dist/daemon/harvest-loop.js +474 -0
- package/dist/daemon/harvest-loop.js.map +1 -0
- package/dist/daemon/join-applier.d.ts +40 -0
- package/dist/daemon/join-applier.js +52 -0
- package/dist/daemon/join-applier.js.map +1 -0
- package/dist/daemon/loop-heartbeat.d.ts +95 -0
- package/dist/daemon/loop-heartbeat.js +80 -0
- package/dist/daemon/loop-heartbeat.js.map +1 -0
- package/dist/{api/peers.js → daemon/peer-sync.js} +3 -1
- package/dist/daemon/peer-sync.js.map +1 -0
- package/dist/daemon/reward-claim-loop.js +28 -10
- package/dist/daemon/reward-claim-loop.js.map +1 -1
- package/dist/daemon/skip-log-dedup.d.ts +1 -1
- package/dist/daemon/skip-log-dedup.js +3 -0
- package/dist/daemon/skip-log-dedup.js.map +1 -1
- package/dist/daemon/spend-cap-gate.d.ts +0 -6
- package/dist/daemon/spend-cap-gate.js +1 -8
- package/dist/daemon/spend-cap-gate.js.map +1 -1
- package/dist/daemon/watchdog-loop.d.ts +84 -0
- package/dist/daemon/watchdog-loop.js +91 -0
- package/dist/daemon/watchdog-loop.js.map +1 -0
- package/dist/dashboard/assets/index-C988eu68.js +95 -0
- package/dist/dashboard/assets/index-CawZUjVI.css +1 -0
- package/dist/dashboard/index.html +2 -2
- package/dist/discovery/http.d.ts +10 -0
- package/dist/discovery/http.js +178 -335
- package/dist/discovery/http.js.map +1 -1
- package/dist/discovery/onchain.js +30 -9
- package/dist/discovery/onchain.js.map +1 -1
- package/dist/discovery/types.d.ts +98 -52
- package/dist/discovery/types.js.map +1 -1
- package/dist/discovery/with-fallback.js +19 -0
- package/dist/discovery/with-fallback.js.map +1 -1
- package/dist/earning/bootstrap-run.d.ts +25 -0
- package/dist/earning/bootstrap-run.js +315 -0
- package/dist/earning/bootstrap-run.js.map +1 -0
- package/dist/earning/bootstrap.d.ts +11 -14
- package/dist/earning/bootstrap.js +56 -204
- package/dist/earning/bootstrap.js.map +1 -1
- package/dist/earning/contracts.d.ts +2 -232
- package/dist/earning/contracts.js +16 -205
- package/dist/earning/contracts.js.map +1 -1
- package/dist/earning/faucet-topup-store.d.ts +41 -0
- package/dist/earning/faucet-topup-store.js +89 -0
- package/dist/earning/faucet-topup-store.js.map +1 -0
- package/dist/earning/master-gas.d.ts +10 -0
- package/dist/earning/master-gas.js +11 -0
- package/dist/earning/master-gas.js.map +1 -0
- package/dist/earning/safe-adapter.js +1 -45
- package/dist/earning/safe-adapter.js.map +1 -1
- package/dist/earning/steps/context.d.ts +42 -0
- package/dist/earning/steps/context.js +4 -0
- package/dist/earning/steps/context.js.map +1 -0
- package/dist/earning/steps/fleet-identity-register.d.ts +4 -0
- package/dist/earning/steps/fleet-identity-register.js +65 -0
- package/dist/earning/steps/fleet-identity-register.js.map +1 -0
- package/dist/earning/steps/fleet-safe-deploy.d.ts +4 -0
- package/dist/earning/steps/fleet-safe-deploy.js +62 -0
- package/dist/earning/steps/fleet-safe-deploy.js.map +1 -0
- package/dist/earning/steps/fleet-safe-predict.d.ts +4 -0
- package/dist/earning/steps/fleet-safe-predict.js +18 -0
- package/dist/earning/steps/fleet-safe-predict.js.map +1 -0
- package/dist/earning/steps/receipt-parsing.d.ts +12 -0
- package/dist/earning/steps/receipt-parsing.js +71 -0
- package/dist/earning/steps/receipt-parsing.js.map +1 -0
- package/dist/earning/stolas-claim.js +8 -8
- package/dist/earning/stolas-claim.js.map +1 -1
- package/dist/earning/{jinn-rewards.d.ts → stolas-staking.d.ts} +4 -8
- package/dist/earning/{jinn-rewards.js → stolas-staking.js} +25 -23
- package/dist/earning/stolas-staking.js.map +1 -0
- package/dist/earning/testnet-setup-migration.d.ts +1 -0
- package/dist/earning/testnet-setup-migration.js +7 -2
- package/dist/earning/testnet-setup-migration.js.map +1 -1
- package/dist/earning/types.d.ts +9 -9
- package/dist/earning/types.js +1 -1
- package/dist/earning/types.js.map +1 -1
- package/dist/earning/viem-clients.d.ts +3 -19
- package/dist/earning/viem-clients.js +4 -31
- package/dist/earning/viem-clients.js.map +1 -1
- package/dist/erc8004/abis.d.ts +16 -0
- package/dist/erc8004/abis.js +12 -0
- package/dist/erc8004/abis.js.map +1 -1
- package/dist/erc8004/addresses.d.ts +6 -5
- package/dist/erc8004/addresses.js +7 -5
- package/dist/erc8004/addresses.js.map +1 -1
- package/dist/erc8004/identity.d.ts +54 -1
- package/dist/erc8004/identity.js +114 -5
- package/dist/erc8004/identity.js.map +1 -1
- package/dist/erc8004/index.d.ts +5 -2
- package/dist/erc8004/index.js +6 -2
- package/dist/erc8004/index.js.map +1 -1
- package/dist/erc8004/manifest-consumer.d.ts +32 -0
- package/dist/erc8004/manifest-consumer.js +95 -0
- package/dist/erc8004/manifest-consumer.js.map +1 -0
- package/dist/erc8004/manifest-registry.d.ts +1 -0
- package/dist/erc8004/manifest-registry.js +2 -0
- package/dist/erc8004/manifest-registry.js.map +1 -0
- package/dist/erc8004/merkle.d.ts +1 -0
- package/dist/erc8004/merkle.js +2 -0
- package/dist/erc8004/merkle.js.map +1 -0
- package/dist/erc8004/publisher-safe-resolver.d.ts +32 -0
- package/dist/erc8004/publisher-safe-resolver.js +102 -0
- package/dist/erc8004/publisher-safe-resolver.js.map +1 -0
- package/dist/erc8004/reputation.js +16 -12
- package/dist/erc8004/reputation.js.map +1 -1
- package/dist/erc8004/validation.js +5 -4
- package/dist/erc8004/validation.js.map +1 -1
- package/dist/eval/attribution-instrument.d.ts +190 -0
- package/dist/eval/attribution-instrument.js +719 -0
- package/dist/eval/attribution-instrument.js.map +1 -0
- package/dist/eval/attribution-verdict-evidence.d.ts +41 -0
- package/dist/eval/attribution-verdict-evidence.js +124 -0
- package/dist/eval/attribution-verdict-evidence.js.map +1 -0
- package/dist/eval/capability-slate.d.ts +64 -0
- package/dist/eval/capability-slate.js +136 -0
- package/dist/eval/capability-slate.js.map +1 -0
- package/dist/eval/capability-stats.d.ts +39 -0
- package/dist/eval/capability-stats.js +123 -0
- package/dist/eval/capability-stats.js.map +1 -0
- package/dist/eval/contested-band.d.ts +18 -0
- package/dist/eval/contested-band.js +19 -0
- package/dist/eval/contested-band.js.map +1 -0
- package/dist/eval/corpus-index.d.ts +21 -0
- package/dist/eval/corpus-index.js +55 -0
- package/dist/eval/corpus-index.js.map +1 -0
- package/dist/eval/disjointness.d.ts +26 -0
- package/dist/eval/disjointness.js +67 -0
- package/dist/eval/disjointness.js.map +1 -0
- package/dist/eval/mcnemar-power.d.ts +14 -0
- package/dist/eval/mcnemar-power.js +40 -0
- package/dist/eval/mcnemar-power.js.map +1 -0
- package/dist/eval/orchestrator.d.ts +64 -3
- package/dist/eval/orchestrator.js +37 -19
- package/dist/eval/orchestrator.js.map +1 -1
- package/dist/eval/paired.d.ts +2 -68
- package/dist/eval/paired.js +2 -92
- package/dist/eval/paired.js.map +1 -1
- package/dist/eval/resolve-slate-tasks.js +2 -2
- package/dist/eval/resolve-slate-tasks.js.map +1 -1
- package/dist/eval/screen-discovery.d.ts +5 -8
- package/dist/eval/screen-discovery.js +13 -55
- package/dist/eval/screen-discovery.js.map +1 -1
- package/dist/events/types.d.ts +1 -1
- package/dist/events/types.js +1 -1
- package/dist/events/types.js.map +1 -1
- package/dist/harnesses/auth-source.d.ts +51 -0
- package/dist/harnesses/auth-source.js +155 -0
- package/dist/harnesses/auth-source.js.map +1 -0
- package/dist/harnesses/engine/backfill-failed-deliveries.d.ts +59 -0
- package/dist/harnesses/engine/backfill-failed-deliveries.js +94 -0
- package/dist/harnesses/engine/backfill-failed-deliveries.js.map +1 -0
- package/dist/harnesses/engine/canonical-json.d.ts +2 -1
- package/dist/harnesses/engine/canonical-json.js +2 -67
- package/dist/harnesses/engine/canonical-json.js.map +1 -1
- package/dist/harnesses/engine/corpus-knowledge.d.ts +67 -0
- package/dist/harnesses/engine/corpus-knowledge.js +194 -0
- package/dist/harnesses/engine/corpus-knowledge.js.map +1 -0
- package/dist/harnesses/engine/engine.d.ts +85 -1
- package/dist/harnesses/engine/engine.js +313 -6
- package/dist/harnesses/engine/engine.js.map +1 -1
- package/dist/harnesses/engine/envelope-assembly.d.ts +9 -1
- package/dist/harnesses/engine/envelope-assembly.js +6 -0
- package/dist/harnesses/engine/envelope-assembly.js.map +1 -1
- package/dist/harnesses/engine/generator-model.d.ts +36 -0
- package/dist/harnesses/engine/generator-model.js +118 -0
- package/dist/harnesses/engine/generator-model.js.map +1 -0
- package/dist/harnesses/engine/packaging.js +5 -5
- package/dist/harnesses/engine/packaging.js.map +1 -1
- package/dist/harnesses/engine/persistence.d.ts +37 -62
- package/dist/harnesses/engine/persistence.js +66 -0
- package/dist/harnesses/engine/persistence.js.map +1 -1
- package/dist/harnesses/impls/_evaluator-base.d.ts +48 -0
- package/dist/harnesses/impls/_evaluator-base.js +35 -0
- package/dist/harnesses/impls/_evaluator-base.js.map +1 -0
- package/dist/harnesses/impls/claude-mcp-hyperliquid/mcp-tools.d.ts +1 -1
- package/dist/harnesses/impls/claude-mcp-hyperliquid/mcp-tools.js +1 -1
- package/dist/harnesses/impls/claude-mcp-hyperliquid/mcp-tools.js.map +1 -1
- package/dist/harnesses/impls/claude-mcp-prediction/index.d.ts +2 -3
- package/dist/harnesses/impls/claude-mcp-prediction/index.js +29 -99
- package/dist/harnesses/impls/claude-mcp-prediction/index.js.map +1 -1
- package/dist/harnesses/impls/claude-mcp-prediction/mcp-tools.js +4 -21
- package/dist/harnesses/impls/claude-mcp-prediction/mcp-tools.js.map +1 -1
- package/dist/harnesses/impls/claude-mcp-prediction/session-orchestrator.d.ts +2 -0
- package/dist/harnesses/impls/claude-mcp-prediction/session-orchestrator.js +1 -1
- package/dist/harnesses/impls/claude-mcp-prediction/session-orchestrator.js.map +1 -1
- package/dist/harnesses/impls/claude-mcp-prediction-apy/index.js +30 -79
- package/dist/harnesses/impls/claude-mcp-prediction-apy/index.js.map +1 -1
- package/dist/harnesses/impls/claude-mcp-prediction-apy/mcp-tools.js +4 -19
- package/dist/harnesses/impls/claude-mcp-prediction-apy/mcp-tools.js.map +1 -1
- package/dist/harnesses/impls/claude-mcp-prediction-apy/session-orchestrator.d.ts +2 -0
- package/dist/harnesses/impls/claude-mcp-prediction-apy/session-orchestrator.js +1 -1
- package/dist/harnesses/impls/claude-mcp-prediction-apy/session-orchestrator.js.map +1 -1
- package/dist/harnesses/impls/claude-mcp-shared/mcp-server-script.d.ts +39 -0
- package/dist/harnesses/impls/claude-mcp-shared/mcp-server-script.js +62 -0
- package/dist/harnesses/impls/claude-mcp-shared/mcp-server-script.js.map +1 -0
- package/dist/harnesses/impls/claude-mcp-shared/mcp-server.d.ts +40 -0
- package/dist/harnesses/impls/claude-mcp-shared/mcp-server.js +44 -0
- package/dist/harnesses/impls/claude-mcp-shared/mcp-server.js.map +1 -0
- package/dist/harnesses/impls/claude-mcp-shared/single-session-harness.d.ts +56 -0
- package/dist/harnesses/impls/claude-mcp-shared/single-session-harness.js +79 -0
- package/dist/harnesses/impls/claude-mcp-shared/single-session-harness.js.map +1 -0
- package/dist/harnesses/impls/hermes-agent/adapter.js +56 -2
- package/dist/harnesses/impls/hermes-agent/adapter.js.map +1 -1
- package/dist/harnesses/impls/hermes-agent/bootstrap.d.ts +6 -0
- package/dist/harnesses/impls/hermes-agent/bootstrap.js +7 -2
- package/dist/harnesses/impls/hermes-agent/bootstrap.js.map +1 -1
- package/dist/harnesses/impls/hermes-agent/harness.d.ts +8 -0
- package/dist/harnesses/impls/hermes-agent/harness.js +21 -0
- package/dist/harnesses/impls/hermes-agent/harness.js.map +1 -1
- package/dist/harnesses/impls/index.js +8 -1
- package/dist/harnesses/impls/index.js.map +1 -1
- package/dist/harnesses/impls/jinn-repo-evaluator/eval-runner.d.ts +34 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/eval-runner.js +111 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/eval-runner.js.map +1 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/evaluator.d.ts +24 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/evaluator.js +19 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/evaluator.js.map +1 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/harness.d.ts +97 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/harness.js +265 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/harness.js.map +1 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/live-eval-runner.d.ts +68 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/live-eval-runner.js +223 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/live-eval-runner.js.map +1 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/repro.d.ts +32 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/repro.js +73 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/repro.js.map +1 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/scope-tests.d.ts +62 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/scope-tests.js +91 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/scope-tests.js.map +1 -0
- package/dist/harnesses/impls/learner/adapters/claude-code.js +9 -2
- package/dist/harnesses/impls/learner/adapters/claude-code.js.map +1 -1
- package/dist/harnesses/impls/learner/adapters/codex-code.d.ts +11 -1
- package/dist/harnesses/impls/learner/adapters/codex-code.js +130 -15
- package/dist/harnesses/impls/learner/adapters/codex-code.js.map +1 -1
- package/dist/harnesses/impls/learner/harness.d.ts +12 -0
- package/dist/harnesses/impls/learner/harness.js +42 -0
- package/dist/harnesses/impls/learner/harness.js.map +1 -1
- package/dist/harnesses/impls/learner/harvest.js +51 -1
- package/dist/harnesses/impls/learner/harvest.js.map +1 -1
- package/dist/harnesses/impls/portfolio-v0-evaluator/index.d.ts +5 -15
- package/dist/harnesses/impls/portfolio-v0-evaluator/index.js +10 -29
- package/dist/harnesses/impls/portfolio-v0-evaluator/index.js.map +1 -1
- package/dist/harnesses/impls/prediction-apy-v0-evaluator/index.d.ts +5 -15
- package/dist/harnesses/impls/prediction-apy-v0-evaluator/index.js +10 -23
- package/dist/harnesses/impls/prediction-apy-v0-evaluator/index.js.map +1 -1
- package/dist/harnesses/impls/prediction-v0-evaluator/index.d.ts +5 -15
- package/dist/harnesses/impls/prediction-v0-evaluator/index.js +10 -25
- package/dist/harnesses/impls/prediction-v0-evaluator/index.js.map +1 -1
- package/dist/harnesses/impls/stub.d.ts +2 -2
- package/dist/harnesses/impls/stub.js +2 -2
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/eval-runner.js +16 -2
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/eval-runner.js.map +1 -1
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/harness.d.ts +65 -6
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/harness.js +590 -35
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/harness.js.map +1 -1
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/hf-fetcher.js +4 -1
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/hf-fetcher.js.map +1 -1
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/routing-task-row-fetcher.d.ts +37 -0
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/routing-task-row-fetcher.js +59 -0
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/routing-task-row-fetcher.js.map +1 -0
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/upstream-patches/passed-actual.patch +21 -0
- package/dist/harnesses/readiness-registry.d.ts +16 -0
- package/dist/harnesses/readiness-registry.js +28 -6
- package/dist/harnesses/readiness-registry.js.map +1 -1
- package/dist/harnesses/types.d.ts +12 -0
- package/dist/learner/verification-gate.d.ts +53 -0
- package/dist/learner/verification-gate.js +80 -0
- package/dist/learner/verification-gate.js.map +1 -0
- package/dist/lifecycle/process-discovery.d.ts +41 -0
- package/dist/lifecycle/process-discovery.js +109 -0
- package/dist/lifecycle/process-discovery.js.map +1 -0
- package/dist/main.js +358 -581
- package/dist/main.js.map +1 -1
- package/dist/mcp/acquire-artifact.d.ts +3 -3
- package/dist/mcp/acquire-artifact.js +3 -3
- package/dist/mcp/operator-server.js +1 -1
- package/dist/mcp/operator-server.js.map +1 -1
- package/dist/mcp/server.js +5 -6
- package/dist/mcp/server.js.map +1 -1
- package/dist/monitoring/net-liveness.d.ts +143 -0
- package/dist/monitoring/net-liveness.js +301 -0
- package/dist/monitoring/net-liveness.js.map +1 -0
- package/dist/observability/emit-event.d.ts +1 -1
- package/dist/observability/emit-event.js +2 -4
- package/dist/observability/emit-event.js.map +1 -1
- package/dist/observability/progress.d.ts +11 -0
- package/dist/observability/progress.js +16 -0
- package/dist/observability/progress.js.map +1 -0
- package/dist/pilot/arm-homes.d.ts +39 -0
- package/dist/pilot/arm-homes.js +104 -0
- package/dist/pilot/arm-homes.js.map +1 -0
- package/dist/pilot/cost.d.ts +19 -0
- package/dist/pilot/cost.js +31 -0
- package/dist/pilot/cost.js.map +1 -0
- package/dist/pilot/instance.d.ts +26 -0
- package/dist/pilot/instance.js +53 -0
- package/dist/pilot/instance.js.map +1 -0
- package/dist/pilot/pipeline.d.ts +17 -0
- package/dist/pilot/pipeline.js +35 -0
- package/dist/pilot/pipeline.js.map +1 -0
- package/dist/pilot/repo.d.ts +37 -0
- package/dist/pilot/repo.js +65 -0
- package/dist/pilot/repo.js.map +1 -0
- package/dist/pilot/resume.d.ts +101 -0
- package/dist/pilot/resume.js +204 -0
- package/dist/pilot/resume.js.map +1 -0
- package/dist/pilot/solve.d.ts +23 -0
- package/dist/pilot/solve.js +37 -0
- package/dist/pilot/solve.js.map +1 -0
- package/dist/pilot/tally.d.ts +42 -0
- package/dist/pilot/tally.js +100 -0
- package/dist/pilot/tally.js.map +1 -0
- package/dist/pilot/task-selection.d.ts +27 -0
- package/dist/pilot/task-selection.js +112 -0
- package/dist/pilot/task-selection.js.map +1 -0
- package/dist/plugins/resolvers.js +7 -4
- package/dist/plugins/resolvers.js.map +1 -1
- package/dist/plugins/types.d.ts +8 -0
- package/dist/preflight/deployment-readiness.d.ts +2 -22
- package/dist/preflight/deployment-readiness.js +1 -59
- package/dist/preflight/deployment-readiness.js.map +1 -1
- package/dist/preflight/pidfile-liveness.d.ts +3 -2
- package/dist/preflight/pidfile-liveness.js +18 -2
- package/dist/preflight/pidfile-liveness.js.map +1 -1
- package/dist/preflight/rpc-network.d.ts +10 -3
- package/dist/preflight/rpc-network.js +46 -13
- package/dist/preflight/rpc-network.js.map +1 -1
- package/dist/preflight/stable-cwd.d.ts +29 -0
- package/dist/preflight/stable-cwd.js +98 -0
- package/dist/preflight/stable-cwd.js.map +1 -0
- package/dist/preflight/version-check.d.ts +41 -0
- package/dist/preflight/version-check.js +80 -0
- package/dist/preflight/version-check.js.map +1 -0
- package/dist/rpc/transport.d.ts +7 -5
- package/dist/rpc/transport.js +8 -6
- package/dist/rpc/transport.js.map +1 -1
- package/dist/scripts/swe-rebench-v2-evaluator.bundle.v1.patch +79 -0
- package/dist/solver-nets/registry.d.ts +19 -0
- package/dist/solver-nets/registry.js +99 -66
- package/dist/solver-nets/registry.js.map +1 -1
- package/dist/solver-types/_jinn-repo-pool.d.ts +61 -0
- package/dist/solver-types/_jinn-repo-pool.js +34 -0
- package/dist/solver-types/_jinn-repo-pool.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-commit-echo-git.d.ts +46 -0
- package/dist/solver-types/_swe-rebench-v2-commit-echo-git.js +192 -0
- package/dist/solver-types/_swe-rebench-v2-commit-echo-git.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-commit-echo.d.ts +57 -0
- package/dist/solver-types/_swe-rebench-v2-commit-echo.js +57 -0
- package/dist/solver-types/_swe-rebench-v2-commit-echo.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-differential-admission.d.ts +395 -0
- package/dist/solver-types/_swe-rebench-v2-differential-admission.js +231 -0
- package/dist/solver-types/_swe-rebench-v2-differential-admission.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-empirical-tests.d.ts +47 -0
- package/dist/solver-types/_swe-rebench-v2-empirical-tests.js +67 -0
- package/dist/solver-types/_swe-rebench-v2-empirical-tests.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-escrow.d.ts +2 -0
- package/dist/solver-types/_swe-rebench-v2-escrow.js +13 -0
- package/dist/solver-types/_swe-rebench-v2-escrow.js.map +1 -1
- package/dist/solver-types/_swe-rebench-v2-guards.d.ts +44 -0
- package/dist/solver-types/_swe-rebench-v2-guards.js +111 -0
- package/dist/solver-types/_swe-rebench-v2-guards.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-harvest-state.d.ts +191 -0
- package/dist/solver-types/_swe-rebench-v2-harvest-state.js +349 -0
- package/dist/solver-types/_swe-rebench-v2-harvest-state.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-harvest.d.ts +123 -0
- package/dist/solver-types/_swe-rebench-v2-harvest.js +539 -0
- package/dist/solver-types/_swe-rebench-v2-harvest.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-held-out-slate.d.ts +1 -1
- package/dist/solver-types/_swe-rebench-v2-held-out-slate.js +1 -1
- package/dist/solver-types/_swe-rebench-v2-held-out-slate.js.map +1 -1
- package/dist/solver-types/_swe-rebench-v2-hunk-echo.d.ts +28 -0
- package/dist/solver-types/_swe-rebench-v2-hunk-echo.js +32 -0
- package/dist/solver-types/_swe-rebench-v2-hunk-echo.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-lookup-tripwire.d.ts +16 -0
- package/dist/solver-types/_swe-rebench-v2-lookup-tripwire.js +18 -0
- package/dist/solver-types/_swe-rebench-v2-lookup-tripwire.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-mineable-store-port.d.ts +74 -0
- package/dist/solver-types/_swe-rebench-v2-mineable-store-port.js +9 -0
- package/dist/solver-types/_swe-rebench-v2-mineable-store-port.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-mineable-store.d.ts +51 -0
- package/dist/solver-types/_swe-rebench-v2-mineable-store.js +171 -0
- package/dist/solver-types/_swe-rebench-v2-mineable-store.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-mint-cli.d.ts +82 -0
- package/dist/solver-types/_swe-rebench-v2-mint-cli.js +434 -0
- package/dist/solver-types/_swe-rebench-v2-mint-cli.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-minted-environment-verifier.d.ts +25 -0
- package/dist/solver-types/_swe-rebench-v2-minted-environment-verifier.js +101 -0
- package/dist/solver-types/_swe-rebench-v2-minted-environment-verifier.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-minted-pool.d.ts +179 -0
- package/dist/solver-types/_swe-rebench-v2-minted-pool.js +408 -0
- package/dist/solver-types/_swe-rebench-v2-minted-pool.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-session-echo.d.ts +36 -0
- package/dist/solver-types/_swe-rebench-v2-session-echo.js +193 -0
- package/dist/solver-types/_swe-rebench-v2-session-echo.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-substrate.d.ts +11 -0
- package/dist/solver-types/_swe-rebench-v2-substrate.js +24 -0
- package/dist/solver-types/_swe-rebench-v2-substrate.js.map +1 -1
- package/dist/solver-types/_swe-rebench-v2-synthetic-claim.d.ts +9 -0
- package/dist/solver-types/_swe-rebench-v2-synthetic-claim.js +16 -0
- package/dist/solver-types/_swe-rebench-v2-synthetic-claim.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-validated-pool.d.ts +144 -1
- package/dist/solver-types/_swe-rebench-v2-validated-pool.js +292 -14
- package/dist/solver-types/_swe-rebench-v2-validated-pool.js.map +1 -1
- package/dist/solver-types/_swe-rebench-v2-verifier-facts.d.ts +93 -0
- package/dist/solver-types/_swe-rebench-v2-verifier-facts.js +583 -0
- package/dist/solver-types/_swe-rebench-v2-verifier-facts.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-yield-report-data.d.ts +5 -0
- package/dist/solver-types/_swe-rebench-v2-yield-report-data.js +16 -0
- package/dist/solver-types/_swe-rebench-v2-yield-report-data.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-yield.d.ts +51 -0
- package/dist/solver-types/_swe-rebench-v2-yield.js +53 -0
- package/dist/solver-types/_swe-rebench-v2-yield.js.map +1 -0
- package/dist/solver-types/index.js +2 -0
- package/dist/solver-types/index.js.map +1 -1
- package/dist/solver-types/jinn-repo-admit.d.ts +17 -0
- package/dist/solver-types/jinn-repo-admit.js +16 -0
- package/dist/solver-types/jinn-repo-admit.js.map +1 -0
- package/dist/solver-types/jinn-repo-auto.d.ts +60 -0
- package/dist/solver-types/jinn-repo-auto.js +163 -0
- package/dist/solver-types/jinn-repo-auto.js.map +1 -0
- package/dist/solver-types/jinn-repo-definition.d.ts +15 -0
- package/dist/solver-types/jinn-repo-definition.js +34 -0
- package/dist/solver-types/jinn-repo-definition.js.map +1 -0
- package/dist/solver-types/jinn-repo-extract.d.ts +16 -0
- package/dist/solver-types/jinn-repo-extract.js +33 -0
- package/dist/solver-types/jinn-repo-extract.js.map +1 -0
- package/dist/solver-types/jinn-repo-live-auto.d.ts +203 -0
- package/dist/solver-types/jinn-repo-live-auto.js +348 -0
- package/dist/solver-types/jinn-repo-live-auto.js.map +1 -0
- package/dist/solver-types/jinn-repo.d.ts +42 -0
- package/dist/solver-types/jinn-repo.js +42 -0
- package/dist/solver-types/jinn-repo.js.map +1 -0
- package/dist/solver-types/learner-loop-test.js +1 -1
- package/dist/solver-types/learner-loop-test.js.map +1 -1
- package/dist/solver-types/slates/held-out-slate.swe-rebench-v2.v3.json +34 -0
- package/dist/solver-types/slates/held-out-slate.swe-rebench-v2.v3.quality-screen.json +186 -0
- package/dist/solver-types/slates/held-out-slate.swe-rebench-v2.v3.screening-report.json +488 -0
- package/dist/solver-types/swe-rebench-v2-auto.d.ts +13 -0
- package/dist/solver-types/swe-rebench-v2-auto.js +36 -1
- package/dist/solver-types/swe-rebench-v2-auto.js.map +1 -1
- package/dist/solver-types/swe-rebench-v2.js +48 -11
- package/dist/solver-types/swe-rebench-v2.js.map +1 -1
- package/dist/solvernets/launched-record-dispatcher.d.ts +14 -0
- package/dist/solvernets/launched-record-dispatcher.js +28 -1
- package/dist/solvernets/launched-record-dispatcher.js.map +1 -1
- package/dist/solvernets/store.d.ts +1 -1
- package/dist/solvernets/store.js +1 -1
- package/dist/solvernets/store.js.map +1 -1
- package/dist/spend/credential.d.ts +2 -2
- package/dist/spend/credential.js +9 -3
- package/dist/spend/credential.js.map +1 -1
- package/dist/spend/spend-cap.d.ts +10 -0
- package/dist/spend/spend-cap.js +13 -0
- package/dist/spend/spend-cap.js.map +1 -0
- package/dist/spend/usage.js +39 -3
- package/dist/spend/usage.js.map +1 -1
- package/dist/store/store.d.ts +59 -1
- package/dist/store/store.js +157 -6
- package/dist/store/store.js.map +1 -1
- package/dist/task-creator/environment/adapters.d.ts +139 -0
- package/dist/task-creator/environment/adapters.js +446 -0
- package/dist/task-creator/environment/adapters.js.map +1 -0
- package/dist/task-creator/environment/build.d.ts +5 -0
- package/dist/task-creator/environment/build.js +53 -0
- package/dist/task-creator/environment/build.js.map +1 -0
- package/dist/task-creator/environment/contracts.d.ts +1338 -0
- package/dist/task-creator/environment/contracts.js +207 -0
- package/dist/task-creator/environment/contracts.js.map +1 -0
- package/dist/task-creator/environment/github.d.ts +25 -0
- package/dist/task-creator/environment/github.js +67 -0
- package/dist/task-creator/environment/github.js.map +1 -0
- package/dist/task-creator/environment/interfaces.d.ts +60 -0
- package/dist/task-creator/environment/interfaces.js +3 -0
- package/dist/task-creator/environment/interfaces.js.map +1 -0
- package/dist/task-creator/environment/jinn-differential-policy.d.ts +22 -0
- package/dist/task-creator/environment/jinn-differential-policy.js +73 -0
- package/dist/task-creator/environment/jinn-differential-policy.js.map +1 -0
- package/dist/task-creator/environment/policy.d.ts +38 -0
- package/dist/task-creator/environment/policy.js +51 -0
- package/dist/task-creator/environment/policy.js.map +1 -0
- package/dist/task-creator/environment/publication.d.ts +39 -0
- package/dist/task-creator/environment/publication.js +139 -0
- package/dist/task-creator/environment/publication.js.map +1 -0
- package/dist/task-creator/environment/publish-cli.d.ts +427 -0
- package/dist/task-creator/environment/publish-cli.js +180 -0
- package/dist/task-creator/environment/publish-cli.js.map +1 -0
- package/dist/task-creator/environment/recipes.d.ts +19 -0
- package/dist/task-creator/environment/recipes.js +122 -0
- package/dist/task-creator/environment/recipes.js.map +1 -0
- package/dist/task-creator/environment/resolver.d.ts +53 -0
- package/dist/task-creator/environment/resolver.js +57 -0
- package/dist/task-creator/environment/resolver.js.map +1 -0
- package/dist/task-creator/proofs/differential-receipt-bound-proof.d.ts +27 -0
- package/dist/task-creator/proofs/differential-receipt-bound-proof.js +86 -0
- package/dist/task-creator/proofs/differential-receipt-bound-proof.js.map +1 -0
- package/dist/task-creator/proofs/ipfs-cid.d.ts +7 -0
- package/dist/task-creator/proofs/ipfs-cid.js +98 -0
- package/dist/task-creator/proofs/ipfs-cid.js.map +1 -0
- package/dist/task-creator/proofs/live-proof.d.ts +99 -0
- package/dist/task-creator/proofs/live-proof.js +419 -0
- package/dist/task-creator/proofs/live-proof.js.map +1 -0
- package/dist/task-creator/proofs/public-repo-fixtures.d.ts +53 -0
- package/dist/task-creator/proofs/public-repo-fixtures.js +93 -0
- package/dist/task-creator/proofs/public-repo-fixtures.js.map +1 -0
- package/dist/task-creator/proofs/vitest-json-fixture.d.ts +40 -0
- package/dist/task-creator/proofs/vitest-json-fixture.js +115 -0
- package/dist/task-creator/proofs/vitest-json-fixture.js.map +1 -0
- package/dist/trajectory/emit.d.ts +6 -0
- package/dist/trajectory/emit.js +9 -1
- package/dist/trajectory/emit.js.map +1 -1
- package/dist/trajectory/harness-bundle-schema.d.ts +3 -3
- package/dist/trajectory/harness-bundle-schema.js +1 -1
- package/dist/trajectory/harness-bundle-schema.js.map +1 -1
- package/dist/trajectory/hash-chain.d.ts +1 -18
- package/dist/trajectory/hash-chain.js +1 -22
- package/dist/trajectory/hash-chain.js.map +1 -1
- package/dist/trajectory/index.d.ts +2 -0
- package/dist/trajectory/index.js +2 -0
- package/dist/trajectory/index.js.map +1 -1
- package/dist/trajectory/processors/identity-scrub.js +22 -3
- package/dist/trajectory/processors/identity-scrub.js.map +1 -1
- package/dist/trajectory/schema.d.ts +1 -598
- package/dist/trajectory/schema.js +1 -102
- package/dist/trajectory/schema.js.map +1 -1
- package/dist/trajectory/scrub/build.d.ts +1 -0
- package/dist/trajectory/scrub/build.js +2 -0
- package/dist/trajectory/scrub/build.js.map +1 -0
- package/dist/trajectory/scrub/emit-scrub.d.ts +1 -0
- package/dist/trajectory/scrub/emit-scrub.js +2 -0
- package/dist/trajectory/scrub/emit-scrub.js.map +1 -0
- package/dist/trajectory/scrub/key-policy.d.ts +1 -0
- package/dist/trajectory/scrub/key-policy.js +2 -0
- package/dist/trajectory/scrub/key-policy.js.map +1 -0
- package/dist/trajectory/scrub/layer2.d.ts +1 -0
- package/dist/trajectory/scrub/layer2.js +2 -0
- package/dist/trajectory/scrub/layer2.js.map +1 -0
- package/dist/trajectory/scrub/ml-pii-stage.d.ts +1 -0
- package/dist/trajectory/scrub/ml-pii-stage.js +2 -0
- package/dist/trajectory/scrub/ml-pii-stage.js.map +1 -0
- package/dist/trajectory/scrub/openredaction-stage.d.ts +1 -0
- package/dist/trajectory/scrub/openredaction-stage.js +2 -0
- package/dist/trajectory/scrub/openredaction-stage.js.map +1 -0
- package/dist/trajectory/scrub/pii-build.d.ts +1 -0
- package/dist/trajectory/scrub/pii-build.js +2 -0
- package/dist/trajectory/scrub/pii-build.js.map +1 -0
- package/dist/trajectory/scrub/pipeline.d.ts +1 -0
- package/dist/trajectory/scrub/pipeline.js +2 -0
- package/dist/trajectory/scrub/pipeline.js.map +1 -0
- package/dist/trajectory/scrub/plain-patterns-stage.d.ts +1 -0
- package/dist/trajectory/scrub/plain-patterns-stage.js +2 -0
- package/dist/trajectory/scrub/plain-patterns-stage.js.map +1 -0
- package/dist/trajectory/scrub/secretlint-stage.d.ts +1 -0
- package/dist/trajectory/scrub/secretlint-stage.js +2 -0
- package/dist/trajectory/scrub/secretlint-stage.js.map +1 -0
- package/dist/trajectory/scrub/transformers-detector.d.ts +1 -0
- package/dist/trajectory/scrub/transformers-detector.js +2 -0
- package/dist/trajectory/scrub/transformers-detector.js.map +1 -0
- package/dist/trajectory/scrub/types.d.ts +1 -0
- package/dist/trajectory/scrub/types.js +2 -0
- package/dist/trajectory/scrub/types.js.map +1 -0
- package/dist/trajectory/secret-scrub.d.ts +4 -6
- package/dist/trajectory/secret-scrub.js +52 -12
- package/dist/trajectory/secret-scrub.js.map +1 -1
- package/dist/trajectory/span-profile.js +14 -0
- package/dist/trajectory/span-profile.js.map +1 -1
- package/dist/trajectory/transcript-parsers/aider-history.d.ts +1 -42
- package/dist/trajectory/transcript-parsers/aider-history.js +1 -181
- package/dist/trajectory/transcript-parsers/aider-history.js.map +1 -1
- package/dist/trajectory/transcript-parsers/claude-code-jsonl.d.ts +1 -37
- package/dist/trajectory/transcript-parsers/claude-code-jsonl.js +1 -142
- package/dist/trajectory/transcript-parsers/claude-code-jsonl.js.map +1 -1
- package/dist/trajectory/transcript-parsers/codex-session.d.ts +1 -42
- package/dist/trajectory/transcript-parsers/codex-session.js +1 -235
- package/dist/trajectory/transcript-parsers/codex-session.js.map +1 -1
- package/dist/trajectory/transcript-parsers/continue-devdata.d.ts +1 -41
- package/dist/trajectory/transcript-parsers/continue-devdata.js +1 -190
- package/dist/trajectory/transcript-parsers/continue-devdata.js.map +1 -1
- package/dist/trajectory/transcript-parsers/cursor-sqlite.d.ts +1 -38
- package/dist/trajectory/transcript-parsers/cursor-sqlite.js +1 -118
- package/dist/trajectory/transcript-parsers/cursor-sqlite.js.map +1 -1
- package/dist/trajectory/transcript-parsers/gemini-session.d.ts +1 -35
- package/dist/trajectory/transcript-parsers/gemini-session.js +1 -137
- package/dist/trajectory/transcript-parsers/gemini-session.js.map +1 -1
- package/dist/trajectory/transcript-parsers/types.d.ts +1 -101
- package/dist/trajectory/transcript-parsers/types.js +1 -32
- package/dist/trajectory/transcript-parsers/types.js.map +1 -1
- package/dist/trajectory/transcript-to-spans/attrs.d.ts +1 -0
- package/dist/trajectory/transcript-to-spans/attrs.js +2 -0
- package/dist/trajectory/transcript-to-spans/attrs.js.map +1 -0
- package/dist/trajectory/transcript-to-spans/claude-code-stream-json.d.ts +1 -0
- package/dist/trajectory/transcript-to-spans/claude-code-stream-json.js +2 -0
- package/dist/trajectory/transcript-to-spans/claude-code-stream-json.js.map +1 -0
- package/dist/trajectory/transcript-to-spans/codex-exec-json.d.ts +1 -0
- package/dist/trajectory/transcript-to-spans/codex-exec-json.js +2 -0
- package/dist/trajectory/transcript-to-spans/codex-exec-json.js.map +1 -0
- package/dist/trajectory/transcript-to-spans/hermes-session-json.d.ts +48 -0
- package/dist/trajectory/transcript-to-spans/hermes-session-json.js +193 -0
- package/dist/trajectory/transcript-to-spans/hermes-session-json.js.map +1 -0
- package/dist/trajectory/transcript-to-spans/index.d.ts +38 -0
- package/dist/trajectory/transcript-to-spans/index.js +77 -0
- package/dist/trajectory/transcript-to-spans/index.js.map +1 -0
- package/dist/trajectory/transcript-to-spans/types.d.ts +16 -0
- package/dist/trajectory/transcript-to-spans/types.js +11 -0
- package/dist/trajectory/transcript-to-spans/types.js.map +1 -0
- package/dist/trajectory/transcript-watcher.d.ts +41 -0
- package/dist/trajectory/transcript-watcher.js +34 -0
- package/dist/trajectory/transcript-watcher.js.map +1 -1
- package/dist/tx-retry.d.ts +18 -0
- package/dist/tx-retry.js +52 -12
- package/dist/tx-retry.js.map +1 -1
- package/dist/types/envelope.d.ts +3 -2785
- package/dist/types/envelope.js +3 -160
- package/dist/types/envelope.js.map +1 -1
- package/dist/types/manifest.d.ts +1 -0
- package/dist/types/manifest.js +2 -0
- package/dist/types/manifest.js.map +1 -0
- package/dist/types/payloads/index.d.ts +1 -1
- package/dist/types/payloads/index.js +7 -1
- package/dist/types/payloads/index.js.map +1 -1
- package/dist/types/payloads/portfolio-v0.d.ts +4 -4
- package/dist/types/payloads/portfolio-v0.js +1 -1
- package/dist/types/payloads/portfolio-v0.js.map +1 -1
- package/dist/types/payloads/prediction-apy-v0.d.ts +4 -4
- package/dist/types/payloads/prediction-apy-v0.js +1 -1
- package/dist/types/payloads/prediction-apy-v0.js.map +1 -1
- package/dist/types/payloads/prediction-v0.d.ts +4 -4
- package/dist/types/payloads/prediction-v0.js +1 -1
- package/dist/types/payloads/prediction-v0.js.map +1 -1
- package/dist/types/portfolio.d.ts +1 -1
- package/dist/types/portfolio.js +1 -1
- package/dist/types/portfolio.js.map +1 -1
- package/dist/types/prediction-apy.d.ts +1 -1
- package/dist/types/prediction-apy.js +1 -1
- package/dist/types/prediction-apy.js.map +1 -1
- package/dist/types/prediction.d.ts +1 -1
- package/dist/types/prediction.js +1 -1
- package/dist/types/prediction.js.map +1 -1
- package/dist/types/session-provenance.d.ts +2 -71
- package/dist/types/session-provenance.js +2 -18
- package/dist/types/session-provenance.js.map +1 -1
- package/dist/types/skill-artifact.d.ts +5 -0
- package/dist/types/skill-artifact.js +6 -0
- package/dist/types/skill-artifact.js.map +1 -0
- package/dist/types/task-document.d.ts +315 -1
- package/dist/types/task-document.js +9 -1
- package/dist/types/task-document.js.map +1 -1
- package/dist/types/task-run-read-model.d.ts +21 -0
- package/dist/types/task-run-read-model.js +2 -0
- package/dist/types/task-run-read-model.js.map +1 -0
- package/dist/types/task-run.d.ts +88 -0
- package/dist/types/task-run.js +2 -0
- package/dist/types/task-run.js.map +1 -0
- package/dist/types/task.d.ts +36 -1
- package/dist/types/task.js +1 -1
- package/dist/types/task.js.map +1 -1
- package/dist/types/window.d.ts +2 -12
- package/dist/types/window.js +2 -5
- package/dist/types/window.js.map +1 -1
- package/dist/util/redact-rpc-urls.d.ts +1 -1
- package/dist/util/redact-rpc-urls.js +57 -2
- package/dist/util/redact-rpc-urls.js.map +1 -1
- package/dist/vendor/@jinn-network/core/dist/canonical-json.d.ts +1 -0
- package/dist/vendor/@jinn-network/core/dist/canonical-json.js +67 -0
- package/dist/vendor/@jinn-network/core/dist/captured-task.d.ts +140 -0
- package/dist/vendor/@jinn-network/core/dist/captured-task.js +122 -0
- package/dist/vendor/@jinn-network/core/dist/contribution-store.d.ts +97 -0
- package/dist/vendor/@jinn-network/core/dist/contribution-store.js +770 -0
- package/dist/vendor/@jinn-network/core/dist/corpus-read/acquire.d.ts +39 -0
- package/dist/vendor/@jinn-network/core/dist/corpus-read/acquire.js +212 -0
- package/dist/vendor/@jinn-network/core/dist/corpus-read/cache.d.ts +14 -0
- package/dist/vendor/@jinn-network/core/dist/corpus-read/cache.js +17 -0
- package/dist/vendor/@jinn-network/core/dist/corpus-read/capture-meta.d.ts +16 -0
- package/dist/vendor/@jinn-network/core/dist/corpus-read/capture-meta.js +18 -0
- package/dist/vendor/@jinn-network/core/dist/corpus-read/create-corpus.d.ts +2 -0
- package/dist/vendor/@jinn-network/core/dist/corpus-read/create-corpus.js +97 -0
- package/dist/vendor/@jinn-network/core/dist/corpus-read/fetch-artifact.d.ts +21 -0
- package/dist/vendor/@jinn-network/core/dist/corpus-read/fetch-artifact.js +32 -0
- package/dist/vendor/@jinn-network/core/dist/corpus-read/fetch.d.ts +12 -0
- package/dist/vendor/@jinn-network/core/dist/corpus-read/fetch.js +24 -0
- package/dist/vendor/@jinn-network/core/dist/corpus-read/http-discovery.d.ts +9 -0
- package/dist/vendor/@jinn-network/core/dist/corpus-read/http-discovery.js +128 -0
- package/dist/vendor/@jinn-network/core/dist/corpus-read/index.d.ts +10 -0
- package/dist/vendor/@jinn-network/core/dist/corpus-read/index.js +10 -0
- package/dist/vendor/@jinn-network/core/dist/corpus-read/ipfs.d.ts +5 -0
- package/dist/vendor/@jinn-network/core/dist/corpus-read/ipfs.js +72 -0
- package/dist/vendor/@jinn-network/core/dist/corpus-read/route-resolver.d.ts +16 -0
- package/dist/vendor/@jinn-network/core/dist/corpus-read/route-resolver.js +19 -0
- package/dist/vendor/@jinn-network/core/dist/corpus-read/types.d.ts +177 -0
- package/dist/vendor/@jinn-network/core/dist/corpus-read/types.js +42 -0
- package/dist/vendor/@jinn-network/core/dist/envelope.d.ts +134 -0
- package/dist/vendor/@jinn-network/core/dist/envelope.js +162 -0
- package/dist/vendor/@jinn-network/core/dist/evidence-adapter.d.ts +26 -0
- package/dist/vendor/@jinn-network/core/dist/evidence-adapter.js +321 -0
- package/dist/vendor/@jinn-network/core/dist/evidence-filesystem.d.ts +40 -0
- package/dist/vendor/@jinn-network/core/dist/evidence-filesystem.js +267 -0
- package/dist/vendor/@jinn-network/core/dist/evidence-index.d.ts +117 -0
- package/dist/vendor/@jinn-network/core/dist/evidence-index.js +1083 -0
- package/dist/vendor/@jinn-network/core/dist/evidence-store-lock.d.ts +2 -0
- package/dist/vendor/@jinn-network/core/dist/evidence-store-lock.js +208 -0
- package/dist/vendor/@jinn-network/core/dist/execution-envelope.d.ts +3142 -0
- package/dist/vendor/@jinn-network/core/dist/execution-envelope.js +203 -0
- package/dist/vendor/@jinn-network/core/dist/index.d.ts +12 -0
- package/dist/vendor/@jinn-network/core/dist/index.js +12 -0
- package/dist/vendor/@jinn-network/core/dist/manifest.d.ts +75 -0
- package/dist/vendor/@jinn-network/core/dist/manifest.js +184 -0
- package/dist/vendor/@jinn-network/core/dist/paired.d.ts +68 -0
- package/dist/vendor/@jinn-network/core/dist/paired.js +92 -0
- package/dist/vendor/@jinn-network/core/dist/scrub/build.d.ts +55 -0
- package/dist/vendor/@jinn-network/core/dist/scrub/build.js +87 -0
- package/dist/vendor/@jinn-network/core/dist/scrub/emit-scrub.d.ts +41 -0
- package/dist/vendor/@jinn-network/core/dist/scrub/emit-scrub.js +87 -0
- package/dist/vendor/@jinn-network/core/dist/scrub/index.d.ts +12 -0
- package/dist/vendor/@jinn-network/core/dist/scrub/index.js +12 -0
- package/dist/vendor/@jinn-network/core/dist/scrub/key-policy.d.ts +20 -0
- package/dist/vendor/@jinn-network/core/dist/scrub/key-policy.js +42 -0
- package/dist/vendor/@jinn-network/core/dist/scrub/layer2.d.ts +24 -0
- package/dist/vendor/@jinn-network/core/dist/scrub/layer2.js +33 -0
- package/dist/vendor/@jinn-network/core/dist/scrub/ml-pii-stage.d.ts +24 -0
- package/dist/vendor/@jinn-network/core/dist/scrub/ml-pii-stage.js +42 -0
- package/dist/vendor/@jinn-network/core/dist/scrub/openredaction-stage.d.ts +196 -0
- package/dist/vendor/@jinn-network/core/dist/scrub/openredaction-stage.js +270 -0
- package/dist/vendor/@jinn-network/core/dist/scrub/pii-build.d.ts +38 -0
- package/dist/vendor/@jinn-network/core/dist/scrub/pii-build.js +67 -0
- package/dist/vendor/@jinn-network/core/dist/scrub/pipeline.d.ts +38 -0
- package/dist/vendor/@jinn-network/core/dist/scrub/pipeline.js +83 -0
- package/dist/vendor/@jinn-network/core/dist/scrub/plain-patterns-stage.d.ts +42 -0
- package/dist/vendor/@jinn-network/core/dist/scrub/plain-patterns-stage.js +114 -0
- package/dist/vendor/@jinn-network/core/dist/scrub/secretlint-stage.d.ts +36 -0
- package/dist/vendor/@jinn-network/core/dist/scrub/secretlint-stage.js +249 -0
- package/dist/vendor/@jinn-network/core/dist/scrub/transformers-detector.d.ts +35 -0
- package/dist/vendor/@jinn-network/core/dist/scrub/transformers-detector.js +67 -0
- package/dist/vendor/@jinn-network/core/dist/scrub/types.d.ts +25 -0
- package/dist/vendor/@jinn-network/core/dist/scrub/types.js +1 -0
- package/dist/vendor/@jinn-network/core/dist/session-provenance.d.ts +75 -0
- package/dist/vendor/@jinn-network/core/dist/session-provenance.js +20 -0
- package/dist/vendor/@jinn-network/core/dist/skill-artifact.d.ts +442 -0
- package/dist/vendor/@jinn-network/core/dist/skill-artifact.js +136 -0
- package/dist/vendor/@jinn-network/core/dist/trajectory/hash-chain.d.ts +18 -0
- package/dist/vendor/@jinn-network/core/dist/trajectory/hash-chain.js +47 -0
- package/dist/vendor/@jinn-network/core/dist/trajectory/index.d.ts +4 -0
- package/dist/vendor/@jinn-network/core/dist/trajectory/index.js +4 -0
- package/dist/vendor/@jinn-network/core/dist/trajectory/schema.d.ts +606 -0
- package/dist/vendor/@jinn-network/core/dist/trajectory/schema.js +110 -0
- package/dist/vendor/@jinn-network/core/dist/trajectory/transcript-parsers/aider-history.d.ts +42 -0
- package/dist/vendor/@jinn-network/core/dist/trajectory/transcript-parsers/aider-history.js +181 -0
- package/dist/vendor/@jinn-network/core/dist/trajectory/transcript-parsers/claude-code-jsonl.d.ts +37 -0
- package/dist/vendor/@jinn-network/core/dist/trajectory/transcript-parsers/claude-code-jsonl.js +142 -0
- package/dist/vendor/@jinn-network/core/dist/trajectory/transcript-parsers/codex-session.d.ts +42 -0
- package/dist/vendor/@jinn-network/core/dist/trajectory/transcript-parsers/codex-session.js +235 -0
- package/dist/vendor/@jinn-network/core/dist/trajectory/transcript-parsers/continue-devdata.d.ts +41 -0
- package/dist/vendor/@jinn-network/core/dist/trajectory/transcript-parsers/continue-devdata.js +190 -0
- package/dist/vendor/@jinn-network/core/dist/trajectory/transcript-parsers/cursor-sqlite.d.ts +38 -0
- package/dist/vendor/@jinn-network/core/dist/trajectory/transcript-parsers/cursor-sqlite.js +118 -0
- package/dist/vendor/@jinn-network/core/dist/trajectory/transcript-parsers/gemini-session.d.ts +35 -0
- package/dist/vendor/@jinn-network/core/dist/trajectory/transcript-parsers/gemini-session.js +137 -0
- package/dist/vendor/@jinn-network/core/dist/trajectory/transcript-parsers/index.d.ts +7 -0
- package/dist/vendor/@jinn-network/core/dist/trajectory/transcript-parsers/index.js +7 -0
- package/dist/vendor/@jinn-network/core/dist/trajectory/transcript-parsers/types.d.ts +101 -0
- package/dist/vendor/@jinn-network/core/dist/trajectory/transcript-parsers/types.js +32 -0
- package/dist/vendor/@jinn-network/core/dist/trajectory/transcript-to-spans/attrs.d.ts +4 -0
- package/dist/vendor/@jinn-network/core/dist/trajectory/transcript-to-spans/attrs.js +30 -0
- package/dist/vendor/@jinn-network/core/dist/trajectory/transcript-to-spans/claude-code-stream-json.d.ts +8 -0
- package/dist/vendor/@jinn-network/core/dist/trajectory/transcript-to-spans/claude-code-stream-json.js +162 -0
- package/dist/vendor/@jinn-network/core/dist/trajectory/transcript-to-spans/codex-exec-json.d.ts +8 -0
- package/dist/vendor/@jinn-network/core/dist/trajectory/transcript-to-spans/codex-exec-json.js +253 -0
- package/dist/vendor/@jinn-network/core/dist/trajectory/transcript-to-spans/index.d.ts +4 -0
- package/dist/vendor/@jinn-network/core/dist/trajectory/transcript-to-spans/index.js +4 -0
- package/dist/vendor/@jinn-network/core/dist/trajectory/transcript-to-spans/types.d.ts +18 -0
- package/dist/vendor/@jinn-network/core/dist/trajectory/transcript-to-spans/types.js +1 -0
- package/dist/vendor/@jinn-network/core/dist/window.d.ts +12 -0
- package/dist/vendor/@jinn-network/core/dist/window.js +5 -0
- package/dist/vendor/@jinn-network/core/package.json +38 -0
- package/dist/vendor/@jinn-network/plugin/dist/eligibility.d.ts +12 -0
- package/dist/vendor/@jinn-network/plugin/dist/eligibility.js +12 -0
- package/dist/vendor/@jinn-network/plugin/dist/history.d.ts +35 -0
- package/dist/vendor/@jinn-network/plugin/dist/history.js +140 -0
- package/dist/vendor/@jinn-network/plugin/dist/index.d.ts +32 -0
- package/dist/vendor/@jinn-network/plugin/dist/index.js +15 -0
- package/dist/vendor/@jinn-network/plugin/dist/outcome.d.ts +26 -0
- package/dist/vendor/@jinn-network/plugin/dist/outcome.js +23 -0
- package/dist/vendor/@jinn-network/plugin/dist/pickup.d.ts +101 -0
- package/dist/vendor/@jinn-network/plugin/dist/pickup.js +354 -0
- package/dist/vendor/@jinn-network/plugin/dist/plugin.d.ts +157 -0
- package/dist/vendor/@jinn-network/plugin/dist/plugin.js +586 -0
- package/dist/vendor/@jinn-network/plugin/dist/ports/contribution-port.d.ts +53 -0
- package/dist/vendor/@jinn-network/plugin/dist/ports/contribution-port.js +14 -0
- package/dist/vendor/@jinn-network/plugin/dist/ports/corpus-port.d.ts +63 -0
- package/dist/vendor/@jinn-network/plugin/dist/ports/corpus-port.js +1 -0
- package/dist/vendor/@jinn-network/plugin/dist/ports/evidence-port.d.ts +17 -0
- package/dist/vendor/@jinn-network/plugin/dist/ports/evidence-port.js +1 -0
- package/dist/vendor/@jinn-network/plugin/dist/ports/local-learning-port.d.ts +22 -0
- package/dist/vendor/@jinn-network/plugin/dist/ports/local-learning-port.js +1 -0
- package/dist/vendor/@jinn-network/plugin/dist/ports/skills-port.d.ts +12 -0
- package/dist/vendor/@jinn-network/plugin/dist/ports/skills-port.js +1 -0
- package/dist/vendor/@jinn-network/plugin/dist/schemas/contribution-candidate.d.ts +116 -0
- package/dist/vendor/@jinn-network/plugin/dist/schemas/contribution-candidate.js +63 -0
- package/dist/vendor/@jinn-network/plugin/dist/schemas/eligibility-verdict.d.ts +8 -0
- package/dist/vendor/@jinn-network/plugin/dist/schemas/eligibility-verdict.js +7 -0
- package/dist/vendor/@jinn-network/plugin/dist/schemas/episode.d.ts +432 -0
- package/dist/vendor/@jinn-network/plugin/dist/schemas/episode.js +452 -0
- package/dist/vendor/@jinn-network/plugin/dist/schemas/history-entry.d.ts +40 -0
- package/dist/vendor/@jinn-network/plugin/dist/schemas/history-entry.js +30 -0
- package/dist/vendor/@jinn-network/plugin/dist/schemas/knowledge-hit.d.ts +27 -0
- package/dist/vendor/@jinn-network/plugin/dist/schemas/knowledge-hit.js +23 -0
- package/dist/vendor/@jinn-network/plugin/dist/schemas/knowledge-packet.d.ts +79 -0
- package/dist/vendor/@jinn-network/plugin/dist/schemas/knowledge-packet.js +213 -0
- package/dist/vendor/@jinn-network/plugin/dist/schemas/pickup-config.d.ts +20 -0
- package/dist/vendor/@jinn-network/plugin/dist/schemas/pickup-config.js +34 -0
- package/dist/vendor/@jinn-network/plugin/dist/schemas/session-summary.d.ts +17 -0
- package/dist/vendor/@jinn-network/plugin/dist/schemas/session-summary.js +19 -0
- package/dist/vendor/@jinn-network/plugin/dist/testing/contract-kits.d.ts +12 -0
- package/dist/vendor/@jinn-network/plugin/dist/testing/contract-kits.js +201 -0
- package/dist/vendor/@jinn-network/plugin/dist/testing/in-memory-contribution.d.ts +93 -0
- package/dist/vendor/@jinn-network/plugin/dist/testing/in-memory-contribution.js +104 -0
- package/dist/vendor/@jinn-network/plugin/dist/testing/in-memory-corpus.d.ts +47 -0
- package/dist/vendor/@jinn-network/plugin/dist/testing/in-memory-corpus.js +54 -0
- package/dist/vendor/@jinn-network/plugin/dist/testing/in-memory-evidence.d.ts +335 -0
- package/dist/vendor/@jinn-network/plugin/dist/testing/in-memory-evidence.js +23 -0
- package/dist/vendor/@jinn-network/plugin/dist/testing/in-memory-local-learning.d.ts +25 -0
- package/dist/vendor/@jinn-network/plugin/dist/testing/in-memory-local-learning.js +30 -0
- package/dist/vendor/@jinn-network/plugin/dist/testing/in-memory-skills.d.ts +9 -0
- package/dist/vendor/@jinn-network/plugin/dist/testing/in-memory-skills.js +16 -0
- package/dist/vendor/@jinn-network/plugin/dist/testing.d.ts +6 -0
- package/dist/vendor/@jinn-network/plugin/dist/testing.js +8 -0
- package/dist/vendor/@jinn-network/plugin/dist/visibility.d.ts +7 -0
- package/dist/vendor/@jinn-network/plugin/dist/visibility.js +9 -0
- package/dist/vendor/@jinn-network/plugin/package.json +22 -0
- package/dist/vendor/@jinn-network/sdk/dist/checkpoint.d.ts +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/checkpoint.js +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/contracts.d.ts +3 -2
- package/dist/vendor/@jinn-network/sdk/dist/contracts.js +49 -0
- package/dist/vendor/@jinn-network/sdk/dist/jinn-repo.d.ts +214 -0
- package/dist/vendor/@jinn-network/sdk/dist/jinn-repo.js +75 -0
- package/dist/vendor/@jinn-network/sdk/dist/json-schema.d.ts +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/json-schema.js +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/payloads/jinn-repo.d.ts +140 -0
- package/dist/vendor/@jinn-network/sdk/dist/payloads/jinn-repo.js +52 -0
- package/dist/vendor/@jinn-network/sdk/dist/payloads/prediction-v1.d.ts +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/payloads/prediction-v1.js +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/payloads/session-derived.d.ts +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/payloads/session-derived.js +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/payloads/swe-rebench-v2.d.ts +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/payloads/swe-rebench-v2.js +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/prediction-v1.d.ts +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/prediction-v1.js +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/jinn-repo.d.ts +4 -0
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/jinn-repo.js +2 -0
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/manifest-schema.d.ts +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/manifest-schema.js +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/swe-rebench-v2.d.ts +34 -6
- package/dist/vendor/@jinn-network/sdk/dist/swe-rebench-v2.js +28 -5
- package/dist/vendor/@jinn-network/sdk/package.json +5 -1
- package/node_modules/@jinn-network/core/dist/canonical-json.d.ts +1 -0
- package/node_modules/@jinn-network/core/dist/canonical-json.js +67 -0
- package/node_modules/@jinn-network/core/dist/captured-task.d.ts +140 -0
- package/node_modules/@jinn-network/core/dist/captured-task.js +122 -0
- package/node_modules/@jinn-network/core/dist/contribution-store.d.ts +97 -0
- package/node_modules/@jinn-network/core/dist/contribution-store.js +770 -0
- package/node_modules/@jinn-network/core/dist/corpus-read/acquire.d.ts +39 -0
- package/node_modules/@jinn-network/core/dist/corpus-read/acquire.js +212 -0
- package/node_modules/@jinn-network/core/dist/corpus-read/cache.d.ts +14 -0
- package/node_modules/@jinn-network/core/dist/corpus-read/cache.js +17 -0
- package/node_modules/@jinn-network/core/dist/corpus-read/capture-meta.d.ts +16 -0
- package/node_modules/@jinn-network/core/dist/corpus-read/capture-meta.js +18 -0
- package/node_modules/@jinn-network/core/dist/corpus-read/create-corpus.d.ts +2 -0
- package/node_modules/@jinn-network/core/dist/corpus-read/create-corpus.js +97 -0
- package/node_modules/@jinn-network/core/dist/corpus-read/fetch-artifact.d.ts +21 -0
- package/node_modules/@jinn-network/core/dist/corpus-read/fetch-artifact.js +32 -0
- package/node_modules/@jinn-network/core/dist/corpus-read/fetch.d.ts +12 -0
- package/node_modules/@jinn-network/core/dist/corpus-read/fetch.js +24 -0
- package/node_modules/@jinn-network/core/dist/corpus-read/http-discovery.d.ts +9 -0
- package/node_modules/@jinn-network/core/dist/corpus-read/http-discovery.js +128 -0
- package/node_modules/@jinn-network/core/dist/corpus-read/index.d.ts +10 -0
- package/node_modules/@jinn-network/core/dist/corpus-read/index.js +10 -0
- package/node_modules/@jinn-network/core/dist/corpus-read/ipfs.d.ts +5 -0
- package/node_modules/@jinn-network/core/dist/corpus-read/ipfs.js +72 -0
- package/node_modules/@jinn-network/core/dist/corpus-read/route-resolver.d.ts +16 -0
- package/node_modules/@jinn-network/core/dist/corpus-read/route-resolver.js +19 -0
- package/node_modules/@jinn-network/core/dist/corpus-read/types.d.ts +177 -0
- package/node_modules/@jinn-network/core/dist/corpus-read/types.js +42 -0
- package/node_modules/@jinn-network/core/dist/envelope.d.ts +134 -0
- package/node_modules/@jinn-network/core/dist/envelope.js +162 -0
- package/node_modules/@jinn-network/core/dist/evidence-adapter.d.ts +26 -0
- package/node_modules/@jinn-network/core/dist/evidence-adapter.js +321 -0
- package/node_modules/@jinn-network/core/dist/evidence-filesystem.d.ts +40 -0
- package/node_modules/@jinn-network/core/dist/evidence-filesystem.js +267 -0
- package/node_modules/@jinn-network/core/dist/evidence-index.d.ts +117 -0
- package/node_modules/@jinn-network/core/dist/evidence-index.js +1083 -0
- package/node_modules/@jinn-network/core/dist/evidence-store-lock.d.ts +2 -0
- package/node_modules/@jinn-network/core/dist/evidence-store-lock.js +208 -0
- package/node_modules/@jinn-network/core/dist/execution-envelope.d.ts +3142 -0
- package/node_modules/@jinn-network/core/dist/execution-envelope.js +203 -0
- package/node_modules/@jinn-network/core/dist/index.d.ts +12 -0
- package/node_modules/@jinn-network/core/dist/index.js +12 -0
- package/node_modules/@jinn-network/core/dist/manifest.d.ts +75 -0
- package/node_modules/@jinn-network/core/dist/manifest.js +184 -0
- package/node_modules/@jinn-network/core/dist/paired.d.ts +68 -0
- package/node_modules/@jinn-network/core/dist/paired.js +92 -0
- package/node_modules/@jinn-network/core/dist/scrub/build.d.ts +55 -0
- package/node_modules/@jinn-network/core/dist/scrub/build.js +87 -0
- package/node_modules/@jinn-network/core/dist/scrub/emit-scrub.d.ts +41 -0
- package/node_modules/@jinn-network/core/dist/scrub/emit-scrub.js +87 -0
- package/node_modules/@jinn-network/core/dist/scrub/index.d.ts +12 -0
- package/node_modules/@jinn-network/core/dist/scrub/index.js +12 -0
- package/node_modules/@jinn-network/core/dist/scrub/key-policy.d.ts +20 -0
- package/node_modules/@jinn-network/core/dist/scrub/key-policy.js +42 -0
- package/node_modules/@jinn-network/core/dist/scrub/layer2.d.ts +24 -0
- package/node_modules/@jinn-network/core/dist/scrub/layer2.js +33 -0
- package/node_modules/@jinn-network/core/dist/scrub/ml-pii-stage.d.ts +24 -0
- package/node_modules/@jinn-network/core/dist/scrub/ml-pii-stage.js +42 -0
- package/node_modules/@jinn-network/core/dist/scrub/openredaction-stage.d.ts +196 -0
- package/node_modules/@jinn-network/core/dist/scrub/openredaction-stage.js +270 -0
- package/node_modules/@jinn-network/core/dist/scrub/pii-build.d.ts +38 -0
- package/node_modules/@jinn-network/core/dist/scrub/pii-build.js +67 -0
- package/node_modules/@jinn-network/core/dist/scrub/pipeline.d.ts +38 -0
- package/node_modules/@jinn-network/core/dist/scrub/pipeline.js +83 -0
- package/node_modules/@jinn-network/core/dist/scrub/plain-patterns-stage.d.ts +42 -0
- package/node_modules/@jinn-network/core/dist/scrub/plain-patterns-stage.js +114 -0
- package/node_modules/@jinn-network/core/dist/scrub/secretlint-stage.d.ts +36 -0
- package/node_modules/@jinn-network/core/dist/scrub/secretlint-stage.js +249 -0
- package/node_modules/@jinn-network/core/dist/scrub/transformers-detector.d.ts +35 -0
- package/node_modules/@jinn-network/core/dist/scrub/transformers-detector.js +67 -0
- package/node_modules/@jinn-network/core/dist/scrub/types.d.ts +25 -0
- package/node_modules/@jinn-network/core/dist/scrub/types.js +1 -0
- package/node_modules/@jinn-network/core/dist/session-provenance.d.ts +75 -0
- package/node_modules/@jinn-network/core/dist/session-provenance.js +20 -0
- package/node_modules/@jinn-network/core/dist/skill-artifact.d.ts +442 -0
- package/node_modules/@jinn-network/core/dist/skill-artifact.js +136 -0
- package/node_modules/@jinn-network/core/dist/trajectory/hash-chain.d.ts +18 -0
- package/node_modules/@jinn-network/core/dist/trajectory/hash-chain.js +47 -0
- package/node_modules/@jinn-network/core/dist/trajectory/index.d.ts +4 -0
- package/node_modules/@jinn-network/core/dist/trajectory/index.js +4 -0
- package/node_modules/@jinn-network/core/dist/trajectory/schema.d.ts +606 -0
- package/node_modules/@jinn-network/core/dist/trajectory/schema.js +110 -0
- package/node_modules/@jinn-network/core/dist/trajectory/transcript-parsers/aider-history.d.ts +42 -0
- package/node_modules/@jinn-network/core/dist/trajectory/transcript-parsers/aider-history.js +181 -0
- package/node_modules/@jinn-network/core/dist/trajectory/transcript-parsers/claude-code-jsonl.d.ts +37 -0
- package/node_modules/@jinn-network/core/dist/trajectory/transcript-parsers/claude-code-jsonl.js +142 -0
- package/node_modules/@jinn-network/core/dist/trajectory/transcript-parsers/codex-session.d.ts +42 -0
- package/node_modules/@jinn-network/core/dist/trajectory/transcript-parsers/codex-session.js +235 -0
- package/node_modules/@jinn-network/core/dist/trajectory/transcript-parsers/continue-devdata.d.ts +41 -0
- package/node_modules/@jinn-network/core/dist/trajectory/transcript-parsers/continue-devdata.js +190 -0
- package/node_modules/@jinn-network/core/dist/trajectory/transcript-parsers/cursor-sqlite.d.ts +38 -0
- package/node_modules/@jinn-network/core/dist/trajectory/transcript-parsers/cursor-sqlite.js +118 -0
- package/node_modules/@jinn-network/core/dist/trajectory/transcript-parsers/gemini-session.d.ts +35 -0
- package/node_modules/@jinn-network/core/dist/trajectory/transcript-parsers/gemini-session.js +137 -0
- package/node_modules/@jinn-network/core/dist/trajectory/transcript-parsers/index.d.ts +7 -0
- package/node_modules/@jinn-network/core/dist/trajectory/transcript-parsers/index.js +7 -0
- package/node_modules/@jinn-network/core/dist/trajectory/transcript-parsers/types.d.ts +101 -0
- package/node_modules/@jinn-network/core/dist/trajectory/transcript-parsers/types.js +32 -0
- package/node_modules/@jinn-network/core/dist/trajectory/transcript-to-spans/attrs.d.ts +4 -0
- package/node_modules/@jinn-network/core/dist/trajectory/transcript-to-spans/attrs.js +30 -0
- package/node_modules/@jinn-network/core/dist/trajectory/transcript-to-spans/claude-code-stream-json.d.ts +8 -0
- package/node_modules/@jinn-network/core/dist/trajectory/transcript-to-spans/claude-code-stream-json.js +162 -0
- package/node_modules/@jinn-network/core/dist/trajectory/transcript-to-spans/codex-exec-json.d.ts +8 -0
- package/node_modules/@jinn-network/core/dist/trajectory/transcript-to-spans/codex-exec-json.js +253 -0
- package/node_modules/@jinn-network/core/dist/trajectory/transcript-to-spans/index.d.ts +4 -0
- package/node_modules/@jinn-network/core/dist/trajectory/transcript-to-spans/index.js +4 -0
- package/node_modules/@jinn-network/core/dist/trajectory/transcript-to-spans/types.d.ts +18 -0
- package/node_modules/@jinn-network/core/dist/trajectory/transcript-to-spans/types.js +1 -0
- package/node_modules/@jinn-network/core/dist/window.d.ts +12 -0
- package/node_modules/@jinn-network/core/dist/window.js +5 -0
- package/node_modules/@jinn-network/core/package.json +61 -0
- package/node_modules/@jinn-network/plugin/dist/eligibility.d.ts +12 -0
- package/node_modules/@jinn-network/plugin/dist/eligibility.js +12 -0
- package/node_modules/@jinn-network/plugin/dist/history.d.ts +35 -0
- package/node_modules/@jinn-network/plugin/dist/history.js +140 -0
- package/node_modules/@jinn-network/plugin/dist/index.d.ts +32 -0
- package/node_modules/@jinn-network/plugin/dist/index.js +15 -0
- package/node_modules/@jinn-network/plugin/dist/outcome.d.ts +26 -0
- package/node_modules/@jinn-network/plugin/dist/outcome.js +23 -0
- package/node_modules/@jinn-network/plugin/dist/pickup.d.ts +101 -0
- package/node_modules/@jinn-network/plugin/dist/pickup.js +354 -0
- package/node_modules/@jinn-network/plugin/dist/plugin.d.ts +157 -0
- package/node_modules/@jinn-network/plugin/dist/plugin.js +586 -0
- package/node_modules/@jinn-network/plugin/dist/ports/contribution-port.d.ts +53 -0
- package/node_modules/@jinn-network/plugin/dist/ports/contribution-port.js +14 -0
- package/node_modules/@jinn-network/plugin/dist/ports/corpus-port.d.ts +63 -0
- package/node_modules/@jinn-network/plugin/dist/ports/corpus-port.js +1 -0
- package/node_modules/@jinn-network/plugin/dist/ports/evidence-port.d.ts +17 -0
- package/node_modules/@jinn-network/plugin/dist/ports/evidence-port.js +1 -0
- package/node_modules/@jinn-network/plugin/dist/ports/local-learning-port.d.ts +22 -0
- package/node_modules/@jinn-network/plugin/dist/ports/local-learning-port.js +1 -0
- package/node_modules/@jinn-network/plugin/dist/ports/skills-port.d.ts +12 -0
- package/node_modules/@jinn-network/plugin/dist/ports/skills-port.js +1 -0
- package/node_modules/@jinn-network/plugin/dist/schemas/contribution-candidate.d.ts +116 -0
- package/node_modules/@jinn-network/plugin/dist/schemas/contribution-candidate.js +63 -0
- package/node_modules/@jinn-network/plugin/dist/schemas/eligibility-verdict.d.ts +8 -0
- package/node_modules/@jinn-network/plugin/dist/schemas/eligibility-verdict.js +7 -0
- package/node_modules/@jinn-network/plugin/dist/schemas/episode.d.ts +432 -0
- package/node_modules/@jinn-network/plugin/dist/schemas/episode.js +452 -0
- package/node_modules/@jinn-network/plugin/dist/schemas/history-entry.d.ts +40 -0
- package/node_modules/@jinn-network/plugin/dist/schemas/history-entry.js +30 -0
- package/node_modules/@jinn-network/plugin/dist/schemas/knowledge-hit.d.ts +27 -0
- package/node_modules/@jinn-network/plugin/dist/schemas/knowledge-hit.js +23 -0
- package/node_modules/@jinn-network/plugin/dist/schemas/knowledge-packet.d.ts +79 -0
- package/node_modules/@jinn-network/plugin/dist/schemas/knowledge-packet.js +213 -0
- package/node_modules/@jinn-network/plugin/dist/schemas/pickup-config.d.ts +20 -0
- package/node_modules/@jinn-network/plugin/dist/schemas/pickup-config.js +34 -0
- package/node_modules/@jinn-network/plugin/dist/schemas/session-summary.d.ts +17 -0
- package/node_modules/@jinn-network/plugin/dist/schemas/session-summary.js +19 -0
- package/node_modules/@jinn-network/plugin/dist/testing/contract-kits.d.ts +12 -0
- package/node_modules/@jinn-network/plugin/dist/testing/contract-kits.js +201 -0
- package/node_modules/@jinn-network/plugin/dist/testing/in-memory-contribution.d.ts +93 -0
- package/node_modules/@jinn-network/plugin/dist/testing/in-memory-contribution.js +104 -0
- package/node_modules/@jinn-network/plugin/dist/testing/in-memory-corpus.d.ts +47 -0
- package/node_modules/@jinn-network/plugin/dist/testing/in-memory-corpus.js +54 -0
- package/node_modules/@jinn-network/plugin/dist/testing/in-memory-evidence.d.ts +335 -0
- package/node_modules/@jinn-network/plugin/dist/testing/in-memory-evidence.js +23 -0
- package/node_modules/@jinn-network/plugin/dist/testing/in-memory-local-learning.d.ts +25 -0
- package/node_modules/@jinn-network/plugin/dist/testing/in-memory-local-learning.js +30 -0
- package/node_modules/@jinn-network/plugin/dist/testing/in-memory-skills.d.ts +9 -0
- package/node_modules/@jinn-network/plugin/dist/testing/in-memory-skills.js +16 -0
- package/node_modules/@jinn-network/plugin/dist/testing.d.ts +6 -0
- package/node_modules/@jinn-network/plugin/dist/testing.js +8 -0
- package/node_modules/@jinn-network/plugin/dist/visibility.d.ts +7 -0
- package/node_modules/@jinn-network/plugin/dist/visibility.js +9 -0
- package/node_modules/@jinn-network/plugin/package.json +50 -0
- package/node_modules/@jinn-network/plugin/process-contract.json +8 -0
- package/package.json +60 -18
- package/plugins/jinn-repo-runtime/.claude-plugin/plugin.json +5 -0
- package/plugins/jinn-repo-runtime/.codex-plugin/plugin.json +39 -0
- package/plugins/jinn-repo-runtime/README.md +27 -0
- package/plugins/jinn-repo-runtime/hooks/hooks.json +16 -0
- package/plugins/jinn-repo-runtime/hooks/session-start +73 -0
- package/plugins/jinn-repo-runtime/jinn.plugin.json +11 -0
- package/plugins/jinn-repo-runtime/skills/task/SKILL.md +92 -0
- package/skills/jinn-operator/SKILL.md +29 -15
- package/deployments/deployment-jinn-mvi-l1-sepolia-fast.json +0 -55
- package/deployments/deployment-jinn-mvi-l1-sepolia.json +0 -55
- package/deployments/deployment-jinn-mvi-l2-baseSepolia.json +0 -13
- package/deployments/deployment-jinn-testnet-faucet-baseSepolia-fast.json +0 -15
- package/dist/api/peers.js.map +0 -1
- package/dist/daemon/jinn-claim-loop-canonical.d.ts +0 -207
- package/dist/daemon/jinn-claim-loop-canonical.js +0 -296
- package/dist/daemon/jinn-claim-loop-canonical.js.map +0 -1
- package/dist/daemon/jinn-claim-loop-mock.d.ts +0 -61
- package/dist/daemon/jinn-claim-loop-mock.js +0 -122
- package/dist/daemon/jinn-claim-loop-mock.js.map +0 -1
- package/dist/daemon/jinn-claim-loop-wiring.d.ts +0 -33
- package/dist/daemon/jinn-claim-loop-wiring.js +0 -40
- package/dist/daemon/jinn-claim-loop-wiring.js.map +0 -1
- package/dist/daemon/jinn-claim-loop.d.ts +0 -130
- package/dist/daemon/jinn-claim-loop.js +0 -328
- package/dist/daemon/jinn-claim-loop.js.map +0 -1
- package/dist/dashboard/assets/index-BVAWkLwY.css +0 -1
- package/dist/dashboard/assets/index-DEPqtGOA.js +0 -167
- package/dist/earning/jinn-rewards.js.map +0 -1
- package/dist/scripts/donation-consumption-acceptance.d.ts +0 -85
- package/dist/scripts/donation-consumption-acceptance.js +0 -1382
- package/dist/scripts/donation-consumption-acceptance.js.map +0 -1
- package/dist/x402/acquire.d.ts +0 -17
- package/dist/x402/acquire.js +0 -49
- package/dist/x402/acquire.js.map +0 -1
- package/dist/x402/facilitator.d.ts +0 -11
- package/dist/x402/facilitator.js +0 -52
- package/dist/x402/facilitator.js.map +0 -1
- package/dist/x402/handler.d.ts +0 -27
- package/dist/x402/handler.js +0 -236
- package/dist/x402/handler.js.map +0 -1
- /package/dist/{api/peers.d.ts → daemon/peer-sync.d.ts} +0 -0
|
@@ -0,0 +1,770 @@
|
|
|
1
|
+
import { access, chmod, link, mkdir, open, readdir, readFile, rename, rm, stat, writeFile, } from 'node:fs/promises';
|
|
2
|
+
import { randomUUID } from 'node:crypto';
|
|
3
|
+
import { homedir } from 'node:os';
|
|
4
|
+
import { dirname, join, resolve as resolvePath } from 'node:path';
|
|
5
|
+
import { ContributionCandidateV1Schema, ContributionCandidateV1ProjectionSchema, EpisodeV1Schema, } from '../../plugin/dist/index.js';
|
|
6
|
+
import { fsyncDirectory } from './evidence-filesystem.js';
|
|
7
|
+
export const CONTRIBUTION_STORE_SCHEMA_VERSION = 'jinn.contribution-store.v3';
|
|
8
|
+
const CONTRIBUTION_STORE_V2_SCHEMA_VERSION = 'jinn.contribution-store.v2';
|
|
9
|
+
export const CONTRIBUTION_STORE_FILE = 'mineable-traces.json';
|
|
10
|
+
export const CONTRIBUTION_PUBLICATION_DISABLED_FILE = 'publication-disabled';
|
|
11
|
+
export const CONTRIBUTION_PUBLICATION_SCHEMA_VERSION = 'jinn.contribution-publication.v1';
|
|
12
|
+
export const DEFAULT_CONTRIBUTION_STATE_DIR = join(homedir(), '.jinn-client', 'mineable');
|
|
13
|
+
export function resolveContributionStateDir(env = process.env) {
|
|
14
|
+
const configured = env.JINN_MINEABLE_STATE_DIR?.trim();
|
|
15
|
+
return configured || DEFAULT_CONTRIBUTION_STATE_DIR;
|
|
16
|
+
}
|
|
17
|
+
const DEFAULT_LOCK = {
|
|
18
|
+
retryDelayMs: 20,
|
|
19
|
+
maxRetries: 50,
|
|
20
|
+
staleAfterMs: 120_000,
|
|
21
|
+
};
|
|
22
|
+
const localLockTails = new Map();
|
|
23
|
+
function sleep(ms) {
|
|
24
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
25
|
+
}
|
|
26
|
+
function nodeErrorCode(error) {
|
|
27
|
+
return error && typeof error === 'object' && 'code' in error
|
|
28
|
+
? String(error.code)
|
|
29
|
+
: undefined;
|
|
30
|
+
}
|
|
31
|
+
function freshStore() {
|
|
32
|
+
return { schemaVersion: CONTRIBUTION_STORE_SCHEMA_VERSION, records: Object.create(null) };
|
|
33
|
+
}
|
|
34
|
+
function contributionRecordMap(entries) {
|
|
35
|
+
const records = Object.create(null);
|
|
36
|
+
for (const [recordId, record] of entries)
|
|
37
|
+
records[recordId] = record;
|
|
38
|
+
return records;
|
|
39
|
+
}
|
|
40
|
+
function ownRecord(file, recordId) {
|
|
41
|
+
return Object.prototype.hasOwnProperty.call(file.records, recordId)
|
|
42
|
+
? file.records[recordId]
|
|
43
|
+
: undefined;
|
|
44
|
+
}
|
|
45
|
+
function optionalNonEmptyString(value, field) {
|
|
46
|
+
if (value === undefined)
|
|
47
|
+
return undefined;
|
|
48
|
+
if (typeof value !== 'string' || value.length === 0) {
|
|
49
|
+
throw new Error(`invalid contribution store ${field}`);
|
|
50
|
+
}
|
|
51
|
+
return value;
|
|
52
|
+
}
|
|
53
|
+
function parseLocalState(value) {
|
|
54
|
+
if (value === 'recorded' || value === 'minted' || value === 'rejected')
|
|
55
|
+
return value;
|
|
56
|
+
throw new Error(`invalid contribution local state: ${String(value)}`);
|
|
57
|
+
}
|
|
58
|
+
function parsePublicationState(value) {
|
|
59
|
+
if (value === 'disabled' ||
|
|
60
|
+
value === 'preview-required' ||
|
|
61
|
+
value === 'queued' ||
|
|
62
|
+
value === 'published' ||
|
|
63
|
+
value === 'vetoed')
|
|
64
|
+
return value;
|
|
65
|
+
throw new Error(`invalid contribution publication state: ${String(value)}`);
|
|
66
|
+
}
|
|
67
|
+
function parseRecord(recordId, value) {
|
|
68
|
+
if (!value || typeof value !== 'object')
|
|
69
|
+
throw new Error(`invalid contribution record ${recordId}`);
|
|
70
|
+
const raw = value;
|
|
71
|
+
if (raw['recordId'] !== recordId)
|
|
72
|
+
throw new Error(`contribution record key/id mismatch: ${recordId}`);
|
|
73
|
+
const allowed = new Set([
|
|
74
|
+
'recordId',
|
|
75
|
+
'localState',
|
|
76
|
+
'publicationState',
|
|
77
|
+
'mintRef',
|
|
78
|
+
'publicationRef',
|
|
79
|
+
'rejectionReason',
|
|
80
|
+
]);
|
|
81
|
+
const unknown = Object.keys(raw).filter((key) => !allowed.has(key));
|
|
82
|
+
if (unknown.length > 0) {
|
|
83
|
+
throw new Error(`invalid contribution record ${recordId}: unexpected fields ${unknown.join(', ')}`);
|
|
84
|
+
}
|
|
85
|
+
const mintRef = optionalNonEmptyString(raw['mintRef'], 'mintRef');
|
|
86
|
+
const publicationRef = optionalNonEmptyString(raw['publicationRef'], 'publicationRef');
|
|
87
|
+
const rejectionReason = optionalNonEmptyString(raw['rejectionReason'], 'rejectionReason');
|
|
88
|
+
return {
|
|
89
|
+
recordId,
|
|
90
|
+
localState: parseLocalState(raw['localState']),
|
|
91
|
+
publicationState: parsePublicationState(raw['publicationState']),
|
|
92
|
+
...(mintRef ? { mintRef } : {}),
|
|
93
|
+
...(publicationRef ? { publicationRef } : {}),
|
|
94
|
+
...(rejectionReason ? { rejectionReason } : {}),
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
function parseV3File(raw) {
|
|
98
|
+
if (!raw || typeof raw !== 'object')
|
|
99
|
+
throw new Error('invalid contribution store: expected object');
|
|
100
|
+
const value = raw;
|
|
101
|
+
if (value['schemaVersion'] !== CONTRIBUTION_STORE_SCHEMA_VERSION) {
|
|
102
|
+
throw new Error(`unsupported contribution store schema: ${String(value['schemaVersion'])}`);
|
|
103
|
+
}
|
|
104
|
+
if (!value['records'] || typeof value['records'] !== 'object' || Array.isArray(value['records'])) {
|
|
105
|
+
throw new Error('invalid contribution store records');
|
|
106
|
+
}
|
|
107
|
+
const previewAt = optionalNonEmptyString(value['firstSharePreviewAcknowledgedAt'], 'firstSharePreviewAcknowledgedAt');
|
|
108
|
+
return {
|
|
109
|
+
schemaVersion: CONTRIBUTION_STORE_SCHEMA_VERSION,
|
|
110
|
+
...(previewAt ? { firstSharePreviewAcknowledgedAt: previewAt } : {}),
|
|
111
|
+
records: contributionRecordMap(Object.entries(value['records'])
|
|
112
|
+
.map(([id, record]) => [id, parseRecord(id, record)])),
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
function migrateLegacyRecord(recordId, rawValue) {
|
|
116
|
+
if (!rawValue || typeof rawValue !== 'object')
|
|
117
|
+
throw new Error(`invalid v1 record ${recordId}`);
|
|
118
|
+
const raw = rawValue;
|
|
119
|
+
const sourceId = typeof raw['sourceId'] === 'string' && raw['sourceId'].length > 0
|
|
120
|
+
? raw['sourceId']
|
|
121
|
+
: recordId;
|
|
122
|
+
if (sourceId !== recordId) {
|
|
123
|
+
throw new Error(`v1 contribution record key/sourceId mismatch: ${recordId}`);
|
|
124
|
+
}
|
|
125
|
+
// Validate the payload before preserving it in the loss-safe backup only.
|
|
126
|
+
ContributionCandidateV1Schema.parse({
|
|
127
|
+
schemaVersion: 'jinn.contribution-candidate.v1',
|
|
128
|
+
sourceId,
|
|
129
|
+
repositorySlug: raw['repo'],
|
|
130
|
+
baseCommit: raw['baseCommit'],
|
|
131
|
+
acceptedDiff: raw['acceptedDiff'],
|
|
132
|
+
testRuns: Array.isArray(raw['testRuns']) ? raw['testRuns'].map((run) => {
|
|
133
|
+
const value = run;
|
|
134
|
+
return { command: value['command'] ?? value['cmd'], exitCode: value['exitCode'], at: value['at'] };
|
|
135
|
+
}) : [],
|
|
136
|
+
intermediateFailureDiffs: Array.isArray(raw['intermediateFailureDiffs'])
|
|
137
|
+
? raw['intermediateFailureDiffs']
|
|
138
|
+
: [],
|
|
139
|
+
skillEvents: Array.isArray(raw['skillEvents']) ? raw['skillEvents'].map((event) => {
|
|
140
|
+
const value = event;
|
|
141
|
+
return { skillRef: value['skillRef'] ?? value['skill'], action: value['action'] };
|
|
142
|
+
}) : [],
|
|
143
|
+
// Legacy consent never becomes durable v2 publication authorization.
|
|
144
|
+
publishMinedTasksConsent: false,
|
|
145
|
+
createdAt: raw['createdAt'],
|
|
146
|
+
});
|
|
147
|
+
const processed = raw['mined'] === true;
|
|
148
|
+
return {
|
|
149
|
+
recordId,
|
|
150
|
+
localState: processed ? 'rejected' : 'recorded',
|
|
151
|
+
publicationState: 'disabled',
|
|
152
|
+
...(processed ? { rejectionReason: 'legacy-processed-unavailable' } : {}),
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
function migrateV1File(raw) {
|
|
156
|
+
if (!raw || typeof raw !== 'object')
|
|
157
|
+
throw new Error('invalid v1 mineable store: expected object');
|
|
158
|
+
const value = raw;
|
|
159
|
+
if (value['schemaVersion'] !== 'mineable-trace-store.v1') {
|
|
160
|
+
throw new Error(`unsupported contribution store schema: ${String(value['schemaVersion'])}`);
|
|
161
|
+
}
|
|
162
|
+
if (!value['records'] || typeof value['records'] !== 'object' || Array.isArray(value['records'])) {
|
|
163
|
+
throw new Error('invalid v1 mineable store records');
|
|
164
|
+
}
|
|
165
|
+
return {
|
|
166
|
+
schemaVersion: CONTRIBUTION_STORE_SCHEMA_VERSION,
|
|
167
|
+
records: contributionRecordMap(Object.entries(value['records'])
|
|
168
|
+
.map(([id, record]) => [id, migrateLegacyRecord(id, record)])),
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
function migrateV2Record(recordId, rawValue) {
|
|
172
|
+
if (!rawValue || typeof rawValue !== 'object')
|
|
173
|
+
throw new Error(`invalid v2 record ${recordId}`);
|
|
174
|
+
const raw = rawValue;
|
|
175
|
+
if (raw['recordId'] !== recordId) {
|
|
176
|
+
throw new Error(`v2 contribution record key/id mismatch: ${recordId}`);
|
|
177
|
+
}
|
|
178
|
+
const candidate = ContributionCandidateV1Schema.parse(raw['candidate']);
|
|
179
|
+
if (candidate.sourceId !== recordId) {
|
|
180
|
+
throw new Error(`v2 contribution record key/sourceId mismatch: ${recordId}`);
|
|
181
|
+
}
|
|
182
|
+
const publicationState = parsePublicationState(raw['publicationState']);
|
|
183
|
+
const mintRef = optionalNonEmptyString(raw['mintRef'], 'mintRef');
|
|
184
|
+
const publicationRef = optionalNonEmptyString(raw['publicationRef'], 'publicationRef');
|
|
185
|
+
const rejectionReason = optionalNonEmptyString(raw['rejectionReason'], 'rejectionReason');
|
|
186
|
+
return {
|
|
187
|
+
recordId,
|
|
188
|
+
localState: parseLocalState(raw['localState']),
|
|
189
|
+
publicationState: publicationState === 'preview-required' || publicationState === 'queued'
|
|
190
|
+
? 'disabled'
|
|
191
|
+
: publicationState,
|
|
192
|
+
...(mintRef ? { mintRef } : {}),
|
|
193
|
+
...(publicationRef ? { publicationRef } : {}),
|
|
194
|
+
...(rejectionReason ? { rejectionReason } : {}),
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
function migrateV2File(raw) {
|
|
198
|
+
if (!raw || typeof raw !== 'object')
|
|
199
|
+
throw new Error('invalid v2 contribution store: expected object');
|
|
200
|
+
const value = raw;
|
|
201
|
+
if (value['schemaVersion'] !== CONTRIBUTION_STORE_V2_SCHEMA_VERSION) {
|
|
202
|
+
throw new Error(`unsupported contribution store schema: ${String(value['schemaVersion'])}`);
|
|
203
|
+
}
|
|
204
|
+
if (!value['records'] || typeof value['records'] !== 'object' || Array.isArray(value['records'])) {
|
|
205
|
+
throw new Error('invalid v2 contribution store records');
|
|
206
|
+
}
|
|
207
|
+
const previewAt = optionalNonEmptyString(value['firstSharePreviewAcknowledgedAt'], 'firstSharePreviewAcknowledgedAt');
|
|
208
|
+
return {
|
|
209
|
+
schemaVersion: CONTRIBUTION_STORE_SCHEMA_VERSION,
|
|
210
|
+
...(previewAt ? { firstSharePreviewAcknowledgedAt: previewAt } : {}),
|
|
211
|
+
records: contributionRecordMap(Object.entries(value['records'])
|
|
212
|
+
.map(([id, record]) => [id, migrateV2Record(id, record)])),
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Cacheless, cross-process-safe contribution store. Every mutation acquires a
|
|
217
|
+
* mkdir-based lock and performs a fresh read-modify-atomic-rename cycle.
|
|
218
|
+
*/
|
|
219
|
+
export class ContributionStore {
|
|
220
|
+
filePath;
|
|
221
|
+
lockPath;
|
|
222
|
+
publicationLockPath;
|
|
223
|
+
publicationDisabledPath;
|
|
224
|
+
lock;
|
|
225
|
+
publicationLock;
|
|
226
|
+
nowMs;
|
|
227
|
+
constructor(options) {
|
|
228
|
+
if (!options.filePath && !options.stateDir) {
|
|
229
|
+
throw new Error('ContributionStore requires stateDir or filePath');
|
|
230
|
+
}
|
|
231
|
+
this.filePath = resolvePath(options.filePath ?? join(options.stateDir, CONTRIBUTION_STORE_FILE));
|
|
232
|
+
this.lockPath = `${this.filePath}.lock`;
|
|
233
|
+
this.publicationLockPath = `${this.filePath}.publication.lock`;
|
|
234
|
+
this.publicationDisabledPath = join(dirname(this.filePath), CONTRIBUTION_PUBLICATION_DISABLED_FILE);
|
|
235
|
+
this.lock = { ...DEFAULT_LOCK, ...options.lock };
|
|
236
|
+
this.publicationLock = {
|
|
237
|
+
...DEFAULT_LOCK,
|
|
238
|
+
maxRetries: 3_000,
|
|
239
|
+
...options.publicationLock,
|
|
240
|
+
};
|
|
241
|
+
this.nowMs = options.nowMs ?? Date.now;
|
|
242
|
+
}
|
|
243
|
+
async tryRecoverStaleLock(lockPath, options) {
|
|
244
|
+
const recoveryPath = `${lockPath}.recovery`;
|
|
245
|
+
const recoveryOwner = await this.acquireRecoveryGuard(recoveryPath, options);
|
|
246
|
+
if (!recoveryOwner)
|
|
247
|
+
return false;
|
|
248
|
+
try {
|
|
249
|
+
let lockStat;
|
|
250
|
+
try {
|
|
251
|
+
lockStat = await stat(lockPath);
|
|
252
|
+
}
|
|
253
|
+
catch (error) {
|
|
254
|
+
if (nodeErrorCode(error) === 'ENOENT')
|
|
255
|
+
return true;
|
|
256
|
+
throw error;
|
|
257
|
+
}
|
|
258
|
+
if (this.nowMs() - lockStat.mtimeMs <= options.staleAfterMs)
|
|
259
|
+
return false;
|
|
260
|
+
let ownerAlive = false;
|
|
261
|
+
try {
|
|
262
|
+
const owner = JSON.parse(await readFile(join(lockPath, 'owner.json'), 'utf8'));
|
|
263
|
+
if (typeof owner.pid === 'number' && Number.isInteger(owner.pid)) {
|
|
264
|
+
try {
|
|
265
|
+
process.kill(owner.pid, 0);
|
|
266
|
+
ownerAlive = true;
|
|
267
|
+
}
|
|
268
|
+
catch (error) {
|
|
269
|
+
ownerAlive = nodeErrorCode(error) === 'EPERM';
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
catch {
|
|
274
|
+
// An ownerless stale directory is safe to recover while this exclusive
|
|
275
|
+
// recovery lock prevents a second contender deleting its successor.
|
|
276
|
+
}
|
|
277
|
+
if (ownerAlive)
|
|
278
|
+
return false;
|
|
279
|
+
await rm(lockPath, { recursive: true, force: true });
|
|
280
|
+
return true;
|
|
281
|
+
}
|
|
282
|
+
finally {
|
|
283
|
+
try {
|
|
284
|
+
await access(join(recoveryPath, recoveryOwner));
|
|
285
|
+
await rm(recoveryPath, { recursive: true, force: true });
|
|
286
|
+
}
|
|
287
|
+
catch {
|
|
288
|
+
// A guard may only disappear after a later stale owner claimed it.
|
|
289
|
+
// Never remove a recovery directory we can no longer prove is ours.
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
ownerProcessAlive(pid) {
|
|
294
|
+
try {
|
|
295
|
+
process.kill(pid, 0);
|
|
296
|
+
return true;
|
|
297
|
+
}
|
|
298
|
+
catch (error) {
|
|
299
|
+
return nodeErrorCode(error) === 'EPERM';
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
recoveryOwnerName(kind) {
|
|
303
|
+
return `${kind}.${Math.trunc(this.nowMs())}.${process.pid}.${randomUUID()}.json`;
|
|
304
|
+
}
|
|
305
|
+
recoveryOwnerMetadata(name) {
|
|
306
|
+
const match = /^(?:owner|claim)\.(-?\d+)\.(\d+)\.[0-9a-f-]+\.json$/u.exec(name);
|
|
307
|
+
if (!match)
|
|
308
|
+
return null;
|
|
309
|
+
const createdAtMs = Number(match[1]);
|
|
310
|
+
const pid = Number(match[2]);
|
|
311
|
+
return Number.isFinite(createdAtMs) && Number.isInteger(pid) ? { createdAtMs, pid } : null;
|
|
312
|
+
}
|
|
313
|
+
async acquireRecoveryGuard(recoveryPath, options) {
|
|
314
|
+
const ownerName = this.recoveryOwnerName('owner');
|
|
315
|
+
try {
|
|
316
|
+
await mkdir(recoveryPath, { mode: 0o700 });
|
|
317
|
+
await writeFile(join(recoveryPath, ownerName), '', { flag: 'wx', mode: 0o600 });
|
|
318
|
+
return ownerName;
|
|
319
|
+
}
|
|
320
|
+
catch (error) {
|
|
321
|
+
if (nodeErrorCode(error) !== 'EEXIST') {
|
|
322
|
+
// If mkdir succeeded but the owner write did not, leave an ownerless
|
|
323
|
+
// directory for the conservative stale protocol below.
|
|
324
|
+
throw error;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
let names;
|
|
328
|
+
try {
|
|
329
|
+
names = await readdir(recoveryPath);
|
|
330
|
+
}
|
|
331
|
+
catch (error) {
|
|
332
|
+
if (nodeErrorCode(error) === 'ENOENT')
|
|
333
|
+
return null;
|
|
334
|
+
throw error;
|
|
335
|
+
}
|
|
336
|
+
const namedOwner = names
|
|
337
|
+
.map((name) => ({ name, metadata: this.recoveryOwnerMetadata(name) }))
|
|
338
|
+
.find((entry) => entry.metadata !== null);
|
|
339
|
+
if (namedOwner?.metadata) {
|
|
340
|
+
if (this.nowMs() - namedOwner.metadata.createdAtMs <= options.staleAfterMs ||
|
|
341
|
+
this.ownerProcessAlive(namedOwner.metadata.pid))
|
|
342
|
+
return null;
|
|
343
|
+
const claimName = this.recoveryOwnerName('claim');
|
|
344
|
+
try {
|
|
345
|
+
await rename(join(recoveryPath, namedOwner.name), join(recoveryPath, claimName));
|
|
346
|
+
return claimName;
|
|
347
|
+
}
|
|
348
|
+
catch (error) {
|
|
349
|
+
if (nodeErrorCode(error) === 'ENOENT')
|
|
350
|
+
return null;
|
|
351
|
+
throw error;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
const ownerlessClaim = join(recoveryPath, 'ownerless.claim');
|
|
355
|
+
if (names.includes('ownerless.claim')) {
|
|
356
|
+
try {
|
|
357
|
+
const raw = JSON.parse(await readFile(ownerlessClaim, 'utf8'));
|
|
358
|
+
if (typeof raw.createdAtMs === 'number' &&
|
|
359
|
+
typeof raw.pid === 'number' &&
|
|
360
|
+
(this.nowMs() - raw.createdAtMs <= options.staleAfterMs || this.ownerProcessAlive(raw.pid)))
|
|
361
|
+
return null;
|
|
362
|
+
}
|
|
363
|
+
catch {
|
|
364
|
+
const claimStat = await stat(ownerlessClaim).catch(() => null);
|
|
365
|
+
if (claimStat && this.nowMs() - claimStat.mtimeMs <= options.staleAfterMs)
|
|
366
|
+
return null;
|
|
367
|
+
}
|
|
368
|
+
const claimName = this.recoveryOwnerName('claim');
|
|
369
|
+
try {
|
|
370
|
+
await rename(ownerlessClaim, join(recoveryPath, claimName));
|
|
371
|
+
return claimName;
|
|
372
|
+
}
|
|
373
|
+
catch (error) {
|
|
374
|
+
if (nodeErrorCode(error) === 'ENOENT')
|
|
375
|
+
return null;
|
|
376
|
+
throw error;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
const recoveryStat = await stat(recoveryPath).catch(() => null);
|
|
380
|
+
if (!recoveryStat || this.nowMs() - recoveryStat.mtimeMs <= options.staleAfterMs)
|
|
381
|
+
return null;
|
|
382
|
+
try {
|
|
383
|
+
await writeFile(ownerlessClaim, JSON.stringify({
|
|
384
|
+
createdAtMs: this.nowMs(),
|
|
385
|
+
pid: process.pid,
|
|
386
|
+
}), { flag: 'wx', mode: 0o600 });
|
|
387
|
+
return 'ownerless.claim';
|
|
388
|
+
}
|
|
389
|
+
catch (error) {
|
|
390
|
+
if (nodeErrorCode(error) === 'EEXIST')
|
|
391
|
+
return null;
|
|
392
|
+
throw error;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
async acquireLockAt(lockPath, options) {
|
|
396
|
+
const parent = dirname(this.filePath);
|
|
397
|
+
await mkdir(parent, { recursive: true, mode: 0o700 });
|
|
398
|
+
await chmod(parent, 0o700);
|
|
399
|
+
let retries = 0;
|
|
400
|
+
while (true) {
|
|
401
|
+
try {
|
|
402
|
+
const token = randomUUID();
|
|
403
|
+
await mkdir(lockPath, { mode: 0o700 });
|
|
404
|
+
try {
|
|
405
|
+
await writeFile(join(lockPath, 'owner.json'), JSON.stringify({ token, pid: process.pid }), { encoding: 'utf8', mode: 0o600 });
|
|
406
|
+
}
|
|
407
|
+
catch (ownerError) {
|
|
408
|
+
await rm(lockPath, { recursive: true, force: true });
|
|
409
|
+
throw ownerError;
|
|
410
|
+
}
|
|
411
|
+
return token;
|
|
412
|
+
}
|
|
413
|
+
catch (error) {
|
|
414
|
+
if (nodeErrorCode(error) !== 'EEXIST')
|
|
415
|
+
throw error;
|
|
416
|
+
if (await this.tryRecoverStaleLock(lockPath, options))
|
|
417
|
+
continue;
|
|
418
|
+
if (retries >= options.maxRetries) {
|
|
419
|
+
throw new Error(`contribution store lock acquisition failed after ${options.maxRetries} retries`);
|
|
420
|
+
}
|
|
421
|
+
retries += 1;
|
|
422
|
+
await sleep(options.retryDelayMs);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
async withLockAt(lockPath, options, operation) {
|
|
427
|
+
const previous = localLockTails.get(lockPath) ?? Promise.resolve();
|
|
428
|
+
let release;
|
|
429
|
+
const turn = new Promise((resolve) => { release = resolve; });
|
|
430
|
+
const tail = previous.catch(() => undefined).then(() => turn);
|
|
431
|
+
localLockTails.set(lockPath, tail);
|
|
432
|
+
await previous.catch(() => undefined);
|
|
433
|
+
try {
|
|
434
|
+
const token = await this.acquireLockAt(lockPath, options);
|
|
435
|
+
try {
|
|
436
|
+
return await operation();
|
|
437
|
+
}
|
|
438
|
+
finally {
|
|
439
|
+
try {
|
|
440
|
+
const owner = JSON.parse(await readFile(join(lockPath, 'owner.json'), 'utf8'));
|
|
441
|
+
if (owner.token === token)
|
|
442
|
+
await rm(lockPath, { recursive: true, force: true });
|
|
443
|
+
}
|
|
444
|
+
catch (error) {
|
|
445
|
+
// A missing/corrupt owner record is never permission to remove a lock
|
|
446
|
+
// we cannot prove is ours. Stale recovery handles it later.
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
finally {
|
|
451
|
+
release();
|
|
452
|
+
if (localLockTails.get(lockPath) === tail)
|
|
453
|
+
localLockTails.delete(lockPath);
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
async withLock(operation) {
|
|
457
|
+
return this.withLockAt(this.lockPath, this.lock, operation);
|
|
458
|
+
}
|
|
459
|
+
async withPublicationLock(operation) {
|
|
460
|
+
return this.withLockAt(this.publicationLockPath, this.publicationLock, operation);
|
|
461
|
+
}
|
|
462
|
+
async writeAtomic(file) {
|
|
463
|
+
const tmp = `${this.filePath}.${process.pid}.${this.nowMs()}.tmp`;
|
|
464
|
+
try {
|
|
465
|
+
await writeFile(tmp, `${JSON.stringify(file, null, 2)}\n`, { encoding: 'utf8', mode: 0o600 });
|
|
466
|
+
await rename(tmp, this.filePath);
|
|
467
|
+
await chmod(this.filePath, 0o600);
|
|
468
|
+
}
|
|
469
|
+
finally {
|
|
470
|
+
await rm(tmp, { force: true });
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
async preserveMigrationBackup(version, sourceText) {
|
|
474
|
+
const backupPath = `${this.filePath}.${version}.bak`;
|
|
475
|
+
const tempPath = `${backupPath}.${process.pid}.${randomUUID()}.tmp`;
|
|
476
|
+
let handle;
|
|
477
|
+
try {
|
|
478
|
+
handle = await open(tempPath, 'wx', 0o600);
|
|
479
|
+
await handle.writeFile(sourceText, 'utf8');
|
|
480
|
+
await handle.sync();
|
|
481
|
+
await handle.close();
|
|
482
|
+
handle = undefined;
|
|
483
|
+
await link(tempPath, backupPath);
|
|
484
|
+
fsyncDirectory(dirname(backupPath));
|
|
485
|
+
await rm(tempPath, { force: true });
|
|
486
|
+
fsyncDirectory(dirname(backupPath));
|
|
487
|
+
return;
|
|
488
|
+
}
|
|
489
|
+
catch (error) {
|
|
490
|
+
if (nodeErrorCode(error) !== 'EEXIST')
|
|
491
|
+
throw error;
|
|
492
|
+
}
|
|
493
|
+
finally {
|
|
494
|
+
await handle?.close().catch(() => undefined);
|
|
495
|
+
await rm(tempPath, { force: true });
|
|
496
|
+
}
|
|
497
|
+
const existing = await readFile(backupPath, 'utf8');
|
|
498
|
+
if (existing !== sourceText) {
|
|
499
|
+
throw new Error(`existing contribution store ${version} backup does not match active store; refusing migration`);
|
|
500
|
+
}
|
|
501
|
+
const existingHandle = await open(backupPath, 'r+');
|
|
502
|
+
try {
|
|
503
|
+
await existingHandle.chmod(0o600);
|
|
504
|
+
await existingHandle.sync();
|
|
505
|
+
}
|
|
506
|
+
finally {
|
|
507
|
+
await existingHandle.close();
|
|
508
|
+
}
|
|
509
|
+
fsyncDirectory(dirname(backupPath));
|
|
510
|
+
}
|
|
511
|
+
async loadUnlocked() {
|
|
512
|
+
let text;
|
|
513
|
+
try {
|
|
514
|
+
text = await readFile(this.filePath, 'utf8');
|
|
515
|
+
await chmod(this.filePath, 0o600);
|
|
516
|
+
}
|
|
517
|
+
catch (error) {
|
|
518
|
+
if (nodeErrorCode(error) === 'ENOENT')
|
|
519
|
+
return freshStore();
|
|
520
|
+
throw error;
|
|
521
|
+
}
|
|
522
|
+
const raw = JSON.parse(text);
|
|
523
|
+
const schemaVersion = raw && typeof raw === 'object'
|
|
524
|
+
? raw['schemaVersion']
|
|
525
|
+
: undefined;
|
|
526
|
+
if (schemaVersion === 'mineable-trace-store.v1') {
|
|
527
|
+
await this.preserveMigrationBackup('v1', text);
|
|
528
|
+
const migrated = migrateV1File(raw);
|
|
529
|
+
await this.writeAtomic(migrated);
|
|
530
|
+
return migrated;
|
|
531
|
+
}
|
|
532
|
+
if (schemaVersion === CONTRIBUTION_STORE_V2_SCHEMA_VERSION) {
|
|
533
|
+
await this.preserveMigrationBackup('v2', text);
|
|
534
|
+
const migrated = migrateV2File(raw);
|
|
535
|
+
await this.writeAtomic(migrated);
|
|
536
|
+
return migrated;
|
|
537
|
+
}
|
|
538
|
+
return parseV3File(raw);
|
|
539
|
+
}
|
|
540
|
+
async mutate(operation) {
|
|
541
|
+
return this.withLock(async () => {
|
|
542
|
+
const file = await this.loadUnlocked();
|
|
543
|
+
const result = operation(file);
|
|
544
|
+
await this.writeAtomic(file);
|
|
545
|
+
return result;
|
|
546
|
+
});
|
|
547
|
+
}
|
|
548
|
+
async publicationDisabledUnlocked() {
|
|
549
|
+
try {
|
|
550
|
+
await access(this.publicationDisabledPath);
|
|
551
|
+
return true;
|
|
552
|
+
}
|
|
553
|
+
catch (error) {
|
|
554
|
+
if (nodeErrorCode(error) === 'ENOENT')
|
|
555
|
+
return false;
|
|
556
|
+
throw error;
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
async record(candidateInput, _localMetadata, options) {
|
|
560
|
+
const candidate = ContributionCandidateV1Schema.parse(candidateInput);
|
|
561
|
+
return this.recordReference(candidate.sourceId, {
|
|
562
|
+
publishMinedTasksConsent: candidate.publishMinedTasksConsent,
|
|
563
|
+
...options,
|
|
564
|
+
});
|
|
565
|
+
}
|
|
566
|
+
async recordReference(episodeId, options = {}) {
|
|
567
|
+
if (typeof episodeId !== 'string' || episodeId.length === 0) {
|
|
568
|
+
throw new Error('contribution episode reference must not be empty');
|
|
569
|
+
}
|
|
570
|
+
return this.withLock(async () => {
|
|
571
|
+
const file = await this.loadUnlocked();
|
|
572
|
+
const existing = ownRecord(file, episodeId);
|
|
573
|
+
if (existing)
|
|
574
|
+
return existing;
|
|
575
|
+
const globallyDisabled = await this.publicationDisabledUnlocked();
|
|
576
|
+
const record = {
|
|
577
|
+
recordId: episodeId,
|
|
578
|
+
localState: 'recorded',
|
|
579
|
+
publicationState: options?.publicationState ??
|
|
580
|
+
(options.publishMinedTasksConsent && !globallyDisabled
|
|
581
|
+
? (file.firstSharePreviewAcknowledgedAt ? 'queued' : 'preview-required')
|
|
582
|
+
: 'disabled'),
|
|
583
|
+
};
|
|
584
|
+
file.records[record.recordId] = record;
|
|
585
|
+
await this.writeAtomic(file);
|
|
586
|
+
return record;
|
|
587
|
+
});
|
|
588
|
+
}
|
|
589
|
+
async get(recordId) {
|
|
590
|
+
return this.withLock(async () => (await this.loadUnlocked()).records[recordId]);
|
|
591
|
+
}
|
|
592
|
+
async list() {
|
|
593
|
+
return this.withLock(async () => Object.values((await this.loadUnlocked()).records));
|
|
594
|
+
}
|
|
595
|
+
async listRecorded() {
|
|
596
|
+
return (await this.list()).filter((record) => record.localState === 'recorded');
|
|
597
|
+
}
|
|
598
|
+
async authorize(recordId, acknowledgedAt) {
|
|
599
|
+
return this.withLock(async () => {
|
|
600
|
+
const file = await this.loadUnlocked();
|
|
601
|
+
if (await this.publicationDisabledUnlocked()) {
|
|
602
|
+
throw new Error('contribution publication is globally disabled');
|
|
603
|
+
}
|
|
604
|
+
const record = this.requireRecord(file, recordId);
|
|
605
|
+
if (record.publicationState === 'published')
|
|
606
|
+
this.throwPublishedImmutable(recordId);
|
|
607
|
+
if (record.publicationState === 'vetoed')
|
|
608
|
+
throw new Error(`contribution ${recordId} is vetoed`);
|
|
609
|
+
if (record.localState === 'rejected')
|
|
610
|
+
throw new Error(`contribution ${recordId} is rejected`);
|
|
611
|
+
if (record.publicationState === 'disabled')
|
|
612
|
+
throw new Error(`contribution ${recordId} publication is disabled`);
|
|
613
|
+
if (record.publicationState === 'preview-required') {
|
|
614
|
+
file.firstSharePreviewAcknowledgedAt = acknowledgedAt;
|
|
615
|
+
for (const candidate of Object.values(file.records)) {
|
|
616
|
+
if (candidate.publicationState === 'preview-required' && candidate.localState !== 'rejected') {
|
|
617
|
+
candidate.publicationState = 'queued';
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
await this.writeAtomic(file);
|
|
622
|
+
return record;
|
|
623
|
+
});
|
|
624
|
+
}
|
|
625
|
+
async markMinted(recordId, mintRef) {
|
|
626
|
+
return this.mutate((file) => {
|
|
627
|
+
const record = this.requireRecord(file, recordId);
|
|
628
|
+
if (record.publicationState === 'published')
|
|
629
|
+
this.throwPublishedImmutable(recordId);
|
|
630
|
+
if (record.localState === 'rejected')
|
|
631
|
+
throw new Error(`contribution ${recordId} is rejected`);
|
|
632
|
+
record.localState = 'minted';
|
|
633
|
+
if (mintRef !== undefined) {
|
|
634
|
+
if (mintRef.length === 0)
|
|
635
|
+
throw new Error('mintRef must not be empty');
|
|
636
|
+
record.mintRef = mintRef;
|
|
637
|
+
}
|
|
638
|
+
return record;
|
|
639
|
+
});
|
|
640
|
+
}
|
|
641
|
+
async markRejected(recordId, reason) {
|
|
642
|
+
return this.withPublicationLock(async () => this.mutate((file) => {
|
|
643
|
+
const record = this.requireRecord(file, recordId);
|
|
644
|
+
if (record.publicationState === 'published')
|
|
645
|
+
this.throwPublishedImmutable(recordId);
|
|
646
|
+
if (record.localState === 'minted')
|
|
647
|
+
throw new Error(`contribution ${recordId} is already minted`);
|
|
648
|
+
record.localState = 'rejected';
|
|
649
|
+
if (record.publicationState !== 'vetoed')
|
|
650
|
+
record.publicationState = 'disabled';
|
|
651
|
+
if (reason !== undefined) {
|
|
652
|
+
if (reason.length === 0)
|
|
653
|
+
throw new Error('rejection reason must not be empty');
|
|
654
|
+
record.rejectionReason = reason;
|
|
655
|
+
}
|
|
656
|
+
return record;
|
|
657
|
+
}));
|
|
658
|
+
}
|
|
659
|
+
async veto(recordId) {
|
|
660
|
+
return this.withPublicationLock(async () => this.mutate((file) => {
|
|
661
|
+
const record = this.requireRecord(file, recordId);
|
|
662
|
+
if (record.publicationState === 'published')
|
|
663
|
+
this.throwPublishedImmutable(recordId);
|
|
664
|
+
record.publicationState = 'vetoed';
|
|
665
|
+
return record;
|
|
666
|
+
}));
|
|
667
|
+
}
|
|
668
|
+
async disableUnpublished() {
|
|
669
|
+
return this.withPublicationLock(async () => this.withLock(async () => {
|
|
670
|
+
const file = await this.loadUnlocked();
|
|
671
|
+
await writeFile(this.publicationDisabledPath, 'disabled\n', { encoding: 'utf8', mode: 0o600 });
|
|
672
|
+
await chmod(this.publicationDisabledPath, 0o600);
|
|
673
|
+
const disabled = [];
|
|
674
|
+
for (const record of Object.values(file.records)) {
|
|
675
|
+
if (record.publicationState === 'preview-required' || record.publicationState === 'queued') {
|
|
676
|
+
record.publicationState = 'disabled';
|
|
677
|
+
disabled.push(record.recordId);
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
await this.writeAtomic(file);
|
|
681
|
+
return disabled;
|
|
682
|
+
}));
|
|
683
|
+
}
|
|
684
|
+
async enablePublication() {
|
|
685
|
+
await this.withPublicationLock(async () => this.withLock(async () => {
|
|
686
|
+
await rm(this.publicationDisabledPath, { force: true });
|
|
687
|
+
}));
|
|
688
|
+
}
|
|
689
|
+
async publishAuthorized(recordId, operation) {
|
|
690
|
+
return this.withPublicationLock(async () => {
|
|
691
|
+
await this.withLock(async () => {
|
|
692
|
+
const file = await this.loadUnlocked();
|
|
693
|
+
if (await this.publicationDisabledUnlocked()) {
|
|
694
|
+
throw new Error('contribution publication is globally disabled');
|
|
695
|
+
}
|
|
696
|
+
const record = this.requireRecord(file, recordId);
|
|
697
|
+
if (record.publicationState === 'published')
|
|
698
|
+
this.throwPublishedImmutable(recordId);
|
|
699
|
+
if (record.publicationState !== 'queued') {
|
|
700
|
+
throw new Error(`contribution ${recordId} is not authorized for publication`);
|
|
701
|
+
}
|
|
702
|
+
if (record.localState === 'rejected')
|
|
703
|
+
throw new Error(`contribution ${recordId} is rejected`);
|
|
704
|
+
});
|
|
705
|
+
const result = await operation();
|
|
706
|
+
if (!result.mintRef || !result.publicationRef) {
|
|
707
|
+
throw new Error('authorized publication must return non-empty mint and publication refs');
|
|
708
|
+
}
|
|
709
|
+
await this.withLock(async () => {
|
|
710
|
+
const file = await this.loadUnlocked();
|
|
711
|
+
const record = this.requireRecord(file, recordId);
|
|
712
|
+
if (record.publicationState !== 'queued' || record.localState === 'rejected') {
|
|
713
|
+
throw new Error(`contribution ${recordId} lost publication authorization`);
|
|
714
|
+
}
|
|
715
|
+
record.localState = 'minted';
|
|
716
|
+
record.mintRef = result.mintRef;
|
|
717
|
+
record.publicationState = 'published';
|
|
718
|
+
record.publicationRef = result.publicationRef;
|
|
719
|
+
await this.writeAtomic(file);
|
|
720
|
+
});
|
|
721
|
+
return result.value;
|
|
722
|
+
});
|
|
723
|
+
}
|
|
724
|
+
async markPublished(recordId, publicationRef) {
|
|
725
|
+
return this.withPublicationLock(async () => this.mutate((file) => {
|
|
726
|
+
const record = this.requireRecord(file, recordId);
|
|
727
|
+
if (record.publicationState === 'published') {
|
|
728
|
+
if (record.publicationRef === publicationRef)
|
|
729
|
+
return record;
|
|
730
|
+
this.throwPublishedImmutable(recordId);
|
|
731
|
+
}
|
|
732
|
+
if (record.localState !== 'minted' || record.publicationState !== 'queued') {
|
|
733
|
+
throw new Error(`contribution ${recordId} is not a queued local mint`);
|
|
734
|
+
}
|
|
735
|
+
if (publicationRef.length === 0)
|
|
736
|
+
throw new Error('publicationRef must not be empty');
|
|
737
|
+
record.publicationState = 'published';
|
|
738
|
+
record.publicationRef = publicationRef;
|
|
739
|
+
return record;
|
|
740
|
+
}));
|
|
741
|
+
}
|
|
742
|
+
toOutboundProjection(record, episodeInput) {
|
|
743
|
+
if (record.localState !== 'minted' || record.publicationState !== 'queued' || !record.mintRef) {
|
|
744
|
+
throw new Error(`contribution ${record.recordId} is not ready for outbound publication`);
|
|
745
|
+
}
|
|
746
|
+
const episode = EpisodeV1Schema.parse(episodeInput);
|
|
747
|
+
if (episode.episodeId !== record.recordId) {
|
|
748
|
+
throw new Error(`contribution ${record.recordId} does not match episode ${episode.episodeId}`);
|
|
749
|
+
}
|
|
750
|
+
const candidate = ContributionCandidateV1ProjectionSchema.safeParse(episode.contributionCandidate);
|
|
751
|
+
if (!candidate.success || candidate.data.sourceId !== record.recordId) {
|
|
752
|
+
throw new Error(`canonical episode ${record.recordId} has no matching contribution candidate`);
|
|
753
|
+
}
|
|
754
|
+
return {
|
|
755
|
+
schemaVersion: CONTRIBUTION_PUBLICATION_SCHEMA_VERSION,
|
|
756
|
+
repositorySlug: candidate.data.repositorySlug,
|
|
757
|
+
baseCommit: candidate.data.baseCommit,
|
|
758
|
+
mintRef: record.mintRef,
|
|
759
|
+
};
|
|
760
|
+
}
|
|
761
|
+
requireRecord(file, recordId) {
|
|
762
|
+
const record = ownRecord(file, recordId);
|
|
763
|
+
if (!record)
|
|
764
|
+
throw new Error(`no such contribution record: ${recordId}`);
|
|
765
|
+
return record;
|
|
766
|
+
}
|
|
767
|
+
throwPublishedImmutable(recordId) {
|
|
768
|
+
throw new Error(`contribution ${recordId} is published and immutable`);
|
|
769
|
+
}
|
|
770
|
+
}
|