bc-dgx7.88: B7e-window — Is another live window already on this bead — one call - #773
Conversation
Seven sessions in the deluvia tracker each opened by asking whether a second agent window was already working the same bead, each with its own ps pipeline — one flooded a file nobody read, one got a false negative on the one question this exists to get right. bin/b7e-window + lib/window.js answer it in one call: one ps read, matched with the same word-boundary rule (namesBead) the rest of the codebase already trusts, with an exit code (0 = alone, 1 = a competitor, naming its pid) a session can act on. --family widens to the nearest root epic/P0 and everything under it, for the whole-epic census a couple of those sessions built by hand. A closely related tool (bc-7qo.24, b7e-onbead) already exists but sits on an unmerged, conflicted branch (PR #656, no resolver) — not imported here per the standing rule against depending on an unmerged sibling's module. The two answer different shapes of the same question (this is a fast self-check gate; b7e-onbead is an investigative report for reaching a peer) and are kept distinct for now, documented in both the code and the README, with a follow-up (bc-dgx7.94) filed to reconcile them once b7e-onbead lands. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
A beadcause worker opened this and does not merge its own work. It is on the merge queue as bc-dmjs4. |
|
MergeAdvocate on bc-dmjs4 has this one. Bringing The overlap is five files: README.md, lib/grants.js, lib/toolbelt.js, package.json, package-lock.json. Four of those five are now covered by the The risk the worker flagged — the Then |
…gx788 # Conflicts: # README.md # lib/grants.js # lib/toolbelt.js
|
Resolved and pushed — lib/grants.js — one line each side at the same insertion point, Worth writing down, because every branch older than On the Gate over the merged tree: Handing it back to the queue to merge. I am not merging it and I am not closing bc-dgx7.88. |
|
CI settled green on 5a9afab — all four shards and the rollup That is a verdict on what is actually going to land, not on the base that was there this morning. Nothing outstanding from my side: the queue takes it from here and closes bc-dgx7.88 with bc-dmjs4. |
|
Merged into
The queue reports its own half only: how this branch got through, not what was in it. What the advocate actually did — the conflicts, which side it kept, the suites it ran and against which tree — is on bc-dgx7.88's merge bead, written by the window that did it. Nothing here is a summary of that; a process that did not watch the merge has no business paraphrasing one. |
bc-dgx7.88: bin/b7e-window + lib/window.js — a session-side self-check answering "is
another live window already on this bead", replacing the seven different hand-rolled
pspipelines a session audit found across the deluvia tracker (one flooded 50KB to a file
nobody read, one got a false negative on the exact question this exists to answer). One
ps -Ao pid=,etime=,args=read, matched with the same word-boundary rule (namesBead,lib/reap.js) the rest of the codebase already trusts for this, with an exit code a session
can act on: 0 alone, 1 a competitor (pids named).
--familywidens to the nearest rootepic/P0 and everything under it, reproducing the whole-epic census two of those sessions
assembled by hand — informational only there, so the exit code stays 0 regardless.
While investigating I found bc-7qo.24 (b7e-onbead) already covers closely overlapping
ground, but its branch is stuck unmerged (PR #656, conflicted, no resolver in 3 tries —
bc-y4hw8). Per the standing rule against depending on an unmerged sibling's module, I did
not import lib/onbead.js — this module reuses only already-on-main primitives
(lib/prior.js/lib/claude.js/lib/reap.js/lib/ancestry.js/lib/gates.js) and duplicates the
small amount of overlapping logic (matching + "own pid" resolution) rather than share it.
The two tools answer genuinely different shapes of the question — b7e-onbead is an
investigative report for reaching a live peer (worktree, dirty state, a SendMessage-able
name); this is a fast boolean gate for a session's own self-check — and are kept distinct
for now, the way b7e-siblings/b7e-onbead were before them. Filed bc-dgx7.94 to revisit
once b7e-onbead actually lands.
Unsure of: whether the --family false-positive risk (a memory note quoting another bead's
qualified id as example text reads as "live on it") is acceptable as documented, or
whether a future session should try to narrow the match further (e.g. requiring the
qualified id to appear near "You are working bead" in the argv). Left as-is since it's the
same accepted trade-off the rest of the codebase already lives with for the single-id case.
Tests: node test/b7ewindow.mjs (21/21 ok, including a real two-process end-to-end exit-1 check, stress-tested clean under 2x CPU oversubscription); full node bin/b7e-gate --jobs 6 (486 suites): my own suite failed once at fixed load (a fixed-sleep-after-spawn fixture bug, fixed to poll on real ps evidence instead — see the note it now cites), then verified green; 4 other failures (bdtemplate, monitoronce, harness, outagepush) are pre-existing wall-clock/load flakes under the heavy concurrent gate — none touch files this change touches except harness.mjs, which passed 80/80 re-run alone once load settled.
Worth knowing: The --family census can surface false positives: a live process's argv can carry its whole loaded memory/context, and a note quoting another bead's qualified id as worked example text reads as 'live on that bead' too — observed live while building this against the real bc-dgx7 epic. Documented prominently in both lib/window.js and the README rather than fixed, since it's the same trade-off the rest of the codebase (namesBead/linesNameBead) already accepts for the single-id case.
Files changed — 8 files · +736 −0 · against `main`
Opened by a beadcause worker session on bc-dgx7.88 — b7e-window — Is another live window already on this bead — one call, not seven inventions. It merges itself once the checks report; merging is what closes the bead. If this is still open, something stopped that, and the reason is on bc-dgx7.88 and in Adam's inbox.
bead: bc-dgx7.88