gabriel / musehub public
Open #212 Bug
filed by gabriel human · 33 days ago

muse mist push crashes unconditionally: SimpleNamespace missing json_out (has json_output) and other required push.py attributes

0 Anchors
— Blast radius
— Churn 30d
0 Proposals
No description provided.
◎ Activity1
●
gabriel opened this issue 33 days ago
○
gabriel 33 days ago

Confirmed while building Episode 20 ("Mist") demo material. Severe: the documented "manual workflow" for mist push crashes 100% of the time, unconditionally, with an unhandled AttributeError.

Repro (exactly the documented flow, from muse mist push --help):

muse init --domain mist
echo "..." > motif.txt
muse commit -m "..." --sign
muse mist push --remote local --branch main

Traceback (most recent call last):
  File ".../muse/cli/commands/mist.py", line 785, in run_push
    push_run(push_args)
  File ".../muse/cli/commands/push.py", line 503, in run
    json_out: bool = args.json_out
                     ^^^^^^^^^^^^^
AttributeError: 'types.SimpleNamespace' object has no attribute
'json_out'. Did you mean: 'json_output'?

Reproduces identically with or without --json on the mist push invocation itself.

Root cause: muse/cli/commands/mist.py::run_push() builds a bare types.SimpleNamespace and hands it to push.py's run() (the regular muse push implementation), reusing it as "delegate to the push command's internals":

push_args = types.SimpleNamespace(
    remote=remote,
    branch=branch,
    force=False,
    json_output=json_output,
)
push_run(push_args)

push.py::run() reads args.json_out (not json_output — genuinely different attribute name, confirmed by grep — no json_out is ever set). It also reads args.branch_pos and args.set_upstream_flag later in the same function, neither of which the constructed namespace provides either. The real argparse-based muse push CLI entry point always populates all of these; this hand-built namespace only covers 4 of the fields run() actually needs.

Impact: muse mist push cannot succeed under any circumstances today. The fast-path muse mist create --push (a single POST /api/mists call, bypassing this code entirely) works correctly but never populates commitId/snapshotId in its response — so Mist's documented "full VCS lineage (branches, commits, proposals, diffs, releases)" claim currently has no working demonstration path via the CLI at all.

Suggested fix: either construct the full attribute set push.py's run() needs (matching whatever the real argparse parser produces — safest to introspect it rather than hand-list fields, since this is exactly how the drift happened), or refactor run() to accept an explicit typed parameter object instead of a raw argparse.Namespace duck-type, so a mismatch like this fails at call-construction time rather than deep inside execution.

Deferred per usual until after the season wraps.