feat: persist real branch-creation provenance, separate from tip authorship (musehub#216)
muse branch --json's created_by field was never a creation record -- it was recomputed live from whichever commit currently happens to be the branch's tip (branch.py's old `rec.agent_id if rec and rec.agent_id else None`). Rewrite history, fast-forward the branch, or have someone else commit to it, and created_by silently changes to match, with no indication the value ever meant something different a moment ago.
BranchMeta never had any field for 'who ran muse switch -c / muse branch <name> and when' -- despite write_branch_meta()'s own docstring already (falsely) claiming creation-time fields were preserved.
Fix: - Add created_by_handle/created_by_kind/created_at to BranchMeta, written once at actual creation time by muse switch -c / muse checkout -b / muse branch <name> (never touched again). - resolve_actor_identity() resolves the invoking actor via MUSE_AGENT_HANDLE (agentception's injection mechanism) or user.handle config -- lightweight and local-only, no key material. - muse branch --json: created_by is now the immutable creation record ({handle, kind}), falling back to the legacy tip-authorship value for branches created before this shipped (no creation record exists). A new last_committer field reports current tip authorship separately -- the fact created_by used to conflate. - Fixed a pre-existing _load_config bug along the way: the TOML parser whitelisted only intent/resumable/remote/merge, silently dropping any other [branch.<name>] field -- would have made the new fields round-trip as empty regardless of what was written. - Batched the --json listing's per-branch config.toml reads into a single load up front. Every branch now gets a creation-provenance section (previously, branches with no --intent/--resumable had no section at all and the file stayed tiny), so the existing per-branch reload in _upstream_for/read_branch_meta became a real O(n^2) cost at scale -- caught by the existing 500-branch listing perf test timing out at ~4.8s against a 2s budget.
Semantic Changes
41 symbols
Files Changed
~4
1260 in snapshot
0 comments
muse hub commit comment sha256:f8da4e8a3d3f70a3d5b8e754b5e775f9785f6021ac2411a7ef82e64e10917ee3 --body "your comment"
No comments yet. Be the first to start the discussion.