Skip to content

Commit 5521c46

Browse files
authored
Merge pull request #2040 from bradygaster/bradygaster-fix-gh-aw-bootstrap
fix(gh-aw): gate merge continuation dispatch
2 parents 530f418 + f823529 commit 5521c46

4 files changed

Lines changed: 318 additions & 21 deletions

File tree

‎test/gh-aw-implement-workflow.test.ts‎

Lines changed: 180 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,8 @@ describe('gh-aw implement workflows', () => {
222222
expect(continuationSection(worker)).toContain(
223223
'^<!-- squad:implement issue=([1-9][0-9]*) run=([1-9][0-9]*) -->$',
224224
);
225-
expect(continuationSection(worker)).toContain(
226-
'issue number to equal the marker\'s issue number',
225+
expect(continuationSection(worker)).toMatch(
226+
/issue\s+number to equal the marker's issue number/,
227227
);
228228
});
229229

@@ -398,7 +398,7 @@ describe('gh-aw implement worker: retro-origin provenance enforcement', () => {
398398
}))).toContain('issue-number-not-numeric');
399399
});
400400

401-
it('leaves a manual dispatch and the merge continuation untouched', () => {
401+
it('leaves a manual dispatch untouched and validates merge continuation provenance', () => {
402402
const manual = guard.evaluateImplementDispatchInputs({
403403
eventName: 'workflow_dispatch',
404404
issueNumber: '42',
@@ -407,9 +407,112 @@ describe('gh-aw implement worker: retro-origin provenance enforcement', () => {
407407
});
408408
expect(manual.ok).toBe(true);
409409
expect(manual.origin).toBe('manual');
410-
const merged = guard.evaluateImplementDispatchInputs({ eventName: 'pull_request' });
410+
const merged = guard.evaluateImplementDispatchInputs({
411+
eventName: 'pull_request',
412+
pullRequestBody: 'Closes #42\n\n<!-- squad:implement issue=42 run=7 -->',
413+
pullRequestHeadRef: 'squad/implement-42-fix-the-widget',
414+
});
411415
expect(merged.ok).toBe(true);
412-
expect(merged.enforced).toBe(false);
416+
expect(merged.enforced).toBe(true);
417+
expect(merged.origin).toBe('merge-continuation');
418+
expect(merged.issue_number).toBe(42);
419+
expect(merged.run_id).toBe(7);
420+
});
421+
422+
it('fails merge continuation closed on missing, duplicate, fenced, malformed, or mismatched evidence', () => {
423+
const evaluate = (body: unknown, headRef: unknown) => guard.evaluateImplementDispatchInputs({
424+
eventName: 'pull_request',
425+
pullRequestBody: body,
426+
pullRequestHeadRef: headRef,
427+
});
428+
expect(kinds(evaluate('', 'squad/implement-42-fix'))).toContain('merge-provenance-marker-invalid');
429+
expect(kinds(evaluate([
430+
'<!-- squad:implement issue=42 run=7 -->',
431+
'<!-- squad:implement issue=42 run=8 -->',
432+
].join('\n'), 'squad/implement-42-fix'))).toContain('merge-provenance-marker-ambiguous');
433+
expect(kinds(evaluate([
434+
'```text',
435+
'<!-- squad:implement issue=42 run=7 -->',
436+
'```',
437+
].join('\n'), 'squad/implement-42-fix'))).toContain('merge-provenance-marker-invalid');
438+
expect(kinds(evaluate(
439+
'prose <!-- squad:implement issue=42 run=7 -->',
440+
'squad/implement-42-fix',
441+
))).toContain('merge-provenance-marker-invalid');
442+
expect(kinds(evaluate(
443+
'<!-- squad:implement issue=42 run=7 -->',
444+
'squad/implement-43-fix',
445+
))).toContain('merge-provenance-issue-mismatch');
446+
expect(kinds(evaluate(
447+
'<!-- squad:implement issue=42 run=7 -->',
448+
'squad/implement-42-Fix',
449+
))).toContain('merge-provenance-branch-invalid');
450+
expect(kinds(evaluate(undefined, undefined))).toEqual(expect.arrayContaining([
451+
'merge-provenance-body-unreadable',
452+
'merge-provenance-branch-unreadable',
453+
]));
454+
});
455+
456+
it('refuses merge dispatch output when runtime provenance no longer validates', async () => {
457+
const result = await guard.enforceImplementSafeOutputs({
458+
SQUAD_IMPLEMENT_EVENT_NAME: 'pull_request',
459+
SQUAD_IMPLEMENT_PULL_BODY: '<!-- squad:implement issue=42 run=7 -->',
460+
SQUAD_IMPLEMENT_PULL_HEAD_REF: 'squad/implement-43-forged',
461+
} as never, {
462+
readItems: () => [{
463+
type: 'dispatch_workflow',
464+
workflow_name: 'squad',
465+
inputs: { command: 'implement', issue_number: '100' },
466+
}],
467+
});
468+
expect(result.ok).toBe(false);
469+
expect(result.enforced).toBe(true);
470+
expect(kinds(result)).toContain('merge-provenance-issue-mismatch');
471+
});
472+
473+
it('binds merge continuation to a successful same-repository implement run', async () => {
474+
const env = {
475+
GITHUB_REPOSITORY: REPO,
476+
SQUAD_IMPLEMENT_DEFAULT_BRANCH: BRANCH,
477+
SQUAD_IMPLEMENT_EVENT_NAME: 'pull_request',
478+
SQUAD_IMPLEMENT_PULL_BODY: '<!-- squad:implement issue=42 run=7 -->',
479+
SQUAD_IMPLEMENT_PULL_HEAD_REF: 'squad/implement-42-fix',
480+
SQUAD_IMPLEMENT_PULL_HEAD_REPOSITORY: REPO,
481+
SQUAD_IMPLEMENT_PULL_CREATED_AT: '2026-09-14T18:00:30Z',
482+
};
483+
const trustedRun = {
484+
id: 7,
485+
path: guard.IMPLEMENT_WORKFLOW_PATH,
486+
event: 'workflow_dispatch',
487+
status: 'completed',
488+
conclusion: 'success',
489+
head_branch: BRANCH,
490+
repository: { full_name: REPO },
491+
head_repository: { full_name: REPO },
492+
run_started_at: '2026-09-14T18:00:00Z',
493+
updated_at: '2026-09-14T18:01:00Z',
494+
};
495+
const valid = await guard.validateImplementOrigin(env, async () => trustedRun);
496+
expect(valid.ok).toBe(true);
497+
expect(valid.origin).toBe('merge-continuation');
498+
499+
const fork = await guard.validateImplementOrigin({
500+
...env,
501+
SQUAD_IMPLEMENT_PULL_HEAD_REPOSITORY: 'attacker/fork',
502+
}, async () => trustedRun);
503+
expect(kinds(fork)).toContain('merge-provenance-head-repository-mismatch');
504+
505+
const copiedAfterRun = await guard.validateImplementOrigin({
506+
...env,
507+
SQUAD_IMPLEMENT_PULL_CREATED_AT: '2026-09-14T18:02:00Z',
508+
}, async () => trustedRun);
509+
expect(kinds(copiedAfterRun)).toContain('merge-provenance-run-window-mismatch');
510+
511+
const unrelatedRun = await guard.validateImplementOrigin(env, async () => ({
512+
...trustedRun,
513+
path: '.github/workflows/other.lock.yml',
514+
}));
515+
expect(kinds(unrelatedRun)).toContain('merge-provenance-run-untrusted');
413516
});
414517

415518
it('refuses an unknown or half-declared origin instead of falling back to manual', () => {
@@ -763,13 +866,84 @@ describe('gh-aw implement worker: retro-origin provenance enforcement', () => {
763866
it('wires the guard into a pre-agent step and the safe-outputs boundary', () => {
764867
expect(worker).toContain('shared/squad-retro-provenance.mjs');
765868
expect(worker).toContain('--implement-inputs');
869+
expect(worker).toContain('Checkout trusted base for the pre-agent provenance guard');
870+
expect(worker).toContain('.squad-pre-agent-trusted-base/.github/workflows/shared/squad-retro-provenance.mjs');
871+
expect(worker).toContain('SQUAD_IMPLEMENT_PULL_BODY');
872+
expect(worker).toContain('SQUAD_IMPLEMENT_PULL_HEAD_REF');
873+
expect(worker).toContain('SQUAD_IMPLEMENT_PULL_HEAD_REPOSITORY');
874+
expect(worker).toContain('SQUAD_IMPLEMENT_PULL_CREATED_AT');
766875
const steps = worker.match(/^ {2}steps:\r?\n([\s\S]*?)^ {2}create-pull-request:/m)?.[1] ?? '';
767876
expect(steps).toContain('enforceImplementSafeOutputs');
768877
expect(steps).toContain('core.setFailed');
769878
expect(steps).toContain('SQUAD_IMPLEMENT_AW_CONTEXT');
770879
expect(steps).toContain('SQUAD_IMPLEMENT_DEFAULT_BRANCH');
880+
expect(steps).toContain('SQUAD_IMPLEMENT_PULL_BODY');
881+
expect(steps).toContain('SQUAD_IMPLEMENT_PULL_HEAD_REF');
882+
expect(steps).toContain('SQUAD_IMPLEMENT_PULL_HEAD_REPOSITORY');
883+
expect(steps).toContain('SQUAD_IMPLEMENT_PULL_CREATED_AT');
771884
});
772885

886+
it('compiles the merge gate before the agent and before safe-output processing', () => {
887+
const lock = compiledWorkerLock();
888+
const preCheckout = lock.indexOf('name: Checkout trusted base for the pre-agent provenance guard');
889+
const preGuard = lock.indexOf('name: Validate dispatch inputs and declared origin');
890+
const agent = lock.indexOf('name: Execute GitHub Copilot CLI');
891+
expect(preCheckout).toBeGreaterThan(-1);
892+
expect(preGuard).toBeGreaterThan(preCheckout);
893+
expect(agent).toBeGreaterThan(preGuard);
894+
const preAgentContract = lock.slice(preCheckout, agent);
895+
const preGuardEnd = preAgentContract.indexOf('name: Download container images');
896+
expect(preGuardEnd).toBeGreaterThan(-1);
897+
const preGateSteps = preAgentContract.slice(0, preGuardEnd);
898+
expect(preAgentContract).toContain('ref: refs/heads/${{ github.event.repository.default_branch }}');
899+
expect(preAgentContract).toContain('persist-credentials: false');
900+
expect(preAgentContract).toContain('SQUAD_IMPLEMENT_PULL_BODY');
901+
expect(preAgentContract).toContain('SQUAD_IMPLEMENT_PULL_HEAD_REF');
902+
expect(preAgentContract).toContain('SQUAD_IMPLEMENT_PULL_HEAD_REPOSITORY');
903+
expect(preAgentContract).toContain('SQUAD_IMPLEMENT_PULL_CREATED_AT');
904+
expect(preGateSteps).not.toMatch(/\n\s+(if|continue-on-error):/);
905+
906+
const safeJob = safeOutputsJob(lock);
907+
const safeGuard = safeJob.indexOf('name: Enforce implement provenance before any output');
908+
const process = safeJob.indexOf('name: Process Safe Outputs');
909+
expect(safeGuard).toBeGreaterThan(-1);
910+
expect(process).toBeGreaterThan(safeGuard);
911+
expect(safeJob.slice(safeGuard, process)).toContain('SQUAD_IMPLEMENT_PULL_BODY');
912+
expect(safeJob.slice(safeGuard, process)).toContain('SQUAD_IMPLEMENT_PULL_HEAD_REF');
913+
expect(safeJob.slice(safeGuard, process)).toContain('SQUAD_IMPLEMENT_PULL_HEAD_REPOSITORY');
914+
expect(safeJob.slice(safeGuard, process)).toContain('SQUAD_IMPLEMENT_PULL_CREATED_AT');
915+
916+
}, 60000);
917+
918+
it('detects mutations that remove either merge-provenance boundary', () => {
919+
const required = [
920+
'Checkout trusted base for the pre-agent provenance guard',
921+
'SQUAD_IMPLEMENT_PULL_BODY',
922+
'SQUAD_IMPLEMENT_PULL_HEAD_REF',
923+
'SQUAD_IMPLEMENT_PULL_HEAD_REPOSITORY',
924+
'SQUAD_IMPLEMENT_PULL_CREATED_AT',
925+
'.squad-pre-agent-trusted-base/.github/workflows/shared/squad-retro-provenance.mjs',
926+
'Enforce implement provenance before any output',
927+
];
928+
const missing = (text: string) => required.filter(value => !text.includes(value));
929+
expect(missing(worker)).toEqual([]);
930+
for (const value of required) {
931+
expect(
932+
missing(worker.replaceAll(value, 'REMOVED')),
933+
`removing ${value} must break the source contract`,
934+
).toContain(value);
935+
}
936+
937+
const compiled = compiledWorkerLock();
938+
expect(missing(compiled)).toEqual([]);
939+
for (const value of required) {
940+
expect(
941+
missing(compiled.replaceAll(value, 'REMOVED')),
942+
`removing ${value} must break the compiled contract`,
943+
).toContain(value);
944+
}
945+
}, 60000);
946+
773947
// -------------------------------------------------------------------------
774948
// FIDO blocker 2: the guard module was imported from GITHUB_WORKSPACE, whose
775949
// only checkout in this job is one gh-aw emits ONLY for `create_pull_request`
@@ -783,7 +957,7 @@ describe('gh-aw implement worker: retro-origin provenance enforcement', () => {
783957
const job = safeOutputsJob(compiledWorkerLock());
784958

785959
const trustedIndex = job.indexOf('name: Checkout trusted base for the provenance guard');
786-
const guardIndex = job.indexOf('name: Enforce retro-origin provenance before any output');
960+
const guardIndex = job.indexOf('name: Enforce implement provenance before any output');
787961
const processIndex = job.indexOf('name: Process Safe Outputs');
788962
expect(trustedIndex).toBeGreaterThan(-1);
789963
expect(guardIndex).toBeGreaterThan(trustedIndex);

‎test/gh-aw-review-workflow.test.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ function provenanceRows(workflow: string): string[] {
7777
function installOrders(markdown: string): string[][] {
7878
const uncommented = markdown.replace(/^#\s?/gm, '');
7979
return [...uncommented.matchAll(/gh aw add \\\n((?:\s+bradygaster\/squad\/workflows\/[^\n]+\n?)+)/g)]
80-
.map(block => [...block[1].matchAll(/bradygaster\/squad\/workflows\/([^@\s\\]+\.md)@(?:dev|\$\{SQUAD_SHA\})/g)]
80+
.map(block => [...block[1].matchAll(/bradygaster\/squad\/workflows\/([^@\s\\]+\.md)@(?:dev|\$\{SQUAD_(?:SHA|WORKFLOW_SHA)\})/g)]
8181
.map(match => match[1]));
8282
}
8383

@@ -212,15 +212,16 @@ describe('gh-aw advisory Squad reviewer', () => {
212212
execFileSync('git', ['init', '--quiet'], { cwd: workspace });
213213
const version = spawnSync('gh', ['aw', '--version'], { encoding: 'utf8', timeout: 15000 });
214214
expect(version.status).toBe(0);
215-
expect(`${version.stdout}${version.stderr}`.trim()).toMatch(/\bv0\.87\.10$/);
215+
const compilerVersion = `${version.stdout}${version.stderr}`.trim();
216+
expect(compilerVersion).toMatch(/\bv0\.(?:8[7-9]|9[0-9])\.[0-9]+$/);
216217
for (const name of installOrder) {
217218
const started = performance.now();
218219
const result = spawnSync(
219220
'gh',
220221
['aw', 'compile', name.slice(0, -3), '--strict', '--approve', '--no-check-update'],
221222
{ cwd: workspace, encoding: 'utf8', stdio: 'pipe', timeout: 60000 },
222223
);
223-
console.log(`strict-compile ${name} v0.87.10 status=${result.status} duration_ms=${Math.round(performance.now() - started)}`);
224+
console.log(`strict-compile ${name} ${compilerVersion} status=${result.status} duration_ms=${Math.round(performance.now() - started)}`);
224225
const diagnostics = `${result.stdout}\n${result.stderr}`;
225226
expect(result.error, `failed to launch gh aw for ${name}`).toBeUndefined();
226227
expect(result.status, `strict compile failed for ${name}:\n${diagnostics}`).toBe(0);

‎workflows/shared/squad-retro-provenance.mjs‎

Lines changed: 93 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@ export const ACTION_LABEL = 'squad-retro-action';
99
export const PROPOSAL_LABEL = 'squad-retro-proposal';
1010
export const RETRO_ORIGIN = 'squad-retro';
1111
export const IMPLEMENT_WORKFLOW = 'squad-implement-worker';
12+
export const IMPLEMENT_WORKFLOW_PATH = '.github/workflows/squad-implement-worker.lock.yml';
1213
export const RETRO_WORKFLOW_PATH = '.github/workflows/squad-retro.lock.yml';
1314
export const FINGERPRINT = /^(?:fail|review):[0-9a-f]{16}$/;
1415
export const TEMPORARY_ID = /^#?aw_[A-Za-z0-9_]{3,12}$/i;
1516
export const NUMERIC_ID = /^[1-9][0-9]*$/;
17+
export const IMPLEMENT_PULL_MARKER = /^<!-- squad:implement issue=([1-9][0-9]*) run=([1-9][0-9]*) -->$/;
18+
export const IMPLEMENT_PULL_BRANCH = /^squad\/implement-([1-9][0-9]*)-[a-z0-9][a-z0-9-]*$/;
1619
export const DISPATCH_INPUT_KEYS = Object.freeze(['issue_number', 'request_origin', 'retro_action_key']);
1720
export const IMPLEMENT_PULL_SCAN_MAX_PAGES = 5;
1821
export const ACTION_COMMENT_MAX_PAGES = 2;
@@ -175,6 +178,62 @@ export function deriveActionTemporaryIds(fingerprints) {
175178
export const normalizeTemporaryId = value => String(value ?? '').replace(/^#/, '').toLowerCase();
176179
export const isTemporaryId = value => TEMPORARY_ID.test(String(value ?? ''));
177180

181+
export function parseImplementMergeProvenance(body, headRef) {
182+
const violations = [];
183+
if (typeof body !== 'string') violations.push({ kind: 'merge-provenance-body-unreadable' });
184+
if (typeof headRef !== 'string') violations.push({ kind: 'merge-provenance-branch-unreadable' });
185+
if (violations.length) return { ok: false, enforced: true, origin: 'merge-continuation', violations };
186+
187+
const text = normalizeText(body);
188+
const markerOccurrences = text.match(/<!-- squad:implement\b/g) || [];
189+
const matches = [];
190+
let fence = null;
191+
for (const line of text.split('\n')) {
192+
if (fence) {
193+
if (markdownFenceClose(line, fence)) fence = null;
194+
continue;
195+
}
196+
const opening = markdownFenceOpen(line);
197+
if (opening) {
198+
fence = opening;
199+
continue;
200+
}
201+
const match = IMPLEMENT_PULL_MARKER.exec(line);
202+
if (match) matches.push(match);
203+
}
204+
205+
if (markerOccurrences.length > 1 || matches.length > 1) {
206+
violations.push({ kind: 'merge-provenance-marker-ambiguous' });
207+
} else if (markerOccurrences.length !== 1 || matches.length !== 1) {
208+
violations.push({ kind: 'merge-provenance-marker-invalid' });
209+
}
210+
211+
const branch = IMPLEMENT_PULL_BRANCH.exec(headRef);
212+
if (!branch) violations.push({ kind: 'merge-provenance-branch-invalid' });
213+
if (violations.length) return { ok: false, enforced: true, origin: 'merge-continuation', violations };
214+
215+
const markerIssue = matches[0][1];
216+
const markerRun = matches[0][2];
217+
const branchIssue = branch[1];
218+
if (!isNumericId(markerIssue) || !isNumericId(markerRun) || !isNumericId(branchIssue)) {
219+
violations.push({ kind: 'merge-provenance-number-invalid' });
220+
} else if (markerIssue !== branchIssue) {
221+
violations.push({
222+
kind: 'merge-provenance-issue-mismatch',
223+
marker_issue: Number(markerIssue),
224+
branch_issue: Number(branchIssue),
225+
});
226+
}
227+
return {
228+
ok: !violations.length,
229+
enforced: true,
230+
origin: 'merge-continuation',
231+
issue_number: Number(markerIssue),
232+
run_id: Number(markerRun),
233+
violations,
234+
};
235+
}
236+
178237
// gh-aw removes HTML comments in prose, but preserves visible fenced text.
179238
// Accept only this complete, explicit envelope, not markers in arbitrary code.
180239
export function retroActionPullMarker(issueNumber, actionKey) {
@@ -448,8 +507,11 @@ export function evaluateRetroDispatchOutputs({ items = [], autoImplementEnabled
448507

449508
export function evaluateImplementDispatchInputs({
450509
eventName = '', issueNumber = '', requestOrigin = '', retroActionKey = '',
451-
awContext = '', repository = '', defaultBranch = '',
510+
awContext = '', repository = '', defaultBranch = '', pullRequestBody, pullRequestHeadRef,
452511
} = {}) {
512+
if (eventName === 'pull_request') {
513+
return parseImplementMergeProvenance(pullRequestBody, pullRequestHeadRef);
514+
}
453515
if (eventName !== 'workflow_dispatch') return { ok: true, enforced: false, origin: 'event', violations: [] };
454516
const violations = [];
455517
if (!isNumericId(issueNumber)) violations.push({ kind: 'issue-number-not-numeric' });
@@ -548,8 +610,36 @@ export async function validateImplementOrigin(env, fetchJson = (route, fields) =
548610
issueNumber: env.SQUAD_IMPLEMENT_ISSUE_NUMBER, requestOrigin: env.SQUAD_IMPLEMENT_REQUEST_ORIGIN,
549611
retroActionKey: env.SQUAD_IMPLEMENT_RETRO_ACTION_KEY, awContext: env.SQUAD_IMPLEMENT_AW_CONTEXT,
550612
repository: env.GITHUB_REPOSITORY, defaultBranch: env.SQUAD_IMPLEMENT_DEFAULT_BRANCH,
613+
pullRequestBody: env.SQUAD_IMPLEMENT_PULL_BODY,
614+
pullRequestHeadRef: env.SQUAD_IMPLEMENT_PULL_HEAD_REF,
551615
});
552-
if (!result.ok || result.origin !== RETRO_ORIGIN) return result;
616+
if (!result.ok) return result;
617+
if (result.origin === 'merge-continuation') {
618+
const violations = [...result.violations];
619+
if (!env.GITHUB_REPOSITORY || env.SQUAD_IMPLEMENT_PULL_HEAD_REPOSITORY !== env.GITHUB_REPOSITORY) {
620+
violations.push({ kind: 'merge-provenance-head-repository-mismatch' });
621+
}
622+
const run = await fetchJson(`repos/${env.GITHUB_REPOSITORY}/actions/runs/${result.run_id}`, {});
623+
if (Number(run?.id) !== result.run_id ||
624+
run.path !== IMPLEMENT_WORKFLOW_PATH ||
625+
run.event !== 'workflow_dispatch' ||
626+
run.status !== 'completed' ||
627+
run.conclusion !== 'success' ||
628+
run.head_branch !== env.SQUAD_IMPLEMENT_DEFAULT_BRANCH ||
629+
run.repository?.full_name !== env.GITHUB_REPOSITORY ||
630+
run.head_repository?.full_name !== env.GITHUB_REPOSITORY) {
631+
violations.push({ kind: 'merge-provenance-run-untrusted' });
632+
}
633+
const createdAt = Date.parse(env.SQUAD_IMPLEMENT_PULL_CREATED_AT || '');
634+
const runStartedAt = Date.parse(run?.run_started_at || '');
635+
const runCompletedAt = Date.parse(run?.updated_at || '');
636+
if (!Number.isFinite(createdAt) || !Number.isFinite(runStartedAt) || !Number.isFinite(runCompletedAt) ||
637+
createdAt < runStartedAt || createdAt > runCompletedAt) {
638+
violations.push({ kind: 'merge-provenance-run-window-mismatch' });
639+
}
640+
return { ...result, ok: !violations.length, violations };
641+
}
642+
if (result.origin !== RETRO_ORIGIN) return result;
553643
const { violations, caller } = result;
554644
if (env.GITHUB_ACTOR !== BOT || env.GITHUB_REF !== `refs/heads/${env.SQUAD_IMPLEMENT_DEFAULT_BRANCH}`) {
555645
violations.push({ kind: 'retro-origin-platform-mismatch' });
@@ -603,6 +693,7 @@ export async function enforceImplementSafeOutputs(env = process.env, {
603693
if (items === null) return { ok: false, enforced: true, violations: [{ kind: 'unreadable-agent-output' }] };
604694
const origin = await validateImplementOrigin(env, fetchJson);
605695
if (!origin.ok) return origin;
696+
if (origin.origin === 'merge-continuation') return origin;
606697
if (origin.origin !== RETRO_ORIGIN) return { ...origin, enforced: false, reason: 'not-retro-originated' };
607698
const pulls = evaluateRetroPullRequestItems({ items, issueNumber: origin.issue_number, actionKey: origin.action_key });
608699
const violations = [...pulls.violations];

0 commit comments

Comments
 (0)