@jevitate/cli 0.7.0 → 0.9.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/dist/ai-cli.d.ts +3 -1
- package/dist/ai-cli.js +60 -16
- package/dist/ai-cli.js.map +1 -1
- package/dist/approval-provenance.d.ts +136 -0
- package/dist/approval-provenance.js +317 -0
- package/dist/approval-provenance.js.map +1 -0
- package/dist/author-journey-cli.js +4 -2
- package/dist/author-journey-cli.js.map +1 -1
- package/dist/bin.js +30544 -20851
- package/dist/browser-cli.d.ts +10 -0
- package/dist/browser-cli.js +50 -0
- package/dist/browser-cli.js.map +1 -0
- package/dist/build-info.generated.js +2 -2
- package/dist/builtin-analyzers.d.ts +7 -0
- package/dist/builtin-analyzers.js +19 -0
- package/dist/builtin-analyzers.js.map +1 -0
- package/dist/campaign-cli.d.ts +6 -0
- package/dist/campaign-cli.js +9 -4
- package/dist/campaign-cli.js.map +1 -1
- package/dist/catalog-analysis.d.ts +70 -0
- package/dist/catalog-analysis.js +507 -0
- package/dist/catalog-analysis.js.map +1 -0
- package/dist/catalog-api.d.ts +73 -0
- package/dist/catalog-api.js +97 -0
- package/dist/catalog-api.js.map +1 -0
- package/dist/catalog-cli.d.ts +12 -0
- package/dist/catalog-cli.js +224 -0
- package/dist/catalog-cli.js.map +1 -0
- package/dist/catalog-review.d.ts +29 -0
- package/dist/catalog-review.js +290 -0
- package/dist/catalog-review.js.map +1 -0
- package/dist/catalog.d.ts +133 -0
- package/dist/catalog.js +352 -0
- package/dist/catalog.js.map +1 -0
- package/dist/change-context.d.ts +44 -0
- package/dist/change-context.js +203 -0
- package/dist/change-context.js.map +1 -0
- package/dist/check-api.d.ts +1 -1
- package/dist/check-api.js +68 -9
- package/dist/check-api.js.map +1 -1
- package/dist/check-cli.d.ts +5 -1
- package/dist/check-cli.js +64 -10
- package/dist/check-cli.js.map +1 -1
- package/dist/check-execute.d.ts +16 -1
- package/dist/check-execute.js +78 -31
- package/dist/check-execute.js.map +1 -1
- package/dist/check-plan.d.ts +14 -0
- package/dist/check-plan.js +28 -2
- package/dist/check-plan.js.map +1 -1
- package/dist/check-suite.js +6 -3
- package/dist/check-suite.js.map +1 -1
- package/dist/check-types.d.ts +51 -6
- package/dist/check-types.js +8 -0
- package/dist/check-types.js.map +1 -1
- package/dist/cli-output.js +85 -5
- package/dist/cli-output.js.map +1 -1
- package/dist/cli-shared.d.ts +22 -2
- package/dist/cli-shared.js +34 -5
- package/dist/cli-shared.js.map +1 -1
- package/dist/demo-aspect-api.d.ts +15 -0
- package/dist/demo-aspect-api.js +26 -1
- package/dist/demo-aspect-api.js.map +1 -1
- package/dist/demo-aspect-cli.js +64 -5
- package/dist/demo-aspect-cli.js.map +1 -1
- package/dist/exit-codes.d.ts +6 -3
- package/dist/exit-codes.js +13 -3
- package/dist/exit-codes.js.map +1 -1
- package/dist/explore-adversarial.d.ts +3 -1
- package/dist/explore-adversarial.js +4 -4
- package/dist/explore-adversarial.js.map +1 -1
- package/dist/explore-author.js +5 -2
- package/dist/explore-author.js.map +1 -1
- package/dist/explore-cli.js +145 -9
- package/dist/explore-cli.js.map +1 -1
- package/dist/explore-coverage.d.ts +6 -2
- package/dist/explore-coverage.js +7 -6
- package/dist/explore-coverage.js.map +1 -1
- package/dist/explore-feature.d.ts +3 -1
- package/dist/explore-feature.js +5 -5
- package/dist/explore-feature.js.map +1 -1
- package/dist/explore-goal.d.ts +37 -6
- package/dist/explore-goal.js +69 -50
- package/dist/explore-goal.js.map +1 -1
- package/dist/explore-shared.d.ts +12 -7
- package/dist/explore-shared.js +9 -1
- package/dist/explore-shared.js.map +1 -1
- package/dist/findings-filing.d.ts +6 -0
- package/dist/findings-filing.js +15 -1
- package/dist/findings-filing.js.map +1 -1
- package/dist/goal-run-flags.d.ts +2 -0
- package/dist/goal-run-flags.js +8 -1
- package/dist/goal-run-flags.js.map +1 -1
- package/dist/heal-probe-guard.d.ts +9 -0
- package/dist/heal-probe-guard.js +113 -0
- package/dist/heal-probe-guard.js.map +1 -0
- package/dist/host-health-run.d.ts +32 -1
- package/dist/host-health-run.js +38 -1
- package/dist/host-health-run.js.map +1 -1
- package/dist/http-5xx-outcome.d.ts +8 -3
- package/dist/http-5xx-outcome.js +5 -15
- package/dist/http-5xx-outcome.js.map +1 -1
- package/dist/init-cli.d.ts +7 -0
- package/dist/init-cli.js +79 -9
- package/dist/init-cli.js.map +1 -1
- package/dist/init-codeowners.d.ts +39 -0
- package/dist/init-codeowners.js +91 -0
- package/dist/init-codeowners.js.map +1 -0
- package/dist/init-keys.d.ts +3 -1
- package/dist/init-keys.js +20 -8
- package/dist/init-keys.js.map +1 -1
- package/dist/init-skills.d.ts +85 -7
- package/dist/init-skills.js +303 -36
- package/dist/init-skills.js.map +1 -1
- package/dist/jev-advisor.d.ts +72 -0
- package/dist/jev-advisor.js +172 -0
- package/dist/jev-advisor.js.map +1 -0
- package/dist/journey-api.d.ts +76 -5
- package/dist/journey-api.js +238 -29
- package/dist/journey-api.js.map +1 -1
- package/dist/journey-cli.js +257 -23
- package/dist/journey-cli.js.map +1 -1
- package/dist/journey-heal.d.ts +74 -0
- package/dist/journey-heal.js +180 -0
- package/dist/journey-heal.js.map +1 -0
- package/dist/journey-network-checks.d.ts +5 -1
- package/dist/journey-network-checks.js +15 -4
- package/dist/journey-network-checks.js.map +1 -1
- package/dist/journey-prefix.js +2 -2
- package/dist/journey-prefix.js.map +1 -1
- package/dist/journey-proposal-store.d.ts +100 -0
- package/dist/journey-proposal-store.js +342 -0
- package/dist/journey-proposal-store.js.map +1 -0
- package/dist/journey-result-record.d.ts +40 -0
- package/dist/journey-result-record.js +28 -0
- package/dist/journey-result-record.js.map +1 -0
- package/dist/journey-review-api.d.ts +19 -0
- package/dist/journey-review-api.js +53 -0
- package/dist/journey-review-api.js.map +1 -0
- package/dist/journey-review-store.d.ts +16 -0
- package/dist/journey-review-store.js +95 -0
- package/dist/journey-review-store.js.map +1 -0
- package/dist/journey-review.d.ts +54 -0
- package/dist/journey-review.js +538 -0
- package/dist/journey-review.js.map +1 -0
- package/dist/journey-verify.js +14 -1
- package/dist/journey-verify.js.map +1 -1
- package/dist/key-report.d.ts +20 -5
- package/dist/key-report.js +32 -9
- package/dist/key-report.js.map +1 -1
- package/dist/kill-signal.js +10 -2
- package/dist/kill-signal.js.map +1 -1
- package/dist/launch-armed.js +5 -1
- package/dist/launch-armed.js.map +1 -1
- package/dist/load-cli.js +4 -2
- package/dist/load-cli.js.map +1 -1
- package/dist/log-classes.d.ts +73 -0
- package/dist/log-classes.js +167 -0
- package/dist/log-classes.js.map +1 -0
- package/dist/log-correlation.d.ts +29 -10
- package/dist/log-correlation.js +44 -21
- package/dist/log-correlation.js.map +1 -1
- package/dist/login-cli.d.ts +17 -0
- package/dist/login-cli.js +161 -0
- package/dist/login-cli.js.map +1 -0
- package/dist/logs-cli.js +3 -1
- package/dist/logs-cli.js.map +1 -1
- package/dist/mcp-api.d.ts +6 -1
- package/dist/mcp-api.js +110 -16
- package/dist/mcp-api.js.map +1 -1
- package/dist/mcp-cli-runner.d.ts +2 -0
- package/dist/mcp-cli-runner.js +3 -1
- package/dist/mcp-cli-runner.js.map +1 -1
- package/dist/mcp-cli-tools.d.ts +5 -0
- package/dist/mcp-cli-tools.js +178 -23
- package/dist/mcp-cli-tools.js.map +1 -1
- package/dist/mission-cli.js +8 -4
- package/dist/mission-cli.js.map +1 -1
- package/dist/mission-journal.d.ts +4 -1
- package/dist/mission-journal.js +9 -3
- package/dist/mission-journal.js.map +1 -1
- package/dist/mission-queue-cli.js +21 -2
- package/dist/mission-queue-cli.js.map +1 -1
- package/dist/mission-queue-runner.d.ts +6 -0
- package/dist/mission-queue-runner.js +33 -3
- package/dist/mission-queue-runner.js.map +1 -1
- package/dist/multi-run-cli.d.ts +7 -1
- package/dist/multi-run-cli.js +10 -3
- package/dist/multi-run-cli.js.map +1 -1
- package/dist/multi-run.d.ts +44 -8
- package/dist/multi-run.js +118 -25
- package/dist/multi-run.js.map +1 -1
- package/dist/persona-login.d.ts +256 -0
- package/dist/persona-login.js +884 -0
- package/dist/persona-login.js.map +1 -0
- package/dist/pre-approval.d.ts +98 -0
- package/dist/pre-approval.js +175 -0
- package/dist/pre-approval.js.map +1 -0
- package/dist/program.js +12 -0
- package/dist/program.js.map +1 -1
- package/dist/project-dir.d.ts +2 -1
- package/dist/project-dir.js +3 -1
- package/dist/project-dir.js.map +1 -1
- package/dist/readiness.d.ts +29 -0
- package/dist/readiness.js +291 -0
- package/dist/readiness.js.map +1 -0
- package/dist/regression-cli.js +4 -2
- package/dist/regression-cli.js.map +1 -1
- package/dist/report-api.d.ts +25 -2
- package/dist/report-api.js +34 -5
- package/dist/report-api.js.map +1 -1
- package/dist/report-cli.js +8 -1
- package/dist/report-cli.js.map +1 -1
- package/dist/resource-preflight.js +5 -3
- package/dist/resource-preflight.js.map +1 -1
- package/dist/result-schema.d.ts +12 -0
- package/dist/result-schema.js +8 -0
- package/dist/result-schema.js.map +1 -1
- package/dist/run-index.d.ts +4 -2
- package/dist/run-index.js +3 -1
- package/dist/run-index.js.map +1 -1
- package/dist/run-key-preflight.d.ts +2 -1
- package/dist/run-key-preflight.js +3 -2
- package/dist/run-key-preflight.js.map +1 -1
- package/dist/run-metadata.d.ts +29 -0
- package/dist/run-metadata.js +48 -0
- package/dist/run-metadata.js.map +1 -0
- package/dist/run-tags-cli.d.ts +14 -0
- package/dist/run-tags-cli.js +41 -0
- package/dist/run-tags-cli.js.map +1 -0
- package/dist/self-heal-adapter.d.ts +43 -27
- package/dist/self-heal-adapter.js +196 -62
- package/dist/self-heal-adapter.js.map +1 -1
- package/dist/site-cli.d.ts +1 -1
- package/dist/site-cli.js +24 -1
- package/dist/site-cli.js.map +1 -1
- package/dist/source-cli.js +9 -5
- package/dist/source-cli.js.map +1 -1
- package/dist/suite-explore-options.d.ts +14 -0
- package/dist/suite-explore-options.js +8 -0
- package/dist/suite-explore-options.js.map +1 -1
- package/dist/sweep-api.d.ts +289 -0
- package/dist/sweep-api.js +859 -0
- package/dist/sweep-api.js.map +1 -0
- package/dist/sweep-cli.d.ts +9 -0
- package/dist/sweep-cli.js +117 -0
- package/dist/sweep-cli.js.map +1 -0
- package/dist/target-config.d.ts +5 -2
- package/dist/target-config.js +15 -0
- package/dist/target-config.js.map +1 -1
- package/dist/ux-cli.js +3 -1
- package/dist/ux-cli.js.map +1 -1
- package/dist/ux-usability.d.ts +9 -3
- package/dist/ux-usability.js +8 -5
- package/dist/ux-usability.js.map +1 -1
- package/dist/verify-fix-cli.js +4 -2
- package/dist/verify-fix-cli.js.map +1 -1
- package/package.json +9 -9
- package/skills/jevitate-ci-check/SKILL.md +9 -1
- package/skills/jevitate-demo/SKILL.md +5 -2
- package/skills/jevitate-getting-started/SKILL.md +14 -1
- package/skills/jevitate-mission-scope/SKILL.md +2 -2
- package/skills/jevitate-run-journey/SKILL.md +42 -9
- package/skills/jevitate-test-campaign/SKILL.md +26 -5
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { mkdir, readFile, rename, writeFile } from "node:fs/promises";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { contentHash } from "@jevitate/domain";
|
|
4
|
+
import { JevJudgmentGateway, JevProviderError, MissingCredentialError, RetryingJudgmentPort, UsageTracker, envCredentialStore, jevProviderOverride, realJevClientCall, resolveJevRoute, } from "@jevitate/ai-core";
|
|
5
|
+
import { GatewaySelectionError, keyPreflightOpts } from "./cli-shared.js";
|
|
6
|
+
import { loadLocalCredentials } from "./credentials-file.js";
|
|
7
|
+
import { preflightRunKeys } from "./run-key-preflight.js";
|
|
8
|
+
import { resolveUsagePricing } from "./usage-config.js";
|
|
9
|
+
/**
|
|
10
|
+
* #434/#435 — the advisory Jev layer of the review sheets and the pre-approval pipeline: one
|
|
11
|
+
* `JudgmentPort` (the existing judgment gateway, TypeSafe or OpenRouter key, #429) behind a cache
|
|
12
|
+
* keyed by the content hash of what is asked, plus the usage of every call actually made.
|
|
13
|
+
*
|
|
14
|
+
* Model use follows the CLI's `--real` convention: the layer runs only on a command given `--real`
|
|
15
|
+
* (review sheets, approvals, `catalog analyze`; MCP `real: true`). Unlike a run, a missing judgment
|
|
16
|
+
* key is not a refusal here — the deterministic layer stands on its own, so the sheet says
|
|
17
|
+
* "skipped: no judgment key". Without `--real` it says "skipped: pass --real".
|
|
18
|
+
*
|
|
19
|
+
* The cache (`<project>/.jevitate/cache/jev/<sha256>.json`, gitignored) holds ANSWERS only — a kind,
|
|
20
|
+
* a value, a probability — keyed by `sha256(state + questions)`. The state is built from catalog
|
|
21
|
+
* text (job stories, persona descriptions, a Journey's review-sheet lines, which never carry a
|
|
22
|
+
* secret value), and it is never written: nothing secret is cached. A re-review of unchanged
|
|
23
|
+
* content asks nothing new. An unreadable entry is a miss (it is re-asked and rewritten).
|
|
24
|
+
*/
|
|
25
|
+
/** Bumped when the questions' meaning changes in a way their text does not show. */
|
|
26
|
+
export const JEV_CACHE_VERSION = 1;
|
|
27
|
+
/** Why the Jev layer did not run. */
|
|
28
|
+
export const JEV_SKIPPED_PASS_REAL = "pass --real to ask Jev (needs a judgment key)";
|
|
29
|
+
export const JEV_SKIPPED_NO_KEY = "no judgment key — set TYPESAFE_API_KEY or OPENROUTER_API_KEY (jevitate ai setup)";
|
|
30
|
+
function validAnswer(q, a) {
|
|
31
|
+
if (a === null || typeof a !== "object")
|
|
32
|
+
return false;
|
|
33
|
+
const o = a;
|
|
34
|
+
if (o.kind !== q.kind)
|
|
35
|
+
return false;
|
|
36
|
+
if (q.kind === "choice")
|
|
37
|
+
return typeof o.value === "string" && q.options.includes(o.value) && typeof o.confidence === "number" && Number.isFinite(o.confidence);
|
|
38
|
+
if (q.kind === "noul")
|
|
39
|
+
return typeof o.value === "boolean" && typeof o.probability === "number" && Number.isFinite(o.probability);
|
|
40
|
+
return typeof o.value === "number" && Number.isFinite(o.value);
|
|
41
|
+
}
|
|
42
|
+
function validAnswers(questions, answers) {
|
|
43
|
+
if (answers === null || typeof answers !== "object")
|
|
44
|
+
return false;
|
|
45
|
+
const rec = answers;
|
|
46
|
+
return Object.entries(questions).every(([name, q]) => validAnswer(q, rec[name]));
|
|
47
|
+
}
|
|
48
|
+
/** #434/#435: the judgment port behind a memory + on-disk answer cache, counting what it asks. */
|
|
49
|
+
export class CachedJevAdvisor {
|
|
50
|
+
judge;
|
|
51
|
+
cacheDir;
|
|
52
|
+
usage;
|
|
53
|
+
#memory = new Map();
|
|
54
|
+
#asked = 0;
|
|
55
|
+
#cached = 0;
|
|
56
|
+
constructor(judge,
|
|
57
|
+
/** The answer cache directory; null: memory only (outside a project). */
|
|
58
|
+
cacheDir, usage) {
|
|
59
|
+
this.judge = judge;
|
|
60
|
+
this.cacheDir = cacheDir;
|
|
61
|
+
this.usage = usage;
|
|
62
|
+
}
|
|
63
|
+
async ask(state, questions) {
|
|
64
|
+
const key = contentHash({ v: JEV_CACHE_VERSION, state, questions });
|
|
65
|
+
const hit = this.#memory.get(key) ?? (await this.#read(key, questions));
|
|
66
|
+
if (hit !== undefined) {
|
|
67
|
+
this.#memory.set(key, hit);
|
|
68
|
+
this.#cached += Object.keys(questions).length;
|
|
69
|
+
return { answers: hit, cached: true };
|
|
70
|
+
}
|
|
71
|
+
this.#asked += Object.keys(questions).length;
|
|
72
|
+
const answers = await this.judge.systemOne({ state, questions });
|
|
73
|
+
if (!validAnswers(questions, answers))
|
|
74
|
+
throw new Error("the judgment answers do not match the questions asked");
|
|
75
|
+
this.#memory.set(key, answers);
|
|
76
|
+
await this.#write(key, answers);
|
|
77
|
+
return { answers, cached: false };
|
|
78
|
+
}
|
|
79
|
+
layer() {
|
|
80
|
+
const usage = this.usage.snapshot();
|
|
81
|
+
const { priceSource, missing, ...counts } = usage;
|
|
82
|
+
return {
|
|
83
|
+
status: "ran",
|
|
84
|
+
asked: this.#asked,
|
|
85
|
+
cached: this.#cached,
|
|
86
|
+
...(usage.judgments + usage.generations === 0
|
|
87
|
+
? {}
|
|
88
|
+
: { usage: { ...counts, ...(priceSource === undefined ? {} : { priceSource: [...priceSource] }), ...(missing === undefined ? {} : { missing: [...missing] }) } }),
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
async #read(key, questions) {
|
|
92
|
+
if (this.cacheDir === null)
|
|
93
|
+
return undefined;
|
|
94
|
+
let raw;
|
|
95
|
+
try {
|
|
96
|
+
raw = await readFile(join(this.cacheDir, `${key}.json`), "utf8");
|
|
97
|
+
}
|
|
98
|
+
catch (err) {
|
|
99
|
+
if (typeof err === "object" && err !== null && "code" in err && err.code === "ENOENT")
|
|
100
|
+
return undefined;
|
|
101
|
+
throw err;
|
|
102
|
+
}
|
|
103
|
+
let parsed;
|
|
104
|
+
try {
|
|
105
|
+
parsed = JSON.parse(raw);
|
|
106
|
+
}
|
|
107
|
+
catch {
|
|
108
|
+
return undefined; // a torn entry is a miss: re-asked and rewritten
|
|
109
|
+
}
|
|
110
|
+
const answers = parsed?.version === JEV_CACHE_VERSION ? parsed.answers : undefined;
|
|
111
|
+
return validAnswers(questions, answers) ? answers : undefined;
|
|
112
|
+
}
|
|
113
|
+
async #write(key, answers) {
|
|
114
|
+
if (this.cacheDir === null)
|
|
115
|
+
return;
|
|
116
|
+
await mkdir(this.cacheDir, { recursive: true, mode: 0o700 });
|
|
117
|
+
const file = join(this.cacheDir, `${key}.json`);
|
|
118
|
+
const tmp = `${file}.${process.pid}.tmp`;
|
|
119
|
+
await writeFile(tmp, `${JSON.stringify({ version: JEV_CACHE_VERSION, answers })}\n`, { mode: 0o600 });
|
|
120
|
+
await rename(tmp, file);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
/** The answer cache directory of a project data dir (`<.jevitate>/cache/jev`), or null outside a project. */
|
|
124
|
+
export function jevCacheDir(catalogDir) {
|
|
125
|
+
return catalogDir === null ? null : join(catalogDir, "cache", "jev");
|
|
126
|
+
}
|
|
127
|
+
/** The Jev layer's report when it did not run. */
|
|
128
|
+
export function skippedLayer(reason) {
|
|
129
|
+
return { status: "skipped", reason, asked: 0, cached: 0 };
|
|
130
|
+
}
|
|
131
|
+
export function jevLayerOf(setup) {
|
|
132
|
+
if (setup === undefined)
|
|
133
|
+
return skippedLayer(JEV_SKIPPED_PASS_REAL);
|
|
134
|
+
return "advisor" in setup ? setup.advisor.layer() : skippedLayer(setup.skipped);
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* #434/#435: the Jev layer of one command. Without `--real`: skipped ("pass --real"). With it: an
|
|
138
|
+
* injected judge (tests) wins; else the live judgment gateway on the resolved Jev route
|
|
139
|
+
* (`--jev-provider`, else TypeSafe then OpenRouter) after the startup key check — or, when no
|
|
140
|
+
* judgment key is configured, skipped ("no judgment key"): the deterministic layer still runs.
|
|
141
|
+
* An unknown `--jev-provider` is refused (`GatewaySelectionError`), never ignored.
|
|
142
|
+
*/
|
|
143
|
+
export async function buildJevSetup(deps, opts) {
|
|
144
|
+
if (opts.real !== true)
|
|
145
|
+
return { skipped: JEV_SKIPPED_PASS_REAL };
|
|
146
|
+
const env = deps.explore?.env ?? process.env;
|
|
147
|
+
const usage = deps.explore?.usage ?? new UsageTracker(resolveUsagePricing(env));
|
|
148
|
+
if (deps.explore?.judge !== undefined)
|
|
149
|
+
return { advisor: new CachedJevAdvisor(deps.explore.judge, opts.cacheDir, usage) };
|
|
150
|
+
let provider;
|
|
151
|
+
try {
|
|
152
|
+
provider = jevProviderOverride(env, opts.jevProvider);
|
|
153
|
+
}
|
|
154
|
+
catch (err) {
|
|
155
|
+
if (err instanceof JevProviderError)
|
|
156
|
+
throw new GatewaySelectionError(err.message);
|
|
157
|
+
throw err;
|
|
158
|
+
}
|
|
159
|
+
const store = envCredentialStore(env, deps.explore?.localConfig ?? loadLocalCredentials());
|
|
160
|
+
try {
|
|
161
|
+
resolveJevRoute(store, provider);
|
|
162
|
+
}
|
|
163
|
+
catch (err) {
|
|
164
|
+
if (err instanceof MissingCredentialError)
|
|
165
|
+
return { skipped: JEV_SKIPPED_NO_KEY };
|
|
166
|
+
throw err;
|
|
167
|
+
}
|
|
168
|
+
await preflightRunKeys(["judgment"], store, { ...keyPreflightOpts(deps), ...(provider === undefined ? {} : { jevProvider: provider }) });
|
|
169
|
+
const judge = new RetryingJudgmentPort(new JevJudgmentGateway(store, await realJevClientCall(undefined, usage), provider));
|
|
170
|
+
return { advisor: new CachedJevAdvisor(judge, opts.cacheDir, usage) };
|
|
171
|
+
}
|
|
172
|
+
//# sourceMappingURL=jev-advisor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jev-advisor.js","sourceRoot":"","sources":["../src/jev-advisor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,oBAAoB,EACpB,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,GAMhB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAgB,MAAM,iBAAiB,CAAC;AACxF,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD;;;;;;;;;;;;;;;GAeG;AAEH,oFAAoF;AACpF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAEnC,qCAAqC;AACrC,MAAM,CAAC,MAAM,qBAAqB,GAAG,+CAA+C,CAAC;AACrF,MAAM,CAAC,MAAM,kBAAkB,GAAG,kFAAkF,CAAC;AAYrH,SAAS,WAAW,CAAC,CAAW,EAAE,CAAU;IAC1C,IAA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AC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,GAAG,YAAY,gBAAgB;YAAE,MAAM,IAAI,qBAAqB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAClF,MAAM,GAAG,CAAC;IACZ,CAAC;IACD,MAAM,KAAK,GAAG,kBAAkB,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,CAAC,CAAC;IAC3F,IAAI,CAAC;QACH,eAAe,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IACnC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,GAAG,YAAY,sBAAsB;YAAE,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,CAAC;QAClF,MAAM,GAAG,CAAC;IACZ,CAAC;IACD,MAAM,gBAAgB,CAAC,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,EAAE,GAAG,gBAAgB,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC;IACzI,MAAM,KAAK,GAAG,IAAI,oBAAoB,CAAC,IAAI,kBAAkB,CAAC,KAAK,EAAE,MAAM,iBAAiB,CAAC,SAAS,EAAE,KAAK,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC;IAC3H,OAAO,EAAE,OAAO,EAAE,IAAI,gBAAgB,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC;AACxE,CAAC"}
|
package/dist/journey-api.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { type Journey, type JourneyLintFinding } from "@jevitate/journey";
|
|
1
|
+
import { type Journey, type JourneyLintFinding, type ApprovalProvenance } from "@jevitate/journey";
|
|
2
|
+
import { type ApprovalConfirm } from "./approval-provenance.js";
|
|
3
|
+
import type { JevSetup } from "./jev-advisor.js";
|
|
2
4
|
import { type RunPolicy } from "@jevitate/domain";
|
|
3
5
|
import { type BrowserPort, type BrowserSession, type EmulationSpec } from "@jevitate/playwright";
|
|
4
6
|
import { type BrowserRunOptions } from "./browser-run-options.js";
|
|
@@ -6,7 +8,8 @@ import { RecordingInterpreter, type StepObserver } from "@jevitate/interpreter";
|
|
|
6
8
|
import { type BlockedWrite, type ReplayDeltaSummary } from "@jevitate/explore";
|
|
7
9
|
import { SecretPixelMask } from "./demo-capture.js";
|
|
8
10
|
import { type ScreenshotsResult, type ScreenshotsSpec } from "./run-screenshots.js";
|
|
9
|
-
import { type JourneyRunResult, type SelfHealer, type SiteGateDeps } from "@jevitate/runtime";
|
|
11
|
+
import { type ProposedRevisionDraft, type ChangeScope, type JourneyRunResult, type SelfHealer, type SiteGateDeps } from "@jevitate/runtime";
|
|
12
|
+
import { type JourneyResultProposal } from "./journey-result-record.js";
|
|
10
13
|
import { type FixtureRecord, type MissionFixtures } from "./mission-fixtures.js";
|
|
11
14
|
import { type ResolvedJourneyEnvironment } from "./environments.js";
|
|
12
15
|
import { type OutcomeCheckFailure } from "./journey-network-checks.js";
|
|
@@ -28,6 +31,14 @@ export declare class JourneyRequiresAuthError extends Error {
|
|
|
28
31
|
* #401: the Journey's assertions cannot prove its outcome (the `lintJourney` errors). `promote`
|
|
29
32
|
* refuses unless the reviewer accepts it with a non-empty `--accept-weak <reason>`.
|
|
30
33
|
*/
|
|
34
|
+
/** #432: `journey promote --reviewed-hash`: the Journey changed after the reviewer's sheet was produced. */
|
|
35
|
+
export declare class StaleReviewError extends Error {
|
|
36
|
+
readonly code = "E_JOURNEY_REVIEW_STALE";
|
|
37
|
+
}
|
|
38
|
+
/** #453: a bad combination of proposal flags (`--proposal` with `--reject-proposal`; a rejection with no reason). Exit 64. */
|
|
39
|
+
export declare class JourneyProposalArgsError extends Error {
|
|
40
|
+
readonly code = "E_JOURNEY_PROPOSAL_ARGS";
|
|
41
|
+
}
|
|
31
42
|
export declare class WeakJourneyError extends Error {
|
|
32
43
|
readonly findings: readonly JourneyLintFinding[];
|
|
33
44
|
constructor(message: string, findings?: readonly JourneyLintFinding[]);
|
|
@@ -56,6 +67,14 @@ export interface RunJourneyProgrammaticallyOptions {
|
|
|
56
67
|
* this port (enforced by `JourneyRunner`'s write floor).
|
|
57
68
|
*/
|
|
58
69
|
selfHealer?: SelfHealer;
|
|
70
|
+
/**
|
|
71
|
+
* #453: the change context a `hybrid`/`full` self-heal is explained by (`readJourneyChangeScope`).
|
|
72
|
+
* With it the runner gets the risky-control classification (`journeyStepRisk`) and a per-step write
|
|
73
|
+
* blocker, so a guarded click/fill may be retargeted. Absent: every break is unexplained (never healed).
|
|
74
|
+
*/
|
|
75
|
+
heal?: {
|
|
76
|
+
readonly scope: ChangeScope;
|
|
77
|
+
};
|
|
59
78
|
/**
|
|
60
79
|
* Mission fixtures (#140/#144), built for the journey's own site once it is known: set up before
|
|
61
80
|
* the browser opens (a failure throws `FixtureSetupError` — the journey never runs on unknown
|
|
@@ -153,6 +172,14 @@ export interface MutationReplayFields {
|
|
|
153
172
|
/** The writes aborted in `blockWritesAtStep`'s window. */
|
|
154
173
|
blockedWrites?: BlockedWrite[];
|
|
155
174
|
}
|
|
175
|
+
/** #453: what a self-heal run adds to its result — the proposal it wrote and the persisted result file. */
|
|
176
|
+
export interface HealRunFields {
|
|
177
|
+
proposal?: JourneyResultProposal & {
|
|
178
|
+
reviewCommand: string;
|
|
179
|
+
acceptCommand: string;
|
|
180
|
+
};
|
|
181
|
+
resultPath?: string;
|
|
182
|
+
}
|
|
156
183
|
/**
|
|
157
184
|
* #246: a secret parameter's value (declared `secret: true`, or a credential-like name) never comes
|
|
158
185
|
* back in a run's output — the interpreter's vars start as the params, so the value is masked there.
|
|
@@ -184,10 +211,48 @@ export declare function lintJourneyById(dir: string, id: string, opts?: {
|
|
|
184
211
|
* #401: lints first — a Journey whose assertions cannot prove its outcome is refused
|
|
185
212
|
* (`WeakJourneyError`) unless the reviewer accepts it with a non-empty `--accept-weak <reason>`,
|
|
186
213
|
* which is recorded on the Journey (`metadata.acceptedWeak`). Warnings never block.
|
|
214
|
+
*
|
|
215
|
+
* #432: records the approval (`metadata.approval`: the review hash, when, the waiver) and keeps a
|
|
216
|
+
* snapshot of the approved Journey (`.approved/<id>.json`). Given `reviewedHash` (what the reviewer's
|
|
217
|
+
* sheet showed), a Journey that changed since is refused (`StaleReviewError`) before anything else.
|
|
218
|
+
*
|
|
219
|
+
* #433: then the catalog gate (`journeyCatalogGate`): a Journey linking a job/persona that is not
|
|
220
|
+
* approved is refused (`UnvettedLinksError`) unless `acceptUnvetted` (recorded in
|
|
221
|
+
* `approval.waivers`), and the shared pre-approval findings are acknowledged (`acceptFindings`,
|
|
222
|
+
* recorded in `approval.acceptedFindings`) — the same pipeline `persona|job approve` and
|
|
223
|
+
* `demo approve` use. `catalogDir` (default: the project's `.jevitate/`) holds personas/jobs.
|
|
187
224
|
*/
|
|
188
|
-
export
|
|
225
|
+
export interface PromoteJourneyOptions {
|
|
189
226
|
acceptWeak?: string;
|
|
190
|
-
|
|
227
|
+
reviewedHash?: string;
|
|
228
|
+
acceptUnvetted?: string;
|
|
229
|
+
acceptFindings?: string;
|
|
230
|
+
/** The catalog's directory; undefined: the project's `.jevitate/` (none outside a project). */
|
|
231
|
+
catalogDir?: string | null;
|
|
232
|
+
/** Which approval path asks (`demo approve` promotes through here too). */
|
|
233
|
+
action?: "journey promote" | "demo approve";
|
|
234
|
+
/** #434/#435: the advisory Jev layer of the pre-approval readiness and analysis (`--real`), or why it is skipped. */
|
|
235
|
+
jev?: JevSetup;
|
|
236
|
+
/**
|
|
237
|
+
* #437: confirms the approval (after every gate, before anything is written) and returns its
|
|
238
|
+
* provenance — the CLI's `makeApprovalConfirm` (a typed confirmation on a TTY, the escape hatch,
|
|
239
|
+
* or the MCP channel). Omitted: recorded as `non-interactive` (`programmaticProvenance`).
|
|
240
|
+
*/
|
|
241
|
+
confirm?: ApprovalConfirm;
|
|
242
|
+
/**
|
|
243
|
+
* #453: accept this pending self-heal proposal (its id) instead of promoting the stored Journey as
|
|
244
|
+
* is. The proposal is re-checked (stale / proof untouched), goes through every gate as the
|
|
245
|
+
* Journey it would make, is confirmed with the proposal shown, and `reviewedHash` is compared with
|
|
246
|
+
* ITS `proposedHash`. Only this writes the stored Journey.
|
|
247
|
+
*/
|
|
248
|
+
proposal?: string;
|
|
249
|
+
/** #453: reject this pending proposal (its id) — needs `reason`; the stored Journey is untouched. */
|
|
250
|
+
rejectProposal?: string;
|
|
251
|
+
reason?: string;
|
|
252
|
+
/** #453: how the rejection was made (`rejectionProvenance`); omitted: the programmatic one. */
|
|
253
|
+
rejectProvenance?: ApprovalProvenance;
|
|
254
|
+
}
|
|
255
|
+
export declare function promoteJourney(dir: string, id: string, opts?: PromoteJourneyOptions): Promise<Journey>;
|
|
191
256
|
/**
|
|
192
257
|
* The one programmatic surface for "run this published Journey by id" —
|
|
193
258
|
* used by BOTH the CLI `journey run` action and external callers. Builds
|
|
@@ -201,6 +266,12 @@ export declare function runJourneyProgrammatically(opts: RunJourneyProgrammatica
|
|
|
201
266
|
fixtures?: FixtureRecord;
|
|
202
267
|
videoPaths?: string[];
|
|
203
268
|
actionDeltas?: ReplayDeltaSummary;
|
|
204
|
-
} & Partial<ScreenshotsResult> & MutationReplayFields>;
|
|
269
|
+
} & Partial<ScreenshotsResult> & MutationReplayFields & HealRunFields>;
|
|
270
|
+
/**
|
|
271
|
+
* The revision a run on an environment proposed, onto the STORED Journey: each changed step's
|
|
272
|
+
* `before` is the stored step, its `after` the retarget — a navigate URL on the environment's base
|
|
273
|
+
* URL moved back onto the recorded site. Without an environment the draft is the stored Journey's.
|
|
274
|
+
*/
|
|
275
|
+
export declare function draftOnStored(stored: Journey, draft: ProposedRevisionDraft, env: ResolvedJourneyEnvironment | undefined): ProposedRevisionDraft;
|
|
205
276
|
/** `err` with every secret (and its URL-encoded forms) masked in its message and stack — same object, same class. */
|
|
206
277
|
export declare function redactErrorSecrets(err: unknown, secrets: readonly string[]): unknown;
|