@farmslot/review-dispatch 0.2.0 → 0.2.1
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/CHANGELOG.md +5 -0
- package/dist/artifact-links.d.ts +18 -0
- package/dist/artifact-links.d.ts.map +1 -0
- package/dist/artifact-links.js +72 -0
- package/dist/artifact-links.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/run-results.d.ts +35 -0
- package/dist/run-results.d.ts.map +1 -0
- package/dist/run-results.js +57 -0
- package/dist/run-results.js.map +1 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
- Active-development baseline; add user-facing changes here before release or package publication.
|
|
6
6
|
|
|
7
|
+
## 0.2.1 - 2026-10-17
|
|
8
|
+
|
|
9
|
+
- Share the run results card summary, the acceptance tally, report link resolution, the web-link check and the artifact HTML policy, so Command Center and Companion show the same results for a run's retained output and open the same artifact from a report link. A review-workspace run shows no results card.
|
|
10
|
+
- Align with `@farmslot/adapter-sdk` 0.18.1 and `@farmslot/recipe-runner` 0.39.1 (network capture summaries redact credential-like path segments).
|
|
11
|
+
|
|
7
12
|
## 0.2.0 - 2026-10-17
|
|
8
13
|
|
|
9
14
|
- Make Send back to agent the gate's one primary action when offered, with recovery status and earlier-proof row details.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Retained report documents link to the run's other artifacts by relative path. Command
|
|
3
|
+
* Center and Companion resolve those links, and isolate the document, from one place.
|
|
4
|
+
*/
|
|
5
|
+
/** Retained HTML is an untrusted document: no scripts, no network, data: media only. */
|
|
6
|
+
export declare const ARTIFACT_HTML_CSP = "default-src 'none'; img-src data:; media-src data:; style-src 'unsafe-inline'; font-src data:; base-uri 'none'; form-action 'none'";
|
|
7
|
+
/** An HTML artifact renders as an isolated page rather than as text. */
|
|
8
|
+
export declare function isHtmlArtifactPath(path: string): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* A report link that may open outside the page: an absolute http(s) URL with no credentials.
|
|
11
|
+
* A string check rather than `URL`, so both clients decide alike: React Native's `URL` is not
|
|
12
|
+
* the WHATWG parser.
|
|
13
|
+
*/
|
|
14
|
+
export declare function isExternalWebLink(href: string): boolean;
|
|
15
|
+
/** A link as written in the page, percent-decoded; null when it cannot be decoded. */
|
|
16
|
+
export declare function decodeArtifactLink(href: string): string | null;
|
|
17
|
+
export declare function buildArtifactUrlResolver(artifactPaths: Iterable<string>, toUrl: (artifactPath: string) => string, documentPath?: string): (rawUrl: string) => string | null;
|
|
18
|
+
//# sourceMappingURL=artifact-links.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact-links.d.ts","sourceRoot":"","sources":["../src/artifact-links.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,wFAAwF;AACxF,eAAO,MAAM,iBAAiB,uIACwG,CAAC;AAEvI,wEAAwE;AACxE,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAExD;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAGvD;AAED,sFAAsF;AACtF,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAO9D;AAYD,wBAAgB,wBAAwB,CACtC,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,EAC/B,KAAK,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,MAAM,EACvC,YAAY,CAAC,EAAE,MAAM,GACpB,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAgCnC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Retained report documents link to the run's other artifacts by relative path. Command
|
|
3
|
+
* Center and Companion resolve those links, and isolate the document, from one place.
|
|
4
|
+
*/
|
|
5
|
+
/** Retained HTML is an untrusted document: no scripts, no network, data: media only. */
|
|
6
|
+
export const ARTIFACT_HTML_CSP = "default-src 'none'; img-src data:; media-src data:; style-src 'unsafe-inline'; font-src data:; base-uri 'none'; form-action 'none'";
|
|
7
|
+
/** An HTML artifact renders as an isolated page rather than as text. */
|
|
8
|
+
export function isHtmlArtifactPath(path) {
|
|
9
|
+
return /\.html?$/i.test(path);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A report link that may open outside the page: an absolute http(s) URL with no credentials.
|
|
13
|
+
* A string check rather than `URL`, so both clients decide alike: React Native's `URL` is not
|
|
14
|
+
* the WHATWG parser.
|
|
15
|
+
*/
|
|
16
|
+
export function isExternalWebLink(href) {
|
|
17
|
+
const authority = /^https?:\/\/([^/?#]*)/i.exec(href)?.[1] ?? '';
|
|
18
|
+
return authority !== '' && !authority.includes('@');
|
|
19
|
+
}
|
|
20
|
+
/** A link as written in the page, percent-decoded; null when it cannot be decoded. */
|
|
21
|
+
export function decodeArtifactLink(href) {
|
|
22
|
+
try {
|
|
23
|
+
return decodeURIComponent(href);
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
if (error instanceof URIError)
|
|
27
|
+
return null;
|
|
28
|
+
throw error;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function normalizeArtifactCandidate(rawUrl) {
|
|
32
|
+
const trimmed = rawUrl.trim();
|
|
33
|
+
if (!trimmed)
|
|
34
|
+
return null;
|
|
35
|
+
if (/^(?:[a-z][a-z0-9+.-]*:|\/\/|#)/i.test(trimmed))
|
|
36
|
+
return null;
|
|
37
|
+
const [pathPart] = trimmed.split(/[?#]/, 1);
|
|
38
|
+
const withoutDot = pathPart.replace(/^\.\/+/, '');
|
|
39
|
+
if (!withoutDot || withoutDot.split(/[\\/]+/).includes('..'))
|
|
40
|
+
return null;
|
|
41
|
+
return withoutDot;
|
|
42
|
+
}
|
|
43
|
+
export function buildArtifactUrlResolver(artifactPaths, toUrl, documentPath) {
|
|
44
|
+
const byPath = new Map();
|
|
45
|
+
const byBasename = new Map();
|
|
46
|
+
for (const artifactPath of artifactPaths) {
|
|
47
|
+
const normalized = artifactPath.replace(/\\/g, '/').replace(/^\.\/+/, '');
|
|
48
|
+
byPath.set(normalized, artifactPath);
|
|
49
|
+
const basename = normalized.split('/').pop();
|
|
50
|
+
if (basename) {
|
|
51
|
+
const previous = byBasename.get(basename);
|
|
52
|
+
byBasename.set(basename, previous === undefined || previous === artifactPath ? artifactPath : null);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return (rawUrl) => {
|
|
56
|
+
const candidate = normalizeArtifactCandidate(rawUrl);
|
|
57
|
+
if (!candidate)
|
|
58
|
+
return null;
|
|
59
|
+
const directory = documentPath?.replace(/\\/g, '/').split('/').slice(0, -1).join('/');
|
|
60
|
+
const artifactPath = (directory ? byPath.get(`${directory}/${candidate}`) : undefined) ??
|
|
61
|
+
byPath.get(candidate) ??
|
|
62
|
+
(!candidate.includes('/') ? byBasename.get(candidate) : undefined);
|
|
63
|
+
// Older frozen packages may omit media from their inventory. Explicit task
|
|
64
|
+
// artifact paths still go through the gateway's authenticated, confined route.
|
|
65
|
+
return artifactPath
|
|
66
|
+
? toUrl(artifactPath)
|
|
67
|
+
: candidate.startsWith('artifacts/')
|
|
68
|
+
? toUrl(candidate)
|
|
69
|
+
: null;
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=artifact-links.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact-links.js","sourceRoot":"","sources":["../src/artifact-links.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,wFAAwF;AACxF,MAAM,CAAC,MAAM,iBAAiB,GAC5B,oIAAoI,CAAC;AAEvI,wEAAwE;AACxE,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC7C,OAAO,WAAW,CAAC,IAAI,C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AC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QACrE,2EAA2E;QAC3E,+EAA+E;QAC/E,OAAO,YAAY;YACjB,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC;YACrB,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC,YAAY,CAAC;gBAClC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC;gBAClB,CAAC,CAAC,IAAI,CAAC;IACb,CAAC,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
export * from './account-session.js';
|
|
2
|
+
export * from './artifact-links.js';
|
|
2
3
|
export * from './catalog.js';
|
|
3
4
|
export * from './checklist-progress.js';
|
|
4
5
|
export * from './execution.js';
|
|
5
6
|
export * from './provenance.js';
|
|
6
7
|
export * from './publication-gate.js';
|
|
8
|
+
export * from './run-results.js';
|
|
7
9
|
export * from './types.js';
|
|
8
10
|
export * from './validation.js';
|
|
9
11
|
export * from './view-model.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
export * from './account-session.js';
|
|
2
|
+
export * from './artifact-links.js';
|
|
2
3
|
export * from './catalog.js';
|
|
3
4
|
export * from './checklist-progress.js';
|
|
4
5
|
export * from './execution.js';
|
|
5
6
|
export * from './provenance.js';
|
|
6
7
|
export * from './publication-gate.js';
|
|
8
|
+
export * from './run-results.js';
|
|
7
9
|
export * from './types.js';
|
|
8
10
|
export * from './validation.js';
|
|
9
11
|
export * from './view-model.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The run results view model that Command Center and Companion share: the
|
|
3
|
+
* results card for a run's retained output (a QA run's report among them) and
|
|
4
|
+
* the acceptance tally above its per-AC and per-case rows. Each client only
|
|
5
|
+
* renders these; neither recomputes a label, count or copy line.
|
|
6
|
+
*/
|
|
7
|
+
import type { EvidenceReviewModel } from '@farmslot/adapter-sdk/evidence';
|
|
8
|
+
import { type AcceptanceCriterionRef, type AcceptanceStatusLedger, type OutputReviewPayload, type Run, type RunDecision, type RunStep } from '@farmslot/protocol';
|
|
9
|
+
export type OutputReviewDecision = RunDecision & {
|
|
10
|
+
payload: OutputReviewPayload;
|
|
11
|
+
};
|
|
12
|
+
/** The run's open output review, whose report snapshot run detail checks the retained report against. */
|
|
13
|
+
export declare function pendingOutputReview(run: Pick<Run, 'decisions'> | null | undefined): OutputReviewDecision | undefined;
|
|
14
|
+
export interface AcceptancePanelPresentation {
|
|
15
|
+
/** Assessment progress stays distinct from how many criteria are proven. */
|
|
16
|
+
counts: string;
|
|
17
|
+
/** Long-form tally for the header tooltip or accessibility label, including the zero buckets. */
|
|
18
|
+
countsTooltip: string;
|
|
19
|
+
/** True while any criterion is unproven — the panel opens in that case. */
|
|
20
|
+
hasOpenCriteria: boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare function acceptancePanelPresentation(ledger: AcceptanceStatusLedger, criteria?: ReadonlyArray<AcceptanceCriterionRef>, model?: EvidenceReviewModel): AcceptancePanelPresentation;
|
|
23
|
+
export interface RunResultsSummary {
|
|
24
|
+
shouldRender: boolean;
|
|
25
|
+
completeStep: RunStep | undefined;
|
|
26
|
+
title: string;
|
|
27
|
+
badge: string;
|
|
28
|
+
status: RunStep['status'];
|
|
29
|
+
copy: string;
|
|
30
|
+
showEvalPackageHint: boolean;
|
|
31
|
+
emptyMessage: string;
|
|
32
|
+
}
|
|
33
|
+
/** The results card for a run, given how many output artifacts the client collected. */
|
|
34
|
+
export declare function runResultsSummary(run: Run, artifactCount: number): RunResultsSummary;
|
|
35
|
+
//# sourceMappingURL=run-results.d.ts.map
|
|
@@ -0,0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EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,GAAG,iBAAiB,CAiCpF"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The run results view model that Command Center and Companion share: the
|
|
3
|
+
* results card for a run's retained output (a QA run's report among them) and
|
|
4
|
+
* the acceptance tally above its per-AC and per-case rows. Each client only
|
|
5
|
+
* renders these; neither recomputes a label, count or copy line.
|
|
6
|
+
*/
|
|
7
|
+
import { summarizeAcceptanceStatus, } from '@farmslot/protocol';
|
|
8
|
+
function isPendingOutputReview(decision) {
|
|
9
|
+
return !decision.resolvedAt && decision.payload?.kind === 'output-review';
|
|
10
|
+
}
|
|
11
|
+
/** The run's open output review, whose report snapshot run detail checks the retained report against. */
|
|
12
|
+
export function pendingOutputReview(run) {
|
|
13
|
+
return run?.decisions.find(isPendingOutputReview);
|
|
14
|
+
}
|
|
15
|
+
export function acceptancePanelPresentation(ledger, criteria = ledger.criteria, model) {
|
|
16
|
+
const summary = model?.summary ?? summarizeAcceptanceStatus(ledger, criteria);
|
|
17
|
+
const assessed = summary.total - summary.unrecorded;
|
|
18
|
+
return {
|
|
19
|
+
counts: `${assessed}/${summary.total} assessed${assessed ? ` · ${summary.proven} proven` : ''}`,
|
|
20
|
+
countsTooltip: `proven ${summary.proven} · weak ${summary.weak} · missing ${summary.missing} · ` +
|
|
21
|
+
`untestable ${summary.untestable} · not assessed ${summary.unrecorded}`,
|
|
22
|
+
hasOpenCriteria: summary.proven + summary.untestable < summary.total,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
/** The results card for a run, given how many output artifacts the client collected. */
|
|
26
|
+
export function runResultsSummary(run, artifactCount) {
|
|
27
|
+
const isReplay = run.lane === 'comparison' || Boolean(run.startRef) || Boolean(run.engineState?.evalExperiment);
|
|
28
|
+
const completeStep = run.steps.find((step) => step.name === 'complete');
|
|
29
|
+
const sourceRef = run.startRef?.resolvedSha ?? run.startRef?.requestedRef;
|
|
30
|
+
const hasOutput = Boolean(run.output);
|
|
31
|
+
return {
|
|
32
|
+
// A review-workspace run shows its review process instead of a results card.
|
|
33
|
+
shouldRender: !run.reviewWorkspaceTarget &&
|
|
34
|
+
(hasOutput || run.completionPolicy === 'artifact-only' || isReplay || artifactCount > 0),
|
|
35
|
+
completeStep,
|
|
36
|
+
title: isReplay ? 'Replay evidence' : 'Run results',
|
|
37
|
+
badge: isReplay ? 'comparison · artifact-only' : (run.metrics.outcome ?? run.status),
|
|
38
|
+
status: completeStep?.status ??
|
|
39
|
+
(run.status === 'done' ? 'done' : run.status === 'failed' ? 'failed' : 'pending'),
|
|
40
|
+
copy: run.output?.closedAt
|
|
41
|
+
? `Execution closed. The recorded result remains ${run.metrics.outcome ?? 'unknown'}; closing is not validation or release approval.`
|
|
42
|
+
: run.output?.workerFinished
|
|
43
|
+
? 'The worker has finished. Read its findings and coverage gaps before reviewing the output. Reviewing does not change the verdict or publish anything.'
|
|
44
|
+
: hasOutput
|
|
45
|
+
? 'Files retained from the worker. Execution is still in progress.'
|
|
46
|
+
: run.startRef
|
|
47
|
+
? `This replay started from ${sourceRef ?? 'the selected ref'} and stopped at artifacts. Prior-run replay comparisons are represented by eval Reference and Candidate packages, not run parentage; no PR was published.`
|
|
48
|
+
: isReplay
|
|
49
|
+
? 'This comparison run stops at artifacts instead of publishing a PR. Use these captured files as the run output evidence.'
|
|
50
|
+
: 'Final artifacts captured by the worker.',
|
|
51
|
+
showEvalPackageHint: Boolean(run.startRef),
|
|
52
|
+
emptyMessage: run.output?.captureError
|
|
53
|
+
? `Could not retrieve worker files: ${run.output.captureError}`
|
|
54
|
+
: 'No output files have been retrieved yet.',
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=run-results.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-results.js","sourceRoot":"","sources":["../src/run-results.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAOL,yBAAyB,GAC1B,MAA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AC,CAAC,QAAQ;4BACR,CAAC,CAAC,yHAAyH;4BAC3H,CAAC,CAAC,yCAAyC;QACrD,mBAAmB,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;QAC1C,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY;YACpC,CAAC,CAAC,oCAAoC,GAAG,CAAC,MAAM,CAAC,YAAY,EAAE;YAC/D,CAAC,CAAC,0CAA0C;KAC/C,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farmslot/review-dispatch",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Shared review and dispatch selection, validation, and view model",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"prepublishOnly": "node ../../scripts/quality/check-farmslot-package-readiness.mjs --publish --packages @farmslot/review-dispatch"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@farmslot/adapter-sdk": "0.18.
|
|
35
|
+
"@farmslot/adapter-sdk": "0.18.1",
|
|
36
36
|
"@farmslot/protocol": "0.54.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|