instar 1.3.1147 → 1.3.1149
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/dist/core/AgentWorktreeDetector.d.ts +48 -0
- package/dist/core/AgentWorktreeDetector.d.ts.map +1 -1
- package/dist/core/AgentWorktreeDetector.js +115 -0
- package/dist/core/AgentWorktreeDetector.js.map +1 -1
- package/dist/data/standards-guard-index.json +1 -1
- package/dist/data/standards-guard-index.meta.json +2 -2
- package/dist/data/standards-registry.meta.json +1 -1
- package/package.json +1 -1
- package/scripts/lint-dev-agent-dark-gate.js +45 -1
- package/src/data/builtin-manifest.json +2 -2
- package/src/data/standards-guard-index.json +1 -1
- package/src/data/standards-guard-index.meta.json +2 -2
- package/src/data/standards-registry.meta.json +1 -1
- package/upgrades/1.3.1148.md +68 -0
- package/upgrades/1.3.1149.md +48 -0
- package/upgrades/side-effects/dev-agent-gate-alias.md +104 -0
- package/upgrades/side-effects/worktree-repo-discovery.md +124 -0
|
@@ -63,6 +63,47 @@ export declare function runDetection(opts: DetectorOptions): Promise<DetectorRes
|
|
|
63
63
|
* mutable file in the read path → the transient-empty failure class is gone.
|
|
64
64
|
*/
|
|
65
65
|
export declare function enumerateSafeRoots(agentsDir?: string): string[];
|
|
66
|
+
/**
|
|
67
|
+
* Derive candidate instar-repo roots from the agent worktrees themselves.
|
|
68
|
+
*
|
|
69
|
+
* WHY THIS EXISTS. The fallback chain below guesses at conventional checkout
|
|
70
|
+
* locations (`~/Documents/Projects/instar`, `~/instar`). An agent whose repo
|
|
71
|
+
* lives anywhere else — e.g. `<agent_home>/.dev/instar`, which is where the
|
|
72
|
+
* dev layout actually puts it — matches none of them, so resolution returned
|
|
73
|
+
* null and every consumer silently did nothing. Meanwhile the answer was
|
|
74
|
+
* sitting on disk the whole time: a linked worktree's `.git` is a FILE whose
|
|
75
|
+
* contents name its owning repo. The worktrees know. Ask them instead of
|
|
76
|
+
* guessing.
|
|
77
|
+
*
|
|
78
|
+
* (2026-07-29 the same blind spot let the reaper report `reclaimable: 0`
|
|
79
|
+
* against 73 worktrees because its `git -C <path> worktree list` was failing
|
|
80
|
+
* outright. The honest-reporting fix landed; the resolution did not.)
|
|
81
|
+
*
|
|
82
|
+
* Deliberately NO subprocess: reading the pointer file is cheaper than
|
|
83
|
+
* `git rev-parse`, cannot block the event loop, and keeps this helper usable
|
|
84
|
+
* from the runtime hot dirs. Returns candidates only — every one is still
|
|
85
|
+
* integrity-validated by `resolveInstarRepo` before it is believed.
|
|
86
|
+
*
|
|
87
|
+
* ORDERED BY COUNT, and the ordering carries a real limitation worth stating.
|
|
88
|
+
* One agent's `.worktrees/` can legitimately hold worktrees of MORE THAN ONE
|
|
89
|
+
* clone of the same upstream — measured on a live agent: 29 worktrees owned by
|
|
90
|
+
* `<home>/.build/instar` and 17 by `<home>/.dev/instar`. This returns the
|
|
91
|
+
* most-owned first, so a single-repo consumer gets the largest coherent set
|
|
92
|
+
* rather than an arbitrary one; it does NOT merge them, and a consumer that
|
|
93
|
+
* takes only `[0]` will not see the smaller repo's worktrees. Consumers that
|
|
94
|
+
* need full coverage must iterate the whole list. The alternative — picking
|
|
95
|
+
* arbitrarily — would make the blind spot unpredictable instead of merely
|
|
96
|
+
* bounded.
|
|
97
|
+
*/
|
|
98
|
+
export declare function discoverInstarRepoFromWorktrees(roots: ReadonlyArray<string>, opts?: {
|
|
99
|
+
maxWorktrees?: number;
|
|
100
|
+
}): string[];
|
|
101
|
+
/**
|
|
102
|
+
* `gitdir: /path/to/repo/.git/worktrees/<slug>` → `/path/to/repo`.
|
|
103
|
+
* Anything that does not have that exact shape names nothing, and returns
|
|
104
|
+
* null rather than a guess.
|
|
105
|
+
*/
|
|
106
|
+
export declare function parseWorktreeGitPointer(contents: string): string | null;
|
|
66
107
|
export interface ResolveDetectorRepoOptions {
|
|
67
108
|
/** Path to user config (defaults to `~/.instar/config.json`). */
|
|
68
109
|
configPath?: string;
|
|
@@ -76,6 +117,13 @@ export interface ResolveDetectorRepoOptions {
|
|
|
76
117
|
* running them has an allowlisted checkout at cwd).
|
|
77
118
|
*/
|
|
78
119
|
cwd?: string;
|
|
120
|
+
/**
|
|
121
|
+
* The CALLER'S OWN agent `.worktrees` root(s), used to derive the owning
|
|
122
|
+
* repo from the worktrees themselves. Omitted ⇒ no worktree-derived
|
|
123
|
+
* candidates. Never pass `enumerateSafeRoots()` here: that spans every agent
|
|
124
|
+
* on the machine and will resolve you to somebody else's repo.
|
|
125
|
+
*/
|
|
126
|
+
worktreeRoots?: ReadonlyArray<string>;
|
|
79
127
|
}
|
|
80
128
|
/**
|
|
81
129
|
* Per spec: the detector uses a deterministic source (config or default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentWorktreeDetector.d.ts","sourceRoot":"","sources":["../../src/core/AgentWorktreeDetector.ts"],"names":[],"mappings":"AAyCA,MAAM,WAAW,eAAe;IAC9B;;iFAE6E;IAC7E,UAAU,EAAE,MAAM,CAAC;IACnB;uCACmC;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB;;;oBAGgB;IAChB,SAAS,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACjC;;gEAE4D;IAC5D,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACnE,yEAAyE;IACzE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;uDACmD;IACnD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,kBAAkB;IACjC,0FAA0F;IAC1F,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;IAC/C,aAAa,CAAC,EAAE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a,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACtC,8DAA8D;IAC9D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;;OAKG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CACvC;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,GAAE,0BAA+B,GAAG,MAAM,GAAG,IAAI,CA4D9F"}
|
|
@@ -333,6 +333,104 @@ export function enumerateSafeRoots(agentsDir) {
|
|
|
333
333
|
}
|
|
334
334
|
return roots;
|
|
335
335
|
}
|
|
336
|
+
// ── Public helper: ask the worktrees which repo owns them ────────────────
|
|
337
|
+
/**
|
|
338
|
+
* Derive candidate instar-repo roots from the agent worktrees themselves.
|
|
339
|
+
*
|
|
340
|
+
* WHY THIS EXISTS. The fallback chain below guesses at conventional checkout
|
|
341
|
+
* locations (`~/Documents/Projects/instar`, `~/instar`). An agent whose repo
|
|
342
|
+
* lives anywhere else — e.g. `<agent_home>/.dev/instar`, which is where the
|
|
343
|
+
* dev layout actually puts it — matches none of them, so resolution returned
|
|
344
|
+
* null and every consumer silently did nothing. Meanwhile the answer was
|
|
345
|
+
* sitting on disk the whole time: a linked worktree's `.git` is a FILE whose
|
|
346
|
+
* contents name its owning repo. The worktrees know. Ask them instead of
|
|
347
|
+
* guessing.
|
|
348
|
+
*
|
|
349
|
+
* (2026-07-29 the same blind spot let the reaper report `reclaimable: 0`
|
|
350
|
+
* against 73 worktrees because its `git -C <path> worktree list` was failing
|
|
351
|
+
* outright. The honest-reporting fix landed; the resolution did not.)
|
|
352
|
+
*
|
|
353
|
+
* Deliberately NO subprocess: reading the pointer file is cheaper than
|
|
354
|
+
* `git rev-parse`, cannot block the event loop, and keeps this helper usable
|
|
355
|
+
* from the runtime hot dirs. Returns candidates only — every one is still
|
|
356
|
+
* integrity-validated by `resolveInstarRepo` before it is believed.
|
|
357
|
+
*
|
|
358
|
+
* ORDERED BY COUNT, and the ordering carries a real limitation worth stating.
|
|
359
|
+
* One agent's `.worktrees/` can legitimately hold worktrees of MORE THAN ONE
|
|
360
|
+
* clone of the same upstream — measured on a live agent: 29 worktrees owned by
|
|
361
|
+
* `<home>/.build/instar` and 17 by `<home>/.dev/instar`. This returns the
|
|
362
|
+
* most-owned first, so a single-repo consumer gets the largest coherent set
|
|
363
|
+
* rather than an arbitrary one; it does NOT merge them, and a consumer that
|
|
364
|
+
* takes only `[0]` will not see the smaller repo's worktrees. Consumers that
|
|
365
|
+
* need full coverage must iterate the whole list. The alternative — picking
|
|
366
|
+
* arbitrarily — would make the blind spot unpredictable instead of merely
|
|
367
|
+
* bounded.
|
|
368
|
+
*/
|
|
369
|
+
export function discoverInstarRepoFromWorktrees(roots, opts = {}) {
|
|
370
|
+
const cap = opts.maxWorktrees ?? 200;
|
|
371
|
+
const counts = new Map();
|
|
372
|
+
let inspected = 0;
|
|
373
|
+
for (const root of roots) {
|
|
374
|
+
let entries = [];
|
|
375
|
+
try {
|
|
376
|
+
entries = fs.readdirSync(root);
|
|
377
|
+
}
|
|
378
|
+
catch {
|
|
379
|
+
// @silent-fallback-ok — root vanished between enumeration and read.
|
|
380
|
+
continue;
|
|
381
|
+
}
|
|
382
|
+
for (const entry of entries) {
|
|
383
|
+
if (inspected >= cap)
|
|
384
|
+
break;
|
|
385
|
+
const pointer = path.join(root, entry, '.git');
|
|
386
|
+
let stat;
|
|
387
|
+
try {
|
|
388
|
+
stat = fs.statSync(pointer);
|
|
389
|
+
}
|
|
390
|
+
catch {
|
|
391
|
+
// @silent-fallback-ok — not a worktree (no .git at all). Skip.
|
|
392
|
+
continue;
|
|
393
|
+
}
|
|
394
|
+
// A linked worktree's .git is a FILE. A full clone's is a directory, and
|
|
395
|
+
// a clone under .worktrees/ is not a worktree of anything — skip it
|
|
396
|
+
// rather than claim it points somewhere.
|
|
397
|
+
if (!stat.isFile())
|
|
398
|
+
continue;
|
|
399
|
+
inspected++;
|
|
400
|
+
let contents;
|
|
401
|
+
try {
|
|
402
|
+
contents = fs.readFileSync(pointer, 'utf-8');
|
|
403
|
+
}
|
|
404
|
+
catch {
|
|
405
|
+
// @silent-fallback-ok — unreadable pointer; it names nothing.
|
|
406
|
+
continue;
|
|
407
|
+
}
|
|
408
|
+
const repo = parseWorktreeGitPointer(contents);
|
|
409
|
+
if (repo)
|
|
410
|
+
counts.set(repo, (counts.get(repo) ?? 0) + 1);
|
|
411
|
+
}
|
|
412
|
+
if (inspected >= cap)
|
|
413
|
+
break;
|
|
414
|
+
}
|
|
415
|
+
return [...counts.entries()]
|
|
416
|
+
.sort((a, b) => (b[1] - a[1]) || a[0].localeCompare(b[0]))
|
|
417
|
+
.map(([repo]) => repo);
|
|
418
|
+
}
|
|
419
|
+
/**
|
|
420
|
+
* `gitdir: /path/to/repo/.git/worktrees/<slug>` → `/path/to/repo`.
|
|
421
|
+
* Anything that does not have that exact shape names nothing, and returns
|
|
422
|
+
* null rather than a guess.
|
|
423
|
+
*/
|
|
424
|
+
export function parseWorktreeGitPointer(contents) {
|
|
425
|
+
const match = /^\s*gitdir:\s*(.+?)\s*$/m.exec(contents);
|
|
426
|
+
if (!match)
|
|
427
|
+
return null;
|
|
428
|
+
const marker = `${path.sep}.git${path.sep}worktrees${path.sep}`;
|
|
429
|
+
const idx = match[1].indexOf(marker);
|
|
430
|
+
if (idx <= 0)
|
|
431
|
+
return null;
|
|
432
|
+
return match[1].slice(0, idx);
|
|
433
|
+
}
|
|
336
434
|
/**
|
|
337
435
|
* Per spec: the detector uses a deterministic source (config or default
|
|
338
436
|
* chain), NOT `INSTAR_REPO` env var, because env vars can differ between
|
|
@@ -358,6 +456,23 @@ export function resolveDetectorInstarRepo(opts = {}) {
|
|
|
358
456
|
const candidateChain = [];
|
|
359
457
|
if (configRepoPath)
|
|
360
458
|
candidateChain.push(configRepoPath);
|
|
459
|
+
// Ask the worktrees who owns them, BEFORE guessing at conventional
|
|
460
|
+
// locations. An operator-supplied `worktree.repoPath` still wins — this only
|
|
461
|
+
// ever gets consulted where the deterministic answer was absent, which is
|
|
462
|
+
// exactly where resolution used to return null.
|
|
463
|
+
//
|
|
464
|
+
// THE CALLER MUST NAME ITS OWN ROOT. There is deliberately no default here,
|
|
465
|
+
// and `enumerateSafeRoots()` is deliberately NOT it: that helper enumerates
|
|
466
|
+
// EVERY agent on the machine, so defaulting to it resolved this agent to a
|
|
467
|
+
// DIFFERENT agent's repo — whichever one happened to own the most worktrees.
|
|
468
|
+
// (Measured, not hypothesised: with the default in place, echo resolved to
|
|
469
|
+
// instar-codey's repo.) A confident wrong repo is worse than the null this
|
|
470
|
+
// change exists to remove, so absent an explicit root we add no candidate
|
|
471
|
+
// and the pre-existing chain applies unchanged.
|
|
472
|
+
for (const repo of discoverInstarRepoFromWorktrees(opts.worktreeRoots ?? [])) {
|
|
473
|
+
if (!candidateChain.includes(repo))
|
|
474
|
+
candidateChain.push(repo);
|
|
475
|
+
}
|
|
361
476
|
if (opts.fallbackChain) {
|
|
362
477
|
candidateChain.push(...opts.fallbackChain);
|
|
363
478
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentWorktreeDetector.js","sourceRoot":"","sources":["../../src/core/AgentWorktreeDetector.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,wEAAwE;AACxE,wEAAwE;AACxE,wEAAwE;AACxE,uEAAuE;AACvE,+DAA+D;AAE/D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AA2D/D,4EAA4E;AAE5E,MAAM,sBAAsB,GA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AAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;IACjD,CAAC;IAED,sEAAsE;IACtE,uEAAuE;IACvE,uDAAuD;IACvD,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,iBAAiB,CAAC;YAC7B,GAAG,EAAE,EAAE;YACP,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACtC,aAAa,EAAE,cAAc;YAC7B,UAAU,EAAE,QAAQ;SACrB,CAAC,CAAC;QACH,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAAC,MAAM,CAAC;QACP,qEAAqE;QACrE,sEAAsE;QACtE,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"generatedFrom": "source-tree",
|
|
4
4
|
"registrySha256": "81b53363a440e832672618965540b3e507ae0d93adcc67ec2b93daf7933b3ab4",
|
|
5
|
-
"packageVersion": "1.3.
|
|
5
|
+
"packageVersion": "1.3.1149",
|
|
6
6
|
"guards": [
|
|
7
7
|
{
|
|
8
8
|
"ref": "docs/audits/phase-b/f10-triage.md",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"sha256": "
|
|
2
|
+
"sha256": "1ed8f5bd6959a002ef362c9be5f88a382b0956d4992b16879350851ce3711ac9",
|
|
3
3
|
"registrySha256": "81b53363a440e832672618965540b3e507ae0d93adcc67ec2b93daf7933b3ab4",
|
|
4
|
-
"packageVersion": "1.3.
|
|
4
|
+
"packageVersion": "1.3.1149"
|
|
5
5
|
}
|
package/package.json
CHANGED
|
@@ -72,6 +72,49 @@ const FUNNEL_ALLOWLIST = new Set([
|
|
|
72
72
|
// in the spec's Layer-1 "misses" row.)
|
|
73
73
|
const HANDROLLED_GATE =
|
|
74
74
|
/\?\?\s*(?:!{1,2}\s*|Boolean\s*\(\s*)?[A-Za-z_$][\w$.?]*(?:\.developmentAgent\b|\[\s*['"]developmentAgent['"]\s*\])/;
|
|
75
|
+
|
|
76
|
+
// ── 2026-08-14: the gate value does not have to be spelled at the `??`. ──
|
|
77
|
+
// The matcher above requires `.developmentAgent` LITERALLY after the `??`, so
|
|
78
|
+
// lifting it into a local const first walks past it while resolving the gate by
|
|
79
|
+
// hand exactly as before:
|
|
80
|
+
// const da = config.developmentAgent;
|
|
81
|
+
// return enabled ?? !!da; // exit 0 against the old matcher
|
|
82
|
+
// The header's declared limit ("cannot catch arbitrary aliases/wrapper helpers")
|
|
83
|
+
// was honest; this closes the LOCAL-CONST half of it, which is the shape a
|
|
84
|
+
// rename-defeat audit actually reproduced.
|
|
85
|
+
//
|
|
86
|
+
// Deliberately NOT closed, so it stays stated rather than implied: wrapper
|
|
87
|
+
// helpers (`isDevAgent(config)`), cross-module aliases, and any value that needs
|
|
88
|
+
// dataflow to resolve. Guessing at those would over-match, and this lint fails
|
|
89
|
+
// builds — flagging correct code is the more expensive error here.
|
|
90
|
+
//
|
|
91
|
+
// Scope-bounded on purpose: an alias binds only within its own file, so the map
|
|
92
|
+
// is rebuilt per file and never leaks between them.
|
|
93
|
+
const ALIAS_DECL =
|
|
94
|
+
/\b(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*(?::\s*[^=]+?)?=\s*[A-Za-z_$][\w$.?]*(?:\.developmentAgent\b|\[\s*['"]developmentAgent['"]\s*\])/;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Local identifiers bound to `<expr>.developmentAgent` in THIS file.
|
|
98
|
+
* `config.developmentAgentName` does not qualify — the `\b` keeps the boundary
|
|
99
|
+
* through the alias exactly as it holds at the direct callsite.
|
|
100
|
+
*/
|
|
101
|
+
function collectDevAgentAliases(lines) {
|
|
102
|
+
const names = new Set();
|
|
103
|
+
for (const line of lines) {
|
|
104
|
+
const code = codeOnly(line);
|
|
105
|
+
if (code === null) continue;
|
|
106
|
+
const m = ALIAS_DECL.exec(code);
|
|
107
|
+
if (m) names.add(m[1]);
|
|
108
|
+
}
|
|
109
|
+
return names;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/** `?? [!! | Boolean(] <alias>` — the aliased spelling of the same hand-rolled gate. */
|
|
113
|
+
function aliasGateMatcher(names) {
|
|
114
|
+
if (names.size === 0) return null;
|
|
115
|
+
const alts = [...names].join('|');
|
|
116
|
+
return new RegExp(`\\?\\?\\s*(?:!{1,2}\\s*|Boolean\\s*\\(\\s*)?(?:${alts})\\b`);
|
|
117
|
+
}
|
|
75
118
|
// A comment referencing the gate convention (for assertion B).
|
|
76
119
|
const GATE_MARKER = /developmentAgent/i;
|
|
77
120
|
const GATE_MARKER_QUALIFIER = /\b(dark|gate)\b/i;
|
|
@@ -171,10 +214,11 @@ for (const file of resolveTargets()) {
|
|
|
171
214
|
|
|
172
215
|
// ── Assertion A: funnel ──
|
|
173
216
|
if (!FUNNEL_ALLOWLIST.has(rel)) {
|
|
217
|
+
const aliasGate = aliasGateMatcher(collectDevAgentAliases(lines));
|
|
174
218
|
lines.forEach((line, i) => {
|
|
175
219
|
const code = codeOnly(line);
|
|
176
220
|
if (code === null) return;
|
|
177
|
-
if (HANDROLLED_GATE.test(code)) {
|
|
221
|
+
if (HANDROLLED_GATE.test(code) || (aliasGate !== null && aliasGate.test(code))) {
|
|
178
222
|
violations.push({
|
|
179
223
|
file: rel, line: i + 1, kind: 'A: hand-rolled gate',
|
|
180
224
|
text: line.trim(),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "./builtin-manifest.schema.json",
|
|
3
3
|
"schemaVersion": 1,
|
|
4
|
-
"generatedAt": "2026-08-
|
|
5
|
-
"instarVersion": "1.3.
|
|
4
|
+
"generatedAt": "2026-08-15T00:08:31.593Z",
|
|
5
|
+
"instarVersion": "1.3.1149",
|
|
6
6
|
"entryCount": 202,
|
|
7
7
|
"entries": {
|
|
8
8
|
"hook:session-start": {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"generatedFrom": "source-tree",
|
|
4
4
|
"registrySha256": "81b53363a440e832672618965540b3e507ae0d93adcc67ec2b93daf7933b3ab4",
|
|
5
|
-
"packageVersion": "1.3.
|
|
5
|
+
"packageVersion": "1.3.1149",
|
|
6
6
|
"guards": [
|
|
7
7
|
{
|
|
8
8
|
"ref": "docs/audits/phase-b/f10-triage.md",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"sha256": "
|
|
2
|
+
"sha256": "1ed8f5bd6959a002ef362c9be5f88a382b0956d4992b16879350851ce3711ac9",
|
|
3
3
|
"registrySha256": "81b53363a440e832672618965540b3e507ae0d93adcc67ec2b93daf7933b3ab4",
|
|
4
|
-
"packageVersion": "1.3.
|
|
4
|
+
"packageVersion": "1.3.1149"
|
|
5
5
|
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Upgrade Guide — vNEXT
|
|
2
|
+
|
|
3
|
+
<!-- assembled-by: assemble-next-md -->
|
|
4
|
+
<!-- bump: patch -->
|
|
5
|
+
|
|
6
|
+
## What Changed
|
|
7
|
+
|
|
8
|
+
Adds to `src/core/AgentWorktreeDetector.ts`:
|
|
9
|
+
|
|
10
|
+
- `parseWorktreeGitPointer(contents)` — `gitdir: /repo/.git/worktrees/<slug>` → `/repo`; null for anything
|
|
11
|
+
that is not exactly that shape.
|
|
12
|
+
- `discoverInstarRepoFromWorktrees(roots, {maxWorktrees})` — reads each worktree's `.git` pointer FILE under
|
|
13
|
+
the given roots and returns owning repo roots, ordered by how many worktrees name each. No subprocess:
|
|
14
|
+
reading the pointer is cheaper than `git rev-parse`, cannot block the event loop, and keeps the helper
|
|
15
|
+
usable from the runtime hot dirs.
|
|
16
|
+
- `ResolveDetectorRepoOptions.worktreeRoots` — when a caller passes ITS OWN `.worktrees` root(s), discovered
|
|
17
|
+
repos join the candidate chain after the operator-supplied `worktree.repoPath` and before the
|
|
18
|
+
conventional-location guesses. Omitted ⇒ no candidates ⇒ byte-identical behaviour.
|
|
19
|
+
|
|
20
|
+
**Why.** On a live agent: `GET /worktrees/agent-reaper` reported `enumerationOk: false`,
|
|
21
|
+
`enumerationFailures: 98`, `git -C <agent home> worktree list --porcelain → fatal: not a git repository`,
|
|
22
|
+
with 45 worktrees and 27 GB unreclaimed. Separately `resolveDetectorInstarRepo` guessed at
|
|
23
|
+
`~/Documents/Projects/instar` and `~/instar`; neither exists there, so it returned null and callers guarded
|
|
24
|
+
with `if (repo)` skipped silently. Both are the same mistake — a path assumed rather than resolved — while a
|
|
25
|
+
linked worktree's `.git` file names its owner outright.
|
|
26
|
+
|
|
27
|
+
**A misresolution caught during development, now pinned.** The first draft defaulted discovery to
|
|
28
|
+
`enumerateSafeRoots()`, which spans EVERY agent home on the machine; measured on the real box, `echo`
|
|
29
|
+
resolved to `instar-codey`'s repo. A confident wrong repo is worse than null — null makes a consumer skip, a
|
|
30
|
+
wrong repo makes it act. There is now no default: a caller must name its own root.
|
|
31
|
+
|
|
32
|
+
**Declared limitation.** One agent's `.worktrees/` can legitimately hold worktrees of more than one clone of
|
|
33
|
+
the same upstream (measured: 29 owned by `<home>/.build/instar`, 17 by `<home>/.dev/instar`). Both are
|
|
34
|
+
returned, most-owned first, unmerged; a consumer taking only `[0]` gets the largest coherent set, not full
|
|
35
|
+
coverage. Stated in the function's doc comment.
|
|
36
|
+
|
|
37
|
+
**Held back deliberately:** pointing `AgentWorktreeReaper` and `OrphanedWorkSentinel` at the resolved repo
|
|
38
|
+
instead of `config.projectDir`. That is runtime code feeding a guard with delete authority, and the
|
|
39
|
+
misresolution above is evidence that getting it wrong is easy — so it goes through the Tier 2 spec +
|
|
40
|
+
operator-approval path as a small focused follow-up, registered as a commitment.
|
|
41
|
+
|
|
42
|
+
## What to Tell Your User
|
|
43
|
+
|
|
44
|
+
Nothing changes for you in this release. This adds an internal ability — working out which repository a set
|
|
45
|
+
of working copies belongs to by asking the working copies themselves — and deliberately does not plug it in
|
|
46
|
+
anywhere yet.
|
|
47
|
+
|
|
48
|
+
It exists because the background housekeeper that reclaims finished working copies had been handed a path
|
|
49
|
+
that is not a repository, so it failed to look 98 times in a row while 27 GB of finished copies accumulated.
|
|
50
|
+
Wiring this in is a separate change that needs review before it goes near anything with permission to delete
|
|
51
|
+
directories.
|
|
52
|
+
|
|
53
|
+
## Summary of New Capabilities
|
|
54
|
+
|
|
55
|
+
None that you can use. No new command, endpoint, setting, or behaviour. Two internal helper functions and one
|
|
56
|
+
opt-in parameter that nothing passes yet.
|
|
57
|
+
|
|
58
|
+
## Evidence
|
|
59
|
+
|
|
60
|
+
- `tests/unit/agent-worktree-repo-discovery.test.ts` — 14/14 green.
|
|
61
|
+
- Existing detector suites unmodified and green (`AgentWorktreeDetector`, `-attention-wireup`,
|
|
62
|
+
`WorktreeEnumerationFailureStore`) — 19/19 — which is what shows the old path is untouched when no caller
|
|
63
|
+
opts in.
|
|
64
|
+
- `npm run lint` chain green; `tsc --noEmit` clean.
|
|
65
|
+
- Real-machine measurement: with the caller's own root, discovery returns both repos in count order; with no
|
|
66
|
+
root, resolution returns null exactly as before.
|
|
67
|
+
- Side-effects: `upgrades/side-effects/worktree-repo-discovery.md` · ELI16:
|
|
68
|
+
`docs/specs/worktree-repo-discovery.eli16.md`.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Upgrade Guide — vNEXT
|
|
2
|
+
|
|
3
|
+
<!-- assembled-by: assemble-next-md -->
|
|
4
|
+
<!-- bump: patch -->
|
|
5
|
+
|
|
6
|
+
## What Changed
|
|
7
|
+
|
|
8
|
+
`scripts/lint-dev-agent-dark-gate.js` assertion A bans hand-rolled dev-agent gate resolution outside
|
|
9
|
+
`resolveDevAgentGate`. The matcher required `.developmentAgent` **literally after the `??`**, so lifting the
|
|
10
|
+
value into a local const first walked past it while resolving the gate by hand exactly as before:
|
|
11
|
+
|
|
12
|
+
```ts
|
|
13
|
+
const da = config.developmentAgent;
|
|
14
|
+
return enabled ?? !!da; // exit 0 against the shipped lint
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
instar-codey reproduced this while auditing rename-defeatable checks and pre-scoped the remedy ("low FP for
|
|
18
|
+
simple local alias folding around `developmentAgent` feeding `??`"). That is the scope implemented: local
|
|
19
|
+
`const`/`let`/`var` aliases, collected per file, matched at `?? [!!|Boolean(] <alias>`.
|
|
20
|
+
|
|
21
|
+
The lint's header already declared this limit ("cannot catch arbitrary aliases/wrapper helpers"). It is
|
|
22
|
+
closed for the shape that actually occurs; the declaration was honest, not wrong.
|
|
23
|
+
|
|
24
|
+
Four controls keep it from failing correct builds, each with a test: only a `developmentAgent` binding
|
|
25
|
+
counts; matching is whole-word so `developmentAgentName` is untouched; an alias never used at a `??` is
|
|
26
|
+
legal (reading the flag is fine — hand-rolling the fallback is what is banned); and a commented-out
|
|
27
|
+
declaration binds nothing.
|
|
28
|
+
|
|
29
|
+
Still not caught, stated in the source: wrapper helpers, cross-module aliases, and anything needing
|
|
30
|
+
dataflow. Guessing at those would over-match a build-failing lint.
|
|
31
|
+
|
|
32
|
+
## What to Tell Your User
|
|
33
|
+
|
|
34
|
+
None — internal change (no user-facing surface).
|
|
35
|
+
|
|
36
|
+
## Summary of New Capabilities
|
|
37
|
+
|
|
38
|
+
None — internal change (no user-facing surface).
|
|
39
|
+
|
|
40
|
+
## Evidence
|
|
41
|
+
|
|
42
|
+
- `tests/unit/lint-dev-agent-dark-gate.test.ts` — **31/31 green** (24 existing + 7 added).
|
|
43
|
+
- Negative control: tests written BEFORE the fix, run against the shipped lint — **3 of 31 fail** (const
|
|
44
|
+
alias, bracket-access alias, `Boolean(alias)`). The other 28 pass both ways.
|
|
45
|
+
- Reproduced by hand first with a positive control: direct form exits 1, aliased form exits 0.
|
|
46
|
+
- Real-tree verdict: `node scripts/lint-dev-agent-dark-gate.js` → exit 0, no new flags.
|
|
47
|
+
- Full `npm run lint` chain green.
|
|
48
|
+
- Side-effects: `upgrades/side-effects/dev-agent-gate-alias.md` · ELI16: `docs/specs/dev-agent-gate-alias.eli16.md`.
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# Side-Effects Review — dev-agent gate check follows a local alias
|
|
2
|
+
|
|
3
|
+
**Version / slug:** `dev-agent-gate-alias`
|
|
4
|
+
**Date:** `2026-08-14`
|
|
5
|
+
**Author:** `echo`
|
|
6
|
+
**Second-pass reviewer:** `not required — Tier 1 (CI-only lint script; no runtime path). The rule is unchanged; the check now recognises one more spelling of the thing it already forbids.`
|
|
7
|
+
|
|
8
|
+
## Summary of the change
|
|
9
|
+
|
|
10
|
+
`scripts/lint-dev-agent-dark-gate.js` assertion A bans hand-rolled dev-agent gate resolution — anything
|
|
11
|
+
resolving `enabled ?? !!<x>.developmentAgent` outside `resolveDevAgentGate`. The matcher required
|
|
12
|
+
`.developmentAgent` (or `['developmentAgent']`) **literally after the `??`**, so lifting the value into a
|
|
13
|
+
local const first walked past it while resolving the gate by hand exactly as before:
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
const da = config.developmentAgent;
|
|
17
|
+
return enabled ?? !!da; // exit 0 against the shipped lint
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
instar-codey reproduced this while auditing rename-defeatable checks and scoped the remedy: *"low for
|
|
21
|
+
simple local alias folding around `developmentAgent` feeding `??`."* That is the scope implemented — local
|
|
22
|
+
`const`/`let`/`var` aliases only, rebuilt per file.
|
|
23
|
+
|
|
24
|
+
The lint's header **already declared this limit** ("cannot catch arbitrary aliases/wrapper helpers"). Like
|
|
25
|
+
the journal-actuation ban earlier today, it is closed because the declared gap is cheap to close for the
|
|
26
|
+
shape that actually occurs, not because the declaration was dishonest.
|
|
27
|
+
|
|
28
|
+
## Decision-point inventory
|
|
29
|
+
|
|
30
|
+
- `collectDevAgentAliases(lines)` — ADD — per-file identifiers bound to `<expr>.developmentAgent`.
|
|
31
|
+
- `aliasGateMatcher(names)` — ADD — `?? [!!|Boolean(] <alias>`; returns null when there are no aliases, so
|
|
32
|
+
a file without one is byte-identical to before.
|
|
33
|
+
- Assertion A predicate — WIDEN — `HANDROLLED_GATE || aliasGate`.
|
|
34
|
+
- Assertions B and C, the funnel allowlist, the comment-stripping (`codeOnly`), and the marker logic are
|
|
35
|
+
untouched.
|
|
36
|
+
- No runtime block/allow decision added or modified. CI-time only.
|
|
37
|
+
|
|
38
|
+
## 1. Over-block
|
|
39
|
+
|
|
40
|
+
The failure that matters: this lint fails builds, so flagging correct code costs more than missing a case.
|
|
41
|
+
Four controls, each with a test:
|
|
42
|
+
|
|
43
|
+
- **An alias of something else** (`config.somethingElse`) is not flagged — only `developmentAgent` binds.
|
|
44
|
+
- **A look-alike name** (`config.developmentAgentName`) is not flagged: the `\b` holds through the alias
|
|
45
|
+
exactly as it holds at the direct callsite.
|
|
46
|
+
- **An alias never used at a `??`** is not flagged. *Reading* the flag is legal; resolving the GATE by hand
|
|
47
|
+
is what is banned, and that distinction is preserved.
|
|
48
|
+
- **A comment describing the aliased pattern** is not flagged — `codeOnly` already strips comments and the
|
|
49
|
+
alias collector runs on the same stripped lines, so a commented-out declaration binds nothing.
|
|
50
|
+
|
|
51
|
+
Scope is per-file by construction: aliases cannot leak between files.
|
|
52
|
+
|
|
53
|
+
Verified against the real tree: exit 0 — the widened check introduces **no new flags on existing code**.
|
|
54
|
+
|
|
55
|
+
## 2. Under-block
|
|
56
|
+
|
|
57
|
+
Stated in the source rather than implied:
|
|
58
|
+
|
|
59
|
+
- **Wrapper helpers** (`isDevAgent(config)`) — still invisible.
|
|
60
|
+
- **Cross-module aliases** — an alias exported from another file is not followed.
|
|
61
|
+
- **Anything needing dataflow** to resolve.
|
|
62
|
+
|
|
63
|
+
Guessing at those would over-match. The header's original claim is narrowed, not erased: it now cannot
|
|
64
|
+
catch *arbitrary* aliases, having gained the local-const case.
|
|
65
|
+
|
|
66
|
+
## 3. Level-of-abstraction fit
|
|
67
|
+
|
|
68
|
+
Same layer as the existing check — line-oriented regex over comment-stripped source, no AST, no type
|
|
69
|
+
information, no new dependency. The alias map is the minimum needed to answer "what value is at this
|
|
70
|
+
`??`?" without climbing to a parser.
|
|
71
|
+
|
|
72
|
+
## 4. Signal vs authority compliance
|
|
73
|
+
|
|
74
|
+
Unchanged. A CI guard, not a runtime authority. It pushes callers toward `resolveDevAgentGate`; the funnel
|
|
75
|
+
allowlist still exempts the funnel itself.
|
|
76
|
+
|
|
77
|
+
## 5. Interactions
|
|
78
|
+
|
|
79
|
+
- `npm run lint` chain — position unchanged; full chain green.
|
|
80
|
+
- Assertions B/C unaffected; their env-fixture tests pass untouched.
|
|
81
|
+
- No source module, route, config key, or state file touched.
|
|
82
|
+
|
|
83
|
+
## 6. External surfaces
|
|
84
|
+
|
|
85
|
+
None. Developer tooling, not an agent capability; the Agent Awareness Standard does not apply.
|
|
86
|
+
|
|
87
|
+
## 7. Rollback cost
|
|
88
|
+
|
|
89
|
+
`git revert` of one script plus the appended tests. No migration, no state, no deployed artifact.
|
|
90
|
+
|
|
91
|
+
## Conclusion
|
|
92
|
+
|
|
93
|
+
Ship. One evasion closed at the scope a peer's audit recommended, four anti-over-block controls added, real
|
|
94
|
+
tree verified clean.
|
|
95
|
+
|
|
96
|
+
## Evidence pointers
|
|
97
|
+
|
|
98
|
+
- `tests/unit/lint-dev-agent-dark-gate.test.ts` — **31/31 green** (24 existing + 7 added).
|
|
99
|
+
- Negative control: tests written BEFORE the fix and run against the shipped lint — **3 of 31 fail** (const
|
|
100
|
+
alias, bracket-access alias, `Boolean(alias)`); the four new controls and all 24 existing tests pass both
|
|
101
|
+
ways, which is what makes them controls.
|
|
102
|
+
- Reproduced by hand first, with a positive control: the direct form exits 1, the aliased form exits 0.
|
|
103
|
+
- Real-tree verdict: `node scripts/lint-dev-agent-dark-gate.js` → exit 0.
|
|
104
|
+
- Full `npm run lint` chain green.
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# Side-Effects Review — ask the worktrees which repo owns them
|
|
2
|
+
|
|
3
|
+
**Version / slug:** `worktree-repo-discovery`
|
|
4
|
+
**Date:** `2026-08-14`
|
|
5
|
+
**Author:** `echo`
|
|
6
|
+
**Second-pass reviewer:** `not required — Tier 1: pure addition with NO caller, therefore no runtime behaviour change on any agent. The consuming wiring is deliberately NOT in this change (see "What is deliberately not here").`
|
|
7
|
+
|
|
8
|
+
## Summary of the change
|
|
9
|
+
|
|
10
|
+
Adds two exported helpers to `src/core/AgentWorktreeDetector.ts` and one option on
|
|
11
|
+
`resolveDetectorInstarRepo`:
|
|
12
|
+
|
|
13
|
+
- `parseWorktreeGitPointer(contents)` — `gitdir: /repo/.git/worktrees/<slug>` → `/repo`, or null for anything
|
|
14
|
+
that is not exactly that shape.
|
|
15
|
+
- `discoverInstarRepoFromWorktrees(roots, {maxWorktrees})` — reads each worktree's `.git` POINTER FILE under
|
|
16
|
+
the given roots and returns the owning repo roots, ordered by how many worktrees name each.
|
|
17
|
+
- `ResolveDetectorRepoOptions.worktreeRoots` — when a caller passes ITS OWN `.worktrees` root(s), the
|
|
18
|
+
discovered repos join the candidate chain after the operator-supplied `worktree.repoPath` and before the
|
|
19
|
+
conventional-location guesses. Omitted ⇒ no candidates ⇒ byte-identical behaviour.
|
|
20
|
+
|
|
21
|
+
**Nothing calls it yet.** This lands the mechanism, verified, with the consuming wiring held back.
|
|
22
|
+
|
|
23
|
+
## Why it exists (observed, not hypothesised)
|
|
24
|
+
|
|
25
|
+
On a live agent, 2026-08-14: `GET /worktrees/agent-reaper` reported `enumerationOk: false`,
|
|
26
|
+
`enumerationFailures: 98`, error `git -C <agent home> worktree list --porcelain → fatal: not a git
|
|
27
|
+
repository` — while 45 worktrees and **27 GB** sat under that agent home.
|
|
28
|
+
|
|
29
|
+
Two blind spots, both a path assumed rather than resolved. `resolveDetectorInstarRepo` guessed at
|
|
30
|
+
`~/Documents/Projects/instar` and `~/instar`; neither exists there, so it returned null and the detector's
|
|
31
|
+
`if (repo)` guard silently skipped every tick. Separately the reaper was wired to `config.projectDir`, which
|
|
32
|
+
on that layout is the agent home and is not a repo at all.
|
|
33
|
+
|
|
34
|
+
The answer was on disk the whole time: a linked worktree's `.git` is a file naming its owning repo. This is
|
|
35
|
+
also the same defect class the reaper's own header records for 2026-07-29 — *"the reaper reported
|
|
36
|
+
`reclaimable: 0` against 73 worktrees because `git -C <path> worktree list` was failing outright."* That fix
|
|
37
|
+
made the failure VISIBLE (`enumerationOk` / `reclaimable: null`), which is how this was found; it did not make
|
|
38
|
+
resolution work.
|
|
39
|
+
|
|
40
|
+
## Decision-point inventory
|
|
41
|
+
|
|
42
|
+
- `parseWorktreeGitPointer` — ADD — pure function; returns null on anything unrecognised.
|
|
43
|
+
- `discoverInstarRepoFromWorktrees` — ADD — filesystem reads only, bounded by `maxWorktrees` (default 200).
|
|
44
|
+
- `ResolveDetectorRepoOptions.worktreeRoots` — ADD — inert unless passed.
|
|
45
|
+
- No runtime block/allow decision added or modified. No caller changed.
|
|
46
|
+
|
|
47
|
+
## 1. Over-block
|
|
48
|
+
|
|
49
|
+
Not applicable in the gate sense (nothing is blocked), but the analogous failure is **naming a wrong repo**,
|
|
50
|
+
and one real instance was caught during development and is now pinned by a test:
|
|
51
|
+
|
|
52
|
+
The first draft defaulted the discovery roots to `enumerateSafeRoots()`. That helper enumerates EVERY agent
|
|
53
|
+
home on the machine, so the agent asking the question resolved to a **different agent's repo** — whichever
|
|
54
|
+
owned the most worktrees. Measured on the real box: `echo` resolved to `instar-codey/repo`. A confident wrong
|
|
55
|
+
repo is strictly worse than the null this change removes — null makes a consumer skip, a wrong repo makes it
|
|
56
|
+
act. The API now has NO default: a caller must name its own root, documented on the option itself, and a test
|
|
57
|
+
asserts resolution takes no worktree candidate when none is named.
|
|
58
|
+
|
|
59
|
+
Other non-answers all return null/empty rather than a guess: a full clone under `.worktrees/` (its `.git` is a
|
|
60
|
+
directory, not a pointer), a malformed pointer, a submodule gitdir with no `/.git/worktrees/` segment, a
|
|
61
|
+
directory with no `.git`, an unreadable file, a missing root.
|
|
62
|
+
|
|
63
|
+
## 2. Under-block
|
|
64
|
+
|
|
65
|
+
**One agent's `.worktrees/` can legitimately hold worktrees of MORE THAN ONE clone of the same upstream.**
|
|
66
|
+
Measured on the agent that surfaced this: 29 worktrees owned by `<home>/.build/instar` and 17 by
|
|
67
|
+
`<home>/.dev/instar`. The helper returns BOTH, most-owned first; it does not merge them. A single-repo
|
|
68
|
+
consumer that takes only `[0]` therefore gets the largest coherent set and still will not see the smaller
|
|
69
|
+
repo's worktrees. That is an improvement over enumerating nothing and it is not full coverage — stated in the
|
|
70
|
+
function's own doc comment rather than left to be discovered.
|
|
71
|
+
|
|
72
|
+
Also unchanged: `resolveInstarRepo` still integrity-validates every candidate, so a discovered path that is
|
|
73
|
+
not a valid instar repo is rejected exactly as before.
|
|
74
|
+
|
|
75
|
+
## 3. Level-of-abstraction fit
|
|
76
|
+
|
|
77
|
+
Filesystem reads in a module that already does filesystem enumeration (`enumerateSafeRoots` next door).
|
|
78
|
+
**Deliberately no subprocess** — reading the pointer file is cheaper than `git rev-parse`, cannot block the
|
|
79
|
+
event loop, and keeps the helper usable from the runtime hot dirs where `lint-no-blocking-process-scans`
|
|
80
|
+
applies.
|
|
81
|
+
|
|
82
|
+
## 4. Signal vs authority compliance
|
|
83
|
+
|
|
84
|
+
The helper produces CANDIDATES, never an authority. Every candidate is still validated by `resolveInstarRepo`
|
|
85
|
+
before anything believes it. An operator-supplied `worktree.repoPath` continues to win outright.
|
|
86
|
+
|
|
87
|
+
## 5. Interactions
|
|
88
|
+
|
|
89
|
+
- `resolveDetectorInstarRepo()` with no `worktreeRoots` is byte-identical to before — verified by the existing
|
|
90
|
+
detector suites (19/19 green, unmodified).
|
|
91
|
+
- No consumer passes `worktreeRoots` in this change, so no runtime path changes on any agent.
|
|
92
|
+
|
|
93
|
+
## 6. External surfaces
|
|
94
|
+
|
|
95
|
+
None. No HTTP route, no config key, no user-visible message. Not an agent capability, so the Agent Awareness
|
|
96
|
+
Standard does not apply.
|
|
97
|
+
|
|
98
|
+
## 7. Rollback cost
|
|
99
|
+
|
|
100
|
+
`git revert` of one source file plus one test file. No migration, no state, no deployed artifact, and — since
|
|
101
|
+
nothing calls it — no behaviour to restore.
|
|
102
|
+
|
|
103
|
+
## What is deliberately NOT here, and why
|
|
104
|
+
|
|
105
|
+
The consuming wiring (pointing `AgentWorktreeReaper` and `OrphanedWorkSentinel` at the resolved repo instead
|
|
106
|
+
of `config.projectDir`) is **held back for a Tier 2 spec + operator approval.** It is runtime code feeding a
|
|
107
|
+
guard with delete authority, and the cross-agent misresolution above is direct evidence that getting
|
|
108
|
+
resolution wrong here is easy. Landing the mechanism first makes that follow-up a small, focused, individually
|
|
109
|
+
reviewable diff. It is registered as a commitment, not an intention.
|
|
110
|
+
|
|
111
|
+
## Conclusion
|
|
112
|
+
|
|
113
|
+
Ship. Verified mechanism, zero runtime effect, one real misresolution caught during development and pinned by
|
|
114
|
+
a test.
|
|
115
|
+
|
|
116
|
+
## Evidence pointers
|
|
117
|
+
|
|
118
|
+
- `tests/unit/agent-worktree-repo-discovery.test.ts` — 14/14 green.
|
|
119
|
+
- Existing detector suites unmodified and green: `AgentWorktreeDetector`, `-attention-wireup`,
|
|
120
|
+
`WorktreeEnumerationFailureStore` — 19/19.
|
|
121
|
+
- Full `npm run lint` chain green; `tsc --noEmit` clean.
|
|
122
|
+
- Real-machine measurement: with the caller's own root, discovery returns
|
|
123
|
+
`[<home>/.build/instar, <home>/.dev/instar]` (29 and 17 worktrees respectively); with no root, resolution
|
|
124
|
+
returns null exactly as before.
|