@@ -76,16 +76,24 @@ function clearPin() {
7676/** The project's own link, naming a DIFFERENT workspace than the pin — the returning-user case
7777 * from the report, where identity said one id and routing said another. */
7878async function seedLocalLink ( datamateId = 7 , datamateName = "project-link" ) {
79- await recordApprovedBinding ( ROOT , {
80- datamateId,
81- datamateName,
82- linkedAt : Date . now ( ) ,
83- repoRemote :
"[email protected] :acme/project.git" , 84- // Both identity keys are written explicitly: the strict reader rejects a row where either is
85- // `undefined` (it accepts `string | null`), so omitting one produces a cache the routing read
86- // cannot parse — which looks like a product failure in a test that is only mis-seeded.
87- projectPath : null ,
88- } as never )
79+ // `awaitBackfill`: recording a link starts a skill sync and a memory seed. Left detached, they
80+ // outlive this file — `afterEach` clears the pin and deletes the cache under them, so they fall
81+ // through to a server lookup that runs under the NEXT file's credentials and lands in its fetch
82+ // stub (#1363). Awaiting them keeps that work inside the test that started it.
83+ await recordApprovedBinding (
84+ ROOT ,
85+ {
86+ datamateId,
87+ datamateName,
88+ linkedAt : Date . now ( ) ,
89+ repoRemote :
"[email protected] :acme/project.git" , 90+ // Both identity keys are written explicitly: the strict reader rejects a row where either is
91+ // `undefined` (it accepts `string | null`), so omitting one produces a cache the routing read
92+ // cannot parse — which looks like a product failure in a test that is only mis-seeded.
93+ projectPath : null ,
94+ } as never ,
95+ { awaitBackfill : true } ,
96+ )
8997}
9098
9199const ORIGINAL_PILOT = process . env . ALTIMATE_WORKSPACE
0 commit comments