bc-dgx7.77: B7e-role — A relay role's whole operating contract, in one call - #758
bc-dgx7.77: B7e-role — A relay role's whole operating contract, in one call#758mordam wants to merge 10 commits into
Conversation
…e call Five deluvia sessions (dv-5eu.1.1, dv-gr6.43, dv-gr6.41, dv-b5d.4.3, dv-gr6.38) each hand-sliced docs/STUDIO_CHARTER.md (726 lines), APPROVAL_PIPELINE.md and a role file differently every time a relay opened or changed roles, and dv-gr6.43's hand-cut slice of clio.md happened to stop short of a ruling that superseded the rule it read instead. b7e-role -w <workspace> <role> prints the role's own charter block, the studio's one law, the role file in full, its declared output template, and the legal --next targets (lib/relay.js's rolesOf) — each with a source path and line range. --next alone answers the question that cost four of the five sessions a rejected `beadcause-relay --next`. --all lists the roster with department and gate. lib/rolecontract.js does the markdown slicing as pure functions over already-read text, fence-aware (a role's worked-example output template can itself be written in markdown headings, which would otherwise fool the section scanner into cutting it short). The command is workspace-general: every path comes off that workspace's own config.relays[name] entry, the same definition beadcause-relay and the relay brief already read, so deluvia is only the first caller. Wired per bc-dgx7.2: both bin registrations (package.json, package-lock.json), Bash(b7e-role:*) on DEFAULT_TOOL_LIST and classified `read` in lib/grants.js, a README section, and test/role.mjs (55 checks) — the CLI half runs against a fixture workspace built on disk with an isolated BEADCAUSE_CONFIG_DIR, so it needs no deluvia checkout; one final block checks the shipped deluvia default's roster shape (19 roles, 18 legal next-roles for clio) without reading any of its files, so it holds on a machine that has never heard of deluvia. Tests: node test/role.mjs (55/55) standalone, then the full gate — bin/b7e-gate --jobs 3 — 478/478 suites passed, including test/role.mjs and test/lockfile.mjs.
|
A beadcause worker opened this and does not merge its own work. It is on the merge queue as bc-ovby9. |
|
The beadcause merge queue tried to merge this and could not: it has been tried 3 times and stopped at the same place each time. the branch still conflicts with |
beadcause-memory's a-checkout-dir-is-not-a-workspaces-dir note flags exactly this command's shape: cfg.workspaces[name].dir is the bd tracker's directory (~/beads/deluvia/.beads), never the code checkout, and a new b7e-* command that needs "which checkout is this workspace" should use lib/session.js's resolveSessionDir — the pair ~25 existing call sites (lib/advocate.js, lib/deploy.js, lib/jiraingest.js, lib/mergesweep.js, lib/prboard.js) already share — rather than hand-roll a path match. b7e-role previously defaulted an unset --dir to process.cwd(), which only worked by accident when invoked from inside the workspace's own checkout (true for a relay session, not for anything else). It now tries resolveSessionDir(cfg, ws) first, falling back to cwd when the workspace has no cfg.workspaces entry or resolveSessionDir cannot place it — so `b7e-role -w deluvia clio` now finds the real charter and role files from anywhere, verified against the real deluvia checkout on this Mac from inside the beadcause worktree itself. --dir still wins outright, and every previously-passing test (cwd-based) still passes unchanged; one new test covers the no-dir/cwd-elsewhere path directly. Tests: node test/role.mjs (57/57, up from 55). The full gate (bin/b7e-gate --jobs 3) ran clean at 478/478 before this fix; a second full-gate run afterward showed 52 unrelated timeouts (bdtemplate, call, commission, census, deploy, endorse, evidence, ...) under heavy concurrent load on this Mac — test/role.mjs itself only "failed" there as a 939s timeout, and passes cleanly standalone in ~19s, so this is the documented gate-reds-on-a-loaded-mac pattern, not a regression from this change.
|
Updated — 2 commits on Follow-up to the same bead, same branch/PR: switches bin/b7e-role's directory default Tests: node test/role.mjs (57/57 standalone, ~19s). Full gate (bin/b7e-gate --jobs 3) ran clean 478/478 before this follow-up commit; a second full-gate run afterward hit 52 unrelated timeouts under heavy concurrent Mac load (test/role.mjs included, as a 939s timeout) but passes cleanly standalone — the documented gate-reds-on-a-loaded-mac pattern, not a regression. |
|
A beadcause worker opened this and does not merge its own work. It is on the merge queue as bc-72dnr. |
# Conflicts: # lib/grants.js # package-lock.json # package.json
# Conflicts: # lib/grants.js
|
The beadcause merge queue tried to merge this and could not: it has been tried 3 times and stopped at the same place each time. the branch still conflicts with |
# Conflicts: # package-lock.json # package.json
# Conflicts: # lib/grants.js
bc-wbrhi (#791) turned lib/grants.js and lib/toolbelt.js into derived registries — a tool declares '@grant read' in its own header and lib/tooldecl.js builds both lists from bin/. Those two files were still merge=union on this branch's .gitattributes, so the merge silently kept both sides: main's derived version plus this branch's 35 hand-written b7e entries restored into each. Resolved by taking origin/main's lib/grants.js and lib/toolbelt.js whole and declaring '@grant read' in bin/b7e-role's header, which is the post-bc-wbrhi way to say the same thing. README's paragraph about where b7e-role is registered updated to match.
|
beadcause-resolver: stood down — worktree-b7e-role-dgx777 is already locked by another resolver on this same PR (reason "resolver pid 64046 #758", pid live in ps). Left the tree untouched and unlocked nothing; that session owns the merge. |
Adds bin/b7e-role: a relay role's whole operating contract in one call, closing the gap
five deluvia sessions each paid for by hand-slicing docs/STUDIO_CHARTER.md (726 lines),
APPROVAL_PIPELINE.md and a role file differently every time a relay opened or changed
roles — one of them reading a rule off trunk that a later ruling had already superseded
because its hand-cut slice happened to stop just short of the correction.
b7e-role -w <workspace> <role>prints the role's own charter block, the studio's onelaw, the role file in full, its declared output template, and the legal --next targets
(lib/relay.js's rolesOf) — each annotated with a source path and line range so a disputed
sentence can be checked against the file it came from.
--nextalone answers thequestion that cost four of the five sessions a rejected
beadcause-relay --nextcall,and
--alllists the roster with each role's department and gate. Every path is read offthat workspace's own
config.relays[name]entry (lib/relay.js) — the same definitionbeadcause-relayand the relay brief already use — so deluvia is only the first caller,not a hardcoded assumption.
lib/rolecontract.js does the markdown slicing as pure functions over already-read text.
The one non-obvious piece: clio's real output template is a worked example wrapped in a
fenced code block that is itself written in markdown headings (
## Clio's Continuity Report,### 1. Timeline) — a naive heading scanner reads the example as more of thedocument and cuts the template off after two lines, so section-finding runs against a
fence-blanked copy of the text (same length, same line breaks) while every slice returned
is still cut from the original.
Wired per bc-dgx7.2: both bin registrations,
Bash(b7e-role:*)onDEFAULT_TOOL_LISTclassified
readin lib/grants.js, a README section, and test/role.mjs. The CLI half ofthe test suite builds its own fixture workspace on disk with an isolated
BEADCAUSE_CONFIG_DIR, so it needs no deluvia checkout to run; a final block checks theshipped
deluviadefault's roster shape (19 roles, 18 legal next-roles for clio) usingonly
--all/--next, which read no files at all, so that block holds on a machine thathas never heard of deluvia — the same guarantee test/relay.mjs's own shipped-config check
relies on.
Unsure of one thing: main moved under me while I worked (another branch added
b7e-rebaselinebetween the same twopackage.jsonbin entriesb7e-rolelandsbetween), so the registration lines will very likely collide on merge — a routine
take-both, per this repo's own notes on b7e-registry conflicts, but flagging it since I
haven't seen the other branch's actual diff.
Tests: node test/role.mjs (55/55 standalone), then the full local gate: bin/b7e-gate --jobs 3 — 478/478 suites passed (including test/role.mjs and test/lockfile.mjs).
Files changed — 8 files · +907 −0 · against `main`
Opened by a beadcause worker session on bc-dgx7.77 — b7e-role — A relay role's whole operating contract, in one call, instead of slicing a 726-line charter. 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.77 and in Adam's inbox.
bead: bc-dgx7.77