humanish 0.32.0 → 0.33.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.
@@ -1,4 +1,4 @@
1
- import type { RunAdapterArtifact, RunAdapterScore, RunBundle, RunFeedbackCandidate } from "./run.js";
1
+ import type { RunAdapterArtifact, RunAdapterScore, RunBundle, RunFeedbackCandidate, RunScorerProvenance } from "./run.js";
2
2
  export type BrowserAdapterBackend = "cua" | "shared-world" | "concurrent-shared-world";
3
3
  /**
4
4
  * Product-agnostic scoring context for browser/computer-use lanes. Product-specific
@@ -49,6 +49,28 @@ export declare function applyBrowserAdapterHooks(args: {
49
49
  sanitize: (text: string) => string;
50
50
  warnings: string[];
51
51
  hookLabel: string;
52
- }): Promise<void>;
52
+ /** Present only when the scorer was CONFIG-DECLARED (#316); core-stamped onto the bundle as
53
+ * evidence of which out-of-tree module was loaded. Absent for library callers. Its presence also
54
+ * opts a THROWING or MALFORMED scorer into the declared-gate downgrade — a declared gate that
55
+ * cannot render a pass is a fail, never a silent green. */
56
+ scorerProvenance?: RunScorerProvenance;
57
+ }): Promise<{
58
+ declaredVerdictFailure?: string;
59
+ }>;
53
60
  export declare function adapterScoreFailureMessage(bundle: RunBundle): string | undefined;
54
61
  export declare function applyAdapterScoreFailureToReview(bundle: RunBundle): string | undefined;
62
+ /**
63
+ * A CONFIG-DECLARED scorer (#316) that fails to render a PASS verdict — it returned status:"fail",
64
+ * threw, or returned a malformed value — must never leave a silent green (the declared-gate invariant:
65
+ * a gate that cannot render a pass is a fail, never a silent pass). Adds a review gap and downgrades a
66
+ * would-be pass/contract_proof_only to fail (this ONLY ever makes the verdict STRICTER). Callers gate
67
+ * on `declared`, so library callers are never affected.
68
+ */
69
+ export declare function recordDeclaredScorerVerdictFailure(bundle: RunBundle, reason: string): void;
70
+ /**
71
+ * Deep-freeze a structured clone so a loaded scorer sees a READ-ONLY bundle: it cannot mutate
72
+ * noSpend/cost/review in place to launder a verdict (which would defeat the costProbe-not-loadable
73
+ * guarantee). A tamper attempt throws in the scorer's strict-mode ESM and is caught as a hook failure.
74
+ * Legitimate read-only scoring is unaffected. The seam always stamps the REAL bundle, never this view.
75
+ */
76
+ export declare function frozenBundleView(bundle: RunBundle): RunBundle;
@@ -1,31 +1,53 @@
1
1
  import path from "node:path";
2
2
  export async function applyBrowserAdapterHooks(args) {
3
- const { hooks, context, bundle, sanitize, warnings, hookLabel } = args;
3
+ const { hooks, context, bundle, sanitize, warnings, hookLabel, scorerProvenance } = args;
4
4
  if (!hooks?.score && !hooks?.deriveFeedback && !hooks?.deriveArtifacts)
5
- return;
5
+ return {};
6
+ const declared = scorerProvenance !== undefined;
7
+ // Record the loaded scorer's identity regardless of hook outcome (a throwing/invalid scorer was
8
+ // still loaded and attempted). A VALID status:"fail" flips the review below via the pre-#316 (#165)
9
+ // path (library + declared); a DECLARED scorer that THROWS or returns MALFORMED also fails (below).
10
+ if (scorerProvenance)
11
+ bundle.scorerProvenance = scorerProvenance;
12
+ // The scorer sees a READ-ONLY view of the bundle: it cannot mutate noSpend/cost/review in place to
13
+ // launder a verdict (a tamper attempt throws in the scorer's strict-mode ESM and is caught below as
14
+ // a hook failure). The seam still stamps the REAL bundle.
15
+ const scoringContext = { ...context, bundle: frozenBundleView(context.bundle) };
6
16
  const scrubValue = (value) => {
7
17
  const encoded = JSON.stringify(value);
8
18
  return encoded === undefined ? value : JSON.parse(sanitize(encoded));
9
19
  };
20
+ let declaredVerdictFailure;
10
21
  if (hooks.score) {
11
22
  try {
12
- const score = await hooks.score(context);
23
+ const score = await hooks.score(scoringContext);
13
24
  const cleaned = scrubValue(score);
14
25
  if (isAdapterScoreShape(cleaned)) {
15
26
  bundle.adapterScore = cleaned;
16
- applyAdapterScoreFailureToReview(bundle);
27
+ const message = applyAdapterScoreFailureToReview(bundle);
28
+ if (declared && message !== undefined)
29
+ declaredVerdictFailure = message;
17
30
  }
18
31
  else {
19
32
  warnings.push(`${hookLabel}.score returned a value that is not a well-formed humanish.adapter-score.v1 (non-empty namespace + status + numeric score + summary); dropped so the bundle stays verifiable.`);
33
+ if (declared) {
34
+ declaredVerdictFailure = "Declared product scorer returned a malformed value instead of a verdict; a declared gate that cannot render a pass is recorded as a fail, never a silent pass.";
35
+ recordDeclaredScorerVerdictFailure(bundle, declaredVerdictFailure);
36
+ }
20
37
  }
21
38
  }
22
39
  catch (error) {
23
- warnings.push(`${hookLabel}.score threw (${sanitize(error instanceof Error ? error.message : String(error))}); dropped so the bundle stays verifiable.`);
40
+ const detail = sanitize(error instanceof Error ? error.message : String(error));
41
+ warnings.push(`${hookLabel}.score threw (${detail}); dropped so the bundle stays verifiable.`);
42
+ if (declared) {
43
+ declaredVerdictFailure = `Declared product scorer threw before returning a verdict (${detail}); a crashed declared gate is recorded as a fail, never a silent pass.`;
44
+ recordDeclaredScorerVerdictFailure(bundle, declaredVerdictFailure);
45
+ }
24
46
  }
25
47
  }
26
48
  if (hooks.deriveFeedback) {
27
49
  try {
28
- const candidates = await hooks.deriveFeedback(context);
50
+ const candidates = await hooks.deriveFeedback(scoringContext);
29
51
  const accepted = [];
30
52
  for (const candidate of Array.isArray(candidates) ? candidates : []) {
31
53
  const cleaned = scrubValue(candidate);
@@ -44,7 +66,7 @@ export async function applyBrowserAdapterHooks(args) {
44
66
  }
45
67
  if (hooks.deriveArtifacts) {
46
68
  try {
47
- const artifacts = await hooks.deriveArtifacts(context);
69
+ const artifacts = await hooks.deriveArtifacts(scoringContext);
48
70
  const accepted = [];
49
71
  for (const artifact of Array.isArray(artifacts) ? artifacts : []) {
50
72
  const cleaned = scrubValue(artifact);
@@ -61,6 +83,7 @@ export async function applyBrowserAdapterHooks(args) {
61
83
  warnings.push(`${hookLabel}.deriveArtifacts threw (${sanitize(error instanceof Error ? error.message : String(error))}); dropped so the bundle stays verifiable.`);
62
84
  }
63
85
  }
86
+ return declaredVerdictFailure === undefined ? {} : { declaredVerdictFailure };
64
87
  }
65
88
  export function adapterScoreFailureMessage(bundle) {
66
89
  return bundle.adapterScore?.status === "fail"
@@ -80,6 +103,40 @@ export function applyAdapterScoreFailureToReview(bundle) {
80
103
  }
81
104
  return message;
82
105
  }
106
+ /**
107
+ * A CONFIG-DECLARED scorer (#316) that fails to render a PASS verdict — it returned status:"fail",
108
+ * threw, or returned a malformed value — must never leave a silent green (the declared-gate invariant:
109
+ * a gate that cannot render a pass is a fail, never a silent pass). Adds a review gap and downgrades a
110
+ * would-be pass/contract_proof_only to fail (this ONLY ever makes the verdict STRICTER). Callers gate
111
+ * on `declared`, so library callers are never affected.
112
+ */
113
+ export function recordDeclaredScorerVerdictFailure(bundle, reason) {
114
+ if (!bundle.review.gaps.includes(reason))
115
+ bundle.review.gaps = [...bundle.review.gaps, reason];
116
+ if (bundle.review.verdict === "pass" || bundle.review.verdict === "contract_proof_only") {
117
+ bundle.review.verdict = "fail";
118
+ bundle.review.summary = reason;
119
+ }
120
+ }
121
+ /**
122
+ * Deep-freeze a structured clone so a loaded scorer sees a READ-ONLY bundle: it cannot mutate
123
+ * noSpend/cost/review in place to launder a verdict (which would defeat the costProbe-not-loadable
124
+ * guarantee). A tamper attempt throws in the scorer's strict-mode ESM and is caught as a hook failure.
125
+ * Legitimate read-only scoring is unaffected. The seam always stamps the REAL bundle, never this view.
126
+ */
127
+ export function frozenBundleView(bundle) {
128
+ const clone = structuredClone(bundle);
129
+ const freeze = (obj) => {
130
+ if (obj !== null && typeof obj === "object" && !Object.isFrozen(obj)) {
131
+ Object.freeze(obj);
132
+ for (const key of Object.keys(obj)) {
133
+ freeze(obj[key]);
134
+ }
135
+ }
136
+ };
137
+ freeze(clone);
138
+ return clone;
139
+ }
83
140
  function isAdapterScoreShape(value) {
84
141
  return typeof value === "object" && value !== null && !Array.isArray(value)
85
142
  && value.schema === "humanish.adapter-score.v1"
@@ -1 +1 @@
1
- {"version":3,"file":"adapter-extension.js","sourceRoot":"","sources":["../src/adapter-extension.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,C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,CAAC;AACtC,CAAC"}
@@ -0,0 +1,42 @@
1
+ import type { BrowserLabScoringContext } from "./adapter-extension.js";
2
+ import type { TerminalProductScoringContext } from "./e2b-terminal-lab.js";
3
+ import type { LabBackend } from "./lab-engine.js";
4
+ import type { RunAdapterArtifact, RunAdapterScore, RunFeedbackCandidate, RunScorerProvenance } from "./run.js";
5
+ /** The read-model context a loaded scorer sees — the terminal or browser scoring context. The module
6
+ * narrows it at runtime (`"product" in ctx` ⇒ terminal; `"backend" in ctx` ⇒ browser). */
7
+ export type AdapterScoringContext = TerminalProductScoringContext | BrowserLabScoringContext;
8
+ /**
9
+ * The adopter-facing scorer module contract (#316). Export any subset of these from a `.mjs` (or a
10
+ * `.js`/`.cjs` whose package.json type matches) — named exports OR a single default object. The
11
+ * loader wires ONLY these three; an exported `executor`/`env`/`provisionSubject`/`costProbe` is never
12
+ * picked up (the whitelist is the scope guard). A module exporting NONE of them is a hard load error.
13
+ */
14
+ export interface AdapterScorerModule {
15
+ score?: (ctx: AdapterScoringContext) => RunAdapterScore | Promise<RunAdapterScore>;
16
+ deriveFeedback?: (ctx: AdapterScoringContext) => RunFeedbackCandidate[] | Promise<RunFeedbackCandidate[]>;
17
+ /** Browser-route only; inert on the terminal route (TerminalProductLabHooks carries no artifacts seam). */
18
+ deriveArtifacts?: (ctx: BrowserLabScoringContext) => RunAdapterArtifact[] | Promise<RunAdapterArtifact[]>;
19
+ }
20
+ export type AdapterScorerLoadErrorCode = "HUMANISH_LAB_SCORER_BAD_REF" | "HUMANISH_LAB_SCORER_NOT_FOUND" | "HUMANISH_LAB_SCORER_LOAD_FAILED" | "HUMANISH_LAB_SCORER_NO_HOOKS" | "HUMANISH_LAB_SCORER_UNSUPPORTED_BACKEND";
21
+ export type AdapterScorerLoadResult = {
22
+ ok: true;
23
+ hooks: AdapterScorerModule;
24
+ provenance: RunScorerProvenance;
25
+ } | {
26
+ ok: false;
27
+ error: {
28
+ code: AdapterScorerLoadErrorCode;
29
+ message: string;
30
+ };
31
+ };
32
+ /**
33
+ * Resolve + load a config-declared scorer module. Resolution clones scenario.ref exactly
34
+ * (prepareSelectedOutputDirectory → cwd-clamp → readContainedRegularFile), then `import()`s the
35
+ * entry file in a BROAD try/catch. The digest is over the readContainedRegularFile ENTRY bytes.
36
+ */
37
+ export declare function loadAdapterScorer(args: {
38
+ cwd: string;
39
+ ref: string;
40
+ backend: LabBackend;
41
+ source: "manifest" | "cli-flag";
42
+ }): Promise<AdapterScorerLoadResult>;
@@ -0,0 +1,129 @@
1
+ // #316 — CLI-loadable adopter scorer. Resolve `review.scorer.ref` / `--scorer` to an out-of-tree
2
+ // scorer module, load it fail-closed (typed error + exit 2, PRE-SPEND), and pick off ONLY the
3
+ // whitelisted read-model hooks {score, deriveFeedback, deriveArtifacts}. `costProbe` is deliberately
4
+ // NOT loadable — an injected provider cost line overwrites the core-measured one and can forge a
5
+ // satisfied no-spend proof, so it stays library-only.
6
+ //
7
+ // TRUST MODEL (stated plainly, no overclaims): the party who writes `review.scorer.ref` is the party
8
+ // who runs `humanish lab run` in their own checkout — identical trust to humanish.lab.yml or a
9
+ // package.json script. #316 adds ZERO new execution capability; it relocates WHERE the reference is
10
+ // declared. Containment is ENTRY-FILE-ONLY: `readContainedRegularFile` blocks abs/`..`/symlink/
11
+ // hardlink/realpath-escape/TOCTOU on the entry module, but `import()` then executes the transitive
12
+ // graph + npm deps with no clamp, and `import()` runs top-level module code before any whitelist
13
+ // check. The whitelist bounds the WIRED HOOK SURFACE, not arbitrary import-time code; the
14
+ // trusted-in-process boundary is the actual safety carrier. The seam's output re-scrub is a
15
+ // best-effort denylist, NOT containment. `review.scorer.ref` entries are executable code — review a
16
+ // PR that adds one as code, not config.
17
+ import { realpath } from "node:fs/promises";
18
+ import path from "node:path";
19
+ import { pathToFileURL } from "node:url";
20
+ import { digestText, redactText } from "./redaction.js";
21
+ import { prepareSelectedOutputDirectory, readContainedRegularFile } from "./selected-output-paths.js";
22
+ /** The backends whose hooks bag can carry the loaded scorer. A declared scorer on ANY other backend
23
+ * (scripted / synthetic / meta / smoke) aborts at load — a gate that cannot run must never green-pass. */
24
+ const SCORER_CAPABLE_BACKENDS = new Set([
25
+ "terminal",
26
+ "cua",
27
+ "shared-world",
28
+ "concurrent-shared-world"
29
+ ]);
30
+ /** `.mjs` is required-canonical; `.js`/`.cjs` accepted but the module system is the adopter repo's
31
+ * package.json `type`. `.ts` is rejected — the compiled `dist/` CLI ships no TypeScript loader. */
32
+ const SCORER_EXTENSIONS = new Set([".mjs", ".js", ".cjs"]);
33
+ /**
34
+ * Resolve + load a config-declared scorer module. Resolution clones scenario.ref exactly
35
+ * (prepareSelectedOutputDirectory → cwd-clamp → readContainedRegularFile), then `import()`s the
36
+ * entry file in a BROAD try/catch. The digest is over the readContainedRegularFile ENTRY bytes.
37
+ */
38
+ export async function loadAdapterScorer(args) {
39
+ const { backend, source } = args;
40
+ const fail = (code, message) => ({ ok: false, error: { code, message } });
41
+ // A declared gate that cannot run on this backend must ABORT (never silently green-pass).
42
+ if (!SCORER_CAPABLE_BACKENDS.has(backend)) {
43
+ return fail("HUMANISH_LAB_SCORER_UNSUPPORTED_BACKEND", `review.scorer.ref is declared but this lab resolves to the ${backend} backend, which has no adopter-scorer seam. A declared scorer that cannot run must fail closed rather than pass silently — declare it on a terminal, cua, shared-world, or concurrent-shared-world lab.`);
44
+ }
45
+ const trimmed = args.ref.trim();
46
+ if (!trimmed) {
47
+ return fail("HUMANISH_LAB_SCORER_BAD_REF", "review.scorer.ref must be a non-empty repo-relative path ending in .mjs (recommended), .js, or .cjs.");
48
+ }
49
+ // Provenance is recorded repo-relative — an absolute ref (even one that happens to land inside cwd)
50
+ // is rejected up front rather than silently rewritten to its in-tree relative form.
51
+ if (path.isAbsolute(trimmed)) {
52
+ return fail("HUMANISH_LAB_SCORER_BAD_REF", `review.scorer.ref "${trimmed}" must be a repo-relative path, not absolute — provenance is recorded repo-relative.`);
53
+ }
54
+ const ext = path.extname(trimmed).toLowerCase();
55
+ if (ext === ".ts") {
56
+ return fail("HUMANISH_LAB_SCORER_BAD_REF", `review.scorer.ref "${trimmed}" ends in .ts, but the shipped CLI runs compiled JS with no TypeScript loader. Precompile to .mjs (recommended) or .js/.cjs.`);
57
+ }
58
+ if (!SCORER_EXTENSIONS.has(ext)) {
59
+ return fail("HUMANISH_LAB_SCORER_BAD_REF", `review.scorer.ref "${trimmed}" must be a repo-relative PATH ending in .mjs (recommended), .js, or .cjs — an id-style ref is not supported.`);
60
+ }
61
+ // Root token: realpath(cwd) → prepareSelectedOutputDirectory(dirname, cwd). Mirrors scenario.ref.
62
+ const physicalCwd = await realpath(path.resolve(args.cwd));
63
+ const root = await prepareSelectedOutputDirectory(path.dirname(physicalCwd), physicalCwd);
64
+ // Clamp verbatim from the scripted scenario.ref branch: resolve → relative → reject escape/absolute.
65
+ const absolutePath = path.resolve(root.physicalPath, trimmed);
66
+ const relative = path.relative(root.physicalPath, absolutePath);
67
+ if (!relative || relative.startsWith("..") || path.isAbsolute(relative)) {
68
+ return fail("HUMANISH_LAB_SCORER_BAD_REF", `review.scorer.ref "${trimmed}" must stay inside the target cwd — provenance is recorded repo-relative and an escaping/absolute path (a cwd parent, node_modules above cwd, an absolute path) cannot be.`);
69
+ }
70
+ const relPosix = relative.split(path.sep).join("/");
71
+ // Fail-closed containment gate on the ENTRY file only: rejects symlink, nlink>1, realpath-escape,
72
+ // TOCTOU. Its returned bytes are the digest input.
73
+ const bytes = await readContainedRegularFile(root, relPosix);
74
+ if (!bytes) {
75
+ return fail("HUMANISH_LAB_SCORER_NOT_FOUND", `review.scorer.ref "${trimmed}" could not be read as a contained regular file (${relPosix}). A scorer must be a regular file inside the target cwd — no symlink, no hardlink, no realpath escape.`);
76
+ }
77
+ const digest = digestText(bytes.toString("utf8"));
78
+ // Import the entry module in a BROAD try/catch (ERR_MODULE_NOT_FOUND / SyntaxError / ERR_REQUIRE_ESM
79
+ // / top-level throw). import() executes the transitive graph — the cwd clamp guards only the ENTRY
80
+ // file; out-of-tree/transitive code is acceptable only because of the trust boundary above.
81
+ let mod;
82
+ try {
83
+ const url = pathToFileURL(path.join(root.physicalPath, relPosix)).href;
84
+ mod = (await import(url));
85
+ }
86
+ catch (error) {
87
+ const detail = error instanceof Error ? error.message : String(error);
88
+ const hint = /ERR_REQUIRE_ESM|import statement outside a module|Cannot use import statement|Unexpected (?:token|identifier)|SyntaxError/i.test(detail)
89
+ ? " Use a .mjs entry file, or set \"type\": \"module\" in the nearest package.json."
90
+ : "";
91
+ return fail("HUMANISH_LAB_SCORER_LOAD_FAILED", `review.scorer.ref "${trimmed}" failed to load: ${redactText(detail)}.${hint}`);
92
+ }
93
+ // mod.default ?? mod, then pick off ONLY the whitelist. An exported executor/env/costProbe is never
94
+ // wired — the whitelist is the scope guard. `exports` records the hooks ACTUALLY WIRED for this
95
+ // backend: deriveArtifacts is browser-only, so on the terminal route it is neither wired nor
96
+ // recorded (a scorer that exported ONLY deriveArtifacts there wires nothing and fails closed below,
97
+ // never a silent no-op).
98
+ const picked = (mod.default ?? mod);
99
+ const terminalRoute = backend === "terminal";
100
+ const hooks = {};
101
+ const exports = [];
102
+ if (typeof picked.score === "function") {
103
+ hooks.score = picked.score;
104
+ exports.push("score");
105
+ }
106
+ if (typeof picked.deriveFeedback === "function") {
107
+ hooks.deriveFeedback = picked.deriveFeedback;
108
+ exports.push("deriveFeedback");
109
+ }
110
+ if (!terminalRoute && typeof picked.deriveArtifacts === "function") {
111
+ hooks.deriveArtifacts = picked.deriveArtifacts;
112
+ exports.push("deriveArtifacts");
113
+ }
114
+ if (exports.length === 0) {
115
+ const artifactsOnly = terminalRoute && typeof picked.deriveArtifacts === "function";
116
+ return fail("HUMANISH_LAB_SCORER_NO_HOOKS", artifactsOnly
117
+ ? `review.scorer.ref "${trimmed}" exported only deriveArtifacts, which is browser-only and inert on the terminal route. Export score and/or deriveFeedback for a terminal-product scorer.`
118
+ : `review.scorer.ref "${trimmed}" loaded but exported none of the adopter-scorer hooks (score, deriveFeedback, deriveArtifacts). Export at least one (named, or on a single default object). costProbe is intentionally NOT loadable.`);
119
+ }
120
+ const provenance = {
121
+ schema: "humanish.scorer-provenance.v1",
122
+ ref: relPosix,
123
+ digest,
124
+ source,
125
+ exports
126
+ };
127
+ return { ok: true, hooks, provenance };
128
+ }
129
+ //# sourceMappingURL=adapter-scorer-loader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter-scorer-loader.js","sourceRoot":"","sources":["../src/adapter-scorer-loader.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,8FAA8F;AAC9F,qGAAqG;AACrG,iGAAiG;AACjG,sDAAsD;AACtD,EAAE;AACF,qGAAqG;AACrG,+FAA+F;AAC/F,oGAAoG;AACpG,gGAAgG;AAChG,mGAAmG;AACnG,iGAAiG;AACjG,0FAA0F;AAC1F,4FAA4F;AAC5F,oGAAoG;AACpG,wCAAwC;AAExC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAKzC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAOxD,OAAO,EACL,8BAA8B,EAC9B,wBAAwB,EACzB,MAAM,4BAA4B,CAAC;AA+BpC;2GAC2G;AAC3G,MAAM,uBAAuB,GAA4B,IAAI,GAAG,CAAa;IAC3E,UAAU;IACV,KAAK;IACL,cAAc;IACd,yBAAyB;CAC1B,CAAC,CAAC;AAEH;oGACoG;AACpG,MAAM,iBAAiB,GAAwB,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;AAEhF;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,IAKvC;IACC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACjC,MAAM,IAAI,GAAG,CAAC,IAAgC,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C,eAAe,KAAK,UAAU,CAAC;QACpF,OAAO,IAAI,CACT,8BAA8B,EAC9B,aAAa;YACX,CAAC,CAAC,sBAAsB,OAAO,2JAA2J;YAC1L,CAAC,CAAC,sBAAsB,OAAO,uMAAuM,CACzO,CAAC;IACJ,CAAC;IAED,MAAM,UAAU,GAAwB;QACtC,MAAM,EAAE,+BAA+B;QACvC,GAAG,EAAE,QAAQ;QACb,MAAM;QACN,MAAM;QACN,OAAO;KACR,CAAC;IACF,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AACzC,CAAC"}
@@ -3,7 +3,7 @@ import { type CuaLaneSpec, type LaneRunOutcome } from "./cua-actor-lab.js";
3
3
  import { type LabActorLane, type LabConfig } from "./lab-config.js";
4
4
  import { type ObserverResult } from "./observer.js";
5
5
  import { type SharedWorldLabHooks } from "./shared-world-lab.js";
6
- import { type RunBundle, type RunSubjectProvenance, type SharedWorldStateSnapshot } from "./run.js";
6
+ import { type RunBundle, type RunScorerProvenance, type RunSubjectProvenance, type SharedWorldStateSnapshot } from "./run.js";
7
7
  export declare const CONCURRENT_SHARED_WORLD_LAB_SCHEMA = "humanish.concurrent-shared-world-lab-result.v1";
8
8
  export declare const CONCURRENT_SHARED_WORLD_PROVIDER_METADATA: {
9
9
  readonly mode: "concurrent-shared-world-lab";
@@ -21,6 +21,9 @@ export interface RunConcurrentSharedWorldLabOptions {
21
21
  ok: true;
22
22
  }) => Promise<void> | void;
23
23
  hooks?: SharedWorldLabHooks;
24
+ /** Present only when the browser-route scorer hooks were CONFIG-DECLARED and loaded by the CLI
25
+ * (#316); core-stamped onto the bundle as evidence. Absent for library callers. */
26
+ scorerProvenance?: RunScorerProvenance;
24
27
  }
25
28
  export type ConcurrentSharedWorldLabErrorCode = "HUMANISH_CONCURRENT_SHARED_WORLD_LAB_FAILED" | "HUMANISH_CONCURRENT_SHARED_WORLD_LAB_ACTOR_UNSUPPORTED" | "HUMANISH_CONCURRENT_SHARED_WORLD_LAB_INVALID" | "HUMANISH_CONCURRENT_SHARED_WORLD_LAB_KEYS_MISSING" | "HUMANISH_CONCURRENT_SHARED_WORLD_LAB_SUBJECT_ENV_MISSING" | "HUMANISH_CONCURRENT_SHARED_WORLD_LAB_GETHOST_UNAVAILABLE" | "HUMANISH_CONCURRENT_SHARED_WORLD_LAB_HANDOFF_TIMEOUT";
26
29
  /** The two plane classes of the concurrent shared-world route (#164 phase 2). */
@@ -1305,7 +1305,7 @@ export async function runConcurrentSharedWorld(options) {
1305
1305
  ...(runError === undefined ? {} : { runError })
1306
1306
  });
1307
1307
  const adapterWarnings = [];
1308
- await applyBrowserAdapterHooks({
1308
+ const scorerResult = await applyBrowserAdapterHooks({
1309
1309
  hooks,
1310
1310
  bundle,
1311
1311
  context: {
@@ -1320,7 +1320,8 @@ export async function runConcurrentSharedWorld(options) {
1320
1320
  },
1321
1321
  sanitize: (text) => redactText(scrubKnownValues(text)),
1322
1322
  warnings: adapterWarnings,
1323
- hookLabel: "sharedWorldHooks"
1323
+ hookLabel: "sharedWorldHooks",
1324
+ ...(options.scorerProvenance === undefined ? {} : { scorerProvenance: options.scorerProvenance })
1324
1325
  });
1325
1326
  await writeConcurrentRunArtifacts(bundle, runPaths);
1326
1327
  const observer = await render(cwd, runId, { open: options.open === true });
@@ -1338,7 +1339,7 @@ export async function runConcurrentSharedWorld(options) {
1338
1339
  const swarmRan = !dryRun && actorResults.length === roles.length
1339
1340
  && actorResults.every(actorLanePassed);
1340
1341
  const adapterFailure = adapterScoreFailureMessage(bundle);
1341
- const ok = observer.ok && runError === undefined && (dryRun || swarmRan) && adapterFailure === undefined;
1342
+ const ok = observer.ok && runError === undefined && (dryRun || swarmRan) && adapterFailure === undefined && scorerResult.declaredVerdictFailure === undefined;
1342
1343
  const overlapProven = !dryRun && actorWindowsOverlap(actorResults);
1343
1344
  const roleResults = actorSpecs.map((spec, index) => {
1344
1345
  const result = actorResults[index];