Repository navigation
feat(bin): attribute Beads audit-trail actors at every boundary - #3712
RooseveltAdvisors wants to merge 4 commits into
Conversation
bd attributes each backlog state change to $BEADS_ACTOR, falling back to git identity, so a fleet sharing one Beads graph collapsed into a single actor. Export the variable at the two boundaries that matter: - bin/fm-spawn.sh exports the task id (the registered secondmate name for a secondmate) process-wide and into the worker's pane, so the dispatch claim and every claim, hold, or close the worker drives record who did it. - Every firstmate-owned mutation records firstmate@<basename of FM_HOME> through fm_tasks_axi_export_actor in bin/fm-tasks-axi-lib.sh, called from the fm_backlog_mutate chokepoint plus the direct tasks-axi call sites (captain holds, handoffs, receipts, the decision shim, public follow-ups). An explicitly exported actor is never overridden. tests/fm-beads-actor.test.sh drives a real spawn and teardown on the beads backend and asserts the claim actor is the task id, the close actor is firstmate@home, and the documented attribution read (tail -100 .beads/interactions.jsonl | jq -r .actor | sort | uniq -c) shows both actors after one spawn and one teardown. Along the way, hardened test fixtures that created state roots under an ambient group-writable umask the process-event privacy contract refuses (captain-hold-lifecycle, procevent, procevent-when, remote-reply, bearings-board-render), and pinned fm-test-run.sh's comm comparisons to LC_ALL=C so the coverage guard works outside the C locale.
…e per authorized review fix
…or resolver in scripts index
Confidence Score: 5/5The PR appears safe to merge because no concrete changed-code failure remains. The actor resolver preserves explicit identities, spawn consistently establishes the task identity before dispatch and pane launch, and the changed mutation boundaries apply the intended attribution without an established contract break. Reviews (1): Last reviewed commit: "no-mistakes(lint): Fix ShellCheck SC2015..." | Re-trigger Greptile |
|
Speaking as Kun's firstmate: this is with the captain for a default-behavior decision — not waiting on you. Reviewed HEAD Contract-class: new-default. Unconfigured Beads attribution changes fleet-wide: unset VISION per-rule
Attestation: MATCH. NM PASS ( Merge-eligible: NO — otherwise ready except default-behavior. Flagging Firstmate for a captain new-default card. Do not merge/rebase while that card is open. |
|
Speaking as Kun's firstmate: captain word on the new-default merge card — skip is not merge and not close. Leave this open. Not waiting on the author. HEAD still Firstmate will only re-flag if the tip product surface changes or this becomes otherwise-ready again and needs a fresh captain card. |
|
Speaking as Kun's firstmate: declined / closed by captain decision. Not waiting on the author. Do not merge. HEAD VISION.md per-rule (close-as-decided)
Thank you @RooseveltAdvisors for the careful work — a later PR that stays on tasks-axi (or an explicit opt-in the captain grants) can be considered on its own. |
…henguid#3712) Upstream: kunchenguid#3712 State: closed-unmerged Slug: beads-actor-identity Upstream PR kunchenguid#3712 (closed, unmerged). BEADS_ACTOR export on firstmate mutations + beads-actor suite. Spawn/captain-hold actor wiring ships with House tracking: one commit ↔ one upstream PR. When this PR merges to origin/main, drop this commit from house main (rebase onto new origin/main or reset residue without this feature).
…id#4225) Upstream: kunchenguid#4225 State: open Slug: stale-sweep-capacity Upstream PR kunchenguid#4225 (open); supersedes closed kunchenguid#3720. Also sibling kunchenguid#4224. Includes bin/fm-spawn.sh and bin/fm-captain-hold.sh full house delta (capacity + kunchenguid#3712 actor bits + kunchenguid#3458 label bits) and bin/fm-teardown.sh full house delta (capacity release + kunchenguid#3657 retire-secondmate authority), because those files are not cleanly separable at tip. House tracking: one commit ↔ one upstream PR. When this PR merges to origin/main, drop this commit from house main (rebase onto new origin/main or reset residue without this feature).
Intent
Captain, 2026-09-04, on the Beads gap-fill table: "go finish these" - the actor-identity lever is idle and due: "1 actor across the last 200 events; the variable appears nowhere in our launch tooling". Make every claim, hold, and close in the shared Beads graph carry who did it.
What Changed
fm_tasks_axi_export_actorinbin/fm-tasks-axi-lib.sh, which exportsBEADS_ACTORasfirstmate@<basename of FM_HOME>.<short hostname>unless already set, and call it from every firstmate-owned mutation path (fm-backlog-handoff.sh,fm-backlog-receive.sh,fm-backlog-transition-lib.sh,fm-captain-hold.sh,fm-decision-hold.sh,fm-public-followup.sh) so claims, holds, and closes record who made them.bin/fm-spawn.shnow setsBEADS_ACTORto the spawned task id (deliberately replacing any inherited value) and ships the same export through the worker's tmux pane, so the dispatch claim and every worker-driven Beads write are attributed to the worker.tests/fm-beads-actor.test.shdriving real spawn/teardown flows against a live bd database to assert recorded actors in.beads/interactions.jsonl(dispatch claim, teardown close, and never overriding an explicit actor); fixLC_ALL=Concomminvocations inbin/fm-test-run.shand make private state roots umask-safe in several test fixtures; document the two attribution boundaries indocs/configuration.mdand the resolver indocs/scripts.md.Risk Assessment
✅ Low: The fix round is a small, mechanical, authorized change confined to the single actor resolver with matching test and doc updates, and no other caller computes the actor formula.
Testing
Completed 1 recorded test check.
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 2 issues found → auto-fixed ✅
bin/fm-tasks-axi-lib.sh:167- The firstmate-side actor is 'firstmate@' + basename(FM_HOME), with no host qualification. Two homes on different machines whose FM_HOME basenames collide (e.g. two clones both named 'firstmate', or secondmate homes both named 'home' in the test fixture's shape) produce identical firstmate actors in the shared Beads graph, partially recreating the collapsed-identity problem this change fixes for firstmate-owned events (worker events stay distinct because the task id is the actor). The stated intent is that every event 'carry who did it', so whether a home-unique name is sufficient is the author's call; a host- or id-qualified actor would extend the change rather than correct it, so this needs authorization rather than an auto-fix.bin/fm-test-run.sh:693- The LC_ALL=C 'comm' fixes are a drive-by correctness repair unrelated to the actor-identity intent: the inputs are LC_ALL=C-sorted but the original comm calls ran under the ambient locale, so the coverage-guard set comparisons could report spurious missing/extra entries under a non-C locale. The fix is mechanically correct and matches the existing sort invocations; noting the scope drift, no action needed.🔧 Fix: Qualify firstmate Beads actor with short hostname per authorized review fix
✅ Re-checked - no issues remain.
bin/fm-test-run.sh --changed --exclude-family real-herdr-gated✅ **Document** - passed
✅ No issues found.
🔧 **Lint** - 1 issue found → auto-fixed ✅
🔧 Fix: Fix ShellCheck SC2015 and SC1010 in tests/fm-beads-actor.test.sh
✅ Re-checked - no issues remain.
✅ **Push** - passed
✅ No issues found.