test(#1575): fix M2 test - source agents have no Co-Authored-By to replace
This commit is contained in:
@@ -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 <test@example.com>';
|
||||
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`);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user