@danceiny/gotry 0.0.1-rc.9 → 0.2.0-rc.28
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/README.md +172 -219
- package/README.zh-CN.md +222 -0
- package/bin/gotry-backend.js +53 -0
- package/bin/gotry-booking-copilot.js +53 -0
- package/bin/gotry-bootstrap.js +1788 -0
- package/bin/gotry-inner.js +733 -83
- package/bin/gotry-process-liveness.d.ts +27 -0
- package/bin/gotry-process-liveness.js +97 -0
- package/bin/gotry-runtime-resolution.d.ts +27 -0
- package/bin/gotry-runtime-resolution.js +49 -0
- package/bin/gotry.js +1 -1
- package/client/client.js +203 -0
- package/cordis.gotry-patch.yml +80 -56
- package/data/airline-airports.json +39 -0
- package/data/stations-12306-verify.json +524 -0
- package/dist/capabilities/agent-reach-deep.js +45 -122
- package/dist/capabilities/agent-reach.js +101 -146
- package/dist/capabilities/anything.js +161 -94
- package/dist/capabilities/artifacts.js +370 -0
- package/dist/capabilities/channel-health.js +131 -0
- package/dist/capabilities/channel-registry.js +256 -0
- package/dist/capabilities/doctor.js +553 -0
- package/dist/capabilities/effect.js +394 -0
- package/dist/capabilities/external-event.js +149 -0
- package/dist/capabilities/fact-log.js +55 -0
- package/dist/capabilities/flyai-config.js +337 -0
- package/dist/capabilities/flyai.js +947 -110
- package/dist/capabilities/fx-contract.js +293 -0
- package/dist/capabilities/geo-atlas.js +246 -0
- package/dist/capabilities/ground-transfer.js +676 -0
- package/dist/capabilities/hbcli.js +260 -123
- package/dist/capabilities/hotelbyte-transaction.js +194 -0
- package/dist/capabilities/incident-log.js +131 -61
- package/dist/capabilities/itinerary-artifact.js +190 -0
- package/dist/capabilities/itinerary-deck-artifact.js +194 -0
- package/dist/capabilities/itinerary-deck-export.js +339 -0
- package/dist/capabilities/lavish-local.js +924 -0
- package/dist/capabilities/model-override.js +38 -0
- package/dist/capabilities/opensky.js +54 -43
- package/dist/capabilities/provider-detail-sanitize.js +64 -0
- package/dist/capabilities/resilience.js +191 -0
- package/dist/capabilities/route-provider-conformance.js +341 -0
- package/dist/capabilities/session/action-cache.js +50 -44
- package/dist/capabilities/session/adapters/ctrip-flight.js +120 -62
- package/dist/capabilities/session/adapters/ctrip-hotel.js +222 -0
- package/dist/capabilities/session/adapters/dida-portal.js +274 -0
- package/dist/capabilities/session/adapters/meituan-local.js +35 -54
- package/dist/capabilities/session/adapters/rail-12306.js +342 -0
- package/dist/capabilities/session/benchmark.js +189 -0
- package/dist/capabilities/session/bridge-ledger.js +224 -0
- package/dist/capabilities/session/extension-bridge.js +636 -0
- package/dist/capabilities/session/extension-channel.js +109 -0
- package/dist/capabilities/session/extension-distribution.js +230 -0
- package/dist/capabilities/session/extract.js +31 -21
- package/dist/capabilities/session/golden-score.js +114 -0
- package/dist/capabilities/session/health-watch.js +215 -0
- package/dist/capabilities/session/read-guard.js +75 -24
- package/dist/capabilities/session/static-flight-golden.js +150 -0
- package/dist/capabilities/session/transport.js +97 -83
- package/dist/capabilities/session/wizard.js +117 -0
- package/dist/capabilities/session-consent.js +178 -0
- package/dist/capabilities/session-login.js +170 -0
- package/dist/capabilities/session-search.js +635 -44
- package/dist/capabilities/spawn-bounded.js +203 -0
- package/dist/capabilities/sponsor-plugin.js +341 -0
- package/dist/capabilities/visa-policy.js +140 -0
- package/dist/capabilities/weather.js +243 -138
- package/dist/data/session-golden-20.json +25 -0
- package/dist/data/sf-golden-manifest.json +103 -0
- package/dist/data/sf-static-routes.json +91 -0
- package/dist/scripts/action-cache-tests.js +24 -59
- package/dist/scripts/agent-planning-turn-deadline-e2e.js +242 -0
- package/dist/scripts/agent-planning-turn-deadline-tests.js +185 -0
- package/dist/scripts/agent-reach-deep-tests.js +30 -40
- package/dist/scripts/agent-reach-error-tests.js +354 -0
- package/dist/scripts/agent-reach-tests.js +26 -18
- package/dist/scripts/agent-reach-wrapper-tests.js +50 -50
- package/dist/scripts/anything-path-measure-tests.js +133 -0
- package/dist/scripts/anything-path-measure.js +150 -0
- package/dist/scripts/anything-tests.js +250 -60
- package/dist/scripts/artifact-client-contract-tests.js +220 -0
- package/dist/scripts/artifacts-capability-tests.js +727 -0
- package/dist/scripts/async-collect.js +50 -11
- package/dist/scripts/benchmark-environment-bridge-e2e.js +741 -0
- package/dist/scripts/benchmark-environment-bridge-tests.js +1452 -0
- package/dist/scripts/booking-copilot-availability-ledger-binding-tests.js +126 -0
- package/dist/scripts/booking-copilot-availability-policy-tests.js +265 -0
- package/dist/scripts/booking-copilot-bin-proof-tests.js +66 -0
- package/dist/scripts/booking-copilot-cleanup-proof-helper.js +76 -0
- package/dist/scripts/booking-copilot-crossrepo-fixture-server.js +144 -0
- package/dist/scripts/booking-copilot-dsh-core-proof-tests.js +424 -0
- package/dist/scripts/booking-copilot-dsh-planner-proof-tests.js +2839 -0
- package/dist/scripts/booking-copilot-dsh-plugin-proof-tests.js +309 -0
- package/dist/scripts/booking-copilot-dsh-readiness-proof.js +238 -0
- package/dist/scripts/booking-copilot-dsh-warmer-proof.js +126 -0
- package/dist/scripts/booking-copilot-event-sequence-concurrency-proof-tests.js +156 -0
- package/dist/scripts/booking-copilot-gap-code-contract-proof-tests.js +70 -0
- package/dist/scripts/booking-copilot-intent-proof-tests.js +422 -0
- package/dist/scripts/booking-copilot-operation-ledger-concurrency-proof-tests.js +184 -0
- package/dist/scripts/booking-copilot-planner-live-probe.js +95 -0
- package/dist/scripts/booking-copilot-proof-runtime.js +42 -0
- package/dist/scripts/booking-copilot-receipt-ledger-concurrency-proof-tests.js +210 -0
- package/dist/scripts/booking-copilot-runtime-proof-tests.js +2349 -0
- package/dist/scripts/booking-copilot-server-proof-tests.js +784 -0
- package/dist/scripts/booking-copilot-startup-proof-tests.js +94 -0
- package/dist/scripts/booking-executor-tests.js +80 -0
- package/dist/scripts/booking-recovery-chain-tests.js +182 -0
- package/dist/scripts/booking-saga-tests.js +125 -0
- package/dist/scripts/booking-surface-contract-proof-tests.js +212 -0
- package/dist/scripts/bootstrap-tests.js +1549 -0
- package/dist/scripts/bridge-events-tests.js +239 -0
- package/dist/scripts/bridge-ledger-tests.js +428 -0
- package/dist/scripts/build-changelog.js +238 -0
- package/dist/scripts/build-metrics-report.js +331 -0
- package/dist/scripts/changelog-tests.js +118 -0
- package/dist/scripts/channel-probe-tests.js +103 -0
- package/dist/scripts/channel-probe.js +169 -0
- package/dist/scripts/channel-registry-tests.js +208 -0
- package/dist/scripts/city-scenario-tier-tests.js +234 -0
- package/dist/scripts/companion-tests.js +25 -70
- package/dist/scripts/dida-cookie-probe.js +87 -0
- package/dist/scripts/dida-runner-stop-tests.js +311 -0
- package/dist/scripts/dida-sw-probe.js +114 -0
- package/dist/scripts/diff-test.js +17 -12
- package/dist/scripts/doctor-tests.js +600 -0
- package/dist/scripts/drill-multiuser-ledger-tests.js +1076 -0
- package/dist/scripts/drill-sdk-descendant-cleanup-tests.js +606 -0
- package/dist/scripts/drill-w2a-sensor-tests.js +788 -0
- package/dist/scripts/dsh-artifact-e2e.js +279 -0
- package/dist/scripts/dsh-artifact-web-e2e.js +675 -0
- package/dist/scripts/dsh-http-proxy-sse-proof.js +90 -0
- package/dist/scripts/dsh-llm-tests.js +437 -0
- package/dist/scripts/dsh-runtime-closure-tests.js +182 -0
- package/dist/scripts/dsh-runtime-closure.js +162 -0
- package/dist/scripts/dsh-session-v3-migration-proof.js +109 -0
- package/dist/scripts/dsh-subprocess-local-proof.js +150 -0
- package/dist/scripts/dsh-target-closure-proof.js +178 -0
- package/dist/scripts/effect-tests.js +539 -0
- package/dist/scripts/engine-run.js +1 -3
- package/dist/scripts/engine-tests.js +16 -10
- package/dist/scripts/evaluation-cadence-tests.js +174 -0
- package/dist/scripts/evaluation-contract-tests.js +268 -0
- package/dist/scripts/extension-distribution-cli.js +39 -0
- package/dist/scripts/extension-distribution-tests.js +443 -0
- package/dist/scripts/extension-tests.js +988 -0
- package/dist/scripts/external-event-tests.js +350 -0
- package/dist/scripts/fact-gate-tests.js +869 -0
- package/dist/scripts/fixtures/extension-bridge-unref-child.mjs +21 -0
- package/dist/scripts/flight-hotel-anchor-363-registered-e2e.js +169 -0
- package/dist/scripts/flight-malformed-tests.js +159 -0
- package/dist/scripts/flyai-setup-tests.js +228 -0
- package/dist/scripts/flyai-setup-tool-tests.js +54 -0
- package/dist/scripts/flyai-tests.js +692 -0
- package/dist/scripts/flyai-tool-registration-contract-tests.js +91 -0
- package/dist/scripts/fx-contract-tests.js +201 -0
- package/dist/scripts/g5-guard-tests.js +150 -0
- package/dist/scripts/g5-guard.js +193 -0
- package/dist/scripts/gen-lunar-anchors.js +106 -0
- package/dist/scripts/geo-atlas-tests.js +283 -0
- package/dist/scripts/gotry-backend-kernel-tests.js +206 -0
- package/dist/scripts/gotry-try-demo-tests.js +79 -0
- package/dist/scripts/gotry-try-demo.js +49 -0
- package/dist/scripts/ground-transfer-tests.js +956 -0
- package/dist/scripts/hbcli-e2e-tests.js +159 -0
- package/dist/scripts/hbcli-live-optin-tests.js +96 -0
- package/dist/scripts/hbcli-release-contract-tests.js +122 -0
- package/dist/scripts/hbcli-tests.js +121 -69
- package/dist/scripts/health-watch-cli.js +73 -0
- package/dist/scripts/hotel-date-gate-tests.js +496 -0
- package/dist/scripts/hotelbyte-reconcile-tests.js +141 -0
- package/dist/scripts/hotelbyte-spawn-e2e-tests.js +373 -0
- package/dist/scripts/i18n-tests.js +41 -0
- package/dist/scripts/incident-tests.js +281 -87
- package/dist/scripts/issue-194-job-id-guard-tests.js +106 -0
- package/dist/scripts/issue-233-cancel-refund-commission-tests.js +392 -0
- package/dist/scripts/issue-271-liveness-tests.js +569 -0
- package/dist/scripts/issue-289-model-retry-real-tests.js +296 -0
- package/dist/scripts/issue-289-model-retry-tests.js +441 -0
- package/dist/scripts/issue-289-web-retry-e2e.js +630 -0
- package/dist/scripts/issue-338-home-city-e2e.js +577 -0
- package/dist/scripts/issue343-real-entry-e2e.js +160 -0
- package/dist/scripts/issue436-persisted-routing-e2e.js +247 -0
- package/dist/scripts/itinerary-artifact-tests.js +368 -0
- package/dist/scripts/itinerary-deck-artifact-tests.js +416 -0
- package/dist/scripts/itinerary-deck-export-tests.js +552 -0
- package/dist/scripts/itinerary-deck-tests.js +435 -0
- package/dist/scripts/itinerary-html-tests.js +426 -0
- package/dist/scripts/journey-tests.js +22 -27
- package/dist/scripts/kernel-manifest-evidence.js +109 -0
- package/dist/scripts/kernel-manifest-gate.js +126 -0
- package/dist/scripts/kernel-manifest-tests.js +212 -0
- package/dist/scripts/kernel-manifest-trace-entry.js +7 -0
- package/dist/scripts/kernel-manifest-trace-hook.mjs +28 -0
- package/dist/scripts/kernel-manifest.js +369 -0
- package/dist/scripts/lavish-local-tests.js +1226 -0
- package/dist/scripts/lavish-product-tools-tests.js +537 -0
- package/dist/scripts/ledger-repair-apply-tests.js +316 -0
- package/dist/scripts/ledger-repair-plan-tests.js +375 -0
- package/dist/scripts/ledger-tests.js +382 -246
- package/dist/scripts/ledger-workflow-crash.js +10 -20
- package/dist/scripts/m3-cohort-tests.js +714 -0
- package/dist/scripts/m3-cohort.js +310 -0
- package/dist/scripts/managed-dsh-cleanup-diagnostic-proof.js +184 -0
- package/dist/scripts/managed-dsh-close-failure-proof.js +172 -0
- package/dist/scripts/managed-dsh-run-port-proof.js +153 -0
- package/dist/scripts/managed-dsh-terminal-proof.js +252 -0
- package/dist/scripts/map-tools-vendor-package-proof.js +365 -0
- package/dist/scripts/memory-capture-tests.js +242 -61
- package/dist/scripts/memory-decay-tests.js +18 -52
- package/dist/scripts/memory-lifecycle-tests.js +657 -0
- package/dist/scripts/memory-lifecycle.js +196 -0
- package/dist/scripts/memory-metrics.js +24 -12
- package/dist/scripts/memory-value-report.js +631 -0
- package/dist/scripts/memory-value-tests.js +328 -0
- package/dist/scripts/metrics-report-tests.js +151 -0
- package/dist/scripts/model-override-e2e.js +137 -0
- package/dist/scripts/nightly-evidence-tests.js +203 -0
- package/dist/scripts/nightly-evidence.js +303 -0
- package/dist/scripts/nudge-digest.js +39 -28
- package/dist/scripts/observability-tests.js +381 -0
- package/dist/scripts/onboarding-tests.js +161 -0
- package/dist/scripts/opensky-check.js +18 -13
- package/dist/scripts/opensky-tests.js +28 -28
- package/dist/scripts/outcome-projection-tests.js +427 -0
- package/dist/scripts/persona-sim-tests.js +603 -0
- package/dist/scripts/persona-sim.js +1081 -0
- package/dist/scripts/persona-surface-guard-tests.js +49 -0
- package/dist/scripts/pnpm-dsh-closure-proof.js +17 -0
- package/dist/scripts/policy-anchor-359-registered-e2e.js +214 -0
- package/dist/scripts/price-drift-tests.js +340 -0
- package/dist/scripts/price-drift-watch.js +447 -0
- package/dist/scripts/probe-poi-tests.js +53 -45
- package/dist/scripts/product-metrics.js +483 -0
- package/dist/scripts/publish-preverify.js +110 -0
- package/dist/scripts/realtime-pricing-tests.js +76 -0
- package/dist/scripts/recall-tests.js +513 -0
- package/dist/scripts/replay-async.js +22 -18
- package/dist/scripts/replay-real.js +18 -18
- package/dist/scripts/replay.js +54 -82
- package/dist/scripts/route-provider-conformance-tests.js +391 -0
- package/dist/scripts/session-attach-diagnose.js +20 -20
- package/dist/scripts/session-attach-poc.js +34 -37
- package/dist/scripts/session-benchmark.js +180 -0
- package/dist/scripts/session-dida-live-e2e.js +199 -0
- package/dist/scripts/session-extract-tests.js +14 -35
- package/dist/scripts/session-link-tests.js +478 -0
- package/dist/scripts/session-login.js +27 -46
- package/dist/scripts/session-tests.js +796 -96
- package/dist/scripts/session-zone-crash.js +49 -0
- package/dist/scripts/session-zone-ledger-tests.js +432 -0
- package/dist/scripts/session-zone-observation-tests.js +492 -0
- package/dist/scripts/session-zone-observe.js +135 -0
- package/dist/scripts/session-zone-wiring-tests.js +566 -0
- package/dist/scripts/session-zones-tests.js +374 -0
- package/dist/scripts/sf-live-benchmark.js +367 -0
- package/dist/scripts/sf-live-challenge-stop-tests.js +453 -0
- package/dist/scripts/sf-live-cli-tests.js +92 -0
- package/dist/scripts/sf-live-options.js +46 -0
- package/dist/scripts/sf-manifest-tests.js +30 -0
- package/dist/scripts/sf-manifest.js +33 -0
- package/dist/scripts/sf-soft-score-tests.js +67 -0
- package/dist/scripts/sf-summary-tests.js +324 -0
- package/dist/scripts/sf-summary.js +525 -0
- package/dist/scripts/share-tests.js +432 -0
- package/dist/scripts/skeleton-check.js +16 -14
- package/dist/scripts/skeleton-integration-test.js +28 -11
- package/dist/scripts/skills-contract-tests.js +51 -46
- package/dist/scripts/smoke-session-gate-tests.js +21 -0
- package/dist/scripts/smoke.js +690 -246
- package/dist/scripts/spawn-bounded-abort-tests.js +244 -0
- package/dist/scripts/sponsor-reuse-tests.js +262 -0
- package/dist/scripts/state-cli-tests.js +226 -101
- package/dist/scripts/state-cli.js +565 -198
- package/dist/scripts/state-repair-cli.js +66 -0
- package/dist/scripts/state-repair-tests.js +140 -0
- package/dist/scripts/static-golden-tests.js +165 -0
- package/dist/scripts/time-eval-tests.js +212 -192
- package/dist/scripts/travel-timeline-tests.js +29 -93
- package/dist/scripts/turn-handoff-collect-tests.js +169 -0
- package/dist/scripts/turn-handoff-collect.js +161 -0
- package/dist/scripts/turn-policy-tests.js +55 -0
- package/dist/scripts/typed-contract-canary.js +176 -0
- package/dist/scripts/tz-resolver-sanity.js +50 -0
- package/dist/scripts/tz-resolver-tests.js +584 -0
- package/dist/scripts/unified-tests.js +60 -20
- package/dist/scripts/visa-policy-tests.js +62 -0
- package/dist/scripts/weather-tests.js +276 -41
- package/dist/scripts/wish-channel-gate-tests.js +54 -0
- package/dist/scripts/write-gate-tests.js +522 -0
- package/dist/scripts/z3-lifecycle-fault-tests.js +188 -0
- package/dist/scripts/z3-lifecycle-tests.js +170 -0
- package/dist/scripts/z3-race-repeat-tests.js +39 -0
- package/dist/scripts/z3-race-tests.js +46 -0
- package/dist/src/artifact-gate.js +829 -0
- package/dist/src/backend/kernel.js +91 -0
- package/dist/src/backend/modules/booking-copilot.js +92 -0
- package/dist/src/backend/modules/booking-executor.js +124 -0
- package/dist/src/backend/modules/session-search.js +551 -0
- package/dist/src/benchmark-agent-conformance.js +578 -0
- package/dist/src/benchmark-environment-bridge.js +515 -0
- package/dist/src/benchmark-headless-child-diagnostics.js +166 -0
- package/dist/src/benchmark-tool-isolation.js +151 -0
- package/dist/src/bookable-facts.js +533 -0
- package/dist/src/booking-saga.js +97 -0
- package/dist/src/booking-surface/availability-policy.js +697 -0
- package/dist/src/booking-surface/booking-intent.js +43 -0
- package/dist/src/booking-surface/cancel-refund-commission.js +379 -0
- package/dist/src/booking-surface/canonical-schema.js +116 -0
- package/dist/src/booking-surface/contracts.js +75 -0
- package/dist/src/booking-surface/dsh-planner.js +1854 -0
- package/dist/src/booking-surface/dsh-plugin.js +378 -0
- package/dist/src/booking-surface/dsh-worker.js +98 -0
- package/dist/src/booking-surface/error-codes.js +231 -0
- package/dist/src/booking-surface/index.js +9 -0
- package/dist/src/booking-surface/managed-dsh-cleanup-diagnostic.js +97 -0
- package/dist/src/booking-surface/managed-dsh-run-port.js +244 -0
- package/dist/src/booking-surface/profile.js +24 -0
- package/dist/src/booking-surface/recovery-chain.js +367 -0
- package/dist/src/booking-surface/runtime.js +1968 -0
- package/dist/src/booking-surface/server.js +674 -0
- package/dist/src/booking-surface/startup.js +168 -0
- package/dist/src/booking-surface/validation.js +261 -0
- package/dist/src/bridge.js +20 -13
- package/dist/src/city-scenario-tier.js +378 -0
- package/dist/src/companions.js +48 -74
- package/dist/src/contracts.js +21 -43
- package/dist/src/dsh-llm.js +171 -115
- package/dist/src/engine.js +276 -193
- package/dist/src/evaluation-cadence.js +97 -0
- package/dist/src/evaluation-contracts.js +283 -0
- package/dist/src/flight-pack-adapter.js +54 -0
- package/dist/src/flight-pack-contract.js +2 -0
- package/dist/src/flyai-setup-tool.js +70 -0
- package/dist/src/gotry-backend.js +125 -0
- package/dist/src/hotel-date-gate.js +118 -0
- package/dist/src/i18n.js +88 -0
- package/dist/src/index.js +2385 -881
- package/dist/src/itinerary-deck.js +139 -0
- package/dist/src/itinerary-doc-shared.js +661 -0
- package/dist/src/itinerary-html.js +131 -0
- package/dist/src/journey.js +155 -108
- package/dist/src/lavish-tools.js +400 -0
- package/dist/src/ledger-repair-apply.js +538 -0
- package/dist/src/ledger-repair-plan.js +463 -0
- package/dist/src/loop.js +331 -161
- package/dist/src/m3-cohort.js +1577 -0
- package/dist/src/memory-capture.js +180 -32
- package/dist/src/memory-decay.js +30 -14
- package/dist/src/memory-lifecycle.js +1310 -0
- package/dist/src/memory-utility.js +27 -40
- package/dist/src/mock-llm.js +36 -61
- package/dist/src/model.js +81 -36
- package/dist/src/outcome-projection.js +746 -0
- package/dist/src/realtime-pricing.js +103 -0
- package/dist/src/recall/card.js +74 -0
- package/dist/src/recall/evaluator.js +140 -0
- package/dist/src/recall/integration.js +17 -0
- package/dist/src/recall/tick.js +166 -0
- package/dist/src/session-link/plan-it-action.js +48 -0
- package/dist/src/session-link/session-link.js +248 -0
- package/dist/src/session-zone-ledger.js +312 -0
- package/dist/src/session-zone-observation.js +354 -0
- package/dist/src/session-zone-wiring.js +658 -0
- package/dist/src/session-zones.js +510 -0
- package/dist/src/share/adapters.js +51 -0
- package/dist/src/share/share-consent.js +76 -0
- package/dist/src/share/share-deck.js +58 -0
- package/dist/src/share/share-token.js +146 -0
- package/dist/src/slot-spec.js +84 -106
- package/dist/src/state-ledger.js +696 -524
- package/dist/src/state-repair.js +299 -0
- package/dist/src/subagent-job-id-guard.js +58 -0
- package/dist/src/time-anchor.js +231 -33
- package/dist/src/tool-packet.js +20 -8
- package/dist/src/travel-slots.js +58 -35
- package/dist/src/travel-timeline.js +44 -63
- package/dist/src/turn-deadline.js +287 -0
- package/dist/src/turn-policy.js +118 -0
- package/dist/src/tz-resolver.js +143 -0
- package/dist/src/unified.js +600 -360
- package/dist/src/wish-pool.js +42 -12
- package/dist/src/write-gate.js +495 -0
- package/dist/src/z3-shared.js +284 -0
- package/extension/README.md +21 -0
- package/extension/README.zh-CN.md +21 -0
- package/extension/background.js +463 -0
- package/extension/content-bridge.js +270 -0
- package/extension/content-main.js +111 -0
- package/extension/manifest.json +60 -0
- package/package.json +407 -14
- package/schemas/booking.intent.schema.json +193 -0
- package/schemas/booking.surface.schema.json +2622 -0
- package/ts/capabilities/agent-reach-deep.ts +114 -0
- package/ts/capabilities/agent-reach.ts +198 -0
- package/ts/capabilities/anything.ts +282 -0
- package/ts/capabilities/artifacts.ts +428 -0
- package/ts/capabilities/fact-log.ts +54 -0
- package/ts/capabilities/flyai-config.ts +388 -0
- package/ts/capabilities/flyai.ts +1274 -0
- package/ts/capabilities/hbcli.ts +253 -71
- package/ts/capabilities/incident-log.ts +88 -59
- package/ts/capabilities/itinerary-artifact.ts +214 -0
- package/ts/capabilities/itinerary-deck-artifact.ts +218 -0
- package/ts/capabilities/itinerary-deck-export.ts +378 -0
- package/ts/capabilities/opensky.ts +121 -0
- package/ts/capabilities/session/action-cache.ts +148 -0
- package/ts/capabilities/session/adapters/ctrip-flight.ts +181 -0
- package/ts/capabilities/session/adapters/ctrip-hotel.ts +238 -0
- package/ts/capabilities/session/adapters/dida-portal.ts +338 -0
- package/ts/capabilities/session/adapters/meituan-local.ts +70 -0
- package/ts/capabilities/session/adapters/rail-12306.ts +392 -0
- package/ts/capabilities/session/benchmark.ts +276 -0
- package/ts/capabilities/session/bridge-ledger.ts +333 -0
- package/ts/capabilities/session/extension-bridge.ts +794 -0
- package/ts/capabilities/session/extension-channel.ts +144 -0
- package/ts/capabilities/session/extension-distribution.ts +266 -0
- package/ts/capabilities/session/extract.ts +54 -0
- package/ts/capabilities/session/golden-score.ts +139 -0
- package/ts/capabilities/session/health-watch.ts +264 -0
- package/ts/capabilities/session/read-guard.ts +141 -0
- package/ts/capabilities/session/static-flight-golden.ts +209 -0
- package/ts/capabilities/session/transport.ts +146 -0
- package/ts/capabilities/session/wizard.ts +140 -0
- package/ts/capabilities/session-consent.ts +211 -0
- package/ts/capabilities/session-login.ts +208 -0
- package/ts/capabilities/session-search.ts +893 -0
- package/ts/capabilities/weather.ts +330 -0
- package/ts/dsh-runtime/vendor/README.md +68 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/LICENSE +21 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/README.en.md +405 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/README.md +404 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/client/client.js +1584 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/cordis.patch.yml +5 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/icon.svg +5 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/clients/amap.js +595 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/clients/nominatim.js +63 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/clients/osrm.js +58 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/clients/photon.js +55 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/config-file.js +87 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/config-route.js +131 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/config.js +16 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/geo.js +232 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/index.js +120 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/settings-ns.js +40 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/staticmap-route.js +115 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/tools/geocode.js +127 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/tools/poi.js +84 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/tools/routes.js +267 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/types/clients/amap.d.ts +90 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/types/clients/nominatim.d.ts +17 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/types/clients/osrm.d.ts +15 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/types/clients/photon.d.ts +22 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/types/config-file.d.ts +33 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/types/config-route.d.ts +23 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/types/config.d.ts +23 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/types/geo.d.ts +61 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/types/index.d.ts +18 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/types/settings-ns.d.ts +14 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/types/staticmap-route.d.ts +31 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/types/tools/geocode.d.ts +11 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/types/tools/poi.d.ts +9 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/types/tools/routes.d.ts +75 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/types/types.d.ts +68 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/types.js +16 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/package.json +97 -0
- package/ts/package.json +293 -3
- package/ts/scripts/async-collect.ts +91 -0
- package/ts/scripts/map-tools-vendor-package-proof.ts +404 -0
- package/ts/scripts/skeleton-check.ts +1 -1
- package/ts/scripts/skeleton-integration-test.ts +23 -1
- package/ts/scripts/state-cli.ts +586 -0
- package/ts/scripts/turn-handoff-collect.ts +178 -0
- package/ts/src/artifact-gate.ts +991 -0
- package/ts/src/benchmark-agent-conformance.ts +619 -0
- package/ts/src/benchmark-environment-bridge.ts +538 -0
- package/ts/src/benchmark-headless-child-diagnostics.ts +184 -0
- package/ts/src/benchmark-tool-isolation.ts +166 -0
- package/ts/src/bookable-facts.ts +837 -0
- package/ts/src/booking-saga.ts +133 -0
- package/ts/src/booking-surface/availability-policy.ts +522 -0
- package/ts/src/booking-surface/booking-intent.ts +86 -0
- package/ts/src/booking-surface/cancel-refund-commission.ts +488 -0
- package/ts/src/booking-surface/canonical-schema.js +116 -0
- package/ts/src/booking-surface/contracts.ts +475 -0
- package/ts/src/booking-surface/dsh-planner.ts +1949 -0
- package/ts/src/booking-surface/dsh-plugin.js +378 -0
- package/ts/src/booking-surface/dsh-worker.ts +110 -0
- package/ts/src/booking-surface/error-codes.ts +241 -0
- package/ts/src/booking-surface/index.ts +9 -0
- package/ts/src/booking-surface/managed-dsh-cleanup-diagnostic.ts +151 -0
- package/ts/src/booking-surface/managed-dsh-run-port.ts +273 -0
- package/ts/src/booking-surface/profile.ts +42 -0
- package/ts/src/booking-surface/recovery-chain.ts +409 -0
- package/ts/src/booking-surface/runtime.ts +1793 -0
- package/ts/src/booking-surface/server.ts +733 -0
- package/ts/src/booking-surface/startup.ts +201 -0
- package/ts/src/booking-surface/validation.ts +217 -0
- package/ts/src/companions.ts +113 -0
- package/ts/src/contracts.ts +17 -3
- package/ts/src/dsh-llm.ts +152 -17
- package/ts/src/flyai-setup-tool.ts +77 -0
- package/ts/src/index.ts +2123 -200
- package/ts/src/itinerary-deck.ts +189 -0
- package/ts/src/itinerary-doc-shared.ts +741 -0
- package/ts/src/itinerary-html.ts +171 -0
- package/ts/src/loop.ts +234 -26
- package/ts/src/memory-capture.ts +283 -0
- package/ts/src/memory-decay.ts +55 -0
- package/ts/src/memory-utility.ts +70 -0
- package/ts/src/mock-llm.ts +4 -8
- package/ts/src/model.ts +88 -2
- package/ts/src/recall/card.ts +106 -0
- package/ts/src/recall/evaluator.ts +170 -0
- package/ts/src/recall/integration.ts +35 -0
- package/ts/src/recall/tick.ts +213 -0
- package/ts/src/session-link/plan-it-action.ts +78 -0
- package/ts/src/session-link/session-link.ts +275 -0
- package/ts/src/share/adapters.ts +93 -0
- package/ts/src/share/share-consent.ts +105 -0
- package/ts/src/share/share-deck.ts +85 -0
- package/ts/src/share/share-token.ts +166 -0
- package/ts/src/slot-spec.ts +172 -0
- package/ts/src/state-ledger.ts +1166 -0
- package/ts/src/subagent-job-id-guard.ts +72 -0
- package/ts/src/time-anchor.ts +338 -0
- package/ts/src/tool-packet.ts +32 -0
- package/ts/src/travel-slots.ts +219 -0
- package/ts/src/travel-timeline.ts +83 -0
- package/ts/src/turn-deadline.ts +366 -0
- package/ts/src/turn-policy.ts +154 -0
- package/ts/src/unified.ts +444 -105
- package/ts/src/wish-pool.ts +79 -0
- package/dist/scripts/session-attach-wait.js +0 -41
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Contract tests for the evaluation cadence policy and planner.
|
|
3
|
+
* Run from ts/: npx tsx scripts/evaluation-cadence-tests.ts
|
|
4
|
+
*/
|
|
5
|
+
import { readFile } from 'node:fs/promises';
|
|
6
|
+
import { join } from 'node:path';
|
|
7
|
+
import assert from 'node:assert/strict';
|
|
8
|
+
import { parseEvaluationCadencePolicy, planEvaluationCadence, } from '../src/evaluation-cadence.js';
|
|
9
|
+
import { assertPublicArtifactSafe } from '../src/evaluation-contracts.js';
|
|
10
|
+
const policyPath = join(process.cwd(), 'data', 'evaluation', 'cadence-policy.json');
|
|
11
|
+
async function loadPolicyFixture() {
|
|
12
|
+
// This must remain a real fixture load: policy behavior is not tested with an inline mock.
|
|
13
|
+
return JSON.parse(await readFile(policyPath, 'utf8'));
|
|
14
|
+
}
|
|
15
|
+
function expectThrows(fn, message) {
|
|
16
|
+
assert.throws(fn, /./, message);
|
|
17
|
+
}
|
|
18
|
+
async function testCanonicalPolicyAndHealthyWeeklyPlan() {
|
|
19
|
+
const raw = await loadPolicyFixture();
|
|
20
|
+
const policy = parseEvaluationCadencePolicy(raw);
|
|
21
|
+
assertPublicArtifactSafe(policy, 'test policy safety');
|
|
22
|
+
assert.deepEqual(policy.levels.map((level) => level.cadence), ['pr', 'nightly', 'weekly', 'milestone']);
|
|
23
|
+
assert.deepEqual(policy.levels.map((level) => level.pass_k), [1, 2, 3, 5]);
|
|
24
|
+
assert.deepEqual(policy.levels.map((level) => level.max_cost_usd), [0, 2, 10, 50]);
|
|
25
|
+
assert.deepEqual(policy.levels.map((level) => level.max_wall_minutes), [20, 90, 360, 1440]);
|
|
26
|
+
assert.deepEqual(policy.levels.map((level) => level.max_tool_calls_per_case), [18, 18, 18, 18]);
|
|
27
|
+
assert.deepEqual(policy.levels.map((level) => [level.human_calibration.required, level.human_calibration.min_samples]), [[false, 0], [false, 0], [true, 10], [true, 30]]);
|
|
28
|
+
const decision = planEvaluationCadence(policy, {
|
|
29
|
+
cadence: 'weekly',
|
|
30
|
+
signals: [],
|
|
31
|
+
recent_optimization_prs: [81, 84, 87, 89],
|
|
32
|
+
});
|
|
33
|
+
assert.deepEqual(decision, {
|
|
34
|
+
cadence: 'weekly',
|
|
35
|
+
admission: true,
|
|
36
|
+
failure_registry: false,
|
|
37
|
+
stop_signals: [],
|
|
38
|
+
launches_external_runs: false,
|
|
39
|
+
pass_k: 3,
|
|
40
|
+
max_cost_usd: 10,
|
|
41
|
+
max_wall_minutes: 360,
|
|
42
|
+
max_tool_calls_per_case: 18,
|
|
43
|
+
human_calibration: { required: true, min_samples: 10 },
|
|
44
|
+
cross_benchmark_window: { min_prs: 3, max_prs: 5 },
|
|
45
|
+
performance_tradeoff_disclosure_threshold: 0.2,
|
|
46
|
+
delivery: {
|
|
47
|
+
exactly_one_gotry_pr: true,
|
|
48
|
+
exactly_one_discussion_78_comment: true,
|
|
49
|
+
update_existing_comment: true,
|
|
50
|
+
},
|
|
51
|
+
cross_benchmark_synthesis: { required: true, overdue: false },
|
|
52
|
+
});
|
|
53
|
+
assertPublicArtifactSafe(decision, 'test decision safety');
|
|
54
|
+
}
|
|
55
|
+
async function testStopSignalsDenyAdmissionAndRegisterFailures() {
|
|
56
|
+
const policy = parseEvaluationCadencePolicy(await loadPolicyFixture());
|
|
57
|
+
const decision = planEvaluationCadence(policy, {
|
|
58
|
+
cadence: 'weekly',
|
|
59
|
+
signals: ['source_revision_drift', 'hard_violation'],
|
|
60
|
+
recent_optimization_prs: [81, 84, 87],
|
|
61
|
+
});
|
|
62
|
+
assert.equal(decision.admission, false);
|
|
63
|
+
assert.deepEqual(decision.stop_signals, ['source_revision_drift', 'hard_violation']);
|
|
64
|
+
assert.equal(decision.failure_registry, true);
|
|
65
|
+
const nonRegistry = planEvaluationCadence(policy, {
|
|
66
|
+
cadence: 'weekly',
|
|
67
|
+
signals: ['license_unresolved'],
|
|
68
|
+
recent_optimization_prs: [81, 84, 87],
|
|
69
|
+
});
|
|
70
|
+
assert.equal(nonRegistry.admission, false);
|
|
71
|
+
assert.equal(nonRegistry.failure_registry, false);
|
|
72
|
+
const allSignals = planEvaluationCadence(policy, {
|
|
73
|
+
cadence: 'weekly',
|
|
74
|
+
signals: ['source_revision_drift', 'license_unresolved', 'scorer_ceiling_invalid', 'known_bad_no_longer_fails', 'hard_violation', 'matched_regression', 'variance_breach', 'budget_breach'],
|
|
75
|
+
recent_optimization_prs: [],
|
|
76
|
+
});
|
|
77
|
+
assert.equal(allSignals.admission, false);
|
|
78
|
+
assert.equal(allSignals.failure_registry, true);
|
|
79
|
+
const duplicatePrs = { cadence: 'weekly', signals: [], recent_optimization_prs: [81, 81, 82] };
|
|
80
|
+
expectThrows(() => planEvaluationCadence(policy, duplicatePrs), 'duplicate optimization PR IDs must fail closed');
|
|
81
|
+
const sparsePrs = [];
|
|
82
|
+
sparsePrs[2] = 81;
|
|
83
|
+
expectThrows(() => planEvaluationCadence(policy, { cadence: 'weekly', signals: [], recent_optimization_prs: sparsePrs }), 'sparse optimization PR IDs must fail closed');
|
|
84
|
+
expectThrows(() => planEvaluationCadence(policy, { cadence: 'weekly', signals: [], recent_optimization_prs: [0] }), 'non-positive optimization PR IDs must fail closed');
|
|
85
|
+
expectThrows(() => planEvaluationCadence(policy, { cadence: 'weekly', signals: [], recent_optimization_prs: [1.5] }), 'fractional optimization PR IDs must fail closed');
|
|
86
|
+
}
|
|
87
|
+
async function testRoundDeliveryAndMilestoneCalibration() {
|
|
88
|
+
const policy = parseEvaluationCadencePolicy(await loadPolicyFixture());
|
|
89
|
+
const milestone = planEvaluationCadence(policy, {
|
|
90
|
+
cadence: 'milestone',
|
|
91
|
+
signals: [],
|
|
92
|
+
recent_optimization_prs: [81, 84, 87, 89, 91],
|
|
93
|
+
});
|
|
94
|
+
assert.equal(milestone.admission, true);
|
|
95
|
+
assert.equal(milestone.pass_k, 5);
|
|
96
|
+
assert.deepEqual(milestone.human_calibration, { required: true, min_samples: 30 });
|
|
97
|
+
assert.deepEqual(milestone.cross_benchmark_window, { min_prs: 3, max_prs: 5 });
|
|
98
|
+
assert.equal(milestone.performance_tradeoff_disclosure_threshold, 0.2);
|
|
99
|
+
assert.deepEqual(milestone.delivery, {
|
|
100
|
+
exactly_one_gotry_pr: true,
|
|
101
|
+
exactly_one_discussion_78_comment: true,
|
|
102
|
+
update_existing_comment: true,
|
|
103
|
+
});
|
|
104
|
+
assert.deepEqual(milestone.cross_benchmark_synthesis, { required: true, overdue: false });
|
|
105
|
+
assert.deepEqual(planEvaluationCadence(policy, { cadence: 'weekly', signals: [], recent_optimization_prs: [] }).cross_benchmark_synthesis, { required: false, overdue: false });
|
|
106
|
+
assert.deepEqual(planEvaluationCadence(policy, { cadence: 'weekly', signals: [], recent_optimization_prs: [81, 82, 83, 84, 85, 86] }).cross_benchmark_synthesis, { required: true, overdue: true });
|
|
107
|
+
}
|
|
108
|
+
async function testMalformedPolicyFailsClosed() {
|
|
109
|
+
const fixture = await loadPolicyFixture();
|
|
110
|
+
const malformed = (change) => {
|
|
111
|
+
const copy = structuredClone(fixture);
|
|
112
|
+
change(copy);
|
|
113
|
+
expectThrows(() => parseEvaluationCadencePolicy(copy), 'malformed policy must fail closed');
|
|
114
|
+
};
|
|
115
|
+
malformed((copy) => { copy.unknown_key = true; });
|
|
116
|
+
malformed((copy) => { copy.levels[0].cadence = 'hourly'; });
|
|
117
|
+
malformed((copy) => { copy.levels[0].pass_k = -1; });
|
|
118
|
+
malformed((copy) => { copy.levels[0].pass_k = 1.5; });
|
|
119
|
+
malformed((copy) => { copy.levels = [...copy.levels].reverse(); });
|
|
120
|
+
malformed((copy) => { const sparse = []; sparse[3] = copy.levels[3]; copy.levels = sparse; });
|
|
121
|
+
malformed((copy) => { delete copy.stop_signals; });
|
|
122
|
+
const policy = parseEvaluationCadencePolicy(fixture);
|
|
123
|
+
const tamperedPolicy = structuredClone(policy);
|
|
124
|
+
tamperedPolicy.levels[2].max_cost_usd = 999;
|
|
125
|
+
expectThrows(() => planEvaluationCadence(tamperedPolicy, { cadence: 'weekly', signals: [], recent_optimization_prs: [] }), 'tampered policy budget must fail closed');
|
|
126
|
+
const tamperedDelivery = structuredClone(policy);
|
|
127
|
+
tamperedDelivery.round_delivery.exactly_one_gotry_pr = false;
|
|
128
|
+
expectThrows(() => planEvaluationCadence(tamperedDelivery, { cadence: 'weekly', signals: [], recent_optimization_prs: [] }), 'tampered policy delivery must fail closed');
|
|
129
|
+
expectThrows(() => planEvaluationCadence(policy, {
|
|
130
|
+
cadence: 'hourly',
|
|
131
|
+
signals: [],
|
|
132
|
+
recent_optimization_prs: [],
|
|
133
|
+
}), 'unknown cadence must fail closed');
|
|
134
|
+
expectThrows(() => planEvaluationCadence(policy, {
|
|
135
|
+
cadence: 'weekly',
|
|
136
|
+
signals: ['unknown_signal'],
|
|
137
|
+
recent_optimization_prs: [],
|
|
138
|
+
}), 'unknown stop signal must fail closed');
|
|
139
|
+
expectThrows(() => planEvaluationCadence(policy, {
|
|
140
|
+
cadence: 'weekly',
|
|
141
|
+
signals: ['hard_violation', 'hard_violation'],
|
|
142
|
+
recent_optimization_prs: [],
|
|
143
|
+
}), 'duplicate stop signals must fail closed');
|
|
144
|
+
const sparseSignals = [];
|
|
145
|
+
sparseSignals[1] = 'hard_violation';
|
|
146
|
+
expectThrows(() => planEvaluationCadence(policy, {
|
|
147
|
+
cadence: 'weekly',
|
|
148
|
+
signals: sparseSignals,
|
|
149
|
+
recent_optimization_prs: [],
|
|
150
|
+
}), 'sparse stop signals must fail closed');
|
|
151
|
+
}
|
|
152
|
+
async function testPolicyPublicSafety() {
|
|
153
|
+
const policy = parseEvaluationCadencePolicy(await loadPolicyFixture());
|
|
154
|
+
assert.deepEqual(policy.public_safety, {
|
|
155
|
+
artifact_classification: 'public_safe',
|
|
156
|
+
contains_third_party_prompt: false,
|
|
157
|
+
contains_gold: false,
|
|
158
|
+
contains_oracle: false,
|
|
159
|
+
contains_private_data: false,
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
async function main() {
|
|
163
|
+
await testCanonicalPolicyAndHealthyWeeklyPlan();
|
|
164
|
+
await testStopSignalsDenyAdmissionAndRegisterFailures();
|
|
165
|
+
await testRoundDeliveryAndMilestoneCalibration();
|
|
166
|
+
await testMalformedPolicyFailsClosed();
|
|
167
|
+
await testPolicyPublicSafety();
|
|
168
|
+
console.log('evaluation cadence tests: PASS');
|
|
169
|
+
}
|
|
170
|
+
main().catch((error) => {
|
|
171
|
+
console.error('evaluation cadence tests: FAIL');
|
|
172
|
+
console.error(error);
|
|
173
|
+
process.exitCode = 1;
|
|
174
|
+
});
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import assert from 'node:assert/strict';
|
|
2
|
+
import { createHash } from 'node:crypto';
|
|
3
|
+
import { readFileSync } from 'node:fs';
|
|
4
|
+
import { BENCHMARK_IDS, applyMutationVector, assertPublicArtifactSafe, deriveMatchedPairs, evaluationFingerprint, parseBenchmarkRegistry, parseEvalCase, parseEvalFailureCluster, parseEvalRunReceipt, parseEvaluationFoundation, parseMutationVectors, stableEvaluationJson, } from '../src/evaluation-contracts.js';
|
|
5
|
+
const load = (file) => JSON.parse(readFileSync(file, 'utf8'));
|
|
6
|
+
const registry = parseBenchmarkRegistry(load('data/evaluation/benchmark-registry.json'));
|
|
7
|
+
assert.deepEqual(registry.map(item => item.benchmark_id), [...BENCHMARK_IDS]);
|
|
8
|
+
assert.equal(registry.length, 7);
|
|
9
|
+
assert.deepEqual(Object.fromEntries(registry.map(item => [item.benchmark_id, item.native_metrics.values.map(metric => metric.receipt_key)])), {
|
|
10
|
+
trek: ['task_perfect_feasible', 'task_perfect_infeasible', 'cat_efficiency'],
|
|
11
|
+
travelplanner: ['commonsense_micro_pass_rate', 'commonsense_macro_pass_rate', 'hard_micro_pass_rate', 'hard_macro_pass_rate', 'final_pass_rate'],
|
|
12
|
+
chinatravel: ['epr_micro', 'epr_macro', 'c_lpr', 'fpr', 'dav', 'att', 'ddr', 'overall_score'],
|
|
13
|
+
travelbench: ['reasoning_planning_score', 'summarization_extraction_score', 'presentation_score', 'user_interaction_score', 'average_score', 'unsolved_accuracy'],
|
|
14
|
+
tau2: ['avg_reward', 'pass_hat_1'], locomo: ['qa_f1'], bfcl: ['category_accuracy', 'overall_accuracy'],
|
|
15
|
+
});
|
|
16
|
+
const registryFacts = Object.fromEntries(registry.map(entry => [entry.benchmark_id, {
|
|
17
|
+
owner: new URL(entry.provenance.official_entry.url).pathname.split('/')[1],
|
|
18
|
+
pins: Object.entries(entry.provenance).map(([kind, pin]) => `${kind}|${pin.url}|${pin.revision.kind}|${pin.revision.value ?? 'null'}|${pin.source_scope}`),
|
|
19
|
+
rights: Object.entries(entry.license.upstream_rights).map(([kind, right]) => `${kind}|${right.value}|${right.determination}|${right.source_url}`),
|
|
20
|
+
metrics: entry.native_metrics.values.map(metric => `${metric.receipt_key}|${metric.upstream_label}|${metric.scope}|${metric.source_url}`),
|
|
21
|
+
}]));
|
|
22
|
+
assert.deepEqual(registryFacts, {
|
|
23
|
+
"trek": { "owner": "TonyQJH", "pins": ["official_entry|https://github.com/TonyQJH/TREK-A-Travel-Reasoning-and-Evaluation-Kit-for-LLM-Agents-in-Complex-Trip-Planning/blob/6ceb4ebb2debd69c5c7c4ba34b5b17524756912b/README.md|git_commit|6ceb4ebb2debd69c5c7c4ba34b5b17524756912b|official definition", "data|https://github.com/TonyQJH/TREK-A-Travel-Reasoning-and-Evaluation-Kit-for-LLM-Agents-in-Complex-Trip-Planning/tree/6ceb4ebb2debd69c5c7c4ba34b5b17524756912b/api/data/v2|git_commit|6ceb4ebb2debd69c5c7c4ba34b5b17524756912b|task data v2", "evaluator|https://github.com/TonyQJH/TREK-A-Travel-Reasoning-and-Evaluation-Kit-for-LLM-Agents-in-Complex-Trip-Planning/blob/6ceb4ebb2debd69c5c7c4ba34b5b17524756912b/scoring.py|git_commit|6ceb4ebb2debd69c5c7c4ba34b5b17524756912b|official nine-dimension scoring implementation"], "rights": ["code|MIT|declared|https://github.com/TonyQJH/TREK-A-Travel-Reasoning-and-Evaluation-Kit-for-LLM-Agents-in-Complex-Trip-Planning/blob/6ceb4ebb2debd69c5c7c4ba34b5b17524756912b/LICENSE", "data|CC-BY-4.0|declared|https://github.com/TonyQJH/TREK-A-Travel-Reasoning-and-Evaluation-Kit-for-LLM-Agents-in-Complex-Trip-Planning/blob/6ceb4ebb2debd69c5c7c4ba34b5b17524756912b/README.md#data-and-license", "evaluator|MIT|declared|https://github.com/TonyQJH/TREK-A-Travel-Reasoning-and-Evaluation-Kit-for-LLM-Agents-in-Complex-Trip-Planning/blob/6ceb4ebb2debd69c5c7c4ba34b5b17524756912b/LICENSE"], "metrics": ["task_perfect_feasible|task_perfect_feasible|task-perfect feasible|https://github.com/TonyQJH/TREK-A-Travel-Reasoning-and-Evaluation-Kit-for-LLM-Agents-in-Complex-Trip-Planning/blob/6ceb4ebb2debd69c5c7c4ba34b5b17524756912b/scoring.py", "task_perfect_infeasible|task_perfect_infeasible|task-perfect infeasible|https://github.com/TonyQJH/TREK-A-Travel-Reasoning-and-Evaluation-Kit-for-LLM-Agents-in-Complex-Trip-Planning/blob/6ceb4ebb2debd69c5c7c4ba34b5b17524756912b/scoring.py", "cat_efficiency|cat_efficiency|category efficiency|https://github.com/TonyQJH/TREK-A-Travel-Reasoning-and-Evaluation-Kit-for-LLM-Agents-in-Complex-Trip-Planning/blob/6ceb4ebb2debd69c5c7c4ba34b5b17524756912b/scoring.py"] },
|
|
24
|
+
"travelplanner": { "owner": "OSU-NLP-Group", "pins": ["official_entry|https://github.com/OSU-NLP-Group/TravelPlanner/blob/e52c87f4ac348a3410c46dc3553c519db5ec5e23/README.md|git_commit|e52c87f4ac348a3410c46dc3553c519db5ec5e23|official definition", "data|https://huggingface.co/datasets/osunlp/TravelPlanner/tree/8736504ecfc31b7f8b7e40122873c337e83fff7c|git_commit|8736504ecfc31b7f8b7e40122873c337e83fff7c|official Hugging Face dataset git revision", "evaluator|https://github.com/OSU-NLP-Group/TravelPlanner/blob/e52c87f4ac348a3410c46dc3553c519db5ec5e23/evaluation/eval.py|git_commit|e52c87f4ac348a3410c46dc3553c519db5ec5e23|official evaluator"], "rights": ["code|MIT|declared|https://github.com/OSU-NLP-Group/TravelPlanner/blob/e52c87f4ac348a3410c46dc3553c519db5ec5e23/LICENSE", "data|CC-BY-4.0|declared|https://huggingface.co/datasets/osunlp/TravelPlanner/blob/8736504ecfc31b7f8b7e40122873c337e83fff7c/README.md", "evaluator|MIT|declared|https://github.com/OSU-NLP-Group/TravelPlanner/blob/e52c87f4ac348a3410c46dc3553c519db5ec5e23/LICENSE"], "metrics": ["commonsense_micro_pass_rate|Commonsense Constraint Micro Pass Rate|commonsense micro|https://github.com/OSU-NLP-Group/TravelPlanner/blob/e52c87f4ac348a3410c46dc3553c519db5ec5e23/evaluation/eval.py", "commonsense_macro_pass_rate|Commonsense Constraint Macro Pass Rate|commonsense macro|https://github.com/OSU-NLP-Group/TravelPlanner/blob/e52c87f4ac348a3410c46dc3553c519db5ec5e23/evaluation/eval.py", "hard_micro_pass_rate|Hard Constraint Micro Pass Rate|hard-constraint micro|https://github.com/OSU-NLP-Group/TravelPlanner/blob/e52c87f4ac348a3410c46dc3553c519db5ec5e23/evaluation/eval.py", "hard_macro_pass_rate|Hard Constraint Macro Pass Rate|hard-constraint macro|https://github.com/OSU-NLP-Group/TravelPlanner/blob/e52c87f4ac348a3410c46dc3553c519db5ec5e23/evaluation/eval.py", "final_pass_rate|Final Pass Rate|complete itinerary|https://github.com/OSU-NLP-Group/TravelPlanner/blob/e52c87f4ac348a3410c46dc3553c519db5ec5e23/evaluation/eval.py"] },
|
|
25
|
+
"chinatravel": { "owner": "chinatravel-competition", "pins": ["official_entry|https://github.com/chinatravel-competition/IJCAI2026/blob/49d02bc322dda7ffbf53dfb7c3d2ced6b4bd4e8b/index.html|git_commit|49d02bc322dda7ffbf53dfb7c3d2ced6b4bd4e8b|official competition entry", "data|https://github.com/chinatravel-competition/IJCAI2026/blob/49d02bc322dda7ffbf53dfb7c3d2ced6b4bd4e8b/TPC_IJCAI_2026_phase2_familiar_100_data.zip|git_commit|49d02bc322dda7ffbf53dfb7c3d2ced6b4bd4e8b|public familiar-track archive", "evaluator|https://github.com/LAMDA-NeSy/ChinaTravel/blob/b071db251905b14002ec98e8b36afca7b6d6cd04/eval_tpc.py|git_commit|b071db251905b14002ec98e8b36afca7b6d6cd04|official TPC evaluator implementation"], "rights": ["code|not_separately_declared|not_separately_declared|https://github.com/LAMDA-NeSy/ChinaTravel/blob/b071db251905b14002ec98e8b36afca7b6d6cd04/README.md", "data|CC-BY-NC-SA-4.0|declared|https://huggingface.co/datasets/LAMDA-NeSy/ChinaTravel/blob/44d5dbf3bba26bdf9a212c3e76d3242b67f0d349/README.md", "evaluator|not_separately_declared|not_separately_declared|https://github.com/LAMDA-NeSy/ChinaTravel/blob/b071db251905b14002ec98e8b36afca7b6d6cd04/README.md"], "metrics": ["epr_micro|EPR-micro|element pass micro|https://github.com/LAMDA-NeSy/ChinaTravel/blob/b071db251905b14002ec98e8b36afca7b6d6cd04/eval_tpc.py", "epr_macro|EPR-macro|element pass macro|https://github.com/LAMDA-NeSy/ChinaTravel/blob/b071db251905b14002ec98e8b36afca7b6d6cd04/eval_tpc.py", "c_lpr|C-LPR|constraint-level pass|https://github.com/LAMDA-NeSy/ChinaTravel/blob/b071db251905b14002ec98e8b36afca7b6d6cd04/eval_tpc.py", "fpr|FPR|final pass|https://github.com/LAMDA-NeSy/ChinaTravel/blob/b071db251905b14002ec98e8b36afca7b6d6cd04/eval_tpc.py", "dav|DAV|Daily Average Attractions Visited|https://github.com/LAMDA-NeSy/ChinaTravel/blob/b071db251905b14002ec98e8b36afca7b6d6cd04/eval_tpc.py", "att|ATT|Averaged Transportation Time|https://github.com/LAMDA-NeSy/ChinaTravel/blob/b071db251905b14002ec98e8b36afca7b6d6cd04/eval_tpc.py", "ddr|DDR|Daily Dining Recommendations|https://github.com/LAMDA-NeSy/ChinaTravel/blob/b071db251905b14002ec98e8b36afca7b6d6cd04/eval_tpc.py", "overall_score|Overall Score|weighted overall score|https://github.com/LAMDA-NeSy/ChinaTravel/blob/b071db251905b14002ec98e8b36afca7b6d6cd04/eval_tpc.py"] },
|
|
26
|
+
"travelbench": { "owner": "small-xiangcheng", "pins": ["official_entry|https://github.com/small-xiangcheng/TravelBench/blob/445a29d9a9b6457fc95fe647c532b6b79e21c43f/README.md|git_commit|445a29d9a9b6457fc95fe647c532b6b79e21c43f|official definition", "data|https://github.com/small-xiangcheng/TravelBench/tree/445a29d9a9b6457fc95fe647c532b6b79e21c43f/datas|git_commit|445a29d9a9b6457fc95fe647c532b6b79e21c43f|official data directory", "evaluator|https://github.com/small-xiangcheng/TravelBench/blob/445a29d9a9b6457fc95fe647c532b6b79e21c43f/travelbench/evaluation/evaluate.py|git_commit|445a29d9a9b6457fc95fe647c532b6b79e21c43f|official evaluator"], "rights": ["code|MIT|declared|https://github.com/small-xiangcheng/TravelBench/blob/445a29d9a9b6457fc95fe647c532b6b79e21c43f/LICENSE", "data|CC-BY-NC-4.0|declared|https://github.com/small-xiangcheng/TravelBench/blob/445a29d9a9b6457fc95fe647c532b6b79e21c43f/datas/LICENSE", "evaluator|MIT|declared|https://github.com/small-xiangcheng/TravelBench/blob/445a29d9a9b6457fc95fe647c532b6b79e21c43f/LICENSE"], "metrics": ["reasoning_planning_score|reasoning_planning_score|reasoning and planning|https://github.com/small-xiangcheng/TravelBench/blob/445a29d9a9b6457fc95fe647c532b6b79e21c43f/travelbench/evaluation/evaluate.py", "summarization_extraction_score|summarization_extraction_score|summarization and extraction|https://github.com/small-xiangcheng/TravelBench/blob/445a29d9a9b6457fc95fe647c532b6b79e21c43f/travelbench/evaluation/evaluate.py", "presentation_score|presentation_score|presentation|https://github.com/small-xiangcheng/TravelBench/blob/445a29d9a9b6457fc95fe647c532b6b79e21c43f/travelbench/evaluation/evaluate.py", "user_interaction_score|user_interaction_score|user interaction|https://github.com/small-xiangcheng/TravelBench/blob/445a29d9a9b6457fc95fe647c532b6b79e21c43f/travelbench/evaluation/evaluate.py", "average_score|average_score|average across dimensions|https://github.com/small-xiangcheng/TravelBench/blob/445a29d9a9b6457fc95fe647c532b6b79e21c43f/travelbench/evaluation/evaluate.py", "unsolved_accuracy|unsolved_accuracy|unsolved cases|https://github.com/small-xiangcheng/TravelBench/blob/445a29d9a9b6457fc95fe647c532b6b79e21c43f/travelbench/evaluation/evaluate_unsolved.py"] },
|
|
27
|
+
"tau2": { "owner": "sierra-research", "pins": ["official_entry|https://github.com/sierra-research/tau2-bench/blob/a2c024725189473d2d7cea3a5cfdbcc67478e41f/README.md|git_commit|a2c024725189473d2d7cea3a5cfdbcc67478e41f|official definition", "data|https://github.com/sierra-research/tau2-bench/tree/a2c024725189473d2d7cea3a5cfdbcc67478e41f/data/tau2|git_commit|a2c024725189473d2d7cea3a5cfdbcc67478e41f|official data", "evaluator|https://github.com/sierra-research/tau2-bench/blob/a2c024725189473d2d7cea3a5cfdbcc67478e41f/src/tau2/metrics/agent_metrics.py|git_commit|a2c024725189473d2d7cea3a5cfdbcc67478e41f|official agent metrics implementation"], "rights": ["code|MIT|declared|https://github.com/sierra-research/tau2-bench/blob/a2c024725189473d2d7cea3a5cfdbcc67478e41f/LICENSE", "data|not_separately_declared|not_separately_declared|https://github.com/sierra-research/tau2-bench/blob/a2c024725189473d2d7cea3a5cfdbcc67478e41f/README.md", "evaluator|MIT|declared|https://github.com/sierra-research/tau2-bench/blob/a2c024725189473d2d7cea3a5cfdbcc67478e41f/LICENSE"], "metrics": ["avg_reward|avg_reward|average reward|https://github.com/sierra-research/tau2-bench/blob/a2c024725189473d2d7cea3a5cfdbcc67478e41f/src/tau2/metrics/agent_metrics.py", "pass_hat_1|pass^1|mean task pass^1|https://github.com/sierra-research/tau2-bench/blob/a2c024725189473d2d7cea3a5cfdbcc67478e41f/src/tau2/metrics/agent_metrics.py"] },
|
|
28
|
+
"locomo": { "owner": "snap-research", "pins": ["official_entry|https://github.com/snap-research/locomo/blob/3eb6f2c585f5e1699204e3c3bdf7adc5c28cb376/README.MD|git_commit|3eb6f2c585f5e1699204e3c3bdf7adc5c28cb376|official definition", "data|https://github.com/snap-research/locomo/blob/3eb6f2c585f5e1699204e3c3bdf7adc5c28cb376/data/locomo10.json|git_commit|3eb6f2c585f5e1699204e3c3bdf7adc5c28cb376|official data", "evaluator|https://github.com/snap-research/locomo/tree/3eb6f2c585f5e1699204e3c3bdf7adc5c28cb376/task_eval|git_commit|3eb6f2c585f5e1699204e3c3bdf7adc5c28cb376|official task evaluation directory"], "rights": ["code|CC-BY-NC-4.0|declared|https://github.com/snap-research/locomo/blob/3eb6f2c585f5e1699204e3c3bdf7adc5c28cb376/LICENSE.txt", "data|CC-BY-NC-4.0|declared|https://github.com/snap-research/locomo/blob/3eb6f2c585f5e1699204e3c3bdf7adc5c28cb376/LICENSE.txt", "evaluator|CC-BY-NC-4.0|declared|https://github.com/snap-research/locomo/blob/3eb6f2c585f5e1699204e3c3bdf7adc5c28cb376/LICENSE.txt"], "metrics": ["qa_f1|F1|question-answering token F1|https://github.com/snap-research/locomo/blob/3eb6f2c585f5e1699204e3c3bdf7adc5c28cb376/task_eval/evaluate_qa.py"] },
|
|
29
|
+
"bfcl": { "owner": "ShishirPatil", "pins": ["official_entry|https://github.com/ShishirPatil/gorilla/blob/6ea57973c7a6097fd7c5915698c54c17c5b1b6c8/berkeley-function-call-leaderboard/README.md|git_commit|6ea57973c7a6097fd7c5915698c54c17c5b1b6c8|official BFCL definition", "data|https://github.com/ShishirPatil/gorilla/tree/6ea57973c7a6097fd7c5915698c54c17c5b1b6c8/berkeley-function-call-leaderboard/bfcl_eval/data|git_commit|6ea57973c7a6097fd7c5915698c54c17c5b1b6c8|BFCL data", "evaluator|https://github.com/ShishirPatil/gorilla/tree/6ea57973c7a6097fd7c5915698c54c17c5b1b6c8/berkeley-function-call-leaderboard/bfcl_eval|git_commit|6ea57973c7a6097fd7c5915698c54c17c5b1b6c8|BFCL evaluator"], "rights": ["code|Apache-2.0|declared|https://github.com/ShishirPatil/gorilla/blob/6ea57973c7a6097fd7c5915698c54c17c5b1b6c8/LICENSE", "data|Apache-2.0|declared|https://github.com/ShishirPatil/gorilla/blob/6ea57973c7a6097fd7c5915698c54c17c5b1b6c8/berkeley-function-call-leaderboard/README.md", "evaluator|Apache-2.0|declared|https://github.com/ShishirPatil/gorilla/blob/6ea57973c7a6097fd7c5915698c54c17c5b1b6c8/LICENSE"], "metrics": ["category_accuracy|accuracy|per test_category|https://github.com/ShishirPatil/gorilla/blob/6ea57973c7a6097fd7c5915698c54c17c5b1b6c8/berkeley-function-call-leaderboard/bfcl_eval/eval_checker/eval_runner_helper.py", "overall_accuracy|Overall Acc|overall accuracy|https://github.com/ShishirPatil/gorilla/blob/6ea57973c7a6097fd7c5915698c54c17c5b1b6c8/berkeley-function-call-leaderboard/README.md"] },
|
|
30
|
+
});
|
|
31
|
+
const raw = load('data/evaluation/known-good.json');
|
|
32
|
+
const diagnostic = parseEvaluationFoundation({ registry, ...raw });
|
|
33
|
+
assert.equal(diagnostic.cases.length, 1);
|
|
34
|
+
assert.equal(diagnostic.run_receipts.length, 1);
|
|
35
|
+
assert.equal(diagnostic.run_receipts[0].evidence_kind, 'synthetic_fixture');
|
|
36
|
+
assert.equal(diagnostic.run_receipts[0].pairing, null);
|
|
37
|
+
assert.equal(diagnostic.run_receipts[0].qualification.official_result, false);
|
|
38
|
+
const emptyResolver = { resolve: () => undefined };
|
|
39
|
+
assert.deepEqual(deriveMatchedPairs(diagnostic, emptyResolver), []);
|
|
40
|
+
for (const item of diagnostic.cases)
|
|
41
|
+
parseEvalCase(item);
|
|
42
|
+
for (const item of diagnostic.run_receipts)
|
|
43
|
+
parseEvalRunReceipt(item);
|
|
44
|
+
for (const item of diagnostic.failure_clusters)
|
|
45
|
+
parseEvalFailureCluster(item);
|
|
46
|
+
for (const item of [...diagnostic.cases, ...diagnostic.run_receipts, ...diagnostic.failure_clusters])
|
|
47
|
+
assertPublicArtifactSafe(item, 'repository fixture');
|
|
48
|
+
const trek = registry.find(item => item.benchmark_id === 'trek');
|
|
49
|
+
const evalCase = diagnostic.cases[0];
|
|
50
|
+
const observedCase = { ...evalCase, input_ref: { ...evalCase.input_ref, kind: 'external_opaque_reference' } };
|
|
51
|
+
const seed = diagnostic.run_receipts[0];
|
|
52
|
+
const controls = {
|
|
53
|
+
...seed.controls,
|
|
54
|
+
case_set_sha256: evaluationFingerprint([observedCase]),
|
|
55
|
+
scorer_sha256: evaluationFingerprint(observedCase.scorer_revision),
|
|
56
|
+
source_fence_sha256: evaluationFingerprint(trek.source_fence),
|
|
57
|
+
official_evaluator_sha256: evaluationFingerprint(trek.provenance.evaluator),
|
|
58
|
+
};
|
|
59
|
+
const observed = (role) => {
|
|
60
|
+
const run = {
|
|
61
|
+
...seed,
|
|
62
|
+
run_id: `run:trek:${role}-test-only`, evidence_kind: 'observed_external',
|
|
63
|
+
gotry_sha: role === 'baseline' ? '1111111111111111111111111111111111111111' : '2222222222222222222222222222222222222222',
|
|
64
|
+
pairing: { pair_id: 'pair:trek:test-only', role, counterpart_run_id: `run:trek:${role === 'baseline' ? 'treatment' : 'baseline'}-test-only` },
|
|
65
|
+
model: { provider: 'test-provider', model: 'test-model' }, controls,
|
|
66
|
+
qualification: {
|
|
67
|
+
official_result: true, source_fence_passed: true, integrity_passed: true,
|
|
68
|
+
evidence_receipts: { official_evaluator_output_sha256: null, source_fence_audit_sha256: null, integrity_audit_sha256: null },
|
|
69
|
+
},
|
|
70
|
+
experiment: {
|
|
71
|
+
changed_variables: role === 'baseline' ? [] : ['gotry_sha'],
|
|
72
|
+
candidate_sha256: evaluationFingerprint({ treatment_variable: 'gotry_sha', gotry_sha: role === 'baseline' ? '1111111111111111111111111111111111111111' : '2222222222222222222222222222222222222222' }),
|
|
73
|
+
},
|
|
74
|
+
evidence_summary: { ...seed.evidence_summary, fixture_only: false, statement: 'test-only observed-external aggregate admission object' },
|
|
75
|
+
};
|
|
76
|
+
const { evidence_receipts: _receipts, ...qualification } = run.qualification;
|
|
77
|
+
const bound = { ...run, qualification };
|
|
78
|
+
const base = { schema_version: 'gotry_eval_evidence_artifact_v0', run_id: run.run_id, benchmark_id: run.benchmark_id, case_id: run.case_id, run_binding_sha256: evaluationFingerprint(bound) };
|
|
79
|
+
const artifacts = {
|
|
80
|
+
official_evaluator: { ...base, artifact_kind: 'official_evaluator', evaluator_sha256: run.controls.official_evaluator_sha256, native_metrics_sha256: evaluationFingerprint(run.native_metrics), native_metrics: run.native_metrics, official_result: true },
|
|
81
|
+
source_fence_audit: { ...base, artifact_kind: 'source_fence_audit', source_fence_sha256: run.controls.source_fence_sha256, input_digest_sha256: observedCase.input_ref.digest_sha256, source_fence_passed: true, forbidden_field_hits: 0 },
|
|
82
|
+
integrity_audit: { ...base, artifact_kind: 'integrity_audit', integrity_sha256: run.controls.integrity_sha256, candidate_sha256: run.experiment.candidate_sha256, integrity_passed: true },
|
|
83
|
+
};
|
|
84
|
+
run.qualification.evidence_receipts = { official_evaluator_output_sha256: evaluationFingerprint(artifacts.official_evaluator), source_fence_audit_sha256: evaluationFingerprint(artifacts.source_fence_audit), integrity_audit_sha256: evaluationFingerprint(artifacts.integrity_audit) };
|
|
85
|
+
return run;
|
|
86
|
+
};
|
|
87
|
+
const countable = parseEvaluationFoundation({
|
|
88
|
+
registry, cases: [observedCase], run_receipts: [observed('baseline'), observed('treatment')],
|
|
89
|
+
failure_clusters: [{ ...diagnostic.failure_clusters[0], run_ids: ['run:trek:baseline-test-only', 'run:trek:treatment-test-only'] }],
|
|
90
|
+
});
|
|
91
|
+
const artifactResolver = { resolve(sha256) {
|
|
92
|
+
for (const run of countable.run_receipts) {
|
|
93
|
+
const { evidence_receipts: _receipts, ...qualification } = run.qualification;
|
|
94
|
+
const bound = { ...run, qualification };
|
|
95
|
+
const base = { schema_version: 'gotry_eval_evidence_artifact_v0', run_id: run.run_id, benchmark_id: run.benchmark_id, case_id: run.case_id, run_binding_sha256: evaluationFingerprint(bound) };
|
|
96
|
+
const artifacts = [{ ...base, artifact_kind: 'official_evaluator', evaluator_sha256: run.controls.official_evaluator_sha256, native_metrics_sha256: evaluationFingerprint(run.native_metrics), native_metrics: run.native_metrics, official_result: true }, { ...base, artifact_kind: 'source_fence_audit', source_fence_sha256: run.controls.source_fence_sha256, input_digest_sha256: observedCase.input_ref.digest_sha256, source_fence_passed: true, forbidden_field_hits: 0 }, { ...base, artifact_kind: 'integrity_audit', integrity_sha256: run.controls.integrity_sha256, candidate_sha256: run.experiment.candidate_sha256, integrity_passed: true }];
|
|
97
|
+
const found = artifacts.find(item => evaluationFingerprint(item) === sha256);
|
|
98
|
+
if (found)
|
|
99
|
+
return found;
|
|
100
|
+
}
|
|
101
|
+
return undefined;
|
|
102
|
+
} };
|
|
103
|
+
const fingerprintMismatchResolver = { resolve(sha256) { const artifact = artifactResolver.resolve(sha256); if (!artifact)
|
|
104
|
+
return undefined; const changed = structuredClone(artifact); if (changed.artifact_kind === 'official_evaluator')
|
|
105
|
+
changed.official_result = false; return changed; } };
|
|
106
|
+
assert.throws(() => deriveMatchedPairs(countable, fingerprintMismatchResolver), /fingerprint mismatch/);
|
|
107
|
+
const pairs = deriveMatchedPairs(countable, artifactResolver);
|
|
108
|
+
assert.deepEqual(pairs, [{
|
|
109
|
+
schema_version: 'gotry_eval_matched_pair_derived_v0', pair_id: 'pair:trek:test-only', benchmark_id: 'trek',
|
|
110
|
+
case_id: 'gotry:foundation:case-001', baseline_run_id: 'run:trek:baseline-test-only',
|
|
111
|
+
treatment_run_id: 'run:trek:treatment-test-only', treatment_variable: 'gotry_sha', matched_pair_countable: true,
|
|
112
|
+
}]);
|
|
113
|
+
// Each adversarial artifact is re-signed and its receipt updated, so deriveMatchedPairs
|
|
114
|
+
// reaches the semantic closure under test rather than stopping at the fingerprint gate.
|
|
115
|
+
const exerciseArtifact = (runIndex, kind, mutate, expected) => {
|
|
116
|
+
const foundation = structuredClone(countable);
|
|
117
|
+
const run = foundation.run_receipts[runIndex];
|
|
118
|
+
const receiptKey = kind === 'official_evaluator' ? 'official_evaluator_output_sha256' : kind === 'source_fence_audit' ? 'source_fence_audit_sha256' : 'integrity_audit_sha256';
|
|
119
|
+
const original = artifactResolver.resolve(run.qualification.evidence_receipts[receiptKey]);
|
|
120
|
+
const artifact = structuredClone(original);
|
|
121
|
+
mutate(artifact);
|
|
122
|
+
const digest = evaluationFingerprint(artifact);
|
|
123
|
+
run.qualification.evidence_receipts[receiptKey] = digest;
|
|
124
|
+
const resolver = { resolve(sha256) { return sha256 === digest ? artifact : artifactResolver.resolve(sha256); } };
|
|
125
|
+
assert.throws(() => deriveMatchedPairs(foundation, resolver), expected);
|
|
126
|
+
};
|
|
127
|
+
assert.throws(() => deriveMatchedPairs(countable, { resolve: () => undefined }), /artifact/);
|
|
128
|
+
exerciseArtifact(0, 'official_evaluator', a => { a.evaluator_sha256 = 'f'.repeat(64); }, /evaluator artifact mismatch/);
|
|
129
|
+
exerciseArtifact(0, 'official_evaluator', a => { a.native_metrics = { altered: 1 }; a.native_metrics_sha256 = evaluationFingerprint(a.native_metrics); }, /evaluator artifact mismatch/);
|
|
130
|
+
exerciseArtifact(0, 'source_fence_audit', a => { a.input_digest_sha256 = 'f'.repeat(64); }, /source-fence artifact mismatch/);
|
|
131
|
+
exerciseArtifact(0, 'source_fence_audit', a => { a.source_fence_passed = false; }, /source-fence artifact mismatch/);
|
|
132
|
+
exerciseArtifact(0, 'source_fence_audit', a => { a.forbidden_field_hits = 1; }, /source-fence artifact mismatch/);
|
|
133
|
+
exerciseArtifact(0, 'integrity_audit', a => { a.candidate_sha256 = 'f'.repeat(64); }, /integrity artifact mismatch/);
|
|
134
|
+
exerciseArtifact(0, 'integrity_audit', a => { a.integrity_passed = false; }, /integrity artifact mismatch/);
|
|
135
|
+
const treatmentReuse = structuredClone(countable);
|
|
136
|
+
const baselineReceipt = treatmentReuse.run_receipts[0].qualification.evidence_receipts.official_evaluator_output_sha256;
|
|
137
|
+
treatmentReuse.run_receipts[1].qualification.evidence_receipts.official_evaluator_output_sha256 = baselineReceipt;
|
|
138
|
+
assert.throws(() => deriveMatchedPairs(treatmentReuse, artifactResolver), /fingerprint mismatch|binding mismatch/);
|
|
139
|
+
// D-28 admission gate solidification (issue #203): the registry file's countability
|
|
140
|
+
// face is a frozen fact — chinatravel/travelbench/locomo are diagnostic_only. The
|
|
141
|
+
// `pair-diagnostic-default` vector proves the mechanism on registry[0]; this block
|
|
142
|
+
// pins the published face itself and proves an otherwise fully-qualified ChinaTravel
|
|
143
|
+
// paired construction (reciprocal observed_external roles, identical model identity,
|
|
144
|
+
// all eight controls, evaluator/source-fence/integrity artifacts resolved and closed)
|
|
145
|
+
// is rejected as diagnostic-only, and becomes derivable only when that frozen face is
|
|
146
|
+
// flipped in memory. Per docs/evaluation/evaluation-foundation.md these in-memory
|
|
147
|
+
// observed_external objects are countable_test_only falsification inputs: never
|
|
148
|
+
// written to git, never a baseline, production result, official score, or
|
|
149
|
+
// Agent-quality evidence.
|
|
150
|
+
const countability = Object.fromEntries(registry.map(item => [item.benchmark_id, item.countability_default]));
|
|
151
|
+
assert.deepEqual(countability, {
|
|
152
|
+
trek: 'countable_if_qualified',
|
|
153
|
+
travelplanner: 'countable_if_qualified',
|
|
154
|
+
chinatravel: 'diagnostic_only',
|
|
155
|
+
travelbench: 'diagnostic_only',
|
|
156
|
+
tau2: 'countable_if_qualified',
|
|
157
|
+
locomo: 'diagnostic_only',
|
|
158
|
+
bfcl: 'countable_if_qualified',
|
|
159
|
+
});
|
|
160
|
+
const chinatravel = registry.find(item => item.benchmark_id === 'chinatravel');
|
|
161
|
+
const ctCase = {
|
|
162
|
+
...structuredClone(observedCase),
|
|
163
|
+
benchmark_id: 'chinatravel',
|
|
164
|
+
case_id: 'gotry:foundation:chinatravel-admission-probe',
|
|
165
|
+
};
|
|
166
|
+
const ctMetrics = Object.fromEntries(chinatravel.native_metrics.values.map(metric => [metric.receipt_key, 0.5]));
|
|
167
|
+
const ctControls = {
|
|
168
|
+
...seed.controls,
|
|
169
|
+
case_set_sha256: evaluationFingerprint([ctCase]),
|
|
170
|
+
scorer_sha256: evaluationFingerprint(ctCase.scorer_revision),
|
|
171
|
+
source_fence_sha256: evaluationFingerprint(chinatravel.source_fence),
|
|
172
|
+
official_evaluator_sha256: evaluationFingerprint(chinatravel.provenance.evaluator),
|
|
173
|
+
};
|
|
174
|
+
const ctRun = (role) => {
|
|
175
|
+
const sha = role === 'baseline' ? '3333333333333333333333333333333333333333' : '4444444444444444444444444444444444444444';
|
|
176
|
+
const run = {
|
|
177
|
+
...seed,
|
|
178
|
+
run_id: `run:chinatravel:${role}-probe`, benchmark_id: 'chinatravel', case_id: ctCase.case_id,
|
|
179
|
+
evidence_kind: 'observed_external',
|
|
180
|
+
gotry_sha: sha,
|
|
181
|
+
pairing: { pair_id: 'pair:chinatravel:admission-gate-probe', role, counterpart_run_id: `run:chinatravel:${role === 'baseline' ? 'treatment' : 'baseline'}-probe` },
|
|
182
|
+
model: { provider: 'test-provider', model: 'test-model' }, controls: ctControls,
|
|
183
|
+
qualification: {
|
|
184
|
+
official_result: true, source_fence_passed: true, integrity_passed: true,
|
|
185
|
+
evidence_receipts: { official_evaluator_output_sha256: null, source_fence_audit_sha256: null, integrity_audit_sha256: null },
|
|
186
|
+
},
|
|
187
|
+
experiment: {
|
|
188
|
+
changed_variables: role === 'baseline' ? [] : ['gotry_sha'],
|
|
189
|
+
candidate_sha256: evaluationFingerprint({ treatment_variable: 'gotry_sha', gotry_sha: sha }),
|
|
190
|
+
},
|
|
191
|
+
native_metrics: ctMetrics,
|
|
192
|
+
evidence_summary: { ...seed.evidence_summary, fixture_only: false, statement: 'test-only diagnostic-gate falsification pair' },
|
|
193
|
+
};
|
|
194
|
+
const { evidence_receipts: _receipts, ...qualification } = run.qualification;
|
|
195
|
+
const bound = { ...run, qualification };
|
|
196
|
+
const base = { schema_version: 'gotry_eval_evidence_artifact_v0', run_id: run.run_id, benchmark_id: run.benchmark_id, case_id: run.case_id, run_binding_sha256: evaluationFingerprint(bound) };
|
|
197
|
+
const artifacts = {
|
|
198
|
+
official_evaluator: { ...base, artifact_kind: 'official_evaluator', evaluator_sha256: run.controls.official_evaluator_sha256, native_metrics_sha256: evaluationFingerprint(run.native_metrics), native_metrics: run.native_metrics, official_result: true },
|
|
199
|
+
source_fence_audit: { ...base, artifact_kind: 'source_fence_audit', source_fence_sha256: run.controls.source_fence_sha256, input_digest_sha256: ctCase.input_ref.digest_sha256, source_fence_passed: true, forbidden_field_hits: 0 },
|
|
200
|
+
integrity_audit: { ...base, artifact_kind: 'integrity_audit', integrity_sha256: run.controls.integrity_sha256, candidate_sha256: run.experiment.candidate_sha256, integrity_passed: true },
|
|
201
|
+
};
|
|
202
|
+
run.qualification.evidence_receipts = { official_evaluator_output_sha256: evaluationFingerprint(artifacts.official_evaluator), source_fence_audit_sha256: evaluationFingerprint(artifacts.source_fence_audit), integrity_audit_sha256: evaluationFingerprint(artifacts.integrity_audit) };
|
|
203
|
+
return run;
|
|
204
|
+
};
|
|
205
|
+
const ctFoundation = parseEvaluationFoundation({
|
|
206
|
+
registry, cases: [ctCase], run_receipts: [ctRun('baseline'), ctRun('treatment')], failure_clusters: [],
|
|
207
|
+
});
|
|
208
|
+
const ctResolver = { resolve(sha256) {
|
|
209
|
+
for (const run of ctFoundation.run_receipts) {
|
|
210
|
+
const { evidence_receipts: _receipts, ...qualification } = run.qualification;
|
|
211
|
+
const bound = { ...run, qualification };
|
|
212
|
+
const base = { schema_version: 'gotry_eval_evidence_artifact_v0', run_id: run.run_id, benchmark_id: run.benchmark_id, case_id: run.case_id, run_binding_sha256: evaluationFingerprint(bound) };
|
|
213
|
+
const artifacts = [{ ...base, artifact_kind: 'official_evaluator', evaluator_sha256: run.controls.official_evaluator_sha256, native_metrics_sha256: evaluationFingerprint(run.native_metrics), native_metrics: run.native_metrics, official_result: true }, { ...base, artifact_kind: 'source_fence_audit', source_fence_sha256: run.controls.source_fence_sha256, input_digest_sha256: ctCase.input_ref.digest_sha256, source_fence_passed: true, forbidden_field_hits: 0 }, { ...base, artifact_kind: 'integrity_audit', integrity_sha256: run.controls.integrity_sha256, candidate_sha256: run.experiment.candidate_sha256, integrity_passed: true }];
|
|
214
|
+
const found = artifacts.find(item => evaluationFingerprint(item) === sha256);
|
|
215
|
+
if (found)
|
|
216
|
+
return found;
|
|
217
|
+
}
|
|
218
|
+
return undefined;
|
|
219
|
+
} };
|
|
220
|
+
assert.throws(() => deriveMatchedPairs(ctFoundation, ctResolver), /diagnostic only/);
|
|
221
|
+
const flippedRegistry = structuredClone(registry);
|
|
222
|
+
flippedRegistry[2].countability_default = 'countable_if_qualified';
|
|
223
|
+
const flippedFoundation = parseEvaluationFoundation({
|
|
224
|
+
registry: flippedRegistry, cases: [ctCase], run_receipts: [ctRun('baseline'), ctRun('treatment')], failure_clusters: [],
|
|
225
|
+
});
|
|
226
|
+
assert.deepEqual(deriveMatchedPairs(flippedFoundation, ctResolver), [{
|
|
227
|
+
schema_version: 'gotry_eval_matched_pair_derived_v0', pair_id: 'pair:chinatravel:admission-gate-probe', benchmark_id: 'chinatravel',
|
|
228
|
+
case_id: 'gotry:foundation:chinatravel-admission-probe', baseline_run_id: 'run:chinatravel:baseline-probe',
|
|
229
|
+
treatment_run_id: 'run:chinatravel:treatment-probe', treatment_variable: 'gotry_sha', matched_pair_countable: true,
|
|
230
|
+
}]);
|
|
231
|
+
const canonical1 = stableEvaluationJson(diagnostic);
|
|
232
|
+
const canonical2 = stableEvaluationJson(parseEvaluationFoundation(JSON.parse(canonical1)));
|
|
233
|
+
const digest1 = createHash('sha256').update(canonical1).digest('hex');
|
|
234
|
+
const digest2 = createHash('sha256').update(canonical2).digest('hex');
|
|
235
|
+
assert.equal(canonical1, canonical2);
|
|
236
|
+
assert.equal(digest1, digest2);
|
|
237
|
+
assert.match(digest1, /^[0-9a-f]{64}$/);
|
|
238
|
+
const vectors = parseMutationVectors(load('data/evaluation/known-bad.json'));
|
|
239
|
+
assert.equal(vectors.length, 39);
|
|
240
|
+
for (const vector of vectors) {
|
|
241
|
+
const base = vector.foundation_kind === 'countable_test_only' ? countable : diagnostic;
|
|
242
|
+
const mutated = applyMutationVector(base, vector);
|
|
243
|
+
assert.throws(() => vector.target === 'foundation' ? deriveMatchedPairs(parseEvaluationFoundation(mutated), vector.foundation_kind === 'countable_test_only' ? artifactResolver : emptyResolver)
|
|
244
|
+
: vector.target === 'registry' ? parseBenchmarkRegistry(mutated)
|
|
245
|
+
: vector.target === 'case' ? parseEvalCase(mutated)
|
|
246
|
+
: vector.target === 'run' ? parseEvalRunReceipt(mutated) : parseEvalFailureCluster(mutated), new RegExp(vector.expected_error), vector.id);
|
|
247
|
+
}
|
|
248
|
+
const runAll = readFileSync('../scripts/run-all-tests.sh', 'utf8');
|
|
249
|
+
assert.match(runAll, /=== 46\. Evaluation Phase 0 foundation/);
|
|
250
|
+
assert.match(runAll, /npx tsx scripts\/evaluation-contract-tests\.ts/);
|
|
251
|
+
assert.throws(() => deriveMatchedPairs(countable, emptyResolver), /artifact/);
|
|
252
|
+
for (const [key, value] of [['apikey', 'secret'], ['access-token', 'secret'], ['apiKey', 'secret'], ['ACCESS-TOKEN', 'secret'], ['client_secret', 'secret'], ['authorization', 'Bearer abcdefghijklmnopqrstuvwxyz123456'], ['value', '/private/file'], ['value', '~/private/file'], ['value', 'C:\\private\\file'], ['value', 'file:///private/file'], ['value', 'sk-abcdefghijklmnopqrstuv'], ['value', 'ghp_abcdefghijklmnopqrstuvwxyz123456'], ['value', 'AKIA1234567890ABCDEF']])
|
|
253
|
+
assert.throws(() => assertPublicArtifactSafe({ [key]: value }, 'adversarial'), /absolute path or secret|credentials/);
|
|
254
|
+
assert.doesNotThrow(() => assertPublicArtifactSafe({ url: 'https://github.com/org/repo/blob/main/README.md', label: 'question-answering token F1' }, 'benign'));
|
|
255
|
+
assert.throws(() => assertPublicArtifactSafe({ value: 'https://example.test/?token=sk-abcdefghijklmnopqrstuv' }, 'https-url-secret'), /absolute path or secret/);
|
|
256
|
+
for (const value of ['log=/Users/a/private.json', 'C:\\Users\\a\\secret', 'file:///tmp/x', '~/x', 'https://github.com/org/repo log=/Users/a/x', 'Bearer abcdefghijklmnopqrstuvwxyz123456', 'sk-abcdefghijklmnopqrstuv', 'ghp_abcdefghijklmnopqrstuvwxyz123456', 'AKIA1234567890ABCDEF'])
|
|
257
|
+
assert.throws(() => assertPublicArtifactSafe({ value }, 'path-or-secret'), /absolute path or secret/);
|
|
258
|
+
assert.doesNotThrow(() => assertPublicArtifactSafe({ github: 'https://github.com/org/repo', huggingface: 'https://huggingface.co/datasets/org/name' }, 'public urls'));
|
|
259
|
+
for (const key of ['source_fence_passed', 'integrity_passed']) {
|
|
260
|
+
const syntheticFlags = JSON.parse(JSON.stringify(load('data/evaluation/known-good.json')));
|
|
261
|
+
const run = syntheticFlags.run_receipts[0];
|
|
262
|
+
const qualification = run.qualification;
|
|
263
|
+
qualification[key] = true;
|
|
264
|
+
assert.equal(qualification[key === 'source_fence_passed' ? 'integrity_passed' : 'source_fence_passed'], false);
|
|
265
|
+
assert.throws(() => parseEvalRunReceipt(run), /synthetic fixture/);
|
|
266
|
+
}
|
|
267
|
+
console.log(`canonical sha256: ${digest1}`);
|
|
268
|
+
console.log(`evaluation-contract tests: ${registry.length} registry, 1 test-only matched pair, 39 negative vectors, chinatravel diagnostic-only gate green`);
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* extension-distribution CLI 入口(gotry setup --extension-from=github,ADR-21):
|
|
3
|
+
*
|
|
4
|
+
* bin/gotry-bootstrap.js setup 子命令 spawn `npx tsx scripts/extension-distribution-cli.ts`,
|
|
5
|
+
* 本脚本调 installExtensionFromGithub,把结果以单行 JSON stdout 打印(父进程解析后人话化)。
|
|
6
|
+
*
|
|
7
|
+
* 参数:
|
|
8
|
+
* --dest <dir> 落位目录(默认 ~/.gotry/extension)
|
|
9
|
+
* --source-dir <dir> bundled 钉扎参照(默认仓库 extension/,由 bootstrap 传入)
|
|
10
|
+
* --release-base <url> Releases 基址(默认 GitHub 官方;测试/镜像可覆盖)
|
|
11
|
+
* --check-only 只报告远端版本,不落盘
|
|
12
|
+
*
|
|
13
|
+
* 退出码:0 = installed/up-to-date;2 = fallback-bundled(JSON 字段区分原因,父进程据此降级);
|
|
14
|
+
* 非 0 且无 JSON = 脚本自身异常。
|
|
15
|
+
*/
|
|
16
|
+
import process from 'node:process';
|
|
17
|
+
import { homedir } from 'node:os';
|
|
18
|
+
import { join, dirname } from 'node:path';
|
|
19
|
+
import { fileURLToPath } from 'node:url';
|
|
20
|
+
import { DEFAULT_RELEASE_BASE, installExtensionFromGithub } from '../capabilities/session/extension-distribution.js';
|
|
21
|
+
function argValue(argv, name) {
|
|
22
|
+
const i = argv.indexOf(name);
|
|
23
|
+
return i >= 0 ? argv[i + 1] : undefined;
|
|
24
|
+
}
|
|
25
|
+
const argv = process.argv.slice(2);
|
|
26
|
+
const repoRoot = join(dirname(fileURLToPath(import.meta.url)), '..', '..');
|
|
27
|
+
const dest = argValue(argv, '--dest') ?? join(homedir(), '.gotry', 'extension');
|
|
28
|
+
const sourceDir = argValue(argv, '--source-dir') ?? join(repoRoot, 'extension');
|
|
29
|
+
const releaseBase = argValue(argv, '--release-base') ?? DEFAULT_RELEASE_BASE;
|
|
30
|
+
const checkOnly = argv.includes('--check-only');
|
|
31
|
+
try {
|
|
32
|
+
const r = await installExtensionFromGithub({ destDir: dest, pinnedSourceDir: sourceDir, releaseBase, checkOnly });
|
|
33
|
+
process.stdout.write(`${JSON.stringify(r)}\n`);
|
|
34
|
+
process.exit(r.ok ? 0 : 2);
|
|
35
|
+
}
|
|
36
|
+
catch (e) {
|
|
37
|
+
process.stdout.write(`${JSON.stringify({ ok: false, action: 'fallback-bundled', error: `CLI 异常 ${e.message}` })}\n`);
|
|
38
|
+
process.exit(2);
|
|
39
|
+
}
|