@farmslot/review-dispatch 0.1.1 → 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 CHANGED
@@ -2,22 +2,29 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
- - Share publication decision status, AC judgment rows and attestation availability across operator clients.
5
+ - Active-development baseline; add user-facing changes here before release or package publication.
6
6
 
7
- - Use gateway device-session expiry in clients instead of the temporary local sign-in lifetime.
7
+ ## 0.2.1 - 2026-10-17
8
8
 
9
- - Document modelPickerState as the renderer API and remove the unused modelChoices method.
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).
10
11
 
11
- - Share model filtering and custom-model detection between the web and native execution pickers.
12
+ ## 0.2.0 - 2026-10-17
12
13
 
14
+ - Make Send back to agent the gate's one primary action when offered, with recovery status and earlier-proof row details.
15
+ - Withhold publication approval while review findings or a fix remain unresolved, and show the shared review status until the fixed head passes review.
16
+ - Share the gateway no-code-review warning without disabling publication approval.
17
+ - Share declared gate criteria across client loading layouts.
18
+ - Share publication decision status, AC judgment rows and attestation availability across operator clients.
19
+ - Use gateway device-session expiry in clients instead of the temporary local sign-in lifetime.
20
+ - Document modelPickerState as the renderer API and remove the unused modelChoices method.
21
+ - Share model filtering and custom-model detection between the web and native execution pickers.
13
22
  - Share compact checklist-progress presentation across operator views.
14
-
15
23
  - Share client sign-in expiry and sign-out confirmation across operator apps.
16
-
17
24
  - Resolve review mode once across explicit selections, recorded run/PR options and project defaults.
18
-
19
25
  - Keep project review policy fields out of review selections while preserving configured defaults.
20
26
  - Add shared review and dispatch selection state, capability defaults, strict validators and ordered request serialization for web, mobile, CLI and gateway consumers, preserving 20-row PR execution profiles and explicit saved defaults.
27
+ - Share AC row state and judgment controls across publication, preview and evidence views in both clients, with qualified pipeline verification for every visual AC.
21
28
 
22
29
  ## 0.1.1 - 2026-10-16
23
30
 
@@ -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,CAAC,IAAI,CAAC,CAAC;AAChC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,MAAM,SAAS,GAAG,wBAAwB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACjE,OAAO,SAAS,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,GAAG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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';
@@ -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"}
@@ -1,38 +1,75 @@
1
- import type { EvidenceReviewJudgmentRow } from '@farmslot/adapter-sdk/evidence';
2
- import { type AcceptanceCriterionView, type DecisionAction, type RunGateReadiness } from '@farmslot/protocol';
1
+ import type { EvidenceReviewClaim, EvidenceReviewJudgmentRow } from '@farmslot/adapter-sdk/evidence';
2
+ import { type AcceptanceCriterionRef, type AcceptanceCriterionView, type DecisionAction, type ReadyGatePayload, type ReadyGatePrPackage, type ReviewSummary, type Run, type RunGateReadiness } from '@farmslot/protocol';
3
3
  export interface PublicationGateAction extends DecisionAction {
4
4
  disabledReason?: string | null;
5
5
  }
6
6
  export interface PublicationGateClaim extends AcceptanceCriterionView {
7
7
  reviewLabels?: readonly string[];
8
+ proofKinds?: EvidenceReviewClaim['proofKinds'];
9
+ evidenceLinked?: boolean;
10
+ retained?: EvidenceReviewClaim['retained'];
8
11
  }
9
12
  export interface PublicationGateInput {
13
+ run?: Pick<Run, 'status' | 'agentContexts' | 'engineState'> | null;
10
14
  actions: readonly PublicationGateAction[];
11
15
  claims?: readonly PublicationGateClaim[];
12
16
  judgmentRows?: readonly EvidenceReviewJudgmentRow[];
13
17
  pendingVisualClaimIds?: readonly string[];
14
18
  readiness?: RunGateReadiness;
19
+ reviewSummary?: ReviewSummary;
15
20
  blockedReason?: string;
16
21
  attestationReason?: string;
17
22
  resolved?: boolean;
18
23
  attesting?: boolean;
19
24
  }
25
+ /** Declared labels size both clients; older gates retain their recorded criterion rows. */
26
+ export declare function publicationGateCriteria(payload: Pick<ReadyGatePayload, 'acceptanceCriteria' | 'acceptanceStatus'> | undefined): readonly AcceptanceCriterionRef[];
27
+ export type AcceptanceClaimTone = 'proven' | 'verified' | 'checked' | 'issue' | 'pending' | 'untestable';
28
+ export interface VisualJudgmentFeedback {
29
+ claimId: string;
30
+ phase: 'saving' | 'refreshing' | 'error';
31
+ message?: string;
32
+ }
33
+ export interface AcceptanceClaimRow {
34
+ id: string;
35
+ text: string;
36
+ state: string;
37
+ tone: AcceptanceClaimTone;
38
+ detail: string;
39
+ pending: boolean;
40
+ source?: PublicationGateClaim;
41
+ judgment?: EvidenceReviewJudgmentRow;
42
+ }
43
+ /** One AC presentation for publication gates, previews and evidence panels. */
44
+ export declare function acceptanceClaimRows(input: Pick<PublicationGateInput, 'claims' | 'judgmentRows' | 'pendingVisualClaimIds'>): AcceptanceClaimRow[];
45
+ /** An optional review policy never waives findings from a review that actually ran. */
46
+ export declare function publicationReviewBlockingReason(run: Pick<Run, 'status' | 'agentContexts' | 'engineState'>, prepared?: Pick<ReadyGatePrPackage, 'headSha'> | null): string | undefined;
20
47
  /** Presentation only: action availability and evidence judgments remain gateway-owned. */
21
48
  export declare function publicationGateView(input: PublicationGateInput): {
22
- claims: {
23
- judgment: EvidenceReviewJudgmentRow | undefined;
24
- id: string;
25
- text: string;
26
- state: string;
27
- pending: boolean;
28
- }[];
49
+ warnings: string[];
50
+ claims: AcceptanceClaimRow[];
29
51
  status: string;
30
52
  blockedReason: string;
31
53
  approval: PublicationGateAction | null;
54
+ sendBack: PublicationGateAction | null;
32
55
  attestation: PublicationGateAction | null;
33
56
  refreshRequired: boolean;
34
57
  secondaryActions: PublicationGateAction[];
35
58
  };
36
59
  export type PublicationGateView = ReturnType<typeof publicationGateView>;
37
60
  export declare function visualPrevalidationLabel(row?: Pick<EvidenceReviewJudgmentRow, 'prevalidation'>): string;
61
+ /** The same evidence-first navigation on desktop and Companion. */
62
+ export declare const PUBLICATION_GATE_TABS: readonly [{
63
+ readonly id: "evidence";
64
+ readonly label: "Evidence";
65
+ }, {
66
+ readonly id: "criteria";
67
+ readonly label: "Criteria";
68
+ }, {
69
+ readonly id: "pr-preview";
70
+ readonly label: "Package";
71
+ }, {
72
+ readonly id: "quality";
73
+ readonly label: "Checks & history";
74
+ }];
38
75
  //# sourceMappingURL=publication-gate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"publication-gate.d.ts","sourceRoot":"","sources":["../src/publication-gate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAChF,OAAO,EACL,KAAK,uBAAuB,EAE5B,KAAK,cAAc,EAGnB,KAAK,gBAAgB,EACtB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,WAAW,qBAAsB,SAAQ,cAAc;IAC3D,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED,MAAM,WAAW,oBAAqB,SAAQ,uBAAuB;IACnE,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAClC;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,SAAS,qBAAqB,EAAE,CAAC;IAC1C,MAAM,CAAC,EAAE,SAAS,oBAAoB,EAAE,CAAC;IACzC,YAAY,CAAC,EAAE,SAAS,yBAAyB,EAAE,CAAC;IACpD,qBAAqB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1C,SAAS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C,oBAAoB,EAAE,QAAQ,GAAG,cAAc,GAAG,uBAAuB,CAAC,GACrF,kBAAkB,EAAE,CAqEtB;AAED,uFAAuF;AACvF,wBAAgB,+BAA+B,CAC7C,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,QAAQ,GAAG,eAAe,GAAG,aAAa,CAAC,EAC1D,QAAQ,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,SAAS,CAAC,GAAG,IAAI,GACpD,MAAM,GAAG,SAAS,CA2CpB;AAED,0FAA0F;AAC1F,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,oBAAoB;;;;;;;;;;EA0F9D;AAED,MAAM,MAAM,mBAAmB,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEzE,wBAAgB,wBAAwB,CACtC,GAAG,CAAC,EAAE,IAAI,CAAC,yBAAyB,EAAE,eAAe,CAAC,GACrD,MAAM,CAER;AAED,mEAAmE;AACnE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;EAKxB,CAAC"}
@@ -1,33 +1,130 @@
1
- import { APPROVE_PUBLISH_EVIDENCE_ATTESTED_ACTION, evidenceAttestationAvailable, isValidEvidenceAttestationReason, } from '@farmslot/protocol';
2
- /** Presentation only: action availability and evidence judgments remain gateway-owned. */
3
- export function publicationGateView(input) {
1
+ import { acceptanceCriterionId, APPROVE_PUBLISH_EVIDENCE_ATTESTED_ACTION, evidenceAttestationAvailable, isPublishApprovalAction, isValidEvidenceAttestationReason, latestReview, SEND_BACK_TO_AGENT_ACTION, } from '@farmslot/protocol';
2
+ /** Declared labels size both clients; older gates retain their recorded criterion rows. */
3
+ export function publicationGateCriteria(payload) {
4
+ if (payload?.acceptanceCriteria?.length)
5
+ return payload.acceptanceCriteria.map((text, index) => ({
6
+ id: acceptanceCriterionId(index),
7
+ text,
8
+ }));
9
+ return payload?.acceptanceStatus?.criteria ?? [];
10
+ }
11
+ /** One AC presentation for publication gates, previews and evidence panels. */
12
+ export function acceptanceClaimRows(input) {
4
13
  const pending = new Set(input.pendingVisualClaimIds ?? []);
5
- const claims = (input.claims ?? input.judgmentRows?.map((row) => row.claim) ?? []).map((claim) => ({
14
+ const claims = (input.claims ??
15
+ input.judgmentRows?.map((row) => row.claim) ??
16
+ []).map((claim) => ({
17
+ source: claim,
6
18
  judgment: input.judgmentRows?.find((row) => row.claim.id === claim.id),
7
19
  id: claim.id,
8
20
  text: claim.text,
9
- state: claim.status?.verdict === 'failed' && claim.reviewLabels?.length
21
+ state: claim.status?.verdict === 'failed'
10
22
  ? 'Issue'
11
- : pending.has(claim.id)
12
- ? 'Needs judgment'
13
- : claim.reviewLabels?.length
14
- ? 'Judged'
15
- : claim.status?.verdict === 'proven'
16
- ? 'Proven'
17
- : (claim.status?.verdict ?? 'Not assessed'),
23
+ : pending.has(claim.id) || claim.status?.verdict === 'awaiting-review'
24
+ ? 'Needs a check'
25
+ : claim.status?.verdict === 'proven'
26
+ ? claim.proofKinds?.includes('person-reviewed')
27
+ ? 'Checked'
28
+ : claim.proofKinds?.includes('agent-reviewed')
29
+ ? 'Verified by agent'
30
+ : 'Proven'
31
+ : (claim.status?.verdict ??
32
+ ('evidenceLinked' in claim && claim.evidenceLinked
33
+ ? 'Evidence linked'
34
+ : 'Not assessed')),
35
+ tone: 'pending',
36
+ detail: '',
18
37
  pending: pending.has(claim.id),
19
38
  }));
39
+ for (const row of claims) {
40
+ row.tone =
41
+ row.state === 'Issue'
42
+ ? 'issue'
43
+ : row.state === 'Checked'
44
+ ? 'checked'
45
+ : row.state === 'Verified by agent'
46
+ ? 'verified'
47
+ : row.state === 'Proven'
48
+ ? 'proven'
49
+ : row.state === 'untestable'
50
+ ? 'untestable'
51
+ : 'pending';
52
+ if (row.tone === 'untestable')
53
+ row.state = 'Untestable';
54
+ const retained = row.source?.retained ?? row.judgment?.claim.retained;
55
+ row.detail = [
56
+ retained
57
+ ? `Earlier proof${retained.revision ? ` · ${retained.revision.slice(0, 7)}` : ''}`
58
+ : undefined,
59
+ row.source?.reviewLabels?.join(' · '),
60
+ row.judgment?.prevalidation?.reason,
61
+ ]
62
+ .filter(Boolean)
63
+ .join(' · ');
64
+ }
20
65
  for (const id of pending) {
21
66
  if (!claims.some((claim) => claim.id === id))
22
67
  claims.push({
23
68
  id,
69
+ source: undefined,
24
70
  judgment: undefined,
25
71
  text: 'Review the recorded criterion.',
26
- state: 'Needs judgment',
72
+ state: 'Needs a check',
73
+ tone: 'pending',
74
+ detail: '',
27
75
  pending: true,
28
76
  });
29
77
  }
30
- const offeredNormal = input.actions.find((action) => ['approve-publish', 'approve-publish-evidence-refresh', 'ready'].includes(action.id));
78
+ return claims;
79
+ }
80
+ /** An optional review policy never waives findings from a review that actually ran. */
81
+ export function publicationReviewBlockingReason(run, prepared) {
82
+ const reviews = run.engineState?.publishGate?.reviews ?? [];
83
+ // Continuations replace the same row. Its attempts retain the findings even
84
+ // when a blocked fix changes the aggregate verdict to failed.
85
+ const latest = latestReview(reviews);
86
+ const head = prepared?.headSha ?? latest?.reviewedHeadSha ?? latest?.reviewSnapshot?.headSha;
87
+ let currentHeadFindings = 0;
88
+ let count = 0;
89
+ for (const review of reviews) {
90
+ for (const entry of [...(review.attempts ?? []), review]) {
91
+ const findings = Math.max(entry.unresolvedCount ?? 0, entry.issues?.length ?? 0);
92
+ if (entry.verdict === 'issues' && findings > 0) {
93
+ count = findings;
94
+ const issueHead = entry === review
95
+ ? (review.reviewedHeadSha ?? review.reviewSnapshot?.headSha)
96
+ : entry.reviewSnapshot?.headSha;
97
+ if (head && issueHead === head)
98
+ currentHeadFindings = Math.max(currentHeadFindings, findings);
99
+ }
100
+ }
101
+ if (review.verdict === 'pass' &&
102
+ (!prepared || (review.reviewedHeadSha ?? review.reviewSnapshot?.headSha) === prepared.headSha))
103
+ count = 0;
104
+ }
105
+ // A different verdict on unchanged code does not prove the reported fix.
106
+ count = Math.max(count, currentHeadFindings);
107
+ const fixing = run.status === 'fixing' ||
108
+ run.agentContexts?.some((context) => context.role === 'review-fix' &&
109
+ ['launching', 'working', 'waiting'].includes(context.status));
110
+ if (fixing)
111
+ return count
112
+ ? `Review found ${count} issue${count === 1 ? '' : 's'}, fix in progress.`
113
+ : 'Review fix in progress.';
114
+ if (count)
115
+ return `Review found ${count} issue${count === 1 ? '' : 's'}. Fix and pass review before publishing.`;
116
+ return undefined;
117
+ }
118
+ /** Presentation only: action availability and evidence judgments remain gateway-owned. */
119
+ export function publicationGateView(input) {
120
+ const pending = new Set(input.pendingVisualClaimIds ?? []);
121
+ const claims = acceptanceClaimRows(input);
122
+ const reviewBlock = (input.run && publicationReviewBlockingReason(input.run)) ||
123
+ input.readiness?.reasons.find((reason) => reason.code === 'review-fix-required')?.message;
124
+ const actions = reviewBlock || input.resolved
125
+ ? input.actions.filter((action) => !isPublishApprovalAction(action.id))
126
+ : input.actions;
127
+ const offeredNormal = actions.find((action) => ['approve-publish', 'approve-publish-evidence-refresh', 'ready'].includes(action.id));
31
128
  const normal = offeredNormal &&
32
129
  input.readiness?.state === 'not-ready' &&
33
130
  offeredNormal.id !== 'approve-publish-evidence-refresh'
@@ -39,7 +136,13 @@ export function publicationGateView(input) {
39
136
  'Publication prerequisites are not satisfied.',
40
137
  }
41
138
  : offeredNormal;
42
- const offeredAttestation = input.actions.find((action) => action.id === APPROVE_PUBLISH_EVIDENCE_ATTESTED_ACTION);
139
+ const offeredAttestation = actions.find((action) => action.id === APPROVE_PUBLISH_EVIDENCE_ATTESTED_ACTION);
140
+ // An Issue blocks publication; returning it to the agent is the gate's one primary action.
141
+ const sendBack = input.resolved
142
+ ? undefined
143
+ : actions.find((action) => action.id === SEND_BACK_TO_AGENT_ACTION);
144
+ const repair = input.run?.engineState?.publishGate?.visualRepairs?.at(-1);
145
+ const sendBackRecovery = sendBack && repair && repair.status !== 'completed' ? repair.reason : undefined;
43
146
  const attestation = !input.resolved &&
44
147
  !pending.size &&
45
148
  offeredAttestation &&
@@ -47,37 +150,54 @@ export function publicationGateView(input) {
47
150
  evidenceAttestationAvailable(input.readiness)
48
151
  ? offeredAttestation
49
152
  : null;
50
- const approval = normal && !normal.disabledReason
51
- ? normal
52
- : ((input.attesting ? attestation : null) ?? normal ?? null);
153
+ const approval = sendBack
154
+ ? null
155
+ : normal && !normal.disabledReason
156
+ ? normal
157
+ : ((input.attesting ? attestation : null) ?? normal ?? null);
53
158
  const refreshRequired = input.readiness?.reasons.some((reason) => reason.code === 'evidence-override-refresh-required') ?? false;
54
159
  const blockedReason = input.resolved
55
160
  ? 'This decision is resolved.'
56
- : refreshRequired
57
- ? 'Refresh package'
58
- : pending.size
59
- ? `${pending.size} ${pending.size === 1 ? 'criterion needs' : 'criteria need'} your visual judgment`
60
- : approval?.disabledReason ||
61
- (!approval
62
- ? attestation
63
- ? 'Choose evidence attestation.'
64
- : input.blockedReason || 'Publication prerequisites are not satisfied.'
65
- : '');
161
+ : reviewBlock
162
+ ? reviewBlock
163
+ : refreshRequired
164
+ ? 'Refresh package'
165
+ : pending.size
166
+ ? `${pending.size} ${pending.size === 1 ? 'criterion needs' : 'criteria need'} a check`
167
+ : approval?.disabledReason ||
168
+ (!approval
169
+ ? attestation
170
+ ? 'Choose evidence attestation.'
171
+ : input.blockedReason || 'Publication prerequisites are not satisfied.'
172
+ : '');
66
173
  const reasonRequired = approval?.id === APPROVE_PUBLISH_EVIDENCE_ATTESTED_ACTION;
67
174
  return {
175
+ warnings: input.reviewSummary?.noCodeReview ? ['No code review ran'] : [],
68
176
  claims,
69
- status: blockedReason || (attestation ? 'Evidence attestation is available.' : 'Ready to publish'),
177
+ status: sendBack
178
+ ? (sendBackRecovery ?? 'Issues found')
179
+ : blockedReason || (attestation ? 'Evidence attestation is available.' : 'Ready to publish'),
70
180
  blockedReason: blockedReason ||
71
181
  (reasonRequired && !isValidEvidenceAttestationReason(input.attestationReason)
72
182
  ? 'Enter an attestation reason before approving.'
73
183
  : ''),
74
184
  approval,
185
+ sendBack: sendBack ?? null,
75
186
  attestation,
76
187
  refreshRequired,
77
- secondaryActions: input.actions.filter((action) => action.id !== normal?.id && action.id !== offeredAttestation?.id),
188
+ secondaryActions: actions.filter((action) => action.id !== normal?.id &&
189
+ action.id !== offeredAttestation?.id &&
190
+ action.id !== sendBack?.id),
78
191
  };
79
192
  }
80
193
  export function visualPrevalidationLabel(row) {
81
194
  return `Agent review · ${row?.prevalidation ? (row.prevalidation.verdict === 'confirmed' ? 'Looks right' : 'Issue') : 'Not recorded'}`;
82
195
  }
196
+ /** The same evidence-first navigation on desktop and Companion. */
197
+ export const PUBLICATION_GATE_TABS = [
198
+ { id: 'evidence', label: 'Evidence' },
199
+ { id: 'criteria', label: 'Criteria' },
200
+ { id: 'pr-preview', label: 'Package' },
201
+ { id: 'quality', label: 'Checks & history' },
202
+ ];
83
203
  //# sourceMappingURL=publication-gate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"publication-gate.js","sourceRoot":"","sources":["../src/publication-gate.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,wCAAwC,EAExC,4BAA4B,EAC5B,gCAAgC,GAEjC,MAAM,oBAAoB,CAAC;AAsB5B,0FAA0F;AAC1F,MAAM,UAAU,mBAAmB,CAAC,KAA2B;IAC7D,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,qBAAqB,IAAI,EAAE,CAAC,CAAC;IAC3D,MAAM,MAAM,GAAG,CAAC,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CACpF,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACV,QAAQ,EAAE,KAAK,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,KAAK,KAAK,CAAC,EAAE,CAAC;QACtE,EAAE,EAAE,KAAK,CAAC,EAAE;QACZ,IAAI,EAAE,KAAK,CAAC,IAAI;Q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C;YACtC,CAAC,CAAC,aAAa,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,oCAAoC,CAAC,CAAC,CAAC,kBAAkB,CAAC;QAC9F,aAAa,EACX,aAAa;YACb,CAAC,cAAc,IAAI,CAAC,gCAAgC,CAAC,KAAK,CAAC,iBAAiB,CAAC;gBAC3E,CAAC,CAAC,+CAA+C;gBACjD,CAAC,CAAC,EAAE,CAAC;QACT,QAAQ;QACR,QAAQ,EAAE,QAAQ,IAAI,IAAI;QAC1B,WAAW;QACX,eAAe;QACf,gBAAgB,EAAE,OAAO,CAAC,MAAM,CAC9B,CAAC,MAAM,EAAE,EAAE,CACT,MAAM,CAAC,EAAE,KAAK,MAAM,EAAE,EAAE;YACxB,MAAM,CAAC,EAAE,KAAK,kBAAkB,EAAE,EAAE;YACpC,MAAM,CAAC,EAAE,KAAK,QAAQ,EAAE,EAAE,CAC7B;KACF,CAAC;AACJ,CAAC;AAID,MAAM,UAAU,wBAAwB,CACtC,GAAsD;IAEtD,OAAO,kBAAkB,GAAG,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,OAAO,KAAK,WAAW,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,cAAc,EAAE,CAAC;AACzI,CAAC;AAED,mEAAmE;AACnE,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;IACrC,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;IACrC,EAAE,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,SAAS,EAAE;IACtC,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,kBAAkB,EAAE;CACpC,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 +1 @@
1
+ {"version":3,"file":"run-results.d.ts","sourceRoot":"","sources":["../src/run-results.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,GAAG,EACR,KAAK,WAAW,EAChB,KAAK,OAAO,EAEb,MAAM,oBAAoB,CAAC;AAE5B,MAAM,MAAM,oBAAoB,GAAG,WAAW,GAAG;IAAE,OAAO,EAAE,mBAAmB,CAAA;CAAE,CAAC;AAMlF,yGAAyG;AACzG,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,WAAW,CAAC,GAAG,IAAI,GAAG,SAAS,GAC7C,oBAAoB,GAAG,SAAS,CAElC;AAED,MAAM,WAAW,2BAA2B;IAC1C,4EAA4E;IAC5E,MAAM,EAAE,MAAM,CAAC;IACf,iGAAiG;IACjG,aAAa,EAAE,MAAM,CAAC;IACtB,2EAA2E;IAC3E,eAAe,EAAE,OAAO,CAAC;CAC1B;AAED,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,sBAAsB,EAC9B,QAAQ,GAAE,aAAa,CAAC,sBAAsB,CAAmB,EACjE,KAAK,CAAC,EAAE,mBAAmB,GAC1B,2BAA2B,CAU7B;AAED,MAAM,WAAW,iBAAiB;IAChC,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,OAAO,GAAG,SAAS,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,mBAAmB,EAAE,OAAO,CAAC;IAC7B,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,wFAAwF;AACxF,wBAAgB,iBAAiB,CAAC,GAAG,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,MAAM,oBAAoB,CAAC;AAI5B,SAAS,qBAAqB,CAAC,QAAqB;IAClD,OAAO,CAAC,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,OAAO,EAAE,IAAI,KAAK,eAAe,CAAC;AAC5E,CAAC;AAED,yGAAyG;AACzG,MAAM,UAAU,mBAAmB,CACjC,GAA8C;IAE9C,OAAO,GAAG,EAAE,SAAS,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;AACpD,CAAC;AAWD,MAAM,UAAU,2BAA2B,CACzC,MAA8B,EAC9B,WAAkD,MAAM,CAAC,QAAQ,EACjE,KAA2B;IAE3B,MAAM,OAAO,GAAG,KAAK,EAAE,OAAO,IAAI,yBAAyB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC9E,MAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,UAAU,CAAC;IACpD,OAAO;QACL,MAAM,EAAE,GAAG,QAAQ,IAAI,OAAO,CAAC,KAAK,YAAY,QAAQ,CAAC,CAAC,CAAC,MAAM,OAAO,CAAC,MAAM,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;QAC/F,aAAa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AAC,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;QACnF,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ;YACxB,CAAC,CAAC,iDAAiD,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,SAAS,kDAAkD;YACrI,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,cAAc;gBAC1B,CAAC,CAAC,sJAAsJ;gBACxJ,CAAC,CAAC,SAAS;oBACT,CAAC,CAAC,iEAAiE;oBACnE,CAAC,CAAC,GAAG,CAAC,QAAQ;wBACZ,CAAC,CAAC,4BAA4B,SAAS,IAAI,kBAAkB,2JAA2J;wBACxN,CAAC,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.1.1",
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,8 +32,8 @@
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.16.1",
36
- "@farmslot/protocol": "0.50.0"
35
+ "@farmslot/adapter-sdk": "0.18.1",
36
+ "@farmslot/protocol": "0.54.0"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/node": "^22.0.0",