gabriel / musehub public
fix patch publish_issue fix/186-publish-issue-staging-url-hard-block #1 / 1
AI Agent gabriel · 19 hours ago · Sep 11, 2026 · Diff

fix(publish_issue): hard-block publishing a body that leaks a staging URL

Per aaronrene's review of #186's publish_issue.py: the staging.musehub.ai check was only a warning printed to stderr alongside the successful publish. The failure mode being guarded against is a leaked internal hostname, and a warning is exactly the thing that gets skimmed past at the moment someone's about to post a ticket link on social media.

Raises StagingUrlLeakError (a RuntimeError) before any production create/update happens, refusing to publish rather than publishing with a note. main() already catches RuntimeError, so the CLI surfaces this as `❌ ...` + exit 1 with no changes needed there.

The bare-issue-reference check (#182-style refs that won't resolve on production) stays a warning, not a block — reviewed by aaronrene, only the staging-URL leak was flagged as needing a hard stop.

Tests: tests/test_publish_issue.py — updated the staging-URL test to assert pytest.raises(StagingUrlLeakError) and that nothing is published to production when it fires. Full file: 8 passed.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

sha256:411992ae51c0ea420190eb8cfc86e6f04de4d0af5f11238a7542e04cf80afc18 sha
+3 ~4 −1 symbols
2 changed · 1075 in snapshot files
sha256:d7203b2aa78df228c8391fb502bd9000b24a8c170d53734bd01fc1c47d6a31e7 snapshot
+3
symbols added
~4
symbols modified
−1
symbol removed
2
files changed
1075
files in snapshot
0
dead code introduced
Semantic Changes 8 symbols
~ scripts/dev/publish_issue.py .py 1 symbol added, 1 symbol modified
+ StagingUrlLeakError class class StagingUrlLeakError L40–45
~ tests/test_publish_issue.py .py 2 symbols added, 1 symbol removed, 3 symbols modified
test_staging_url_in_body_triggers_warning method method test_staging_url_in_body_triggers_warning L102–111
+ test_staging_url_in_body_raises_and_blocks_publish method method test_staging_url_in_body_raises_and_blocks_publish L102–116
+ StagingUrlLeakError import import StagingUrlLeakError L13–13
Files Changed
~2
1075 in snapshot
← Older Oldest on fix/186-publish-issue-staging-url-hard-block
All commits
Newer → Latest on fix/186-publish-issue-staging-url-hard-block

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:411992ae51c0ea420190eb8cfc86e6f04de4d0af5f11238a7542e04cf80afc18 --body "your comment"