@jevitate/cli 0.1.0 → 0.3.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/README.md +23 -0
- package/dist/ai-cli.d.ts +31 -11
- package/dist/ai-cli.js +131 -88
- package/dist/ai-cli.js.map +1 -1
- package/dist/author-journey-cli.d.ts +4 -0
- package/dist/author-journey-cli.js +111 -0
- package/dist/author-journey-cli.js.map +1 -0
- package/dist/bin.js +60349 -16477
- package/dist/bin.js.map +1 -1
- package/dist/browser-run-options.d.ts +89 -0
- package/dist/browser-run-options.js +175 -0
- package/dist/browser-run-options.js.map +1 -0
- package/dist/build-info.generated.d.ts +2 -0
- package/dist/build-info.generated.js +10 -0
- package/dist/build-info.generated.js.map +1 -0
- package/dist/campaign-api.d.ts +151 -0
- package/dist/campaign-api.js +446 -0
- package/dist/campaign-api.js.map +1 -0
- package/dist/campaign-cli.d.ts +6 -0
- package/dist/campaign-cli.js +66 -0
- package/dist/campaign-cli.js.map +1 -0
- package/dist/check-api.d.ts +5 -0
- package/dist/check-api.js +234 -0
- package/dist/check-api.js.map +1 -0
- package/dist/check-budget.d.ts +26 -0
- package/dist/check-budget.js +90 -0
- package/dist/check-budget.js.map +1 -0
- package/dist/check-cli.d.ts +31 -0
- package/dist/check-cli.js +109 -0
- package/dist/check-cli.js.map +1 -0
- package/dist/check-execute.d.ts +29 -0
- package/dist/check-execute.js +420 -0
- package/dist/check-execute.js.map +1 -0
- package/dist/check-plan.d.ts +118 -0
- package/dist/check-plan.js +516 -0
- package/dist/check-plan.js.map +1 -0
- package/dist/check-suite.d.ts +184 -0
- package/dist/check-suite.js +540 -0
- package/dist/check-suite.js.map +1 -0
- package/dist/check-types.d.ts +181 -0
- package/dist/check-types.js +35 -0
- package/dist/check-types.js.map +1 -0
- package/dist/cli-args.d.ts +26 -0
- package/dist/cli-args.js +50 -0
- package/dist/cli-args.js.map +1 -0
- package/dist/cli-output.d.ts +106 -0
- package/dist/cli-output.js +563 -0
- package/dist/cli-output.js.map +1 -0
- package/dist/cli-reference.d.ts +3 -0
- package/dist/cli-reference.js +81 -0
- package/dist/cli-reference.js.map +1 -0
- package/dist/cli-refusal.d.ts +12 -0
- package/dist/cli-refusal.js +52 -0
- package/dist/cli-refusal.js.map +1 -0
- package/dist/cli-shared.d.ts +340 -0
- package/dist/cli-shared.js +537 -0
- package/dist/cli-shared.js.map +1 -0
- package/dist/cli-surface.d.ts +33 -0
- package/dist/cli-surface.js +48 -0
- package/dist/cli-surface.js.map +1 -0
- package/dist/conversation-options.d.ts +15 -0
- package/dist/conversation-options.js +10 -0
- package/dist/conversation-options.js.map +1 -0
- package/dist/credentials-file.d.ts +15 -0
- package/dist/credentials-file.js +56 -0
- package/dist/credentials-file.js.map +1 -0
- package/dist/data-dir.d.ts +1 -1
- package/dist/data-dir.js +1 -1
- package/dist/defect-evidence.d.ts +141 -0
- package/dist/defect-evidence.js +505 -0
- package/dist/defect-evidence.js.map +1 -0
- package/dist/demo-aspect-api.d.ts +209 -0
- package/dist/demo-aspect-api.js +398 -0
- package/dist/demo-aspect-api.js.map +1 -0
- package/dist/demo-aspect-cli.d.ts +3 -0
- package/dist/demo-aspect-cli.js +243 -0
- package/dist/demo-aspect-cli.js.map +1 -0
- package/dist/demo-capture.d.ts +142 -0
- package/dist/demo-capture.js +537 -0
- package/dist/demo-capture.js.map +1 -0
- package/dist/engine.d.ts +35 -0
- package/dist/engine.js +25 -0
- package/dist/engine.js.map +1 -0
- package/dist/environments.d.ts +155 -0
- package/dist/environments.js +364 -0
- package/dist/environments.js.map +1 -0
- package/dist/exit-codes.d.ts +46 -0
- package/dist/exit-codes.js +91 -0
- package/dist/exit-codes.js.map +1 -0
- package/dist/explore-adversarial.d.ts +144 -0
- package/dist/explore-adversarial.js +227 -0
- package/dist/explore-adversarial.js.map +1 -0
- package/dist/explore-api.d.ts +7 -187
- package/dist/explore-api.js +7 -301
- package/dist/explore-api.js.map +1 -1
- package/dist/explore-author.d.ts +79 -0
- package/dist/explore-author.js +86 -0
- package/dist/explore-author.js.map +1 -0
- package/dist/explore-cli.d.ts +7 -0
- package/dist/explore-cli.js +1199 -0
- package/dist/explore-cli.js.map +1 -0
- package/dist/explore-coverage.d.ts +173 -0
- package/dist/explore-coverage.js +246 -0
- package/dist/explore-coverage.js.map +1 -0
- package/dist/explore-feature.d.ts +125 -0
- package/dist/explore-feature.js +218 -0
- package/dist/explore-feature.js.map +1 -0
- package/dist/explore-goal.d.ts +271 -0
- package/dist/explore-goal.js +417 -0
- package/dist/explore-goal.js.map +1 -0
- package/dist/explore-shared.d.ts +177 -0
- package/dist/explore-shared.js +149 -0
- package/dist/explore-shared.js.map +1 -0
- package/dist/explore-specs.d.ts +53 -0
- package/dist/explore-specs.js +333 -0
- package/dist/explore-specs.js.map +1 -0
- package/dist/findings-filing.d.ts +64 -0
- package/dist/findings-filing.js +108 -0
- package/dist/findings-filing.js.map +1 -0
- package/dist/fixture-auth.d.ts +63 -0
- package/dist/fixture-auth.js +95 -0
- package/dist/fixture-auth.js.map +1 -0
- package/dist/fixture-cli.d.ts +99 -0
- package/dist/fixture-cli.js +292 -0
- package/dist/fixture-cli.js.map +1 -0
- package/dist/github-issue-filer.d.ts +62 -0
- package/dist/github-issue-filer.js +189 -0
- package/dist/github-issue-filer.js.map +1 -0
- package/dist/host-health-run.d.ts +25 -0
- package/dist/host-health-run.js +33 -0
- package/dist/host-health-run.js.map +1 -0
- package/dist/http-5xx-outcome.d.ts +6 -0
- package/dist/http-5xx-outcome.js +39 -0
- package/dist/http-5xx-outcome.js.map +1 -0
- package/dist/inbox-cli.d.ts +7 -0
- package/dist/inbox-cli.js +197 -0
- package/dist/inbox-cli.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/init-cli.d.ts +4 -0
- package/dist/init-cli.js +156 -0
- package/dist/init-cli.js.map +1 -0
- package/dist/init-keys.d.ts +30 -2
- package/dist/init-keys.js +19 -5
- package/dist/init-keys.js.map +1 -1
- package/dist/init-next-steps.d.ts +35 -0
- package/dist/init-next-steps.js +79 -0
- package/dist/init-next-steps.js.map +1 -0
- package/dist/invariants-file.d.ts +34 -0
- package/dist/invariants-file.js +68 -0
- package/dist/invariants-file.js.map +1 -0
- package/dist/invariants-validate.d.ts +30 -0
- package/dist/invariants-validate.js +105 -0
- package/dist/invariants-validate.js.map +1 -0
- package/dist/journey-annotate-api.d.ts +76 -0
- package/dist/journey-annotate-api.js +269 -0
- package/dist/journey-annotate-api.js.map +1 -0
- package/dist/journey-annotate-cli.d.ts +9 -0
- package/dist/journey-annotate-cli.js +181 -0
- package/dist/journey-annotate-cli.js.map +1 -0
- package/dist/journey-api.d.ts +104 -2
- package/dist/journey-api.js +163 -20
- package/dist/journey-api.js.map +1 -1
- package/dist/journey-cli.d.ts +4 -0
- package/dist/journey-cli.js +411 -0
- package/dist/journey-cli.js.map +1 -0
- package/dist/journey-demo-api.d.ts +114 -0
- package/dist/journey-demo-api.js +405 -0
- package/dist/journey-demo-api.js.map +1 -0
- package/dist/journey-demo-cli.d.ts +10 -0
- package/dist/journey-demo-cli.js +158 -0
- package/dist/journey-demo-cli.js.map +1 -0
- package/dist/journey-prefix.d.ts +194 -0
- package/dist/journey-prefix.js +279 -0
- package/dist/journey-prefix.js.map +1 -0
- package/dist/key-report.d.ts +49 -0
- package/dist/key-report.js +101 -0
- package/dist/key-report.js.map +1 -0
- package/dist/kill-signal.d.ts +193 -0
- package/dist/kill-signal.js +283 -0
- package/dist/kill-signal.js.map +1 -0
- package/dist/launch-armed.d.ts +37 -0
- package/dist/launch-armed.js +31 -0
- package/dist/launch-armed.js.map +1 -0
- package/dist/ledger-api.d.ts +106 -0
- package/dist/ledger-api.js +239 -0
- package/dist/ledger-api.js.map +1 -0
- package/dist/ledger-cli.d.ts +18 -0
- package/dist/ledger-cli.js +107 -0
- package/dist/ledger-cli.js.map +1 -0
- package/dist/load-api.d.ts +29 -11
- package/dist/load-api.js +23 -15
- package/dist/load-api.js.map +1 -1
- package/dist/load-cli.d.ts +4 -0
- package/dist/load-cli.js +97 -0
- package/dist/load-cli.js.map +1 -0
- package/dist/log-correlation.d.ts +200 -0
- package/dist/log-correlation.js +394 -0
- package/dist/log-correlation.js.map +1 -0
- package/dist/log-lines.d.ts +131 -0
- package/dist/log-lines.js +389 -0
- package/dist/log-lines.js.map +1 -0
- package/dist/log-sources.d.ts +71 -0
- package/dist/log-sources.js +236 -0
- package/dist/log-sources.js.map +1 -0
- package/dist/log-trace.d.ts +80 -0
- package/dist/log-trace.js +210 -0
- package/dist/log-trace.js.map +1 -0
- package/dist/logs-cli.d.ts +3 -0
- package/dist/logs-cli.js +51 -0
- package/dist/logs-cli.js.map +1 -0
- package/dist/logs-retention.d.ts +28 -0
- package/dist/logs-retention.js +85 -0
- package/dist/logs-retention.js.map +1 -0
- package/dist/masked-input.d.ts +22 -0
- package/dist/masked-input.js +99 -0
- package/dist/masked-input.js.map +1 -0
- package/dist/mcp-api.d.ts +91 -1
- package/dist/mcp-api.js +514 -18
- package/dist/mcp-api.js.map +1 -1
- package/dist/mcp-args.d.ts +50 -0
- package/dist/mcp-args.js +164 -0
- package/dist/mcp-args.js.map +1 -0
- package/dist/mcp-cli-bridge.d.ts +34 -0
- package/dist/mcp-cli-bridge.js +62 -0
- package/dist/mcp-cli-bridge.js.map +1 -0
- package/dist/mcp-cli-runner.d.ts +29 -0
- package/dist/mcp-cli-runner.js +44 -0
- package/dist/mcp-cli-runner.js.map +1 -0
- package/dist/mcp-cli-tools.d.ts +129 -0
- package/dist/mcp-cli-tools.js +737 -0
- package/dist/mcp-cli-tools.js.map +1 -0
- package/dist/mcp-paths.d.ts +28 -0
- package/dist/mcp-paths.js +76 -0
- package/dist/mcp-paths.js.map +1 -0
- package/dist/mission-actors.d.ts +40 -0
- package/dist/mission-actors.js +72 -0
- package/dist/mission-actors.js.map +1 -0
- package/dist/mission-api.d.ts +35 -0
- package/dist/mission-api.js +60 -3
- package/dist/mission-api.js.map +1 -1
- package/dist/mission-cli.d.ts +4 -0
- package/dist/mission-cli.js +248 -0
- package/dist/mission-cli.js.map +1 -0
- package/dist/mission-exit.d.ts +22 -0
- package/dist/mission-exit.js +26 -0
- package/dist/mission-exit.js.map +1 -0
- package/dist/mission-fixtures.d.ts +234 -0
- package/dist/mission-fixtures.js +862 -0
- package/dist/mission-fixtures.js.map +1 -0
- package/dist/mission-journal.d.ts +60 -0
- package/dist/mission-journal.js +115 -0
- package/dist/mission-journal.js.map +1 -0
- package/dist/mission-queue-cli.d.ts +10 -0
- package/dist/mission-queue-cli.js +198 -0
- package/dist/mission-queue-cli.js.map +1 -0
- package/dist/mission-queue-runner.d.ts +126 -0
- package/dist/mission-queue-runner.js +406 -0
- package/dist/mission-queue-runner.js.map +1 -0
- package/dist/multi-run-cli.d.ts +37 -0
- package/dist/multi-run-cli.js +116 -0
- package/dist/multi-run-cli.js.map +1 -0
- package/dist/multi-run.d.ts +339 -0
- package/dist/multi-run.js +619 -0
- package/dist/multi-run.js.map +1 -0
- package/dist/openrouter-call.d.ts +22 -0
- package/dist/openrouter-call.js +64 -0
- package/dist/openrouter-call.js.map +1 -0
- package/dist/profile-cli.d.ts +4 -0
- package/dist/profile-cli.js +57 -0
- package/dist/profile-cli.js.map +1 -0
- package/dist/program.d.ts +3 -75
- package/dist/program.js +123 -1921
- package/dist/program.js.map +1 -1
- package/dist/project-dir.d.ts +96 -0
- package/dist/project-dir.js +221 -0
- package/dist/project-dir.js.map +1 -0
- package/dist/record-api.d.ts +13 -7
- package/dist/record-api.js +44 -30
- package/dist/record-api.js.map +1 -1
- package/dist/record-cli.d.ts +4 -0
- package/dist/record-cli.js +76 -0
- package/dist/record-cli.js.map +1 -0
- package/dist/recording-cli.d.ts +4 -0
- package/dist/recording-cli.js +248 -0
- package/dist/recording-cli.js.map +1 -0
- package/dist/regression-api.d.ts +107 -0
- package/dist/regression-api.js +387 -6
- package/dist/regression-api.js.map +1 -1
- package/dist/regression-cli.d.ts +4 -0
- package/dist/regression-cli.js +284 -0
- package/dist/regression-cli.js.map +1 -0
- package/dist/report-api.d.ts +146 -0
- package/dist/report-api.js +431 -0
- package/dist/report-api.js.map +1 -0
- package/dist/report-cli.d.ts +12 -0
- package/dist/report-cli.js +147 -0
- package/dist/report-cli.js.map +1 -0
- package/dist/resource-preflight.d.ts +87 -0
- package/dist/resource-preflight.js +160 -0
- package/dist/resource-preflight.js.map +1 -0
- package/dist/result-schema.d.ts +22 -0
- package/dist/result-schema.js +28 -0
- package/dist/result-schema.js.map +1 -0
- package/dist/run-index.d.ts +29 -0
- package/dist/run-index.js +70 -0
- package/dist/run-index.js.map +1 -0
- package/dist/run-key-preflight.d.ts +42 -0
- package/dist/run-key-preflight.js +82 -0
- package/dist/run-key-preflight.js.map +1 -0
- package/dist/run-screenshots.d.ts +123 -0
- package/dist/run-screenshots.js +235 -0
- package/dist/run-screenshots.js.map +1 -0
- package/dist/runtime-env.d.ts +8 -0
- package/dist/runtime-env.js +23 -0
- package/dist/runtime-env.js.map +1 -0
- package/dist/secret-args.d.ts +23 -0
- package/dist/secret-args.js +45 -0
- package/dist/secret-args.js.map +1 -0
- package/dist/serve-cli.d.ts +4 -0
- package/dist/serve-cli.js +95 -0
- package/dist/serve-cli.js.map +1 -0
- package/dist/server-log-verify.d.ts +36 -0
- package/dist/server-log-verify.js +120 -0
- package/dist/server-log-verify.js.map +1 -0
- package/dist/session-check.d.ts +14 -0
- package/dist/session-check.js +44 -0
- package/dist/session-check.js.map +1 -0
- package/dist/site-cli.d.ts +4 -0
- package/dist/site-cli.js +127 -0
- package/dist/site-cli.js.map +1 -0
- package/dist/site-gate-cli.d.ts +28 -0
- package/dist/site-gate-cli.js +59 -0
- package/dist/site-gate-cli.js.map +1 -0
- package/dist/source-api.js +20 -4
- package/dist/source-api.js.map +1 -1
- package/dist/source-cli.d.ts +4 -0
- package/dist/source-cli.js +284 -0
- package/dist/source-cli.js.map +1 -0
- package/dist/source-run-api.d.ts +27 -1
- package/dist/source-run-api.js +22 -11
- package/dist/source-run-api.js.map +1 -1
- package/dist/storage-state-snapshot.d.ts +50 -0
- package/dist/storage-state-snapshot.js +87 -0
- package/dist/storage-state-snapshot.js.map +1 -0
- package/dist/suite-explore-options.d.ts +321 -0
- package/dist/suite-explore-options.js +162 -0
- package/dist/suite-explore-options.js.map +1 -0
- package/dist/target-config.d.ts +115 -0
- package/dist/target-config.js +225 -0
- package/dist/target-config.js.map +1 -0
- package/dist/transcript-file.d.ts +12 -0
- package/dist/transcript-file.js +23 -0
- package/dist/transcript-file.js.map +1 -0
- package/dist/type-fixture-file.d.ts +9 -0
- package/dist/type-fixture-file.js +48 -0
- package/dist/type-fixture-file.js.map +1 -0
- package/dist/ui-api.d.ts +3 -0
- package/dist/ui-api.js +11 -4
- package/dist/ui-api.js.map +1 -1
- package/dist/usability-capture.d.ts +43 -0
- package/dist/usability-capture.js +327 -0
- package/dist/usability-capture.js.map +1 -0
- package/dist/usage-config.d.ts +36 -0
- package/dist/usage-config.js +114 -0
- package/dist/usage-config.js.map +1 -0
- package/dist/ux-api.d.ts +3 -75
- package/dist/ux-api.js +3 -220
- package/dist/ux-api.js.map +1 -1
- package/dist/ux-claim-probe.d.ts +45 -0
- package/dist/ux-claim-probe.js +386 -0
- package/dist/ux-claim-probe.js.map +1 -0
- package/dist/ux-cli.d.ts +4 -0
- package/dist/ux-cli.js +109 -0
- package/dist/ux-cli.js.map +1 -0
- package/dist/ux-config.d.ts +29 -0
- package/dist/ux-config.js +103 -0
- package/dist/ux-config.js.map +1 -0
- package/dist/ux-evidence.d.ts +54 -0
- package/dist/ux-evidence.js +197 -0
- package/dist/ux-evidence.js.map +1 -0
- package/dist/ux-product.d.ts +14 -0
- package/dist/ux-product.js +39 -0
- package/dist/ux-product.js.map +1 -0
- package/dist/ux-review.d.ts +116 -0
- package/dist/ux-review.js +171 -0
- package/dist/ux-review.js.map +1 -0
- package/dist/ux-usability.d.ts +263 -0
- package/dist/ux-usability.js +580 -0
- package/dist/ux-usability.js.map +1 -0
- package/dist/verify-fix-api.d.ts +194 -0
- package/dist/verify-fix-api.js +506 -0
- package/dist/verify-fix-api.js.map +1 -0
- package/dist/verify-fix-cli.d.ts +4 -0
- package/dist/verify-fix-cli.js +115 -0
- package/dist/verify-fix-cli.js.map +1 -0
- package/package.json +23 -18
- package/skills/jevitate-ci-check/SKILL.md +77 -0
- package/skills/jevitate-demo/SKILL.md +61 -0
- package/skills/jevitate-explore/SKILL.md +96 -87
- package/skills/jevitate-getting-started/SKILL.md +89 -0
- package/skills/jevitate-load-test/SKILL.md +11 -2
- package/skills/jevitate-mission-scope/SKILL.md +19 -11
- package/skills/jevitate-record/SKILL.md +23 -5
- package/skills/jevitate-run-journey/SKILL.md +61 -17
- package/skills/jevitate-sources/SKILL.md +57 -14
- package/skills/jevitate-test-campaign/SKILL.md +203 -0
- package/skills/jevitate-ux-review/SKILL.md +106 -16
- package/skills/jevitate-verify-fix/SKILL.md +76 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import type { UsageCounts } from "@jevitate/ai-core";
|
|
2
|
+
import { type BrowserPort, type EmulationSpec } from "@jevitate/playwright";
|
|
3
|
+
import { type BrowserRunOptions } from "./browser-run-options.js";
|
|
4
|
+
import { type ScreenshotsSpec } from "./run-screenshots.js";
|
|
5
|
+
import { type InvariantSpec } from "@jevitate/recording";
|
|
6
|
+
import type { HostHealthSampler, InvariantDefect, SafetyConfig } from "@jevitate/explore";
|
|
7
|
+
import type { EnvironmentDegraded, HostHealthSummary } from "@jevitate/domain";
|
|
8
|
+
import { type Bounds, type FeatureRunResult, type MissionRouteScope, type Http5xxDefect } from "@jevitate/explore";
|
|
9
|
+
import { type MissionOutcome } from "@jevitate/domain";
|
|
10
|
+
import { type EngineInfo } from "./engine.js";
|
|
11
|
+
import { MISSION_RESULT_SCHEMA_VERSION } from "./result-schema.js";
|
|
12
|
+
import { type ServerLogDefect, type ServerLogsSummary } from "./log-correlation.js";
|
|
13
|
+
import { type ServerLogOptions, type MissionTarget } from "./explore-shared.js";
|
|
14
|
+
/**
|
|
15
|
+
* The programmatic surface behind `jevitate explore --feature <name>` — the
|
|
16
|
+
* capability-scoped feature-testing mission (ticket #2, paired site ticket
|
|
17
|
+
* #11). Model-free by design, so unlike `runExploration` it needs no gateways.
|
|
18
|
+
*
|
|
19
|
+
* The authorized-target guard runs FIRST (fail-closed), BEFORE any browser is
|
|
20
|
+
* opened — an unauthorized origin never launches Chromium.
|
|
21
|
+
*/
|
|
22
|
+
export interface RunFeatureCliMissionOptions {
|
|
23
|
+
/** Test seam (#203): the run's host-health sampler (a deterministic fake host). Default: this host's. */
|
|
24
|
+
readonly hostHealth?: HostHealthSampler;
|
|
25
|
+
readonly seedUrl: string;
|
|
26
|
+
readonly allowlist: readonly string[];
|
|
27
|
+
readonly capability: string;
|
|
28
|
+
/**
|
|
29
|
+
* The `--route` globs, used exactly as given. Empty/absent (#224): the start URL's route and
|
|
30
|
+
* everything under it — the default every strategy shares (`resolveRouteScope`), stated in the
|
|
31
|
+
* result's `scope`. A start URL no default can be derived from is refused up front
|
|
32
|
+
* (`ScopeUnderivableError`, a usage error) before any browser opens.
|
|
33
|
+
*/
|
|
34
|
+
readonly routeGlobs?: readonly string[];
|
|
35
|
+
/** No-progress watchdog (CLI `--stall-timeout`, #114): ends the run `stalled` (inconclusive). Default 120s. */
|
|
36
|
+
readonly stallTimeoutMs?: number;
|
|
37
|
+
/** Step/action budget (CLI `--max-actions` / `--max-decisions`). */
|
|
38
|
+
readonly bounds?: Partial<Bounds>;
|
|
39
|
+
/** Testing seam — defaults to a real `PlaywrightBrowserPort`. */
|
|
40
|
+
readonly browserPortFactory?: () => BrowserPort;
|
|
41
|
+
/** How Chromium is launched (executable/channel/extra args) and shown (#245 demo mode). Default: pinned Chromium, headless. */
|
|
42
|
+
readonly browser?: BrowserRunOptions;
|
|
43
|
+
/** #251 `--screenshots`: masked screenshots (one per distinct screen, or per step) + `index.md`. */
|
|
44
|
+
readonly screenshots?: ScreenshotsSpec;
|
|
45
|
+
/**
|
|
46
|
+
* #250 `--evidence-video`: after the result is written, each defect's minimal repro is replayed
|
|
47
|
+
* with captions (the failing step marked) into a masked clip + before/at screenshots, attached as
|
|
48
|
+
* `defects[].evidence` (and to its issue draft).
|
|
49
|
+
*/
|
|
50
|
+
readonly evidenceVideo?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Playwright storageState JSON to seed the session from (CLI `--storage-state`) —
|
|
53
|
+
* the deterministic authenticated pre-step. Contains live session cookies: it is
|
|
54
|
+
* handed only to the browser, never to a model or a Recording.
|
|
55
|
+
*/
|
|
56
|
+
readonly storageState?: string;
|
|
57
|
+
/** Where the recordings, transcript and typed result are written. Default `.jevitate/logs/<date>` (project, else `~/.jevitate`). */
|
|
58
|
+
readonly outDir?: string;
|
|
59
|
+
/** ISO clock for output filenames. Default `Date.now()`. */
|
|
60
|
+
readonly nowIso?: () => string;
|
|
61
|
+
/**
|
|
62
|
+
* Writes the browser context's storageState (cookies + origin storage) here when the run ends
|
|
63
|
+
* (CLI `--save-storage-state`) — so a rotating refresh token stays usable across runs instead of
|
|
64
|
+
* invalidating `--storage-state`'s file on first use. The file holds live session credentials:
|
|
65
|
+
* written with mode 0600, and its contents are never logged. See
|
|
66
|
+
* `RunExplorationOptions.saveStorageState`'s own doc for the full behaviour (#159: written on
|
|
67
|
+
* every exit path including a crash/kill signal, never over a lost/logged-out session).
|
|
68
|
+
*/
|
|
69
|
+
readonly saveStorageState?: string;
|
|
70
|
+
/** App-declared invariants (`--invariants`, #86), already validated against the allowlist. */
|
|
71
|
+
readonly invariants?: InvariantSpec;
|
|
72
|
+
/** Backend log sources (`--log-source`/`--log-defect`, #142), already validated. */
|
|
73
|
+
readonly serverLog?: ServerLogOptions;
|
|
74
|
+
/** Resolved `authFrom.secret` refs (#135) a declared probe may use: `env:VAR` → its value. */
|
|
75
|
+
readonly invariantAuthTokens?: ReadonlyMap<string, string>;
|
|
76
|
+
/** The shared safety policy (#116: `--deny`, `--allow-destructive`, `--read-rpc`). */
|
|
77
|
+
readonly safety?: SafetyConfig;
|
|
78
|
+
/** Per-mission viewport/device emulation (#149); see `RunExplorationOptions.emulation`. */
|
|
79
|
+
readonly emulation?: EmulationSpec;
|
|
80
|
+
}
|
|
81
|
+
/** The feature mission's result plus its typed verdict, exit code, and where its artifacts landed. */
|
|
82
|
+
export type FeatureCliMissionResult = Omit<FeatureRunResult, "outcome"> & {
|
|
83
|
+
/** The frontier's ending — `insufficient-coverage` (#209) when it emptied having proved nothing about the feature. */
|
|
84
|
+
readonly outcome: FeatureRunResult["outcome"] | "insufficient-coverage";
|
|
85
|
+
/** The result schema's version (#195): the common fields are filled the same way by every strategy. */
|
|
86
|
+
readonly schemaVersion: typeof MISSION_RESULT_SCHEMA_VERSION;
|
|
87
|
+
readonly strategy: "feature";
|
|
88
|
+
/** The route scope the run used (#224): the `--route` globs, or the one derived from the start URL. */
|
|
89
|
+
readonly scope: MissionRouteScope;
|
|
90
|
+
/**
|
|
91
|
+
* `clean` only when the run actually exercised an in-scope, non-chrome
|
|
92
|
+
* control of the named capability (`coverage.inScopeActionsExercised > 0`).
|
|
93
|
+
* A run that touched nothing but global chrome and/or left `--route` scope
|
|
94
|
+
* on every attempt is `inconclusive` — never a fabricated `clean` (ticket
|
|
95
|
+
* #78's guardrail: a run that proved nothing is never `clean`).
|
|
96
|
+
*/
|
|
97
|
+
readonly missionOutcome: MissionOutcome;
|
|
98
|
+
readonly exitCode: number;
|
|
99
|
+
/** Which build produced this result (issue #83): `{version, commit, builtAt}`. */
|
|
100
|
+
readonly engine: EngineInfo;
|
|
101
|
+
/** One Recording per distinct discovered path (`feature-<stamp>-path-<n>.json`). */
|
|
102
|
+
readonly recordingPaths: string[];
|
|
103
|
+
/** #245: `--record-video` files, finalized before this result was written (absent when not recording). */
|
|
104
|
+
readonly videoPaths?: string[];
|
|
105
|
+
/** The shared decision transcript (`feature-<stamp>.transcript.json`). */
|
|
106
|
+
readonly transcriptPath: string;
|
|
107
|
+
/** The persisted typed result (`feature-<stamp>.result.json`), readable via MCP `get_mission_result`. */
|
|
108
|
+
readonly resultPath: string;
|
|
109
|
+
/** Where the run happened — what `verify-fix` needs to replay a declared-invariant defect. */
|
|
110
|
+
readonly target: MissionTarget;
|
|
111
|
+
/** EVERY defect the run found (#195): declared-invariant defects (#86, each with its own path Recording) and `server-log` defects (#142). */
|
|
112
|
+
readonly defects: Array<InvariantDefect | Http5xxDefect | ServerLogDefect>;
|
|
113
|
+
readonly invariantSpec?: InvariantSpec;
|
|
114
|
+
/** Backend log correlation summary (#142) — present only when `--log-source` was given. */
|
|
115
|
+
readonly serverLogs?: ServerLogsSummary;
|
|
116
|
+
/** Always zero (#188): a feature mission makes no model call — stated, never absent ("not tracked"). */
|
|
117
|
+
readonly usage: UsageCounts;
|
|
118
|
+
/** The host's health over the run (#203): peaks, the slowest render, starved steps. */
|
|
119
|
+
readonly hostHealth: HostHealthSummary;
|
|
120
|
+
/** Findings met while the host was starved (#203) — advisory, never a defect/hang, never failing the run. */
|
|
121
|
+
readonly environmentDegraded: EnvironmentDegraded[];
|
|
122
|
+
};
|
|
123
|
+
/** A model-free mission's usage (#188): nothing called, nothing to price — a known $0. */
|
|
124
|
+
export declare const NO_MODEL_USAGE: UsageCounts;
|
|
125
|
+
export declare function runFeatureCliMission(opts: RunFeatureCliMissionOptions): Promise<FeatureCliMissionResult>;
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
/** The feature strategy runner behind `jevitate explore --strategy feature`. */
|
|
2
|
+
import { writeFile } from "node:fs/promises";
|
|
3
|
+
import { logsDirFor } from "./project-dir.js";
|
|
4
|
+
import { join, resolve as resolvePath } from "node:path";
|
|
5
|
+
import { PlaywrightBrowserPort, resolveEmulation } from "@jevitate/playwright";
|
|
6
|
+
import { closeOnce, demoOverlayOf, finalizeVideos, runVideoDir, sessionLaunchOptions } from "./browser-run-options.js";
|
|
7
|
+
import { runCaptureFor } from "./run-screenshots.js";
|
|
8
|
+
import { evidenceOf, withRunEvidence } from "./defect-evidence.js";
|
|
9
|
+
import { CastActor, BrowseTheWeb } from "@jevitate/screenplay";
|
|
10
|
+
import { runFeatureMission, assertAuthorizedExploreTarget, resolveRouteScope, refusalNote, safetyRefusalsFromTranscript, Http5xxOracle, hangOutcome, } from "@jevitate/explore";
|
|
11
|
+
import { combineOutcomes, clock } from "@jevitate/domain";
|
|
12
|
+
import { currentEngineInfo } from "./engine.js";
|
|
13
|
+
import { MissionJournal, artifactStamp, closeQuietly, resultPathFor, writeMissionResult } from "./mission-journal.js";
|
|
14
|
+
import { MISSION_RESULT_SCHEMA_VERSION, unifiedDefects } from "./result-schema.js";
|
|
15
|
+
import { missionExitCode } from "./mission-exit.js";
|
|
16
|
+
import { launchArmed } from "./launch-armed.js";
|
|
17
|
+
import { finishHostHealth } from "./host-health-run.js";
|
|
18
|
+
import { applyServerLogOutcome, openServerLogRuntime, } from "./log-correlation.js";
|
|
19
|
+
import { serverLogResult, freshSessionOpener, currentUrlSafe, assertSaveStorageStateOutsideProject, persistStorageState, declaredResult, serverLogRuntimeOptions, } from "./explore-shared.js";
|
|
20
|
+
/** A model-free mission's usage (#188): nothing called, nothing to price — a known $0. */
|
|
21
|
+
export const NO_MODEL_USAGE = {
|
|
22
|
+
judgments: 0,
|
|
23
|
+
generations: 0,
|
|
24
|
+
inputTokens: 0,
|
|
25
|
+
outputTokens: 0,
|
|
26
|
+
totalUsd: 0,
|
|
27
|
+
priced: "full",
|
|
28
|
+
priceSource: ["no model call"],
|
|
29
|
+
};
|
|
30
|
+
export async function runFeatureCliMission(opts) {
|
|
31
|
+
// Guardrail #1 — authorize BEFORE opening a browser. Throws on refusal.
|
|
32
|
+
const origin = assertAuthorizedExploreTarget(opts.seedUrl, opts.allowlist);
|
|
33
|
+
assertSaveStorageStateOutsideProject(opts.saveStorageState);
|
|
34
|
+
// #224: no --route → the start URL's route (the shared default); refused up front when underivable.
|
|
35
|
+
const routeScope = resolveRouteScope(opts.seedUrl, opts.routeGlobs);
|
|
36
|
+
const scope = { name: opts.capability, originAllowlist: opts.allowlist, routeGlobs: routeScope.routeGlobs };
|
|
37
|
+
// #149: refused BEFORE any browser opens.
|
|
38
|
+
resolveEmulation(opts.emulation);
|
|
39
|
+
// #250/#251: a recorded or screenshotted run's sessions carry the live pixel mask from their first
|
|
40
|
+
// paint; `--screenshots` captures after each step (the Recording path names their folder).
|
|
41
|
+
const capture = runCaptureFor({
|
|
42
|
+
recordsVideo: opts.browser?.recordVideo !== undefined,
|
|
43
|
+
screenshots: opts.screenshots,
|
|
44
|
+
secrets: [],
|
|
45
|
+
artifactPath: () => journal.recordingPath,
|
|
46
|
+
title: `feature: ${opts.capability}`,
|
|
47
|
+
});
|
|
48
|
+
const portFactory = capture.wrap(opts.browserPortFactory ?? (() => new PlaywrightBrowserPort()));
|
|
49
|
+
// Persist recordings + transcript + a typed result, like the goal and
|
|
50
|
+
// coverage missions do (ticket #78 — previously nothing was written).
|
|
51
|
+
const outDir = opts.outDir ?? logsDirFor();
|
|
52
|
+
const iso = (opts.nowIso ?? (() => clock.nowIso()))();
|
|
53
|
+
const stamp = artifactStamp(iso);
|
|
54
|
+
const journal = new MissionJournal(join(outDir, `feature-${stamp}.json`));
|
|
55
|
+
// #245: the mission session and every hang-replay session are shown/recorded alike.
|
|
56
|
+
const videoDir = runVideoDir(opts.browser, journal.recordingPath);
|
|
57
|
+
const launch = {
|
|
58
|
+
...sessionLaunchOptions(opts.browser, videoDir),
|
|
59
|
+
allowedOrigins: [...opts.allowlist],
|
|
60
|
+
baseUrl: origin,
|
|
61
|
+
...opts.emulation,
|
|
62
|
+
...(opts.storageState !== undefined ? { storageState: opts.storageState } : {}),
|
|
63
|
+
};
|
|
64
|
+
// #226: the kill switch is armed BEFORE the host sampler and the browser launch (see launch-armed.ts).
|
|
65
|
+
const { disarmKillSwitch, health, session, snapshotter } = await launchArmed({
|
|
66
|
+
hostHealth: opts.hostHealth,
|
|
67
|
+
saveStorageState: opts.saveStorageState !== undefined,
|
|
68
|
+
open: () => portFactory().open(launch),
|
|
69
|
+
mission: (hooks) => ({
|
|
70
|
+
// #220: the killed run's partial result carries the unified schema's common fields too.
|
|
71
|
+
strategy: "feature",
|
|
72
|
+
target: { seedUrl: opts.seedUrl, allowlist: [...opts.allowlist], ...(opts.storageState !== undefined ? { storageStatePath: resolvePath(opts.storageState) } : {}) },
|
|
73
|
+
recordingPath: journal.recordingPath,
|
|
74
|
+
hostHealth: hooks.hostHealth,
|
|
75
|
+
...(videoDir === undefined ? {} : { videoDir }),
|
|
76
|
+
transcriptPath: journal.transcriptPath,
|
|
77
|
+
transcript: () => journal.transcript,
|
|
78
|
+
...(opts.saveStorageState === undefined ? {} : { storageState: { path: opts.saveStorageState, snapshot: hooks.snapshot } }),
|
|
79
|
+
}),
|
|
80
|
+
});
|
|
81
|
+
// #208: the shared HTTP 5xx hard signal, listening from before the first navigation.
|
|
82
|
+
const http5xx = new Http5xxOracle(session.page, { allowlist: opts.allowlist });
|
|
83
|
+
const serverLog = openServerLogRuntime({
|
|
84
|
+
...serverLogRuntimeOptions(opts.serverLog),
|
|
85
|
+
secrets: [],
|
|
86
|
+
onTranscriptEntry: journal.onTranscriptEntry,
|
|
87
|
+
});
|
|
88
|
+
// #204: every request's correlation ids, from before the first navigation.
|
|
89
|
+
serverLog?.observe(session.page);
|
|
90
|
+
const onTranscriptEntry = (entry, all) => {
|
|
91
|
+
capture.noteEntry(session.page, entry);
|
|
92
|
+
health.noteStep(entry);
|
|
93
|
+
http5xx.noteStep(entry);
|
|
94
|
+
(serverLog?.onTranscriptEntry ?? journal.onTranscriptEntry)(entry, all);
|
|
95
|
+
snapshotter.noteSettledStep(currentUrlSafe(session));
|
|
96
|
+
};
|
|
97
|
+
// #159/#245: persisted and closed once — early (before the result is written) when recording video.
|
|
98
|
+
const closeSession = closeOnce(async () => {
|
|
99
|
+
await persistStorageState(session, opts.saveStorageState, snapshotter);
|
|
100
|
+
await closeQuietly(session);
|
|
101
|
+
});
|
|
102
|
+
try {
|
|
103
|
+
const actor = CastActor.named("feature-mission").whoCan(new BrowseTheWeb(session, [...opts.allowlist]));
|
|
104
|
+
const result = await runFeatureMission({
|
|
105
|
+
openFreshSession: freshSessionOpener(portFactory, launch, opts.allowlist),
|
|
106
|
+
page: session.page,
|
|
107
|
+
actor,
|
|
108
|
+
seedUrl: opts.seedUrl,
|
|
109
|
+
allowlist: opts.allowlist,
|
|
110
|
+
scope,
|
|
111
|
+
bounds: opts.bounds,
|
|
112
|
+
onTranscriptEntry,
|
|
113
|
+
...(opts.invariants === undefined ? {} : { invariants: opts.invariants }),
|
|
114
|
+
...(opts.invariantAuthTokens === undefined ? {} : { invariantAuthTokens: opts.invariantAuthTokens }),
|
|
115
|
+
...(opts.stallTimeoutMs === undefined ? {} : { stallTimeoutMs: opts.stallTimeoutMs }),
|
|
116
|
+
...(opts.safety === undefined ? {} : { safety: opts.safety }),
|
|
117
|
+
hostHealth: health,
|
|
118
|
+
demoOverlay: demoOverlayOf(opts.browser),
|
|
119
|
+
});
|
|
120
|
+
const serverLogRun = serverLog === undefined ? undefined : await serverLog.finish(result.transcript);
|
|
121
|
+
const recordingPaths = [];
|
|
122
|
+
for (let i = 0; i < result.recordings.length; i++) {
|
|
123
|
+
const p = join(outDir, `feature-${stamp}-path-${i}.json`);
|
|
124
|
+
await writeFile(p, `${JSON.stringify(result.recordings[i], null, 2)}\n`, "utf8");
|
|
125
|
+
recordingPaths.push(p);
|
|
126
|
+
}
|
|
127
|
+
journal.writeTranscript(serverLogRun?.transcript ?? result.transcript);
|
|
128
|
+
// Honest outcome (ticket #78): a run that exercised nothing in-scope and
|
|
129
|
+
// non-chrome proved nothing about the named capability — `inconclusive`,
|
|
130
|
+
// never `clean`, whatever the loop's own stop reason was. Mirrors the
|
|
131
|
+
// adversarial mission's `insufficient-coverage` idiom.
|
|
132
|
+
const chromeOnly = result.outcome !== "crashed" && result.coverage.inScopeActionsExercised === 0;
|
|
133
|
+
// #209: in-scope, non-chrome controls were exercised — but none of them had anything to do with
|
|
134
|
+
// the named capability (every one at relevance=0 against its words). That proves no more about
|
|
135
|
+
// it than the chrome-only case: `inconclusive`, never `clean`.
|
|
136
|
+
const words = result.coverage.featureWords;
|
|
137
|
+
const irrelevant = !chromeOnly && result.outcome !== "crashed" && words.length > 0 && result.coverage.relevantActionsExercised === 0;
|
|
138
|
+
const thin = chromeOnly || irrelevant;
|
|
139
|
+
const coverageFailure = chromeOnly
|
|
140
|
+
? {
|
|
141
|
+
kind: "insufficient-coverage",
|
|
142
|
+
message: `no in-scope, non-chrome control of "${opts.capability}" was exercised within route(s) [${routeScope.routeGlobs.join(", ")}]${routeScope.source === "start-url" ? " (derived from the start URL)" : ""} — ${result.coverage.boundaryEdges.length} boundary edge(s) hit instead${refusalNote(safetyRefusalsFromTranscript(result.transcript))}`,
|
|
143
|
+
}
|
|
144
|
+
: irrelevant
|
|
145
|
+
? {
|
|
146
|
+
kind: "insufficient-coverage",
|
|
147
|
+
message: `no control relevant to "${opts.capability}" was exercised: all ${result.coverage.inScopeActionsExercised} in-scope action(s) were on controls at relevance=0 (none named with ${words.map((w) => `"${w}"`).join(", ")}) — name the feature with the words its controls use, or point --url/--route at the page that has them`,
|
|
148
|
+
}
|
|
149
|
+
: undefined;
|
|
150
|
+
// A declared-invariant violation (#86) is a hard defect even on a thin run: it was observed.
|
|
151
|
+
// #208: the shared HTTP 5xx hard signal's defects count like declared-invariant ones.
|
|
152
|
+
const httpDefects = http5xx.defects(result.transcript);
|
|
153
|
+
const hardDefects = (result.invariantDefects?.length ?? 0) + httpDefects.length;
|
|
154
|
+
// #150 — a crossed mission spend budget is a deliberate, clean stop (not the run breaking): it
|
|
155
|
+
// maps to `inconclusive`, but a defect found before it still wins, reported with `stop: "budget"`.
|
|
156
|
+
const preLogOutcome = combineOutcomes([
|
|
157
|
+
result.outcome === "crashed"
|
|
158
|
+
? "crashed"
|
|
159
|
+
: result.outcome === "scope-unreachable" || result.outcome === "stalled"
|
|
160
|
+
? "inconclusive"
|
|
161
|
+
: result.outcome === "budget"
|
|
162
|
+
? hardDefects > 0
|
|
163
|
+
? "defects-found"
|
|
164
|
+
: "inconclusive"
|
|
165
|
+
: hardDefects > 0
|
|
166
|
+
? "defects-found"
|
|
167
|
+
: thin
|
|
168
|
+
? "inconclusive"
|
|
169
|
+
: "clean",
|
|
170
|
+
...result.hangs.map((h) => hangOutcome(h.reproduction.status)),
|
|
171
|
+
]);
|
|
172
|
+
// #142 follow-up: a server-log defect counts as `defects-found`; an unreadable `--log-defect`
|
|
173
|
+
// oracle turns an otherwise-`clean` run `inconclusive` — never a false clean.
|
|
174
|
+
const host = await finishHostHealth(health, applyServerLogOutcome(preLogOutcome, serverLogRun));
|
|
175
|
+
const missionOutcome = host.outcome;
|
|
176
|
+
const exitCode = missionExitCode(missionOutcome);
|
|
177
|
+
// #245: every context closed (videos finalized) before the result naming them is written.
|
|
178
|
+
const shotFields = await capture.finish();
|
|
179
|
+
const videos = await finalizeVideos(videoDir, closeSession);
|
|
180
|
+
const typed = {
|
|
181
|
+
...result,
|
|
182
|
+
// #209: one name — a frontier that emptied having proved nothing about the feature is not
|
|
183
|
+
// `exhausted` ("fully covered"): it is `insufficient-coverage`, the same word as its failure.kind.
|
|
184
|
+
outcome: thin && result.outcome === "exhausted" ? "insufficient-coverage" : result.outcome,
|
|
185
|
+
schemaVersion: MISSION_RESULT_SCHEMA_VERSION,
|
|
186
|
+
strategy: "feature",
|
|
187
|
+
scope: routeScope,
|
|
188
|
+
transcript: (serverLogRun?.transcript ?? result.transcript),
|
|
189
|
+
failure: result.failure ?? host.failure ?? coverageFailure,
|
|
190
|
+
missionOutcome,
|
|
191
|
+
exitCode,
|
|
192
|
+
recordingPaths,
|
|
193
|
+
...videos,
|
|
194
|
+
...shotFields,
|
|
195
|
+
transcriptPath: journal.transcriptPath,
|
|
196
|
+
engine: currentEngineInfo(),
|
|
197
|
+
target: {
|
|
198
|
+
seedUrl: opts.seedUrl,
|
|
199
|
+
allowlist: [...opts.allowlist],
|
|
200
|
+
...(opts.storageState !== undefined ? { storageStatePath: resolvePath(opts.storageState) } : {}),
|
|
201
|
+
},
|
|
202
|
+
...declaredResult(opts.invariants, result.invariantDefects, result.invariants),
|
|
203
|
+
...serverLogResult(serverLogRun),
|
|
204
|
+
defects: unifiedDefects([...(opts.invariants === undefined ? [] : (result.invariantDefects ?? [])), ...httpDefects], serverLogRun?.defects),
|
|
205
|
+
resultPath: resultPathFor(journal.recordingPath),
|
|
206
|
+
usage: NO_MODEL_USAGE,
|
|
207
|
+
...host.fields,
|
|
208
|
+
};
|
|
209
|
+
return await withRunEvidence({ ...typed, resultPath: writeMissionResult(journal.recordingPath, missionOutcome, exitCode, typed) }, evidenceOf(opts, []));
|
|
210
|
+
}
|
|
211
|
+
finally {
|
|
212
|
+
disarmKillSwitch();
|
|
213
|
+
health.stop();
|
|
214
|
+
await serverLog?.abort();
|
|
215
|
+
await closeSession();
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
//# sourceMappingURL=explore-feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"explore-feature.js","sourceRoot":"","sources":["../src/explore-feature.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,WAAW,CAAC;AAEzD,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAwC,MAAM,sBAAsB,CAAC;AACrH,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,cAAc,EAAE,WAAW,EAAE,oBAAoB,EAA0B,MAAM,0BAA0B,CAAC;AAC/I,OAAO,EAAE,aAAa,EAAwB,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,sBAAsB,CA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@ -0,0 +1,271 @@
|
|
|
1
|
+
import type { JudgmentPort, GenerationPort, UsageTracker, UsageCounts } from "@jevitate/ai-core";
|
|
2
|
+
import { type BrowserPort, type EmulationSpec } from "@jevitate/playwright";
|
|
3
|
+
import { type BrowserRunOptions } from "./browser-run-options.js";
|
|
4
|
+
import { type ScreenshotsSpec } from "./run-screenshots.js";
|
|
5
|
+
import { type Assertion, type InvariantSpec, type Recording } from "@jevitate/recording";
|
|
6
|
+
import type { ActionDeltaStats, HostHealthSampler, InvariantDefect, InvariantReport, SideEffect } from "@jevitate/explore";
|
|
7
|
+
import type { EnvironmentDegraded, HostHealthSummary } from "@jevitate/domain";
|
|
8
|
+
import { type Bounds, type GoalBasedOutcome, type StopReason, type TranscriptEntry, type RunAnswer, type RunOutcome, type SuccessCheck, type SuccessCheckResult, type SuccessWhen, type SecretField, type TypeFixture, type BudgetTrajectory, type CrashReport, type Http5xxDefect } from "@jevitate/explore";
|
|
9
|
+
import { type ConversationOptions } from "./conversation-options.js";
|
|
10
|
+
import { type FilingConfig, type IssueFilerPort, type MissionFailure, type MissionOutcome } from "@jevitate/domain";
|
|
11
|
+
import { type HangFinding, type TimingSummary } from "@jevitate/explore";
|
|
12
|
+
import { type FindingsIssues } from "./findings-filing.js";
|
|
13
|
+
import { type EngineInfo } from "./engine.js";
|
|
14
|
+
import type { TargetConfig } from "./target-config.js";
|
|
15
|
+
import { MISSION_RESULT_SCHEMA_VERSION } from "./result-schema.js";
|
|
16
|
+
import { type JourneyPrefix } from "./journey-prefix.js";
|
|
17
|
+
import type { JourneyBranchPoint } from "@jevitate/journey";
|
|
18
|
+
import { type ServerLogDefect, type ServerLogsSummary, type TranscriptEntryWithLogs } from "./log-correlation.js";
|
|
19
|
+
import { type MissionFixtureResult, type MissionFixtures } from "./mission-fixtures.js";
|
|
20
|
+
import { type MissionActors } from "./mission-actors.js";
|
|
21
|
+
import { type ServerLogOptions, type MissionTarget } from "./explore-shared.js";
|
|
22
|
+
/**
|
|
23
|
+
* The programmatic surface behind `jevitate explore` — wires a real Playwright
|
|
24
|
+
* `Page` + gateways to `@jevitate/explore`'s goal-based mission, then persists
|
|
25
|
+
* the emitted `Recording` under `.jevitate/logs/<date>`.
|
|
26
|
+
*
|
|
27
|
+
* The authorized-target guard runs FIRST (fail-closed), BEFORE any browser is
|
|
28
|
+
* opened — an unauthorized origin never launches Chromium. Gateways are
|
|
29
|
+
* injected (fakes in tests / live wiring in `program.ts`), so this file needs
|
|
30
|
+
* no keys or network to be unit-tested.
|
|
31
|
+
*/
|
|
32
|
+
export interface RunExplorationOptions {
|
|
33
|
+
/** Test seam (#203): the run's host-health sampler (a deterministic fake host). Default: this host's. */
|
|
34
|
+
readonly hostHealth?: HostHealthSampler;
|
|
35
|
+
readonly url: string;
|
|
36
|
+
readonly goal: string;
|
|
37
|
+
/** A success assertion on the final page. With `successChecks`, every one must hold. */
|
|
38
|
+
readonly successAssertion?: Assertion;
|
|
39
|
+
/** More independent checks (`--success`, repeatable): page, reloadThen, requestMade, responseStatus. */
|
|
40
|
+
readonly successChecks?: readonly SuccessCheck[];
|
|
41
|
+
/**
|
|
42
|
+
* When the page checks must hold (`--success-when`, #80): `final` (default) — on the final page;
|
|
43
|
+
* `held` — on the final page or together at any settled step. `reloadThen` is final-only.
|
|
44
|
+
*/
|
|
45
|
+
readonly successWhen?: SuccessWhen;
|
|
46
|
+
/**
|
|
47
|
+
* #202 (`--allow-vacuous-checks`): a check satisfied before the run's first action (held on the
|
|
48
|
+
* seed page and never changed; a request matched only by page load/polling) is a warning instead
|
|
49
|
+
* of a failure. Default: it fails — a run that proved nothing is never clean.
|
|
50
|
+
*/
|
|
51
|
+
readonly allowVacuousChecks?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* #303 `--action-deltas` (opt-in, off by default): record what each action changed on the page
|
|
54
|
+
* (code's verdict per action) — attached to every transcript and Recording step, summarised in the
|
|
55
|
+
* result (`actionDeltas`), told to the model and used by the no-progress check. Off: no capture.
|
|
56
|
+
*/
|
|
57
|
+
readonly actionDeltas?: boolean;
|
|
58
|
+
readonly allowlist: readonly string[];
|
|
59
|
+
readonly judge: JudgmentPort;
|
|
60
|
+
readonly gen: GenerationPort;
|
|
61
|
+
/**
|
|
62
|
+
* Usage accounting (#100): when supplied, its snapshot (judgments/generations/tokens/`usd`) lands
|
|
63
|
+
* in the result as `usage`. The CLI builds one per invocation and hands it to the gateways
|
|
64
|
+
* `judge`/`gen` were constructed with, so the counts here are exactly what this run made.
|
|
65
|
+
*/
|
|
66
|
+
readonly usage?: UsageTracker;
|
|
67
|
+
readonly bounds?: Partial<Bounds>;
|
|
68
|
+
readonly secrets?: readonly string[];
|
|
69
|
+
/**
|
|
70
|
+
* Secret field bindings (CLI `--secret-field` / `--totp`, resolved from the environment): typed
|
|
71
|
+
* by code, never by the model; each value/seed is also a run secret (redacted everywhere).
|
|
72
|
+
*/
|
|
73
|
+
readonly secretFields?: readonly SecretField[];
|
|
74
|
+
/** #281: fields typed with a file's exact text (CLI `--type-fixture`, read by the CLI). */
|
|
75
|
+
readonly typeFixtures?: readonly TypeFixture[];
|
|
76
|
+
/**
|
|
77
|
+
* Local file the `upload` op attaches (CLI `--fixture`). Validated before any
|
|
78
|
+
* browser opens: a missing file throws `FixtureNotFoundError`.
|
|
79
|
+
*/
|
|
80
|
+
readonly fixture?: string;
|
|
81
|
+
/** Where the Recording is written. Default `.jevitate/logs/<date>` (project, else `~/.jevitate`). */
|
|
82
|
+
readonly outDir?: string;
|
|
83
|
+
/** Testing seam — defaults to a real `PlaywrightBrowserPort`. */
|
|
84
|
+
readonly browserPortFactory?: () => BrowserPort;
|
|
85
|
+
/** How Chromium is launched (executable/channel/extra args) and shown (#245 demo mode). Default: pinned Chromium, headless. */
|
|
86
|
+
readonly browser?: BrowserRunOptions;
|
|
87
|
+
/** #251 `--screenshots`: masked screenshots (one per distinct screen, or per step) + `index.md`. */
|
|
88
|
+
readonly screenshots?: ScreenshotsSpec;
|
|
89
|
+
/**
|
|
90
|
+
* #250 `--evidence-video`: after the result is written, each defect's minimal repro is replayed
|
|
91
|
+
* with captions (the failing step marked) into a masked clip + before/at screenshots, attached as
|
|
92
|
+
* `defects[].evidence` (and to its issue draft).
|
|
93
|
+
*/
|
|
94
|
+
readonly evidenceVideo?: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Playwright storageState JSON to seed the session from (CLI `--storage-state`) —
|
|
97
|
+
* the deterministic authenticated pre-step. Contains live session cookies: it is
|
|
98
|
+
* handed only to the browser, never to a model or a Recording.
|
|
99
|
+
*/
|
|
100
|
+
readonly storageState?: string;
|
|
101
|
+
/**
|
|
102
|
+
* Writes the browser context's storageState (cookies + origin storage) here when the run ends
|
|
103
|
+
* (CLI `--save-storage-state`) — so a rotating refresh token stays usable across runs instead of
|
|
104
|
+
* invalidating `--storage-state`'s file on first use. The file holds live session credentials:
|
|
105
|
+
* written with mode 0600, and its contents are never logged.
|
|
106
|
+
*
|
|
107
|
+
* #159: written on EVERY exit path, not only a clean one — a crash (thrown mid-mission, still
|
|
108
|
+
* reaches `persistStorageState` in this function's `finally`) and a kill signal (SIGTERM/SIGINT,
|
|
109
|
+
* via the kill switch's own synchronous write of the mission's `StorageStateSnapshotter`, see
|
|
110
|
+
* `storage-state-snapshot.ts`) both still get a write. Neither ever overwrites a good file with a
|
|
111
|
+
* session that is already lost/logged-out (a page that looks login-like at the moment of capture):
|
|
112
|
+
* the mission falls back to the last snapshot taken while the session still looked authenticated,
|
|
113
|
+
* and writes nothing at all if it never captured one. There is currently no flag to force a write
|
|
114
|
+
* over that guard — an operator who wants the raw end-state regardless can inspect the Recording's
|
|
115
|
+
* `finalUrl` and re-run with a fresh `--storage-state` login.
|
|
116
|
+
*/
|
|
117
|
+
readonly saveStorageState?: string;
|
|
118
|
+
/** ISO clock for the recording filename. Default `Date.now()`. */
|
|
119
|
+
readonly nowIso?: () => string;
|
|
120
|
+
/** The target's settle/hang configuration (`~/.jevitate/targets.json` + flags). */
|
|
121
|
+
readonly target?: TargetConfig;
|
|
122
|
+
/** Issue filing for a crash (off unless enabled + a repo is configured). Default: drafts only. */
|
|
123
|
+
readonly filing?: FilingConfig;
|
|
124
|
+
/** Creates the filer — called only when filing is enabled. */
|
|
125
|
+
readonly issueFiler?: () => IssueFilerPort;
|
|
126
|
+
/** Fresh-context replays that confirm a hang (default 2). */
|
|
127
|
+
readonly hangReplays?: number;
|
|
128
|
+
/** Conversational pages: the reply wait (ms) and the cap (chars) on each generated message. */
|
|
129
|
+
readonly conversation?: ConversationOptions;
|
|
130
|
+
/** App-declared invariants (`--invariants`, #86), already validated against the allowlist. */
|
|
131
|
+
readonly invariants?: InvariantSpec;
|
|
132
|
+
/** Backend log sources (`--log-source`/`--log-defect`, #142), already validated. */
|
|
133
|
+
readonly serverLog?: ServerLogOptions;
|
|
134
|
+
/** Resolved `authFrom.secret` refs (#135) a declared probe may use: `env:VAR` → its value. */
|
|
135
|
+
readonly invariantAuthTokens?: ReadonlyMap<string, string>;
|
|
136
|
+
/**
|
|
137
|
+
* Mission fixtures (#140/#144), ALREADY set up by the caller: every hang replay re-runs
|
|
138
|
+
* restore+setup first, the state is restored when the mission ends (the caller also restores on
|
|
139
|
+
* every exit path — idempotent), and the result/Recording carry the identity.
|
|
140
|
+
*/
|
|
141
|
+
readonly fixtures?: MissionFixtures;
|
|
142
|
+
/**
|
|
143
|
+
* Per-mission viewport/device emulation (#149, CLI `--viewport <W>x<H>` / `--device "<name>"`,
|
|
144
|
+
* mutually exclusive). An unknown device name (or both given together) is refused BEFORE any
|
|
145
|
+
* browser opens (`PlaywrightBrowserPort.open`'s `resolveEmulation`). Recorded on the Recording,
|
|
146
|
+
* so replay/verify-fix reproduce under the SAME device by default.
|
|
147
|
+
*/
|
|
148
|
+
readonly emulation?: EmulationSpec;
|
|
149
|
+
/**
|
|
150
|
+
* #147: the mission's actors (`--actor`). The primary's storageState seeds the mission session
|
|
151
|
+
* (it must equal `storageState` when both are given); each observer gets its own fresh context,
|
|
152
|
+
* opened only when a declared cross-actor check needs it, never driven by the model.
|
|
153
|
+
*/
|
|
154
|
+
readonly actors?: MissionActors;
|
|
155
|
+
/**
|
|
156
|
+
* #293 `--from-journey`/`--at-step`: replayed into the session (after fixture setup) before the
|
|
157
|
+
* goal loop, which then starts on the live page it left — never a fresh navigation. `url` is only
|
|
158
|
+
* the expected landing.
|
|
159
|
+
*/
|
|
160
|
+
readonly journeyPrefix?: JourneyPrefix;
|
|
161
|
+
}
|
|
162
|
+
export interface RunExplorationResult {
|
|
163
|
+
/** The result schema's version (#195): the common fields below are filled the same way by every strategy. */
|
|
164
|
+
readonly schemaVersion: typeof MISSION_RESULT_SCHEMA_VERSION;
|
|
165
|
+
readonly strategy: "goal";
|
|
166
|
+
/**
|
|
167
|
+
* #213: the `--storage-state` session was not honoured — the run's first page was a sign-in page, so
|
|
168
|
+
* whatever it did (the model may sign in by itself), it did not start as that session. A warning.
|
|
169
|
+
*/
|
|
170
|
+
readonly sessionLost?: {
|
|
171
|
+
readonly reason: string;
|
|
172
|
+
};
|
|
173
|
+
/**
|
|
174
|
+
* The portable verdict — ALWAYS canonical (#217): `goalOutcome` folded by the domain's single
|
|
175
|
+
* mapping (`GOAL_OUTCOME_FOLD`): succeeded → clean; failed/exhausted/blocked → defects-found.
|
|
176
|
+
*/
|
|
177
|
+
readonly missionOutcome: MissionOutcome;
|
|
178
|
+
/** The goal run's own ending (#217): succeeded/failed/exhausted/blocked, or a shared outcome. Equal to `outcome`. */
|
|
179
|
+
readonly goalOutcome: GoalBasedOutcome;
|
|
180
|
+
readonly outcome: GoalBasedOutcome;
|
|
181
|
+
/** The writes the run's actions fired (#116), marked when the control was paid / destructive. */
|
|
182
|
+
readonly sideEffects: SideEffect[];
|
|
183
|
+
readonly sideEffectsTruncated?: number;
|
|
184
|
+
/** #303: the run's action deltas (verdict counts, per-action overhead) — only with `--action-deltas`. */
|
|
185
|
+
readonly actionDeltas?: ActionDeltaStats;
|
|
186
|
+
/**
|
|
187
|
+
* Did the loop complete its goal (`completed`, verified by the success assertion), or why not
|
|
188
|
+
* (`incomplete` + reason)? `outcome` above is the mission verdict; this is the run's own account.
|
|
189
|
+
*/
|
|
190
|
+
readonly runOutcome: RunOutcome;
|
|
191
|
+
/** A find-out goal's answer (#101), present only when code grounded it on the observed pages. */
|
|
192
|
+
readonly answer?: RunAnswer;
|
|
193
|
+
readonly assertionPassed: boolean;
|
|
194
|
+
/** Each success check's verdict and what the oracle saw. */
|
|
195
|
+
readonly checks: SuccessCheckResult[];
|
|
196
|
+
/** Warnings about the verdict (#174: a `--success-when held` check that already held on the start page). */
|
|
197
|
+
readonly checkWarnings?: string[];
|
|
198
|
+
readonly stop: StopReason;
|
|
199
|
+
readonly finalUrl: string;
|
|
200
|
+
readonly decisions: number;
|
|
201
|
+
readonly actions: number;
|
|
202
|
+
/** Every Recording the run wrote (#195: one list on every strategy) — a goal run writes one. */
|
|
203
|
+
readonly recordingPaths: string[];
|
|
204
|
+
/** #245: `--record-video` files, finalized before this result was written (absent when not recording). */
|
|
205
|
+
readonly videoPaths?: string[];
|
|
206
|
+
/**
|
|
207
|
+
* The per-decision trail (op, target, confidence, whether the action succeeded and why
|
|
208
|
+
* not, URL, page signature) — so a stalled or failed run is explainable. Written next to
|
|
209
|
+
* the Recording as `<recording>.transcript.json`. Built from already-redacted state.
|
|
210
|
+
*/
|
|
211
|
+
readonly transcriptPath: string;
|
|
212
|
+
readonly transcript: readonly TranscriptEntry[];
|
|
213
|
+
/** Process exit code for this outcome (see `goalExitCode`). */
|
|
214
|
+
readonly exitCode: number;
|
|
215
|
+
/** Why the run ended `crashed`/`inconclusive`. */
|
|
216
|
+
readonly failure?: MissionFailure;
|
|
217
|
+
/** Why the mission did not succeed (every outcome but `succeeded`, `blocked`/`exhausted` included). */
|
|
218
|
+
readonly reason?: string;
|
|
219
|
+
/** Issue drafts (a crash) written next to the Recording, and what filing did with them. */
|
|
220
|
+
readonly issues: FindingsIssues;
|
|
221
|
+
/** Slowest pages/transitions and endpoints (p50/max), keyed by normalized route/endpoint. */
|
|
222
|
+
readonly timing: TimingSummary;
|
|
223
|
+
/** Hang findings (0 or 1: the loop stops at a hang), each with its fresh-context reproduction. */
|
|
224
|
+
readonly hangs: HangFinding[];
|
|
225
|
+
/** #126: seed-load hangs that did not reproduce (the goal was retried) — evidence, whatever the outcome. */
|
|
226
|
+
readonly intermittentHangs?: HangFinding[];
|
|
227
|
+
/** For a `crashed` run: the evidence and its attribution (jevitate / system under test / uncertain). */
|
|
228
|
+
readonly crash?: CrashReport;
|
|
229
|
+
/** Declared mission spend budgets (#150/#180): the observed trajectory, whatever the outcome. */
|
|
230
|
+
readonly budget?: BudgetTrajectory[];
|
|
231
|
+
/** The run's Recording (also written to `recordingPath`). */
|
|
232
|
+
readonly recording: Recording;
|
|
233
|
+
/** Where the run happened — what `verify-fix` needs to replay a finding. */
|
|
234
|
+
readonly target: MissionTarget;
|
|
235
|
+
/** The persisted typed result (`<recording>.result.json`). */
|
|
236
|
+
readonly resultPath: string;
|
|
237
|
+
/** Which build produced this result (issue #83): `{version, commit, builtAt}`. */
|
|
238
|
+
readonly engine: EngineInfo;
|
|
239
|
+
/**
|
|
240
|
+
* EVERY defect the run found (#195): HTTP 5xx hard-signal defects (#208), declared-invariant defects (#86, with `--invariants`) and
|
|
241
|
+
* `server-log` defects (#142, with `--log-defect`) — `verify-fix` replays any of them by fingerprint.
|
|
242
|
+
*/
|
|
243
|
+
readonly defects: Array<InvariantDefect | Http5xxDefect | ServerLogDefect>;
|
|
244
|
+
/** Per declared invariant: applied / held / violated / unreadable counts. */
|
|
245
|
+
readonly invariants?: InvariantReport[];
|
|
246
|
+
/** The declared spec the run evaluated — persisted so `verify-fix` re-checks the SAME invariants. */
|
|
247
|
+
readonly invariantSpec?: InvariantSpec;
|
|
248
|
+
/** Judgment/generation call counts and tokens for this run (#100); present only when `opts.usage` was supplied. */
|
|
249
|
+
readonly usage?: UsageCounts;
|
|
250
|
+
/** Backend log correlation summary (#142) — present only when `--log-source` was given. */
|
|
251
|
+
readonly serverLogs?: ServerLogsSummary;
|
|
252
|
+
/** The fixture the mission started from (#140/#144): identity, non-secret outputs, the setup/restore log. */
|
|
253
|
+
readonly fixtures?: MissionFixtureResult;
|
|
254
|
+
/** The host's health over the run (#203): peaks, the slowest render, starved steps. */
|
|
255
|
+
readonly hostHealth: HostHealthSummary;
|
|
256
|
+
/** Findings met while the host was starved (#203) — advisory, never a defect/hang, never failing the run. */
|
|
257
|
+
readonly environmentDegraded: EnvironmentDegraded[];
|
|
258
|
+
/** #293: the Journey step a journey-anchored run branched from (absent on a bare-URL run). */
|
|
259
|
+
readonly branch?: JourneyBranchPoint;
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Pairs an already-computed UI-side `reason` with the correlated server cause on the step the run
|
|
263
|
+
* ended on (#165 "Also"): `"<UI reason>; server: <level> \"<message>\""` — or, when the line was
|
|
264
|
+
* correlated to its exact request by a trace/correlation id (#204), `"<UI reason>; caused by:
|
|
265
|
+
* <level> \"<message>\" on POST /x (500)"`. A no-op when there is no
|
|
266
|
+
* `reason` to pair with, the outcome isn't one of blocked/exhausted/inconclusive (a `defects-found`
|
|
267
|
+
* or an oracle-unhealthy `inconclusive` already gets its own `serverLogOutcomeReason`), or no
|
|
268
|
+
* server-log evidence attached to that step — including when `--log-source` was never given.
|
|
269
|
+
*/
|
|
270
|
+
export declare function withServerCause(reason: string | undefined, outcome: GoalBasedOutcome, transcript: readonly TranscriptEntryWithLogs[] | undefined): string | undefined;
|
|
271
|
+
export declare function runExploration(opts: RunExplorationOptions): Promise<RunExplorationResult>;
|