@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,284 @@
|
|
|
1
|
+
import { BranchReplayInputError, JourneyPrefixStaleError, prefixFromBranch, recordedBranchOf } from "./journey-prefix.js";
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
3
|
+
import { readFile, writeFile } from "node:fs/promises";
|
|
4
|
+
import { join } from "node:path";
|
|
5
|
+
import { RecordingSchema } from "@jevitate/recording";
|
|
6
|
+
import { BrowseTheWebToken } from "@jevitate/screenplay";
|
|
7
|
+
import { ok, fail } from "./envelope.js";
|
|
8
|
+
import { runRegressionCapture, runRegressionRun, RegressionNotFoundError, RegressionHardSignalOracleError, RegressionExistsError } from "./regression-api.js";
|
|
9
|
+
import { regressionFixtures, withFixtureFlags } from "./fixture-cli.js";
|
|
10
|
+
import { rebindReplayNavigation } from "./mission-fixtures.js";
|
|
11
|
+
import { withEngine } from "./engine.js";
|
|
12
|
+
import { positiveIntArg } from "./cli-args.js";
|
|
13
|
+
import { formatRegressionCaptureHuman, formatRegressionRunHuman } from "./cli-output.js";
|
|
14
|
+
import { environmentFromFlags, isEnvironmentError, withEnvironmentFlags } from "./environments.js";
|
|
15
|
+
import { resolveRegressionsDir, makeRealBrowserActor, withBrowserLaunchFlags, browserRunFromFlags, withDemoFlags, withEmulationFlags, emulationFromFlags, emitJson, environmentSeams, collectParam, resolveDbPath, refuseUnsafeName, writeHumanResult, } from "./cli-shared.js";
|
|
16
|
+
/** Registers `jevitate regression`: `capture` and `run`. */
|
|
17
|
+
export function registerRegressionCommands(program, deps) {
|
|
18
|
+
// Additive: `@jevitate/regression` — reproduce -> minimize -> commit a
|
|
19
|
+
// failing Recording into a committed regression artifact (Ticket #5).
|
|
20
|
+
// Independent of the `journey`/`load` commands above; wires a real
|
|
21
|
+
// Playwright-backed `makeActor` (one fresh browser session per
|
|
22
|
+
// reproduce/minimize attempt, closed after each use) into
|
|
23
|
+
// `runRegressionCapture`.
|
|
24
|
+
const regression = program.command("regression").description("capture, run and manage regression tests from discovered failures");
|
|
25
|
+
/** #293: the prefix a branch-point failure replays through; `null` after refusing (exit 64). */
|
|
26
|
+
const branchPrefixOrRefuse = async (branch, params, storageState) => {
|
|
27
|
+
try {
|
|
28
|
+
return await prefixFromBranch(branch, { params, ...(storageState === undefined ? {} : { storageState }), dbPath: resolveDbPath(deps), environmentSeams: environmentSeams(deps) });
|
|
29
|
+
}
|
|
30
|
+
catch (err) {
|
|
31
|
+
if (!(err instanceof BranchReplayInputError))
|
|
32
|
+
throw err;
|
|
33
|
+
emitJson(program, fail("E_REGRESSION_ARGS", err.message));
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
/** #293: a prefix that no longer replays proved nothing — a typed inconclusive (exit 2). */
|
|
38
|
+
const emitJourneyStale = (err) => {
|
|
39
|
+
emitJson(program, ok(withEngine({ verdict: "inconclusive", reason: `journey-stale: ${err.message}`, failure: { kind: "journey-stale", message: err.message }, branch: err.branch })));
|
|
40
|
+
process.exitCode = 2;
|
|
41
|
+
};
|
|
42
|
+
withDemoFlags(withBrowserLaunchFlags(withEmulationFlags(withFixtureFlags(regression.command("capture")))))
|
|
43
|
+
.requiredOption("--from <file>", "path to the schema-valid failing Recording JSON to capture")
|
|
44
|
+
.requiredOption("--id <id>", "regression id (used for the committed <id>.recording.json/<id>.meta.json filenames)")
|
|
45
|
+
.option("--dir <path>", "regressions directory (default: the repo's .jevitate/regressions; outside a repo ~/.jevitate/regressions)")
|
|
46
|
+
.option("--attempts <n>", "reproduction attempts before labeling flaky", positiveIntArg, 3)
|
|
47
|
+
.option("--summary <text>", "optional human-readable bug summary recorded in the meta sidecar")
|
|
48
|
+
.option("--result <file>", "mission result JSON (as written alongside --from by `jevitate explore`) — supplies a failure oracle when the Recording alone never fails on replay")
|
|
49
|
+
.option("--fingerprint <fp>", "pin the required failure — a structural step signature (alone, restricts --from to failing at exactly that step), or (with --result, #119/#129) a defect/invariant fingerprint from the mission's own findings; with --result alone, cross-checks the derived oracle")
|
|
50
|
+
.option("--storage-state <file>", "Playwright storageState JSON to open the reproduce/minimize browser sessions authenticated (#129); must exist")
|
|
51
|
+
.option("--force", "overwrite an existing regression id's committed files (default: refused, #213)", false)
|
|
52
|
+
.option("--param <kv>", "#293: a Journey param as key=value (repeatable) for a failure found from a Journey branch point — every replay goes through the same prefix; a secret param (never persisted) must be given again", collectParam, {})
|
|
53
|
+
.option("--json", "emit a JSON envelope")
|
|
54
|
+
.action(async function () {
|
|
55
|
+
// #245: demo mode (--headed/--slow-mo), resolved before any browser opens.
|
|
56
|
+
let browser;
|
|
57
|
+
try {
|
|
58
|
+
browser = browserRunFromFlags(this.opts(), deps.explore?.env ?? process.env);
|
|
59
|
+
}
|
|
60
|
+
catch (err) {
|
|
61
|
+
emitJson(program, fail("E_REGRESSION_ARGS", err instanceof Error ? err.message : String(err)));
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const flags = this.opts();
|
|
65
|
+
const { from, id, dir, attempts, summary, result: resultPath, fingerprint, storageState, force, json, param } = flags;
|
|
66
|
+
if (refuseUnsafeName(program, id, "regression id"))
|
|
67
|
+
return;
|
|
68
|
+
// #218: unusable input is refused up front (64), never a capture that broke at runtime (2).
|
|
69
|
+
for (const [flag, path] of [["--from", from], ["--result", resultPath]]) {
|
|
70
|
+
if (path !== undefined && !existsSync(path)) {
|
|
71
|
+
emitJson(program, fail("E_REGRESSION_ARGS", `${flag} file not found: ${path}`));
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
if (storageState !== undefined && !existsSync(storageState)) {
|
|
76
|
+
emitJson(program, fail("E_REGRESSION_ARGS", `storage state not found: ${storageState}`));
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
let captureEmulationFlag;
|
|
80
|
+
try {
|
|
81
|
+
captureEmulationFlag = emulationFromFlags(flags);
|
|
82
|
+
}
|
|
83
|
+
catch (err) {
|
|
84
|
+
emitJson(program, fail("E_REGRESSION_ARGS", err instanceof Error ? err.message : String(err)));
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const opened = [];
|
|
88
|
+
let fx;
|
|
89
|
+
try {
|
|
90
|
+
const raw = JSON.parse(await readFile(from, "utf8"));
|
|
91
|
+
const recording = RecordingSchema.parse(raw);
|
|
92
|
+
// #149: --viewport/--device, else the Recording's OWN emulation (reproduces under the same device).
|
|
93
|
+
const captureEmulation = captureEmulationFlag ??
|
|
94
|
+
(recording.emulation === undefined
|
|
95
|
+
? undefined
|
|
96
|
+
: recording.emulation.device !== undefined
|
|
97
|
+
? { device: recording.emulation.device }
|
|
98
|
+
: { viewport: recording.emulation.viewport });
|
|
99
|
+
// #144: every reproduce/minimize replay restores the fixture state the Recording started from.
|
|
100
|
+
fx = regressionFixtures(flags, recording, resultPath === undefined ? undefined : JSON.parse(await readFile(resultPath, "utf8")), storageState);
|
|
101
|
+
const replayFixture = fx;
|
|
102
|
+
// #293: a failure found from a Journey branch point is reproduced THROUGH that prefix.
|
|
103
|
+
const branch = resultPath === undefined ? undefined : recordedBranchOf(JSON.parse(await readFile(resultPath, "utf8")).result);
|
|
104
|
+
const prefix = branch === undefined ? undefined : await branchPrefixOrRefuse(branch, param, storageState);
|
|
105
|
+
if (prefix === null)
|
|
106
|
+
return;
|
|
107
|
+
const result = await runRegressionCapture({
|
|
108
|
+
...(prefix === undefined ? {} : { anchored: true }),
|
|
109
|
+
failingRecordingPath: from,
|
|
110
|
+
id,
|
|
111
|
+
regressionsDir: resolveRegressionsDir(dir),
|
|
112
|
+
attempts: Number(attempts),
|
|
113
|
+
bugSummary: summary,
|
|
114
|
+
resultPath,
|
|
115
|
+
fingerprint,
|
|
116
|
+
force,
|
|
117
|
+
makeActor: async () => {
|
|
118
|
+
await replayFixture?.reset();
|
|
119
|
+
const { actor, close } = await makeRealBrowserActor(recording.site, storageState, captureEmulation, browser, deps.explore?.browserPortFactory);
|
|
120
|
+
opened.push(close);
|
|
121
|
+
if (prefix !== undefined)
|
|
122
|
+
await prefix.replay(actor.ability(BrowseTheWebToken).session, browser);
|
|
123
|
+
if (replayFixture !== undefined) {
|
|
124
|
+
rebindReplayNavigation(actor.ability(BrowseTheWebToken).session.page, recording.fixture?.outputs ?? {}, replayFixture.publicOutputs());
|
|
125
|
+
}
|
|
126
|
+
return actor;
|
|
127
|
+
},
|
|
128
|
+
}).then((r) => withEngine(r));
|
|
129
|
+
await fx?.restore();
|
|
130
|
+
// #293: the committed regression remembers its branch point, so `regression run` replays through it.
|
|
131
|
+
if (branch !== undefined && "metaPath" in result) {
|
|
132
|
+
const meta = JSON.parse(await readFile(result.metaPath, "utf8"));
|
|
133
|
+
await writeFile(result.metaPath, `${JSON.stringify({ ...meta, branch }, null, 2)}\n`);
|
|
134
|
+
}
|
|
135
|
+
const envelope = ok(fx === undefined ? result : { ...result, fixtures: fx.record() });
|
|
136
|
+
if (json) {
|
|
137
|
+
emitJson(program, envelope);
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
// #227/#230: a human summary (captured/flaky, where the files went, what to run next,
|
|
141
|
+
// carrying the same --dir the user passed) — never the raw result JSON, which used to
|
|
142
|
+
// print unconditionally without --json.
|
|
143
|
+
writeHumanResult(program, result, (r) => formatRegressionCaptureHuman(r, { dir }));
|
|
144
|
+
process.exitCode = 0;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
catch (err) {
|
|
148
|
+
// #213: these two are usage refusals (64) — an existing id needing --force, or a
|
|
149
|
+
// hard-signal defect that needs `ledger add` instead — never a generic capture failure (2).
|
|
150
|
+
if (err instanceof RegressionExistsError || err instanceof RegressionHardSignalOracleError) {
|
|
151
|
+
emitJson(program, fail(err.code, err.message));
|
|
152
|
+
}
|
|
153
|
+
else if (err instanceof JourneyPrefixStaleError) {
|
|
154
|
+
emitJourneyStale(err);
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
emitJson(program, fail("E_REGRESSION_CAPTURE", String(err instanceof Error ? err.message : err)));
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
finally {
|
|
161
|
+
for (const close of opened)
|
|
162
|
+
await close();
|
|
163
|
+
await fx?.restore();
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
// Additive: `regression run <id>` (#129 item 4) — replays a committed regression (whatever
|
|
167
|
+
// `regression capture` wrote — a step-oracle, network-check, or declared-invariant one) and
|
|
168
|
+
// reports "reproduces" or "fixed". The one CLI/MCP surface `loadRegressions`/`replayRegression`
|
|
169
|
+
// (`@jevitate/regression`) previously had none of.
|
|
170
|
+
withEnvironmentFlags(withDemoFlags(withBrowserLaunchFlags(withEmulationFlags(regression.command("run")))))
|
|
171
|
+
.argument("<id>", "the committed regression id (its <id>.recording.json/<id>.meta.json)")
|
|
172
|
+
.option("--dir <path>", "regressions directory (default: the repo's .jevitate/regressions; outside a repo ~/.jevitate/regressions)")
|
|
173
|
+
.option("--attempts <n>", "fresh-context replays for a declared-invariant oracle (default 3)", positiveIntArg)
|
|
174
|
+
.option("--storage-state <file>", "Playwright storageState JSON to open the replay session authenticated (#129); must exist")
|
|
175
|
+
.option("--param <kv>", "#293: a Journey param as key=value (repeatable) for a failure found from a Journey branch point — every replay goes through the same prefix; a secret param (never persisted) must be given again", collectParam, {})
|
|
176
|
+
.option("--json", "emit a JSON envelope")
|
|
177
|
+
.action(async function (id) {
|
|
178
|
+
// #245: demo mode (--headed/--slow-mo), resolved before any browser opens.
|
|
179
|
+
let browser;
|
|
180
|
+
try {
|
|
181
|
+
browser = browserRunFromFlags(this.opts(), deps.explore?.env ?? process.env);
|
|
182
|
+
}
|
|
183
|
+
catch (err) {
|
|
184
|
+
emitJson(program, fail("E_REGRESSION_ARGS", err instanceof Error ? err.message : String(err)));
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
const { dir, attempts, storageState: storageStateFlag, json, env: envName, baseUrl, param, ...emulationFlags } = this.opts();
|
|
188
|
+
// #247: --env/--base-url choose where the regression replays (unknown env / bad file → 64).
|
|
189
|
+
let environment;
|
|
190
|
+
try {
|
|
191
|
+
environment = environmentFromFlags({ ...(envName === undefined ? {} : { env: envName }), ...(baseUrl === undefined ? {} : { baseUrl }) }, environmentSeams(deps));
|
|
192
|
+
}
|
|
193
|
+
catch (err) {
|
|
194
|
+
if (!isEnvironmentError(err))
|
|
195
|
+
throw err;
|
|
196
|
+
emitJson(program, fail(err.code, err.message));
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
// --storage-state wins; else the environment's own session (~/.jevitate/targets.json[<origin>]).
|
|
200
|
+
const storageState = storageStateFlag ?? environment?.storageState;
|
|
201
|
+
if (storageState !== undefined && !existsSync(storageState)) {
|
|
202
|
+
emitJson(program, fail("E_REGRESSION_ARGS", `storage state not found: ${storageState}`));
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
let runEmulationFlag;
|
|
206
|
+
try {
|
|
207
|
+
runEmulationFlag = emulationFromFlags(emulationFlags);
|
|
208
|
+
}
|
|
209
|
+
catch (err) {
|
|
210
|
+
emitJson(program, fail("E_REGRESSION_ARGS", err instanceof Error ? err.message : String(err)));
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
if (refuseUnsafeName(program, id, "regression id"))
|
|
214
|
+
return;
|
|
215
|
+
const regressionsDir = resolveRegressionsDir(dir);
|
|
216
|
+
// #218: an unknown id is a usage error (64), refused before anything opens.
|
|
217
|
+
if (!existsSync(join(regressionsDir, `${id}.recording.json`))) {
|
|
218
|
+
const notFound = new RegressionNotFoundError(id, regressionsDir);
|
|
219
|
+
emitJson(program, fail(notFound.code, notFound.message));
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
const opened = [];
|
|
223
|
+
try {
|
|
224
|
+
const recording = RecordingSchema.parse(JSON.parse(await readFile(join(regressionsDir, `${id}.recording.json`), "utf8")));
|
|
225
|
+
// #293: a regression captured from a Journey branch point replays through that prefix.
|
|
226
|
+
let branch;
|
|
227
|
+
try {
|
|
228
|
+
branch = recordedBranchOf(JSON.parse(await readFile(join(regressionsDir, `${id}.meta.json`), "utf8")));
|
|
229
|
+
}
|
|
230
|
+
catch {
|
|
231
|
+
branch = undefined;
|
|
232
|
+
}
|
|
233
|
+
const prefix = branch === undefined ? undefined : await branchPrefixOrRefuse(branch, param, storageState);
|
|
234
|
+
if (prefix === null)
|
|
235
|
+
return;
|
|
236
|
+
// #149: --viewport/--device, else the committed Recording's OWN emulation.
|
|
237
|
+
const runEmulation = runEmulationFlag ??
|
|
238
|
+
(recording.emulation === undefined
|
|
239
|
+
? undefined
|
|
240
|
+
: recording.emulation.device !== undefined
|
|
241
|
+
? { device: recording.emulation.device }
|
|
242
|
+
: { viewport: recording.emulation.viewport });
|
|
243
|
+
const report = await runRegressionRun({
|
|
244
|
+
id,
|
|
245
|
+
regressionsDir,
|
|
246
|
+
...(attempts !== undefined ? { attempts: Number(attempts) } : {}),
|
|
247
|
+
...(environment === undefined ? {} : { environment }),
|
|
248
|
+
makeActor: async () => {
|
|
249
|
+
const { actor, close } = await makeRealBrowserActor(environment?.baseUrl ?? recording.site, storageState, runEmulation, browser, deps.explore?.browserPortFactory, environment?.allowedOrigins);
|
|
250
|
+
opened.push(close);
|
|
251
|
+
if (prefix !== undefined)
|
|
252
|
+
await prefix.replay(actor.ability(BrowseTheWebToken).session, browser);
|
|
253
|
+
return actor;
|
|
254
|
+
},
|
|
255
|
+
});
|
|
256
|
+
const envelope = ok(withEngine(report));
|
|
257
|
+
if (json) {
|
|
258
|
+
emitJson(program, envelope);
|
|
259
|
+
}
|
|
260
|
+
else {
|
|
261
|
+
// #227/#230: the verdict/reason/next-step summary (carrying the same --dir the user
|
|
262
|
+
// passed) — never the raw report JSON.
|
|
263
|
+
program.configureOutput().writeOut?.(formatRegressionRunHuman(report, { dir }));
|
|
264
|
+
}
|
|
265
|
+
process.exitCode = report.verdict === "reproduces" ? 1 : report.verdict === "fixed" ? 0 : 2;
|
|
266
|
+
}
|
|
267
|
+
catch (err) {
|
|
268
|
+
if (err instanceof RegressionNotFoundError || isEnvironmentError(err)) {
|
|
269
|
+
emitJson(program, fail(err.code, err.message));
|
|
270
|
+
}
|
|
271
|
+
else if (err instanceof JourneyPrefixStaleError) {
|
|
272
|
+
emitJourneyStale(err);
|
|
273
|
+
}
|
|
274
|
+
else {
|
|
275
|
+
emitJson(program, fail("E_REGRESSION_RUN", String(err instanceof Error ? err.message : err)));
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
finally {
|
|
279
|
+
for (const close of opened)
|
|
280
|
+
await close();
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
//# sourceMappingURL=regression-cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"regression-cli.js","sourceRoot":"","sources":["../src/regression-cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,gBAAgB,EAA2C,MAAM,qBAAqB,CAAC;AACnK,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,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AAC;YAC9B,CAAC;iBAAM,CAAC;gBACN,oFAAoF;gBACpF,uCAAuC;gBACvC,OAAO,CAAC,eAAe,EAAE,CAAC,QAAQ,EAAE,CAAC,wBAAwB,CAAC,MAAM,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;YAClF,CAAC;YACD,OAAO,CAAC,QAAQ,GAAG,MAAM,CAAC,OAAO,KAAK,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC9F,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,GAAG,YAAY,uBAAuB,IAAI,kBAAkB,CAAC,GAAG,CAAC,EAAE,CAAC;gBACtE,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;YACjD,CAAC;iBAAM,IAAI,GAAG,YAAY,uBAAuB,EAAE,CAAC;gBAClD,gBAAgB,CAAC,GAAG,CAAC,CAAC;YACxB,CAAC;iBAAM,CAAC;gBACN,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,kBAAkB,EAAE,MAAM,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YAChG,CAAC;QACH,CAAC;gBAAS,CAAC;YACT,KAAK,MAAM,KAAK,IAAI,MAAM;gBAAE,MAAM,KAAK,EAAE,CAAC;QAC5C,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { type RunIndexDeps } from "./run-index.js";
|
|
2
|
+
import { type ConsolidatedDefect, type FindingsDiff, type RunRecord } from "@jevitate/findings";
|
|
3
|
+
import { type UsageAggregate } from "@jevitate/ai-core";
|
|
4
|
+
/**
|
|
5
|
+
* The programmatic surface behind `jevitate report` (#139), `jevitate diff` / `--baseline` (#138)
|
|
6
|
+
* and `jevitate baseline tag`. It only READS what the runners already persisted — every result was
|
|
7
|
+
* redacted before it was written, so nothing here can surface a secret the result did not already
|
|
8
|
+
* hold; a report adds no page data and makes no model call.
|
|
9
|
+
*
|
|
10
|
+
* A "run reference" (a `<run>` argument) is, in order: a file path (a `<stem>.result.json`, a
|
|
11
|
+
* usability report, or a `jevitate check` record naming its results), a baseline tag name, or a
|
|
12
|
+
* run id (a result file's stem, looked up in the result dirs).
|
|
13
|
+
*/
|
|
14
|
+
export declare class ReportInputError extends Error {
|
|
15
|
+
readonly code: "E_REPORT_INPUT";
|
|
16
|
+
constructor(message: string);
|
|
17
|
+
}
|
|
18
|
+
/** Where results live by default: mission results next to their Recordings, and UX reports. */
|
|
19
|
+
export declare function defaultResultDirs(): string[];
|
|
20
|
+
/**
|
|
21
|
+
* #213: where a report reads by default. A bare `report` reads the CURRENT project only: its own
|
|
22
|
+
* `.jevitate/logs` (none outside a project) plus every run the run index recorded for this project —
|
|
23
|
+
* including runs written to an `--out` dir. With `--target`, every results dir is read too (the
|
|
24
|
+
* target filter keeps it to that app), plus the indexed runs.
|
|
25
|
+
*/
|
|
26
|
+
export declare function defaultReportSources(withTarget: boolean, deps?: RunIndexDeps): {
|
|
27
|
+
dirs: string[];
|
|
28
|
+
files: string[];
|
|
29
|
+
};
|
|
30
|
+
/** #213: where `diff`/`baseline tag` look a run id up: this project's sources first, then every results dir. */
|
|
31
|
+
export declare function defaultLookupDirs(deps?: RunIndexDeps): string[];
|
|
32
|
+
export declare function defaultBaselinesDir(): string;
|
|
33
|
+
/** Reads one persisted result file into a run. Null for a file that is not a result. */
|
|
34
|
+
export declare function loadRunFile(path: string): RunRecord | null;
|
|
35
|
+
/**
|
|
36
|
+
* Every result in `dirs` and their subdirectories (#171: a `runs/<id>/…result.json` layout), oldest
|
|
37
|
+
* first. Missing dirs are skipped; dot-dirs, `node_modules` and symlinked dirs are not walked.
|
|
38
|
+
*/
|
|
39
|
+
export declare function scanRuns(dirs: readonly string[]): RunRecord[];
|
|
40
|
+
export interface BaselineTag {
|
|
41
|
+
readonly version: 1;
|
|
42
|
+
readonly name: string;
|
|
43
|
+
readonly createdAt: string;
|
|
44
|
+
/** The result files it was tagged from (evidence; the runs below are a snapshot of them). */
|
|
45
|
+
readonly sources: readonly string[];
|
|
46
|
+
/** Snapshot of the tagged runs' findings, so a baseline survives its result files being pruned. */
|
|
47
|
+
readonly runs: readonly RunRecord[];
|
|
48
|
+
}
|
|
49
|
+
export declare function tagBaseline(opts: {
|
|
50
|
+
name: string;
|
|
51
|
+
runs: readonly RunRecord[];
|
|
52
|
+
dir?: string;
|
|
53
|
+
nowIso?: () => string;
|
|
54
|
+
}): Promise<{
|
|
55
|
+
tag: BaselineTag;
|
|
56
|
+
path: string;
|
|
57
|
+
}>;
|
|
58
|
+
export declare function readBaseline(name: string, dir?: string): BaselineTag | null;
|
|
59
|
+
export declare function listBaselines(dir?: string): Promise<Array<{
|
|
60
|
+
name: string;
|
|
61
|
+
createdAt: string;
|
|
62
|
+
runs: number;
|
|
63
|
+
}>>;
|
|
64
|
+
export interface RunRefContext {
|
|
65
|
+
readonly dirs: readonly string[];
|
|
66
|
+
readonly baselinesDir?: string;
|
|
67
|
+
}
|
|
68
|
+
/** Resolves one `<run>` reference to its runs (a check record or a baseline tag names several). */
|
|
69
|
+
export declare function resolveRunRef(ref: string, ctx: RunRefContext): RunRecord[];
|
|
70
|
+
export declare function resolveRunRefs(refs: readonly string[], ctx: RunRefContext): RunRecord[];
|
|
71
|
+
/**
|
|
72
|
+
* `last`: for every (target, mode) the current runs cover, the most recent EARLIER run of that
|
|
73
|
+
* target and mode in `pool` — "the last run on this target", per mode.
|
|
74
|
+
*/
|
|
75
|
+
export declare function lastRunsBefore(current: readonly RunRecord[], pool: readonly RunRecord[]): RunRecord[];
|
|
76
|
+
/** Resolves `--baseline <run|tag|last>` against the current runs. */
|
|
77
|
+
export declare function resolveBaseline(ref: string, current: readonly RunRecord[], ctx: RunRefContext & {
|
|
78
|
+
pool?: readonly RunRecord[];
|
|
79
|
+
}): RunRecord[];
|
|
80
|
+
/**
|
|
81
|
+
* `--target <origin|name>`: an origin (or any URL on it), or a name — a suite target name stamped
|
|
82
|
+
* on results by `jevitate check`, or a registered mission target (`~/.jevitate/missions/targets`).
|
|
83
|
+
*/
|
|
84
|
+
export declare function resolveTargetFilter(target: string, missionTargetsDir: string): Promise<{
|
|
85
|
+
origins: string[];
|
|
86
|
+
name: string;
|
|
87
|
+
}>;
|
|
88
|
+
/** `--since <run|date>`: an ISO date/time, or a run reference whose start time is the cut-off. */
|
|
89
|
+
export declare function resolveSince(since: string, ctx: RunRefContext): string;
|
|
90
|
+
export interface BuildReportOptions {
|
|
91
|
+
readonly target?: string;
|
|
92
|
+
readonly since?: string;
|
|
93
|
+
readonly dirs?: readonly string[];
|
|
94
|
+
readonly baseline?: string;
|
|
95
|
+
readonly baselinesDir?: string;
|
|
96
|
+
readonly missionTargetsDir: string;
|
|
97
|
+
/** Explicit runs (e.g. `jevitate check`'s own results) instead of scanning `dirs`. */
|
|
98
|
+
readonly runs?: readonly RunRecord[];
|
|
99
|
+
/** #213: the project/run-index seam (cwd, home, index file) for the default sources. */
|
|
100
|
+
readonly index?: RunIndexDeps;
|
|
101
|
+
}
|
|
102
|
+
export interface RunSummary {
|
|
103
|
+
readonly runId: string;
|
|
104
|
+
readonly mode: string;
|
|
105
|
+
readonly path: string;
|
|
106
|
+
readonly target?: string;
|
|
107
|
+
readonly startedAt?: string;
|
|
108
|
+
readonly missionOutcome?: string;
|
|
109
|
+
/** #217: a goal run's own ending, beside the canonical `missionOutcome`. */
|
|
110
|
+
readonly goalOutcome?: string;
|
|
111
|
+
readonly targetBuild?: string;
|
|
112
|
+
readonly engineCommit?: string;
|
|
113
|
+
readonly findings: number;
|
|
114
|
+
}
|
|
115
|
+
export interface ReportResult {
|
|
116
|
+
readonly target?: string;
|
|
117
|
+
readonly since?: string;
|
|
118
|
+
readonly runs: readonly RunSummary[];
|
|
119
|
+
readonly defects: readonly ConsolidatedDefect[];
|
|
120
|
+
readonly summary: {
|
|
121
|
+
readonly defects: number;
|
|
122
|
+
readonly advisory: number;
|
|
123
|
+
readonly runs: number;
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* Model usage summed over the reported runs (#163). Runs whose result carries no `usage` (they made
|
|
127
|
+
* no model call, or predate usage accounting) are counted in `unreportedRuns`, not priced.
|
|
128
|
+
*/
|
|
129
|
+
readonly usage: UsageAggregate;
|
|
130
|
+
readonly diff?: FindingsDiff;
|
|
131
|
+
readonly baselineRuns?: readonly RunSummary[];
|
|
132
|
+
readonly markdown: string;
|
|
133
|
+
}
|
|
134
|
+
export declare function summarizeRun(r: RunRecord): RunSummary;
|
|
135
|
+
export declare function buildReport(opts: BuildReportOptions): Promise<ReportResult>;
|
|
136
|
+
/** Sums the runs' persisted usage (#163). */
|
|
137
|
+
export declare function usageOfRuns(runs: readonly RunRecord[]): UsageAggregate;
|
|
138
|
+
/** The report's cost section: the full total, flagged when partial. */
|
|
139
|
+
export declare function usageMarkdown(u: UsageAggregate): string;
|
|
140
|
+
/** `jevitate diff <runA> <runB>`: A is the baseline side, B the current side. */
|
|
141
|
+
export declare function diffRunRefs(a: string, b: string, ctx: RunRefContext): {
|
|
142
|
+
diff: FindingsDiff;
|
|
143
|
+
markdown: string;
|
|
144
|
+
baseline: RunSummary[];
|
|
145
|
+
current: RunSummary[];
|
|
146
|
+
};
|