@enricai/barnacle 1.0.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/LICENSE +21 -0
- package/README.md +958 -0
- package/dist/api/errors.d.ts +88 -0
- package/dist/api/errors.d.ts.map +1 -0
- package/dist/api/errors.js +164 -0
- package/dist/api/errors.js.map +1 -0
- package/dist/api/helpers/envelope.d.ts +13 -0
- package/dist/api/helpers/envelope.d.ts.map +1 -0
- package/dist/api/helpers/envelope.js +20 -0
- package/dist/api/helpers/envelope.js.map +1 -0
- package/dist/api/helpers/reply.d.ts +9 -0
- package/dist/api/helpers/reply.d.ts.map +1 -0
- package/dist/api/helpers/reply.js +14 -0
- package/dist/api/helpers/reply.js.map +1 -0
- package/dist/api/plugins/auth.d.ts +27 -0
- package/dist/api/plugins/auth.d.ts.map +1 -0
- package/dist/api/plugins/auth.js +111 -0
- package/dist/api/plugins/auth.js.map +1 -0
- package/dist/api/plugins/error-handler.d.ts +12 -0
- package/dist/api/plugins/error-handler.d.ts.map +1 -0
- package/dist/api/plugins/error-handler.js +72 -0
- package/dist/api/plugins/error-handler.js.map +1 -0
- package/dist/api/plugins/request-context.d.ts +17 -0
- package/dist/api/plugins/request-context.d.ts.map +1 -0
- package/dist/api/plugins/request-context.js +61 -0
- package/dist/api/plugins/request-context.js.map +1 -0
- package/dist/api/routes/health.d.ts +55 -0
- package/dist/api/routes/health.d.ts.map +1 -0
- package/dist/api/routes/health.js +137 -0
- package/dist/api/routes/health.js.map +1 -0
- package/dist/api/routes/plugins-introspection.d.ts +17 -0
- package/dist/api/routes/plugins-introspection.d.ts.map +1 -0
- package/dist/api/routes/plugins-introspection.js +13 -0
- package/dist/api/routes/plugins-introspection.js.map +1 -0
- package/dist/api/schemas/common.d.ts +114 -0
- package/dist/api/schemas/common.d.ts.map +1 -0
- package/dist/api/schemas/common.js +109 -0
- package/dist/api/schemas/common.js.map +1 -0
- package/dist/api/schemas/telemetry.d.ts +66 -0
- package/dist/api/schemas/telemetry.d.ts.map +1 -0
- package/dist/api/schemas/telemetry.js +52 -0
- package/dist/api/schemas/telemetry.js.map +1 -0
- package/dist/cache/keyed-ttl-cache.d.ts +45 -0
- package/dist/cache/keyed-ttl-cache.d.ts.map +1 -0
- package/dist/cache/keyed-ttl-cache.js +69 -0
- package/dist/cache/keyed-ttl-cache.js.map +1 -0
- package/dist/cache/response-cache.d.ts +37 -0
- package/dist/cache/response-cache.d.ts.map +1 -0
- package/dist/cache/response-cache.js +114 -0
- package/dist/cache/response-cache.js.map +1 -0
- package/dist/config.d.ts +258 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +138 -0
- package/dist/config.js.map +1 -0
- package/dist/lib/applicant-payload.d.ts +28 -0
- package/dist/lib/applicant-payload.d.ts.map +1 -0
- package/dist/lib/applicant-payload.js +20 -0
- package/dist/lib/applicant-payload.js.map +1 -0
- package/dist/lib/application-address.d.ts +16 -0
- package/dist/lib/application-address.d.ts.map +1 -0
- package/dist/lib/application-address.js +20 -0
- package/dist/lib/application-address.js.map +1 -0
- package/dist/lib/application-answers.d.ts +151 -0
- package/dist/lib/application-answers.d.ts.map +1 -0
- package/dist/lib/application-answers.js +95 -0
- package/dist/lib/application-answers.js.map +1 -0
- package/dist/lib/application-identity.d.ts +18 -0
- package/dist/lib/application-identity.d.ts.map +1 -0
- package/dist/lib/application-identity.js +20 -0
- package/dist/lib/application-identity.js.map +1 -0
- package/dist/lib/application-resume.d.ts +21 -0
- package/dist/lib/application-resume.d.ts.map +1 -0
- package/dist/lib/application-resume.js +23 -0
- package/dist/lib/application-resume.js.map +1 -0
- package/dist/lib/bedrock.d.ts +22 -0
- package/dist/lib/bedrock.d.ts.map +1 -0
- package/dist/lib/bedrock.js +35 -0
- package/dist/lib/bedrock.js.map +1 -0
- package/dist/lib/case-insensitive-headers.d.ts +15 -0
- package/dist/lib/case-insensitive-headers.d.ts.map +1 -0
- package/dist/lib/case-insensitive-headers.js +29 -0
- package/dist/lib/case-insensitive-headers.js.map +1 -0
- package/dist/lib/chromium-client-hints.d.ts +11 -0
- package/dist/lib/chromium-client-hints.d.ts.map +1 -0
- package/dist/lib/chromium-client-hints.js +17 -0
- package/dist/lib/chromium-client-hints.js.map +1 -0
- package/dist/lib/cookie-value.d.ts +8 -0
- package/dist/lib/cookie-value.d.ts.map +1 -0
- package/dist/lib/cookie-value.js +14 -0
- package/dist/lib/cookie-value.js.map +1 -0
- package/dist/lib/datadog.d.ts +8 -0
- package/dist/lib/datadog.d.ts.map +1 -0
- package/dist/lib/datadog.js +27 -0
- package/dist/lib/datadog.js.map +1 -0
- package/dist/lib/dd-metrics.d.ts +28 -0
- package/dist/lib/dd-metrics.d.ts.map +1 -0
- package/dist/lib/dd-metrics.js +62 -0
- package/dist/lib/dd-metrics.js.map +1 -0
- package/dist/lib/dispatch-metrics.d.ts +19 -0
- package/dist/lib/dispatch-metrics.d.ts.map +1 -0
- package/dist/lib/dispatch-metrics.js +65 -0
- package/dist/lib/dispatch-metrics.js.map +1 -0
- package/dist/lib/env.d.ts +37 -0
- package/dist/lib/env.d.ts.map +1 -0
- package/dist/lib/env.js +70 -0
- package/dist/lib/env.js.map +1 -0
- package/dist/lib/errors.d.ts +15 -0
- package/dist/lib/errors.d.ts.map +1 -0
- package/dist/lib/errors.js +20 -0
- package/dist/lib/errors.js.map +1 -0
- package/dist/lib/http.d.ts +7 -0
- package/dist/lib/http.d.ts.map +1 -0
- package/dist/lib/http.js +14 -0
- package/dist/lib/http.js.map +1 -0
- package/dist/lib/job-tracking.d.ts +17 -0
- package/dist/lib/job-tracking.d.ts.map +1 -0
- package/dist/lib/job-tracking.js +19 -0
- package/dist/lib/job-tracking.js.map +1 -0
- package/dist/lib/llm/anthropic-client.d.ts +12 -0
- package/dist/lib/llm/anthropic-client.d.ts.map +1 -0
- package/dist/lib/llm/anthropic-client.js +23 -0
- package/dist/lib/llm/anthropic-client.js.map +1 -0
- package/dist/lib/llm/judge.d.ts +57 -0
- package/dist/lib/llm/judge.d.ts.map +1 -0
- package/dist/lib/llm/judge.js +123 -0
- package/dist/lib/llm/judge.js.map +1 -0
- package/dist/lib/llm/judges/error-messages.d.ts +38 -0
- package/dist/lib/llm/judges/error-messages.d.ts.map +1 -0
- package/dist/lib/llm/judges/error-messages.js +72 -0
- package/dist/lib/llm/judges/error-messages.js.map +1 -0
- package/dist/lib/llm/judges/invalid-fields.d.ts +43 -0
- package/dist/lib/llm/judges/invalid-fields.d.ts.map +1 -0
- package/dist/lib/llm/judges/invalid-fields.js +80 -0
- package/dist/lib/llm/judges/invalid-fields.js.map +1 -0
- package/dist/lib/llm/judges/modal-priority.d.ts +41 -0
- package/dist/lib/llm/judges/modal-priority.d.ts.map +1 -0
- package/dist/lib/llm/judges/modal-priority.js +74 -0
- package/dist/lib/llm/judges/modal-priority.js.map +1 -0
- package/dist/lib/llm/judges/select-option.d.ts +49 -0
- package/dist/lib/llm/judges/select-option.d.ts.map +1 -0
- package/dist/lib/llm/judges/select-option.js +90 -0
- package/dist/lib/llm/judges/select-option.js.map +1 -0
- package/dist/lib/llm/judges/verify-submit.d.ts +68 -0
- package/dist/lib/llm/judges/verify-submit.d.ts.map +1 -0
- package/dist/lib/llm/judges/verify-submit.js +89 -0
- package/dist/lib/llm/judges/verify-submit.js.map +1 -0
- package/dist/lib/llm/schemas.d.ts +220 -0
- package/dist/lib/llm/schemas.d.ts.map +1 -0
- package/dist/lib/llm/schemas.js +239 -0
- package/dist/lib/llm/schemas.js.map +1 -0
- package/dist/lib/logging.d.ts +39 -0
- package/dist/lib/logging.d.ts.map +1 -0
- package/dist/lib/logging.js +219 -0
- package/dist/lib/logging.js.map +1 -0
- package/dist/lib/multipart.d.ts +34 -0
- package/dist/lib/multipart.d.ts.map +1 -0
- package/dist/lib/multipart.js +55 -0
- package/dist/lib/multipart.js.map +1 -0
- package/dist/lib/option-matcher.d.ts +15 -0
- package/dist/lib/option-matcher.d.ts.map +1 -0
- package/dist/lib/option-matcher.js +69 -0
- package/dist/lib/option-matcher.js.map +1 -0
- package/dist/lib/phone.d.ts +11 -0
- package/dist/lib/phone.d.ts.map +1 -0
- package/dist/lib/phone.js +17 -0
- package/dist/lib/phone.js.map +1 -0
- package/dist/lib/random.d.ts +22 -0
- package/dist/lib/random.d.ts.map +1 -0
- package/dist/lib/random.js +33 -0
- package/dist/lib/random.js.map +1 -0
- package/dist/lib/statsd.d.ts +11 -0
- package/dist/lib/statsd.d.ts.map +1 -0
- package/dist/lib/statsd.js +68 -0
- package/dist/lib/statsd.js.map +1 -0
- package/dist/lib/telemetry/call-capture.d.ts +89 -0
- package/dist/lib/telemetry/call-capture.d.ts.map +1 -0
- package/dist/lib/telemetry/call-capture.js +190 -0
- package/dist/lib/telemetry/call-capture.js.map +1 -0
- package/dist/lib/telemetry/call-types.d.ts +65 -0
- package/dist/lib/telemetry/call-types.d.ts.map +1 -0
- package/dist/lib/telemetry/call-types.js +68 -0
- package/dist/lib/telemetry/call-types.js.map +1 -0
- package/dist/lib/telemetry/run-state.d.ts +15 -0
- package/dist/lib/telemetry/run-state.d.ts.map +1 -0
- package/dist/lib/telemetry/run-state.js +23 -0
- package/dist/lib/telemetry/run-state.js.map +1 -0
- package/dist/lib/telemetry/s3-sink.d.ts +48 -0
- package/dist/lib/telemetry/s3-sink.d.ts.map +1 -0
- package/dist/lib/telemetry/s3-sink.js +229 -0
- package/dist/lib/telemetry/s3-sink.js.map +1 -0
- package/dist/lib/telemetry/submission-capture.d.ts +45 -0
- package/dist/lib/telemetry/submission-capture.d.ts.map +1 -0
- package/dist/lib/telemetry/submission-capture.js +57 -0
- package/dist/lib/telemetry/submission-capture.js.map +1 -0
- package/dist/lib/telemetry/telemetry-paths.d.ts +59 -0
- package/dist/lib/telemetry/telemetry-paths.d.ts.map +1 -0
- package/dist/lib/telemetry/telemetry-paths.js +103 -0
- package/dist/lib/telemetry/telemetry-paths.js.map +1 -0
- package/dist/lib/tracking-click.d.ts +20 -0
- package/dist/lib/tracking-click.d.ts.map +1 -0
- package/dist/lib/tracking-click.js +75 -0
- package/dist/lib/tracking-click.js.map +1 -0
- package/dist/lib/url-capture.d.ts +8 -0
- package/dist/lib/url-capture.d.ts.map +1 -0
- package/dist/lib/url-capture.js +17 -0
- package/dist/lib/url-capture.js.map +1 -0
- package/dist/lib/us-states.d.ts +20 -0
- package/dist/lib/us-states.d.ts.map +1 -0
- package/dist/lib/us-states.js +86 -0
- package/dist/lib/us-states.js.map +1 -0
- package/dist/lib/zod-multipart.d.ts +18 -0
- package/dist/lib/zod-multipart.d.ts.map +1 -0
- package/dist/lib/zod-multipart.js +35 -0
- package/dist/lib/zod-multipart.js.map +1 -0
- package/dist/plugins/config-plugin.d.ts +77 -0
- package/dist/plugins/config-plugin.d.ts.map +1 -0
- package/dist/plugins/config-plugin.js +216 -0
- package/dist/plugins/config-plugin.js.map +1 -0
- package/dist/plugins/discover.d.ts +72 -0
- package/dist/plugins/discover.d.ts.map +1 -0
- package/dist/plugins/discover.js +265 -0
- package/dist/plugins/discover.js.map +1 -0
- package/dist/plugins/json-schema-to-zod.d.ts +47 -0
- package/dist/plugins/json-schema-to-zod.d.ts.map +1 -0
- package/dist/plugins/json-schema-to-zod.js +85 -0
- package/dist/plugins/json-schema-to-zod.js.map +1 -0
- package/dist/plugins/loader.d.ts +34 -0
- package/dist/plugins/loader.d.ts.map +1 -0
- package/dist/plugins/loader.js +348 -0
- package/dist/plugins/loader.js.map +1 -0
- package/dist/plugins/plugin-api-version.d.ts +8 -0
- package/dist/plugins/plugin-api-version.d.ts.map +1 -0
- package/dist/plugins/plugin-api-version.js +11 -0
- package/dist/plugins/plugin-api-version.js.map +1 -0
- package/dist/plugins/plugin-manifest-envelope.d.ts +16 -0
- package/dist/plugins/plugin-manifest-envelope.d.ts.map +1 -0
- package/dist/plugins/plugin-manifest-envelope.js +19 -0
- package/dist/plugins/plugin-manifest-envelope.js.map +1 -0
- package/dist/scraper/behavioral-signals.d.ts +16 -0
- package/dist/scraper/behavioral-signals.d.ts.map +1 -0
- package/dist/scraper/behavioral-signals.js +30 -0
- package/dist/scraper/behavioral-signals.js.map +1 -0
- package/dist/scraper/errors.d.ts +193 -0
- package/dist/scraper/errors.d.ts.map +1 -0
- package/dist/scraper/errors.js +226 -0
- package/dist/scraper/errors.js.map +1 -0
- package/dist/scraper/fixtures.d.ts +23 -0
- package/dist/scraper/fixtures.d.ts.map +1 -0
- package/dist/scraper/fixtures.js +48 -0
- package/dist/scraper/fixtures.js.map +1 -0
- package/dist/scraper/flow-runner.d.ts +1319 -0
- package/dist/scraper/flow-runner.d.ts.map +1 -0
- package/dist/scraper/flow-runner.js +5637 -0
- package/dist/scraper/flow-runner.js.map +1 -0
- package/dist/scraper/graphql-client.d.ts +30 -0
- package/dist/scraper/graphql-client.d.ts.map +1 -0
- package/dist/scraper/graphql-client.js +14 -0
- package/dist/scraper/graphql-client.js.map +1 -0
- package/dist/scraper/http-client.d.ts +75 -0
- package/dist/scraper/http-client.d.ts.map +1 -0
- package/dist/scraper/http-client.js +189 -0
- package/dist/scraper/http-client.js.map +1 -0
- package/dist/scraper/http-status-classifier.d.ts +12 -0
- package/dist/scraper/http-status-classifier.d.ts.map +1 -0
- package/dist/scraper/http-status-classifier.js +29 -0
- package/dist/scraper/http-status-classifier.js.map +1 -0
- package/dist/scraper/metrics.d.ts +50 -0
- package/dist/scraper/metrics.d.ts.map +1 -0
- package/dist/scraper/metrics.js +85 -0
- package/dist/scraper/metrics.js.map +1 -0
- package/dist/scraper/navigate.d.ts +20 -0
- package/dist/scraper/navigate.d.ts.map +1 -0
- package/dist/scraper/navigate.js +30 -0
- package/dist/scraper/navigate.js.map +1 -0
- package/dist/scraper/oracle-sentinels.d.ts +22 -0
- package/dist/scraper/oracle-sentinels.d.ts.map +1 -0
- package/dist/scraper/oracle-sentinels.js +40 -0
- package/dist/scraper/oracle-sentinels.js.map +1 -0
- package/dist/scraper/parse-json-response.d.ts +16 -0
- package/dist/scraper/parse-json-response.d.ts.map +1 -0
- package/dist/scraper/parse-json-response.js +37 -0
- package/dist/scraper/parse-json-response.js.map +1 -0
- package/dist/scraper/pool.d.ts +37 -0
- package/dist/scraper/pool.d.ts.map +1 -0
- package/dist/scraper/pool.js +105 -0
- package/dist/scraper/pool.js.map +1 -0
- package/dist/scraper/rate-limited-json-client.d.ts +35 -0
- package/dist/scraper/rate-limited-json-client.d.ts.map +1 -0
- package/dist/scraper/rate-limited-json-client.js +29 -0
- package/dist/scraper/rate-limited-json-client.js.map +1 -0
- package/dist/scraper/raw-fetch.d.ts +49 -0
- package/dist/scraper/raw-fetch.d.ts.map +1 -0
- package/dist/scraper/raw-fetch.js +40 -0
- package/dist/scraper/raw-fetch.js.map +1 -0
- package/dist/scraper/require-response-field.d.ts +23 -0
- package/dist/scraper/require-response-field.d.ts.map +1 -0
- package/dist/scraper/require-response-field.js +42 -0
- package/dist/scraper/require-response-field.js.map +1 -0
- package/dist/scraper/retry.d.ts +33 -0
- package/dist/scraper/retry.d.ts.map +1 -0
- package/dist/scraper/retry.js +122 -0
- package/dist/scraper/retry.js.map +1 -0
- package/dist/scraper/session-browserbase.d.ts +35 -0
- package/dist/scraper/session-browserbase.d.ts.map +1 -0
- package/dist/scraper/session-browserbase.js +198 -0
- package/dist/scraper/session-browserbase.js.map +1 -0
- package/dist/scraper/session-shared.d.ts +29 -0
- package/dist/scraper/session-shared.d.ts.map +1 -0
- package/dist/scraper/session-shared.js +35 -0
- package/dist/scraper/session-shared.js.map +1 -0
- package/dist/scraper/session-steel.d.ts +31 -0
- package/dist/scraper/session-steel.d.ts.map +1 -0
- package/dist/scraper/session-steel.js +140 -0
- package/dist/scraper/session-steel.js.map +1 -0
- package/dist/scraper/session-warmup.d.ts +31 -0
- package/dist/scraper/session-warmup.d.ts.map +1 -0
- package/dist/scraper/session-warmup.js +46 -0
- package/dist/scraper/session-warmup.js.map +1 -0
- package/dist/scraper/session.d.ts +21 -0
- package/dist/scraper/session.d.ts.map +1 -0
- package/dist/scraper/session.js +28 -0
- package/dist/scraper/session.js.map +1 -0
- package/dist/scraper/stagehand-guard.d.ts +128 -0
- package/dist/scraper/stagehand-guard.d.ts.map +1 -0
- package/dist/scraper/stagehand-guard.js +337 -0
- package/dist/scraper/stagehand-guard.js.map +1 -0
- package/dist/scraper/throttle.d.ts +21 -0
- package/dist/scraper/throttle.d.ts.map +1 -0
- package/dist/scraper/throttle.js +45 -0
- package/dist/scraper/throttle.js.map +1 -0
- package/dist/scripts/hca-inbox-poll.d.ts +19 -0
- package/dist/scripts/hca-inbox-poll.d.ts.map +1 -0
- package/dist/scripts/hca-inbox-poll.js +151 -0
- package/dist/scripts/hca-inbox-poll.js.map +1 -0
- package/dist/scripts/judge-llm-batch.d.ts +98 -0
- package/dist/scripts/judge-llm-batch.d.ts.map +1 -0
- package/dist/scripts/judge-llm-batch.js +350 -0
- package/dist/scripts/judge-llm-batch.js.map +1 -0
- package/dist/scripts/llm-heal.d.ts +165 -0
- package/dist/scripts/llm-heal.d.ts.map +1 -0
- package/dist/scripts/llm-heal.js +595 -0
- package/dist/scripts/llm-heal.js.map +1 -0
- package/dist/scripts/migrate-telemetry-dir-names.d.ts +57 -0
- package/dist/scripts/migrate-telemetry-dir-names.d.ts.map +1 -0
- package/dist/scripts/migrate-telemetry-dir-names.js +156 -0
- package/dist/scripts/migrate-telemetry-dir-names.js.map +1 -0
- package/dist/scripts/probe-setinputfiles.d.ts +28 -0
- package/dist/scripts/probe-setinputfiles.d.ts.map +1 -0
- package/dist/scripts/probe-setinputfiles.js +95 -0
- package/dist/scripts/probe-setinputfiles.js.map +1 -0
- package/dist/scripts/recon-browser.d.ts +304 -0
- package/dist/scripts/recon-browser.d.ts.map +1 -0
- package/dist/scripts/recon-browser.js +1833 -0
- package/dist/scripts/recon-browser.js.map +1 -0
- package/dist/scripts/recon-generate.d.ts +182 -0
- package/dist/scripts/recon-generate.d.ts.map +1 -0
- package/dist/scripts/recon-generate.js +2572 -0
- package/dist/scripts/recon-generate.js.map +1 -0
- package/dist/scripts/recon-heal.d.ts +176 -0
- package/dist/scripts/recon-heal.d.ts.map +1 -0
- package/dist/scripts/recon-heal.js +584 -0
- package/dist/scripts/recon-heal.js.map +1 -0
- package/dist/scripts/recon-http.d.ts +19 -0
- package/dist/scripts/recon-http.d.ts.map +1 -0
- package/dist/scripts/recon-http.js +377 -0
- package/dist/scripts/recon-http.js.map +1 -0
- package/dist/scripts/recon-replay-jobs.d.ts +21 -0
- package/dist/scripts/recon-replay-jobs.d.ts.map +1 -0
- package/dist/scripts/recon-replay-jobs.js +221 -0
- package/dist/scripts/recon-replay-jobs.js.map +1 -0
- package/dist/scripts/recon-shared.d.ts +52 -0
- package/dist/scripts/recon-shared.d.ts.map +1 -0
- package/dist/scripts/recon-shared.js +68 -0
- package/dist/scripts/recon-shared.js.map +1 -0
- package/dist/scripts/recon-summarize.d.ts +15 -0
- package/dist/scripts/recon-summarize.d.ts.map +1 -0
- package/dist/scripts/recon-summarize.js +233 -0
- package/dist/scripts/recon-summarize.js.map +1 -0
- package/dist/scripts/smoke-test.d.ts +22 -0
- package/dist/scripts/smoke-test.d.ts.map +1 -0
- package/dist/scripts/smoke-test.js +236 -0
- package/dist/scripts/smoke-test.js.map +1 -0
- package/dist/server.d.ts +10 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +189 -0
- package/dist/server.js.map +1 -0
- package/dist/site-plugin.d.ts +226 -0
- package/dist/site-plugin.d.ts.map +1 -0
- package/dist/site-plugin.js +13 -0
- package/dist/site-plugin.js.map +1 -0
- package/dist/testing/answers-fixture.d.ts +13 -0
- package/dist/testing/answers-fixture.d.ts.map +1 -0
- package/dist/testing/answers-fixture.js +37 -0
- package/dist/testing/answers-fixture.js.map +1 -0
- package/dist/testing/batch-email-confirmation.d.ts +58 -0
- package/dist/testing/batch-email-confirmation.d.ts.map +1 -0
- package/dist/testing/batch-email-confirmation.js +62 -0
- package/dist/testing/batch-email-confirmation.js.map +1 -0
- package/dist/testing/batch-report.d.ts +33 -0
- package/dist/testing/batch-report.d.ts.map +1 -0
- package/dist/testing/batch-report.js +30 -0
- package/dist/testing/batch-report.js.map +1 -0
- package/dist/testing/contract-parity-suite.d.ts +55 -0
- package/dist/testing/contract-parity-suite.d.ts.map +1 -0
- package/dist/testing/contract-parity-suite.js +39 -0
- package/dist/testing/contract-parity-suite.js.map +1 -0
- package/dist/testing/coverage-guard-suite.d.ts +46 -0
- package/dist/testing/coverage-guard-suite.d.ts.map +1 -0
- package/dist/testing/coverage-guard-suite.js +39 -0
- package/dist/testing/coverage-guard-suite.js.map +1 -0
- package/dist/testing/fixtures/resume.pdf +54 -0
- package/dist/testing/integration-runner.d.ts +62 -0
- package/dist/testing/integration-runner.d.ts.map +1 -0
- package/dist/testing/integration-runner.js +46 -0
- package/dist/testing/integration-runner.js.map +1 -0
- package/dist/testing/mock-fetch-response.d.ts +7 -0
- package/dist/testing/mock-fetch-response.d.ts.map +1 -0
- package/dist/testing/mock-fetch-response.js +16 -0
- package/dist/testing/mock-fetch-response.js.map +1 -0
- package/dist/testing/persona-fixture.d.ts +77 -0
- package/dist/testing/persona-fixture.d.ts.map +1 -0
- package/dist/testing/persona-fixture.js +83 -0
- package/dist/testing/persona-fixture.js.map +1 -0
- package/dist/testing/replay-integration-suite.d.ts +50 -0
- package/dist/testing/replay-integration-suite.d.ts.map +1 -0
- package/dist/testing/replay-integration-suite.js +45 -0
- package/dist/testing/replay-integration-suite.js.map +1 -0
- package/dist/testing/resume-fixture.d.ts +39 -0
- package/dist/testing/resume-fixture.d.ts.map +1 -0
- package/dist/testing/resume-fixture.js +38 -0
- package/dist/testing/resume-fixture.js.map +1 -0
- package/dist/testmail/client.d.ts +61 -0
- package/dist/testmail/client.d.ts.map +1 -0
- package/dist/testmail/client.js +190 -0
- package/dist/testmail/client.js.map +1 -0
- package/dist/testmail/errors.d.ts +18 -0
- package/dist/testmail/errors.d.ts.map +1 -0
- package/dist/testmail/errors.js +29 -0
- package/dist/testmail/errors.js.map +1 -0
- package/dist/types/dispatch-metrics.d.ts +46 -0
- package/dist/types/dispatch-metrics.d.ts.map +1 -0
- package/dist/types/dispatch-metrics.js +25 -0
- package/dist/types/dispatch-metrics.js.map +1 -0
- package/dist/types/logging.d.ts +11 -0
- package/dist/types/logging.d.ts.map +1 -0
- package/dist/types/logging.js +3 -0
- package/dist/types/logging.js.map +1 -0
- package/package.json +283 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LLM batch judge: reads a calls.ndjson capture file, filters by callType,
|
|
3
|
+
* scores each sample on a three-dimensional rubric (schema adherence, factual
|
|
4
|
+
* grounding, hallucination-freeness), aggregates the results, and writes a
|
|
5
|
+
* schema-valid verdict JSON to the judge-out directory.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* pnpm judge:llm \
|
|
9
|
+
* --calls-ndjson .barnacle/calls.ndjson \
|
|
10
|
+
* --call-type act \
|
|
11
|
+
* --batch-index 0 \
|
|
12
|
+
* --judge-model claude-sonnet-4-6
|
|
13
|
+
*
|
|
14
|
+
* Knobs (all optional):
|
|
15
|
+
* --out-dir <path> default judge-out
|
|
16
|
+
* --dry-run stubs the scorer (CI mode, no API calls)
|
|
17
|
+
* --batch-index <N> default 0; disambiguates multiple verdict files
|
|
18
|
+
*/
|
|
19
|
+
import Anthropic from "@anthropic-ai/sdk";
|
|
20
|
+
import { type JudgeAggregate, type JudgeVerdict, type JudgeVerdictEntry, type LlmCallSample } from "../api/schemas/telemetry";
|
|
21
|
+
/** Raw scoring dimensions returned by the scorer for a single sample. */
|
|
22
|
+
export interface SampleScore {
|
|
23
|
+
schemaOk: boolean;
|
|
24
|
+
schemaRationale: string;
|
|
25
|
+
factuallyGrounded: boolean;
|
|
26
|
+
factualRationale: string;
|
|
27
|
+
hallucinationFree: boolean;
|
|
28
|
+
hallucinationRationale: string;
|
|
29
|
+
worstOffender?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Injectable scorer — real implementation calls the LLM; dry-run stub
|
|
33
|
+
* returns deterministic values. Mirrors recon-heal's requestPatchFn injection
|
|
34
|
+
* so the deterministic core (parse/aggregate/write) is fully unit-testable.
|
|
35
|
+
*/
|
|
36
|
+
export type ScorerFn = (sample: LlmCallSample) => Promise<SampleScore>;
|
|
37
|
+
/**
|
|
38
|
+
* Reads an NDJSON file and returns the lines parsed as LlmCallSample objects.
|
|
39
|
+
* Lines that fail JSON parsing or Zod validation are returned with
|
|
40
|
+
* parsedOk=false so they auto-fail schema adherence in the judge pass.
|
|
41
|
+
*/
|
|
42
|
+
export declare function parseSamples(ndjsonContent: string): LlmCallSample[];
|
|
43
|
+
/**
|
|
44
|
+
* Filters samples to only those matching the requested callType.
|
|
45
|
+
*/
|
|
46
|
+
export declare function filterByCallType(samples: LlmCallSample[], callType: string): LlmCallSample[];
|
|
47
|
+
/**
|
|
48
|
+
* Derives a JudgeVerdictEntry from a sample and its score. Enforces the rule
|
|
49
|
+
* that parsedOk=false automatically fails schema adherence regardless of what
|
|
50
|
+
* the scorer returns.
|
|
51
|
+
*/
|
|
52
|
+
export declare function computeVerdict(sample: LlmCallSample, score: SampleScore): JudgeVerdictEntry;
|
|
53
|
+
/**
|
|
54
|
+
* Computes aggregate counts over a set of verdict entries.
|
|
55
|
+
*/
|
|
56
|
+
export declare function aggregate(verdicts: JudgeVerdictEntry[]): JudgeAggregate;
|
|
57
|
+
/**
|
|
58
|
+
* Validates and writes the verdict object as JSON to the judge-out directory.
|
|
59
|
+
* Returns the written file path.
|
|
60
|
+
*/
|
|
61
|
+
export declare function writeVerdict(params: {
|
|
62
|
+
outDir: string;
|
|
63
|
+
verdict: JudgeVerdict;
|
|
64
|
+
}): string;
|
|
65
|
+
/**
|
|
66
|
+
* Dry-run scorer: marks every dimension true with a placeholder rationale.
|
|
67
|
+
* Used in CI and tests to exercise the full pipeline without any API call.
|
|
68
|
+
*/
|
|
69
|
+
export declare function makeDryRunScorer(): ScorerFn;
|
|
70
|
+
/**
|
|
71
|
+
* Real LLM scorer: sends each sample to the Anthropic API for judgment.
|
|
72
|
+
* Defaults to the configured scraper model (respects STAGEHAND_MODEL env var)
|
|
73
|
+
* unless overridden by `judgeModel`.
|
|
74
|
+
*/
|
|
75
|
+
export declare function makeAnthropicScorer(client: Anthropic, judgeModel?: string): ScorerFn;
|
|
76
|
+
/** Parameters accepted by `runJudge`. */
|
|
77
|
+
export interface JudgeParams {
|
|
78
|
+
callsNdjsonPath: string;
|
|
79
|
+
callType: string;
|
|
80
|
+
batchIndex?: number;
|
|
81
|
+
judgeModel?: string;
|
|
82
|
+
outDir?: string;
|
|
83
|
+
dryRun?: boolean;
|
|
84
|
+
/** Injectable scorer for unit tests. */
|
|
85
|
+
scorerFn?: ScorerFn;
|
|
86
|
+
}
|
|
87
|
+
/** Return value of `runJudge`. */
|
|
88
|
+
export interface JudgeResult {
|
|
89
|
+
verdictPath: string;
|
|
90
|
+
verdict: JudgeVerdict;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Drives the full parse → filter → score → aggregate → write pipeline for a
|
|
94
|
+
* single batch. Accepts an injectable `scorerFn` so tests exercise the full
|
|
95
|
+
* pipeline without any live model call.
|
|
96
|
+
*/
|
|
97
|
+
export declare function runJudge(params: JudgeParams): Promise<JudgeResult>;
|
|
98
|
+
//# sourceMappingURL=judge-llm-batch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"judge-llm-batch.d.ts","sourceRoot":"","sources":["../../src/scripts/judge-llm-batch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAKH,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAG1C,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EAEtB,KAAK,aAAa,EAEnB,MAAM,yBAAyB,CAAC;AAcjC,yEAAyE;AACzE,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,OAAO,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,iB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,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,kCAAkC;AAClC,MAAM,WAAW,WAAW;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,YAAY,CAAC;CACvB;AAED;;;;GAIG;AACH,wBAAsB,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,CAqExE"}
|
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* LLM batch judge: reads a calls.ndjson capture file, filters by callType,
|
|
4
|
+
* scores each sample on a three-dimensional rubric (schema adherence, factual
|
|
5
|
+
* grounding, hallucination-freeness), aggregates the results, and writes a
|
|
6
|
+
* schema-valid verdict JSON to the judge-out directory.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* pnpm judge:llm \
|
|
10
|
+
* --calls-ndjson .barnacle/calls.ndjson \
|
|
11
|
+
* --call-type act \
|
|
12
|
+
* --batch-index 0 \
|
|
13
|
+
* --judge-model claude-sonnet-4-6
|
|
14
|
+
*
|
|
15
|
+
* Knobs (all optional):
|
|
16
|
+
* --out-dir <path> default judge-out
|
|
17
|
+
* --dry-run stubs the scorer (CI mode, no API calls)
|
|
18
|
+
* --batch-index <N> default 0; disambiguates multiple verdict files
|
|
19
|
+
*/
|
|
20
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
21
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.parseSamples = parseSamples;
|
|
25
|
+
exports.filterByCallType = filterByCallType;
|
|
26
|
+
exports.computeVerdict = computeVerdict;
|
|
27
|
+
exports.aggregate = aggregate;
|
|
28
|
+
exports.writeVerdict = writeVerdict;
|
|
29
|
+
exports.makeDryRunScorer = makeDryRunScorer;
|
|
30
|
+
exports.makeAnthropicScorer = makeAnthropicScorer;
|
|
31
|
+
exports.runJudge = runJudge;
|
|
32
|
+
const node_fs_1 = require("node:fs");
|
|
33
|
+
const node_path_1 = require("node:path");
|
|
34
|
+
const sdk_1 = __importDefault(require("@anthropic-ai/sdk"));
|
|
35
|
+
const zod_1 = require("@anthropic-ai/sdk/helpers/zod");
|
|
36
|
+
const date_fns_1 = require("date-fns");
|
|
37
|
+
const telemetry_1 = require("../api/schemas/telemetry");
|
|
38
|
+
const config_1 = require("../config");
|
|
39
|
+
const schemas_1 = require("../lib/llm/schemas");
|
|
40
|
+
const logging_1 = require("../lib/logging");
|
|
41
|
+
const logger = (0, logging_1.getScriptLogger)("judge-llm-batch");
|
|
42
|
+
// ── defaults ──────────────────────────────────────────────────────────────────
|
|
43
|
+
const DEFAULT_OUT_DIR = "judge-out";
|
|
44
|
+
const DEFAULT_BATCH_INDEX = 0;
|
|
45
|
+
// ── pure core ─────────────────────────────────────────────────────────────────
|
|
46
|
+
/**
|
|
47
|
+
* Reads an NDJSON file and returns the lines parsed as LlmCallSample objects.
|
|
48
|
+
* Lines that fail JSON parsing or Zod validation are returned with
|
|
49
|
+
* parsedOk=false so they auto-fail schema adherence in the judge pass.
|
|
50
|
+
*/
|
|
51
|
+
function parseSamples(ndjsonContent) {
|
|
52
|
+
const samples = [];
|
|
53
|
+
for (const raw of ndjsonContent.split("\n")) {
|
|
54
|
+
const line = raw.trim();
|
|
55
|
+
if (line.length === 0)
|
|
56
|
+
continue;
|
|
57
|
+
let parsed;
|
|
58
|
+
try {
|
|
59
|
+
parsed = JSON.parse(line);
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
samples.push(makeMalformedSample(line));
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
const result = telemetry_1.llmCallSampleSchema.safeParse(parsed);
|
|
66
|
+
if (!result.success) {
|
|
67
|
+
samples.push(makeMalformedSample(line));
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
samples.push(result.data);
|
|
71
|
+
}
|
|
72
|
+
return samples;
|
|
73
|
+
}
|
|
74
|
+
function makeMalformedSample(raw) {
|
|
75
|
+
return {
|
|
76
|
+
callId: `malformed-${raw.slice(0, 16)}`,
|
|
77
|
+
callType: "unknown",
|
|
78
|
+
model: "unknown",
|
|
79
|
+
systemPrompt: null,
|
|
80
|
+
userContent: raw.slice(0, 256),
|
|
81
|
+
responseContent: null,
|
|
82
|
+
parsedOk: false,
|
|
83
|
+
inputTokens: null,
|
|
84
|
+
outputTokens: null,
|
|
85
|
+
latencyMs: null,
|
|
86
|
+
success: false,
|
|
87
|
+
errorMessage: null,
|
|
88
|
+
failureKind: null,
|
|
89
|
+
ts: (0, date_fns_1.formatISO)(new Date()),
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Filters samples to only those matching the requested callType.
|
|
94
|
+
*/
|
|
95
|
+
function filterByCallType(samples, callType) {
|
|
96
|
+
return samples.filter((s) => s.callType === callType);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Derives a JudgeVerdictEntry from a sample and its score. Enforces the rule
|
|
100
|
+
* that parsedOk=false automatically fails schema adherence regardless of what
|
|
101
|
+
* the scorer returns.
|
|
102
|
+
*/
|
|
103
|
+
function computeVerdict(sample, score) {
|
|
104
|
+
const schemaOk = sample.parsedOk ? score.schemaOk : false;
|
|
105
|
+
const schemaRationale = sample.parsedOk
|
|
106
|
+
? score.schemaRationale
|
|
107
|
+
: "parsedOk=false: response could not be parsed as the expected schema";
|
|
108
|
+
const pass = schemaOk && score.factuallyGrounded && score.hallucinationFree;
|
|
109
|
+
return {
|
|
110
|
+
callId: sample.callId,
|
|
111
|
+
schemaOk,
|
|
112
|
+
schemaRationale,
|
|
113
|
+
factuallyGrounded: score.factuallyGrounded,
|
|
114
|
+
factualRationale: score.factualRationale,
|
|
115
|
+
hallucinationFree: score.hallucinationFree,
|
|
116
|
+
hallucinationRationale: score.hallucinationRationale,
|
|
117
|
+
...(score.worstOffender !== undefined ? { worstOffender: score.worstOffender } : {}),
|
|
118
|
+
pass,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Computes aggregate counts over a set of verdict entries.
|
|
123
|
+
*/
|
|
124
|
+
function aggregate(verdicts) {
|
|
125
|
+
const n = verdicts.length;
|
|
126
|
+
let schemaPass = 0;
|
|
127
|
+
let factualPass = 0;
|
|
128
|
+
let hallucinationFreePass = 0;
|
|
129
|
+
let overallPass = 0;
|
|
130
|
+
for (const v of verdicts) {
|
|
131
|
+
if (v.schemaOk)
|
|
132
|
+
schemaPass++;
|
|
133
|
+
if (v.factuallyGrounded)
|
|
134
|
+
factualPass++;
|
|
135
|
+
if (v.hallucinationFree)
|
|
136
|
+
hallucinationFreePass++;
|
|
137
|
+
if (v.pass)
|
|
138
|
+
overallPass++;
|
|
139
|
+
}
|
|
140
|
+
return { n, schemaPass, factualPass, hallucinationFreePass, overallPass };
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Validates and writes the verdict object as JSON to the judge-out directory.
|
|
144
|
+
* Returns the written file path.
|
|
145
|
+
*/
|
|
146
|
+
function writeVerdict(params) {
|
|
147
|
+
const { outDir, verdict } = params;
|
|
148
|
+
const parsed = telemetry_1.judgeVerdictSchema.safeParse(verdict);
|
|
149
|
+
if (!parsed.success) {
|
|
150
|
+
throw new Error(`verdict does not satisfy judgeVerdictSchema: ${parsed.error.message}`);
|
|
151
|
+
}
|
|
152
|
+
(0, node_fs_1.mkdirSync)(outDir, { recursive: true });
|
|
153
|
+
const fileName = `verdict-${verdict.callType}-${verdict.batchIndex}.json`;
|
|
154
|
+
const filePath = (0, node_path_1.join)(outDir, fileName);
|
|
155
|
+
(0, node_fs_1.writeFileSync)(filePath, JSON.stringify(verdict, null, 2));
|
|
156
|
+
return filePath;
|
|
157
|
+
}
|
|
158
|
+
// ── scorer implementations ────────────────────────────────────────────────────
|
|
159
|
+
/**
|
|
160
|
+
* Dry-run scorer: marks every dimension true with a placeholder rationale.
|
|
161
|
+
* Used in CI and tests to exercise the full pipeline without any API call.
|
|
162
|
+
*/
|
|
163
|
+
function makeDryRunScorer() {
|
|
164
|
+
return async () => ({
|
|
165
|
+
schemaOk: true,
|
|
166
|
+
schemaRationale: "dry-run: schema adherence assumed",
|
|
167
|
+
factuallyGrounded: true,
|
|
168
|
+
factualRationale: "dry-run: factual grounding assumed",
|
|
169
|
+
hallucinationFree: true,
|
|
170
|
+
hallucinationRationale: "dry-run: hallucination-free assumed",
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
function anthropicModelName() {
|
|
174
|
+
const raw = config_1.config.scraper.model;
|
|
175
|
+
return raw.startsWith("anthropic/") ? raw.slice("anthropic/".length) : raw;
|
|
176
|
+
}
|
|
177
|
+
const SCORE_SYSTEM_PROMPT = `You are a quality judge for LLM call outputs. Evaluate each sample on three dimensions:
|
|
178
|
+
|
|
179
|
+
1. SCHEMA_OK: Did the model's response match the expected output structure?
|
|
180
|
+
- true if responseContent is valid JSON that matches the callType's expected schema
|
|
181
|
+
- false if malformed, missing required fields, or has unexpected structure
|
|
182
|
+
|
|
183
|
+
2. FACTUALLY_GROUNDED: Is the response factually grounded given the input?
|
|
184
|
+
- true if all factual claims in the response are consistent with the userContent context
|
|
185
|
+
- false if the response contradicts or ignores facts present in the userContent
|
|
186
|
+
|
|
187
|
+
3. HALLUCINATION_FREE: Does the response avoid hallucinating content?
|
|
188
|
+
- true if the response contains no fabricated facts, URLs, entities, or values
|
|
189
|
+
- false if it invents information not implied by the prompt
|
|
190
|
+
|
|
191
|
+
Set worstOffender to one of "schema", "factual", or "hallucination" naming the worst-failing dimension, or null when all three pass. Each rationale is one short sentence.`;
|
|
192
|
+
/**
|
|
193
|
+
* Real LLM scorer: sends each sample to the Anthropic API for judgment.
|
|
194
|
+
* Defaults to the configured scraper model (respects STAGEHAND_MODEL env var)
|
|
195
|
+
* unless overridden by `judgeModel`.
|
|
196
|
+
*/
|
|
197
|
+
function makeAnthropicScorer(client, judgeModel) {
|
|
198
|
+
const model = judgeModel ?? anthropicModelName();
|
|
199
|
+
return async (sample) => {
|
|
200
|
+
const userMessage = [
|
|
201
|
+
`callType: ${sample.callType}`,
|
|
202
|
+
`model: ${sample.model}`,
|
|
203
|
+
`parsedOk: ${sample.parsedOk}`,
|
|
204
|
+
`systemPrompt: ${sample.systemPrompt ?? "(none)"}`,
|
|
205
|
+
`userContent: ${sample.userContent}`,
|
|
206
|
+
`responseContent: ${sample.responseContent ?? "(null)"}`,
|
|
207
|
+
].join("\n");
|
|
208
|
+
try {
|
|
209
|
+
const response = await client.messages.parse({
|
|
210
|
+
model,
|
|
211
|
+
max_tokens: 512,
|
|
212
|
+
system: SCORE_SYSTEM_PROMPT,
|
|
213
|
+
messages: [{ role: "user", content: userMessage }],
|
|
214
|
+
output_config: {
|
|
215
|
+
format: (0, zod_1.zodOutputFormat)(schemas_1.JUDGE_VERDICT_SCHEMA),
|
|
216
|
+
},
|
|
217
|
+
});
|
|
218
|
+
const parsed = response.parsed_output;
|
|
219
|
+
if (parsed === null) {
|
|
220
|
+
return fallbackScore("structured-output enabled but parsed_output is null");
|
|
221
|
+
}
|
|
222
|
+
return {
|
|
223
|
+
schemaOk: parsed.schemaOk,
|
|
224
|
+
schemaRationale: parsed.schemaRationale,
|
|
225
|
+
factuallyGrounded: parsed.factuallyGrounded,
|
|
226
|
+
factualRationale: parsed.factualRationale,
|
|
227
|
+
hallucinationFree: parsed.hallucinationFree,
|
|
228
|
+
hallucinationRationale: parsed.hallucinationRationale,
|
|
229
|
+
...(typeof parsed.worstOffender === "string"
|
|
230
|
+
? { worstOffender: parsed.worstOffender }
|
|
231
|
+
: {}),
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
catch (err) {
|
|
235
|
+
return fallbackScore(`API call threw an error: ${err instanceof Error ? err.message : String(err)}`);
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
function fallbackScore(reason) {
|
|
240
|
+
return {
|
|
241
|
+
schemaOk: false,
|
|
242
|
+
schemaRationale: `judge error: ${reason}`,
|
|
243
|
+
factuallyGrounded: false,
|
|
244
|
+
factualRationale: `judge error: ${reason}`,
|
|
245
|
+
hallucinationFree: false,
|
|
246
|
+
hallucinationRationale: `judge error: ${reason}`,
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Drives the full parse → filter → score → aggregate → write pipeline for a
|
|
251
|
+
* single batch. Accepts an injectable `scorerFn` so tests exercise the full
|
|
252
|
+
* pipeline without any live model call.
|
|
253
|
+
*/
|
|
254
|
+
async function runJudge(params) {
|
|
255
|
+
const { callsNdjsonPath, callType, batchIndex = DEFAULT_BATCH_INDEX, judgeModel, outDir = DEFAULT_OUT_DIR, dryRun = false, } = params;
|
|
256
|
+
let scorerFn = params.scorerFn;
|
|
257
|
+
if (!scorerFn) {
|
|
258
|
+
if (dryRun) {
|
|
259
|
+
scorerFn = makeDryRunScorer();
|
|
260
|
+
}
|
|
261
|
+
else {
|
|
262
|
+
if (!config_1.config.scraper.anthropicApiKey) {
|
|
263
|
+
throw new Error("judge:llm requires ANTHROPIC_API_KEY");
|
|
264
|
+
}
|
|
265
|
+
const client = new sdk_1.default({ apiKey: config_1.config.scraper.anthropicApiKey });
|
|
266
|
+
scorerFn = makeAnthropicScorer(client, judgeModel);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
const resolvedJudgeModel = judgeModel ?? (dryRun ? "dry-run" : anthropicModelName());
|
|
270
|
+
logger.info(`judge-llm-batch: reading ${callsNdjsonPath}`);
|
|
271
|
+
let ndjsonContent;
|
|
272
|
+
try {
|
|
273
|
+
ndjsonContent = (0, node_fs_1.readFileSync)(callsNdjsonPath, "utf-8");
|
|
274
|
+
}
|
|
275
|
+
catch (err) {
|
|
276
|
+
throw new Error(`judge-llm-batch: cannot read ${callsNdjsonPath}: ${String(err)}`);
|
|
277
|
+
}
|
|
278
|
+
const allSamples = parseSamples(ndjsonContent);
|
|
279
|
+
logger.info(`judge-llm-batch: parsed ${allSamples.length} total samples`);
|
|
280
|
+
const samples = filterByCallType(allSamples, callType);
|
|
281
|
+
logger.info(`judge-llm-batch: ${samples.length} samples for callType="${callType}"`);
|
|
282
|
+
const verdicts = [];
|
|
283
|
+
for (const sample of samples) {
|
|
284
|
+
logger.info(`judge-llm-batch: scoring callId=${sample.callId}`);
|
|
285
|
+
const score = await scorerFn(sample);
|
|
286
|
+
const entry = computeVerdict(sample, score);
|
|
287
|
+
verdicts.push(entry);
|
|
288
|
+
logger.info(`judge-llm-batch: callId=${sample.callId} pass=${entry.pass} schema=${entry.schemaOk} factual=${entry.factuallyGrounded} halluc=${entry.hallucinationFree}`);
|
|
289
|
+
}
|
|
290
|
+
const agg = aggregate(verdicts);
|
|
291
|
+
logger.info(`judge-llm-batch: aggregate n=${agg.n} schemaPass=${agg.schemaPass} factualPass=${agg.factualPass} hallucinationFreePass=${agg.hallucinationFreePass} overallPass=${agg.overallPass}`);
|
|
292
|
+
const verdict = {
|
|
293
|
+
callType,
|
|
294
|
+
batchIndex,
|
|
295
|
+
judgedAt: (0, date_fns_1.formatISO)(new Date()),
|
|
296
|
+
judgeModel: resolvedJudgeModel,
|
|
297
|
+
verdicts,
|
|
298
|
+
aggregate: agg,
|
|
299
|
+
};
|
|
300
|
+
const verdictPath = writeVerdict({ outDir, verdict });
|
|
301
|
+
logger.info(`judge-llm-batch: verdict written to ${verdictPath}`);
|
|
302
|
+
return { verdictPath, verdict };
|
|
303
|
+
}
|
|
304
|
+
// ── CLI ───────────────────────────────────────────────────────────────────────
|
|
305
|
+
/**
|
|
306
|
+
* Parses CLI args and exits with a usage message when required args are absent.
|
|
307
|
+
*/
|
|
308
|
+
function parseCli() {
|
|
309
|
+
const args = process.argv.slice(2);
|
|
310
|
+
let callsNdjsonPath = "";
|
|
311
|
+
let callType = "";
|
|
312
|
+
let batchIndex = DEFAULT_BATCH_INDEX;
|
|
313
|
+
let judgeModel;
|
|
314
|
+
let outDir = DEFAULT_OUT_DIR;
|
|
315
|
+
let dryRun = false;
|
|
316
|
+
for (let i = 0; i < args.length; i++) {
|
|
317
|
+
if (args[i] === "--calls-ndjson" && args[i + 1])
|
|
318
|
+
callsNdjsonPath = args[++i];
|
|
319
|
+
else if (args[i] === "--call-type" && args[i + 1])
|
|
320
|
+
callType = args[++i];
|
|
321
|
+
else if (args[i] === "--batch-index" && args[i + 1])
|
|
322
|
+
batchIndex = Number(args[++i]);
|
|
323
|
+
else if (args[i] === "--judge-model" && args[i + 1])
|
|
324
|
+
judgeModel = args[++i];
|
|
325
|
+
else if (args[i] === "--out-dir" && args[i + 1])
|
|
326
|
+
outDir = args[++i];
|
|
327
|
+
else if (args[i] === "--dry-run")
|
|
328
|
+
dryRun = true;
|
|
329
|
+
}
|
|
330
|
+
if (!callsNdjsonPath || !callType) {
|
|
331
|
+
logger.error("usage: judge-llm-batch.ts --calls-ndjson <path> --call-type <type> " +
|
|
332
|
+
"[--batch-index N] [--judge-model <model>] [--out-dir <path>] [--dry-run]");
|
|
333
|
+
process.exit(1);
|
|
334
|
+
}
|
|
335
|
+
return { callsNdjsonPath, callType, batchIndex, judgeModel, outDir, dryRun };
|
|
336
|
+
}
|
|
337
|
+
async function main() {
|
|
338
|
+
const cliArgs = parseCli();
|
|
339
|
+
const { verdictPath, verdict } = await runJudge(cliArgs);
|
|
340
|
+
logger.info(`judge-llm-batch complete: verdict written to ${verdictPath}`);
|
|
341
|
+
logger.info(`judge-llm-batch: n=${verdict.aggregate.n} overallPass=${verdict.aggregate.overallPass}`);
|
|
342
|
+
}
|
|
343
|
+
if (process.argv[1] !== undefined &&
|
|
344
|
+
(process.argv[1].endsWith("judge-llm-batch.ts") || process.argv[1].endsWith("judge-llm-batch.js"))) {
|
|
345
|
+
main().catch((err) => {
|
|
346
|
+
logger.error(`judge-llm-batch failed: ${String(err)}`);
|
|
347
|
+
process.exit(1);
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
//# sourceMappingURL=judge-llm-batch.js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B,OAAO,CAAC,SAAS,CAAC,CAAC,gBAAgB,OAAO,CAAC,SAAS,CAAC,WAAW,EAAE,CACzF,CAAC;AACJ,CAAC;AAED,IACE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,SAAS;IAC7B,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,oBAAoB,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,oBAAoB,CAAC,CAAC,EAClG,CAAC;IACD,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;QACnB,MAAM,CAAC,KAAK,CAAC,2BAA2B,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACvD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LLM prompt-template self-heal harness: given a judge verdict file containing
|
|
3
|
+
* failing samples for a callType, iterate — run a baseline pass rate, ask the
|
|
4
|
+
* patch generator to propose a minimal edit to the prompt template, replay the
|
|
5
|
+
* patched prompt against the captured user_content, score, and check convergence.
|
|
6
|
+
* Writes a healing-<callType>.md report for human review and manual apply.
|
|
7
|
+
* Production prompts in src/prompts/ are NEVER modified.
|
|
8
|
+
*
|
|
9
|
+
* Usage:
|
|
10
|
+
* pnpm heal:llm \
|
|
11
|
+
* --verdict-path judge-out/verdict-act-0.json \
|
|
12
|
+
* --call-type act
|
|
13
|
+
*
|
|
14
|
+
* Knobs (all optional):
|
|
15
|
+
* --max-iterations <N> default 5
|
|
16
|
+
* --n-replays <N> default 5
|
|
17
|
+
* --success-threshold <0..1> default 0.9
|
|
18
|
+
* --plateau-delta <0..1> default 0.03
|
|
19
|
+
* --plateau-window <N> default 3
|
|
20
|
+
* --out-dir <path> default llm-heal-out
|
|
21
|
+
* --judge-model <model> override the judge model
|
|
22
|
+
* --dry-run stubs the scorer (CI mode, no API calls)
|
|
23
|
+
*/
|
|
24
|
+
import Anthropic from "@anthropic-ai/sdk";
|
|
25
|
+
import { type LlmCallSample } from "../api/schemas/telemetry";
|
|
26
|
+
import { buildAnthropicClient } from "../lib/llm/anthropic-client";
|
|
27
|
+
import { type LlmCallInput } from "../lib/telemetry/call-capture";
|
|
28
|
+
import { type ScorerFn } from "../scripts/judge-llm-batch";
|
|
29
|
+
import { type FlowPatch, type HealVerdict, type IterationRecord } from "../scripts/recon-heal";
|
|
30
|
+
/**
|
|
31
|
+
* Persistent state written after each iteration so the operator can inspect
|
|
32
|
+
* progress. Mirrors recon-heal's HealState but scoped to prompt-template arms.
|
|
33
|
+
*/
|
|
34
|
+
export interface LlmHealState {
|
|
35
|
+
callType: string;
|
|
36
|
+
baselinePassRate: number;
|
|
37
|
+
history: IterationRecord[];
|
|
38
|
+
bestPassRate: number;
|
|
39
|
+
bestPatch: FlowPatch | null;
|
|
40
|
+
bestIterN: number;
|
|
41
|
+
}
|
|
42
|
+
/** Injectable replay runner — real or dry-run stub. */
|
|
43
|
+
export type ReplayFn = (params: {
|
|
44
|
+
samples: LlmCallSample[];
|
|
45
|
+
promptTemplate: string;
|
|
46
|
+
scorerFn: ScorerFn;
|
|
47
|
+
nReplays: number;
|
|
48
|
+
}) => Promise<{
|
|
49
|
+
passRate: number;
|
|
50
|
+
passCount: number;
|
|
51
|
+
failCount: number;
|
|
52
|
+
}>;
|
|
53
|
+
/** Injectable patch-request function for unit tests. */
|
|
54
|
+
export type RequestPromptPatchFn = (params: {
|
|
55
|
+
client: Anthropic;
|
|
56
|
+
callType: string;
|
|
57
|
+
promptTemplate: string;
|
|
58
|
+
failingSamples: LlmCallSample[];
|
|
59
|
+
iterN: number;
|
|
60
|
+
priorAttempts: Array<{
|
|
61
|
+
iter: number;
|
|
62
|
+
anchor: string;
|
|
63
|
+
replacement: string;
|
|
64
|
+
strategy: string;
|
|
65
|
+
outcome: "improved" | "no_change" | "regressed";
|
|
66
|
+
}>;
|
|
67
|
+
captureFn?: (input: LlmCallInput) => Promise<void>;
|
|
68
|
+
}) => Promise<FlowPatch | null>;
|
|
69
|
+
/** Parameters accepted by `phaseLlmHeal`. */
|
|
70
|
+
export interface LlmHealParams {
|
|
71
|
+
verdictPath: string;
|
|
72
|
+
callType: string;
|
|
73
|
+
maxIterations?: number;
|
|
74
|
+
nReplays?: number;
|
|
75
|
+
successThreshold?: number;
|
|
76
|
+
plateauDelta?: number;
|
|
77
|
+
plateauWindow?: number;
|
|
78
|
+
outDir?: string;
|
|
79
|
+
judgeModel?: string;
|
|
80
|
+
dryRun?: boolean;
|
|
81
|
+
replayFn?: ReplayFn;
|
|
82
|
+
requestPatchFn?: RequestPromptPatchFn;
|
|
83
|
+
scorerFn?: ScorerFn;
|
|
84
|
+
}
|
|
85
|
+
/** Return value of `phaseLlmHeal`. */
|
|
86
|
+
export interface LlmHealResult {
|
|
87
|
+
verdict: HealVerdict;
|
|
88
|
+
reportPath: string;
|
|
89
|
+
state: LlmHealState;
|
|
90
|
+
}
|
|
91
|
+
export { buildAnthropicClient };
|
|
92
|
+
/**
|
|
93
|
+
* Asks the model to propose a minimal patch to the prompt template, following
|
|
94
|
+
* the same anchor/replacement discipline as recon-flow-patch-generator but
|
|
95
|
+
* applied to a natural-language system or user prompt string.
|
|
96
|
+
*/
|
|
97
|
+
export declare function requestPromptPatch(params: {
|
|
98
|
+
client: Anthropic;
|
|
99
|
+
callType: string;
|
|
100
|
+
promptTemplate: string;
|
|
101
|
+
failingSamples: LlmCallSample[];
|
|
102
|
+
iterN: number;
|
|
103
|
+
priorAttempts: Array<{
|
|
104
|
+
iter: number;
|
|
105
|
+
anchor: string;
|
|
106
|
+
replacement: string;
|
|
107
|
+
strategy: string;
|
|
108
|
+
outcome: "improved" | "no_change" | "regressed";
|
|
109
|
+
}>;
|
|
110
|
+
captureFn?: (input: LlmCallInput) => Promise<void>;
|
|
111
|
+
}): Promise<FlowPatch | null>;
|
|
112
|
+
/**
|
|
113
|
+
* Scores each failing sample with the given scorer, treating the patched
|
|
114
|
+
* prompt as the system prompt context. Repeats nReplays times per sample and
|
|
115
|
+
* averages the pass rate — accounts for LLM non-determinism on borderline cases.
|
|
116
|
+
*/
|
|
117
|
+
export declare function replayPromptArm(params: {
|
|
118
|
+
samples: LlmCallSample[];
|
|
119
|
+
promptTemplate: string;
|
|
120
|
+
scorerFn: ScorerFn;
|
|
121
|
+
nReplays: number;
|
|
122
|
+
}): Promise<{
|
|
123
|
+
passRate: number;
|
|
124
|
+
passCount: number;
|
|
125
|
+
failCount: number;
|
|
126
|
+
}>;
|
|
127
|
+
/**
|
|
128
|
+
* Dry-run replay runner: marks every sample as passing without calling the
|
|
129
|
+
* scorer. Used in CI to verify the loop mechanics without any API calls.
|
|
130
|
+
*/
|
|
131
|
+
export declare function makeDryRunReplayFn(passRate?: number): ReplayFn;
|
|
132
|
+
/**
|
|
133
|
+
* Writes the current heal state to llm-heal-out/<callType>/state.json so the
|
|
134
|
+
* operator can inspect progress across interruptions.
|
|
135
|
+
*/
|
|
136
|
+
export declare function writeLlmHealState(outDir: string, callType: string, state: LlmHealState): void;
|
|
137
|
+
/**
|
|
138
|
+
* Persists per-iteration inputs and outputs for audit.
|
|
139
|
+
*/
|
|
140
|
+
export declare function writeLlmIterationArtifacts(params: {
|
|
141
|
+
outDir: string;
|
|
142
|
+
callType: string;
|
|
143
|
+
iterN: number;
|
|
144
|
+
patch: FlowPatch | null;
|
|
145
|
+
patchedPrompt: string;
|
|
146
|
+
passRate: number;
|
|
147
|
+
passCount: number;
|
|
148
|
+
failCount: number;
|
|
149
|
+
}): void;
|
|
150
|
+
/**
|
|
151
|
+
* Writes the healing report markdown and returns its path.
|
|
152
|
+
*/
|
|
153
|
+
export declare function writeLlmHealReport(params: {
|
|
154
|
+
outDir: string;
|
|
155
|
+
callType: string;
|
|
156
|
+
state: LlmHealState;
|
|
157
|
+
verdict: HealVerdict;
|
|
158
|
+
}): string;
|
|
159
|
+
/**
|
|
160
|
+
* Drives the full baseline → patch → replay → converge loop for a single
|
|
161
|
+
* callType's failing prompt. Accepts injectable `replayFn`, `requestPatchFn`,
|
|
162
|
+
* and `scorerFn` so tests can stub LLM calls and scoring.
|
|
163
|
+
*/
|
|
164
|
+
export declare function phaseLlmHeal(params: LlmHealParams): Promise<LlmHealResult>;
|
|
165
|
+
//# sourceMappingURL=llm-heal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"llm-heal.d.ts","sourceRoot":"","sources":["../../src/scripts/llm-heal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAMH,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAI1C,OAAO,EAAyC,KAAK,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAEpG,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAGlE,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAIL,KAAK,QAAQ,EACd,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,eAAe,EACrB,MAAM,sBAAsB,CAAC;AAe9B;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,SAAS,GAAG,IAAI,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,uDAAuD;AACvD,MAAM,MAAM,QAAQ,GAAG,CAAC,MAAM,EAAE;IAC9B,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,QAAQ,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB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