Found while building Episode 01 ("The Whole Workflow") demo material —
a real question about why created_by showed null for a genuinely
human-authored branch led to this.
Confirmed:muse/cli/commands/branch.py:872:
created_by: str | None = (rec.agent_id if rec and rec.agent_id else None)
CommitRecord (muse/core/commits.py) has two separate authorship
fields — author: str = "" (human handle, e.g. "gabriel") and
agent_id: str = "" (agent identity, e.g. "claude-code"). The
created_by computation above only ever reads agent_id. It never
falls back to .author. For any branch whose tip commit was made by
a human (i.e. no --agent-id passed to muse commit), created_by
is unconditionally null — not because nothing is known, but because
the one field that is known (.author) is never consulted.
Reproduced live: committed as a human (muse commit -m "...", no
agent flags) → muse branch --json shows "created_by": null.
Committed again with --agent-id claude-code --model-id claude-sonnet-5 → created_by immediately became "claude-code".
Same repo, same branch, only the authorship fields on the tip commit
changed.
Suggested fix:created_by = rec.agent_id or rec.author or None
(or equivalent), so the field reflects whichever authorship type is
actually present rather than silently treating human-authored
branches as if nothing were known about them.
Related, larger issue filed separately:created_by is also
computed from the branch's current tip commit, not from any
persisted record of who actually created the branch — see the
companion ticket on that. This ticket is scoped narrowly to the
.author fallback; fixing it doesn't require solving that larger
problem.
Found while building Episode 01 ("The Whole Workflow") demo material — a real question about why
created_byshowednullfor a genuinely human-authored branch led to this.Confirmed:
muse/cli/commands/branch.py:872:CommitRecord(muse/core/commits.py) has two separate authorship fields —author: str = ""(human handle, e.g."gabriel") andagent_id: str = ""(agent identity, e.g."claude-code"). Thecreated_bycomputation above only ever readsagent_id. It never falls back to.author. For any branch whose tip commit was made by a human (i.e. no--agent-idpassed tomuse commit),created_byis unconditionallynull— not because nothing is known, but because the one field that is known (.author) is never consulted.Reproduced live: committed as a human (
muse commit -m "...", no agent flags) →muse branch --jsonshows"created_by": null. Committed again with--agent-id claude-code --model-id claude-sonnet-5→created_byimmediately became"claude-code". Same repo, same branch, only the authorship fields on the tip commit changed.Suggested fix:
created_by = rec.agent_id or rec.author or None(or equivalent), so the field reflects whichever authorship type is actually present rather than silently treating human-authored branches as if nothing were known about them.Related, larger issue filed separately:
created_byis also computed from the branch's current tip commit, not from any persisted record of who actually created the branch — see the companion ticket on that. This ticket is scoped narrowly to the.authorfallback; fixing it doesn't require solving that larger problem.Deferred per usual until after the season wraps.