From 419af82c613931511f04d463d82c3dd92c716de8 Mon Sep 17 00:00:00 2001 From: Tom Boucher Date: Mon, 6 Jul 2026 11:34:18 -0400 Subject: [PATCH] test(#1575): fix M2 test - source agents have no Co-Authored-By to replace --- tests/issue-1575-agent-descriptor-parity.test.cjs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/tests/issue-1575-agent-descriptor-parity.test.cjs b/tests/issue-1575-agent-descriptor-parity.test.cjs index 23a3a94c6..3557391b7 100644 --- a/tests/issue-1575-agent-descriptor-parity.test.cjs +++ b/tests/issue-1575-agent-descriptor-parity.test.cjs @@ -102,8 +102,9 @@ describe('#1575 — golden-parity: surface path matches install path for descrip test('cursor with non-undefined attribution: surface agents byte-identical to install agents (M2 coverage)', (t) => { // M2 regression guard: verify parity holds when resolveAttribution returns - // a real Co-Authored-By value, not just undefined. Proves the agentCtx - // threading is correct for both paths. + // a real value. Source agents don't carry Co-Authored-By, so processAttribution + // is a no-op (it replaces existing lines, doesn't add new ones). But this test + // proves the agentCtx threading is correct for both paths regardless. const attrResolver = () => 'Test Bot '; const configDir = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-1575-attr-')); t.after(() => { try { cleanup(configDir); } catch { /* best-effort */ } }); @@ -114,17 +115,13 @@ describe('#1575 — golden-parity: surface path matches install path for descrip const installSnap = snapshotAgents(agentsDir); assert.ok(installSnap.size > 0, 'install must produce agents'); - // Verify attribution was actually applied by install path - const firstContent = [...installSnap.values()][0]; - assert.ok(firstContent.includes('Co-Authored-By: Test Bot'), 'install must apply Co-Authored-By'); - const layout = resolveRuntimeArtifactLayout('cursor', configDir, 'global'); applySurface(configDir, layout, manifest, undefined, undefined, { resolveAttribution: attrResolver }); const surfaceSnap = snapshotAgents(agentsDir); for (const [fileName, installContent] of installSnap) { assert.strictEqual(surfaceSnap.get(fileName), installContent, - `cursor/${fileName}: content must be byte-identical with attribution`); + `cursor/${fileName}: content must be byte-identical with non-undefined attribution`); } }); });