Skip to content

feat: B2 Atlas Prompt OS TUI — v0.6.0 MVP#8

Merged
MCamner merged 31 commits into
mainfrom
feat/brain-bridge
Jun 9, 2026
Merged

feat: B2 Atlas Prompt OS TUI — v0.6.0 MVP#8
MCamner merged 31 commits into
mainfrom
feat/brain-bridge

Conversation

@MCamner

@MCamner MCamner commented Jun 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • B2 Atlas Prompt OS TUI (mqlaunch/b2_tui/) — full structured prompt browser and composer for terminal use
  • CLI commands: mq b2 list, show, compose, route, validate, history, config, export-last, open-last
  • Textual TUI (mq b2) — three-panel layout (categories / projects / preview), j/k navigation, / search, compose/route/history modals
  • Rule-based task router with support project suggestions
  • JSONL history + Obsidian run writer
  • 40 passing tests (no real vault required)
  • Dev menu shortcut: Main → 5 (Dev) → a

Also includes brain-bridge commands, fzf prompt picker, gitlaunch protected-push improvements, and markdownlint config from earlier work on this branch.

Test plan

  • PYTHONPATH=. /opt/homebrew/bin/pytest mqlaunch/b2_tui/tests -v — 40 passed
  • mq b2 validate — 43 prompts OK, 0 errors
  • mq b2 list, categories, show 02.11, route "...", history — all smoke-checked
  • VERSION bumped to 0.6.0, tag v0.6.0 pushed
  • README badge, CHANGELOG [0.6.0], ROADMAP Phase 13 all updated

🤖 Generated with Claude Code

MCamner and others added 15 commits June 7, 2026 18:37
- terminal/bridges/brain-bridge.sh — thin bridge: brain/note/sessions/
  decisions/reviews/learn/memory/vault subcommands open vault views.
  Read-only — never writes. Uses Obsidian URI or open fallback.
- mqlaunch.sh — sources brain-bridge alongside hal-bridge
- mqlaunch-command-mode.sh — routes brain and shortcut aliases
  (note, sessions, decisions, reviews) via dispatch_cli_command

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
mqlaunch learn now routes to mq_brain_run "learn" via both
dispatch_cli_command and run_arg_command, matching the pattern
for note/sessions/decisions/reviews.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…urning to main menu

Implements the documented back-marker-pattern so mqlaunch restarts
gitlaunch on unexpected exits instead of falling through to the main menu.

- gitlaunch: add BACK_MARKER env var, mark_gitlaunch_back() function,
  call it on b/B before break
- mqlaunch: wrap open_git_menu invocation in restart loop; only breaks
  when back-marker file is written (deliberate b navigation) or after
  5 consecutive unexpected exits
- smoke test: assert mark_gitlaunch_back, BACK_MARKER, MQ_GITLAUNCH_BACK_MARKER
  are present in gitlaunch.sh

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- brain-bridge.sh: add `systems` and `verified` subcommands; remove `memory` case arm (memory/ retired in P4)
- mqlaunch.sh and mqlaunch-command-mode.sh: extend brain pattern match to include `verified|systems`
- tests/brain-bridge-smoke.sh: new smoke test (6 assertions) covering subcommand presence and memory removal

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…(P8)

mqlaunch release-check --brain appends a BRAIN RECORD section after the
standard release-check: runs mq-agent signal --brain . to write the
repo-signal result to mqobsidian/reviews/ via mq-mcp.

mqlaunch-command-mode.sh now passes all args (${@:2}) to
mq-release-check.sh so flags like --brain reach the script.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Three write commands added to command-mode and dispatch table:
  mqlaunch review-brain [path]   → mq-agent review repo --brain
  mqlaunch signal-brain [path]   → mq-agent signal --brain
  mqlaunch learn-promote <slug>  → mq-agent learn promote --approve

All three guard on _run_agent availability (declare -f pattern).
Covers the two main vault write flows and the human curation gate.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…index

Both the panel (show_command_index) and plain-text (show_help) sections updated.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ption 6

- Option 6: was duplicate "signal ." → now "signal --brain ." (saves to brain)
- New section SECOND BRAIN:
  - 15. Review repo → brain  (review repo . --brain)
  - 16. Promote learn pattern (prompts for slug → learn promote --approve)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
_brain_pick_and_promote() lists learn/ files via fzf (falls back to
numbered list + read if fzf not found). User no longer needs to know
slug from memory.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…inue

After pr_aware_push switched branches with git switch -c, the WORK_DIR
variable became stale. On next detect_repo iteration, cd "$WORK_DIR" || exit
triggered an exit, causing the open_git_menu restart loop to give up after
5 restarts and return to main menu.

Fix: pause_git_menu is now called from the case statement in the main loop
(same pattern as options 1,2,4,8), not from within run_ai_commit. The
continue was also removed — natural loop iteration is sufficient.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@MCamner MCamner changed the title chore(lint): add markdownlint config feat(brain-bridge): second brain pipeline, fzf picker, gitlaunch fix Jun 8, 2026
MCamner and others added 14 commits June 8, 2026 22:58
Browses all 43 saved prompts from mqobsidian/_prompts/ via fzf
with a 40-line preview panel. Selected prompt is copied to clipboard.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
New b2tui.py CLI with subcommands:
- projects: list all 43 prompts by category
- run <id>: preview + compose + copy to clipboard + save history
- route <task>: keyword-based route matching across 7 routes
- validate: check all prompt files readable + route primaries present
- history: show recent runs from ~/.b2tui_history.jsonl

Wired as mqlaunch b2tui / mqlaunch b2 via both
run_arg_command and dispatch_cli_command.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
mqlaunch stack  → opens mq-stack/05_RELEASE_STATUS.md in Obsidian
mqlaunch roadmap → opens mq-stack/01_ROADMAP.md in Obsidian

Routes via mq_brain_run (brain-bridge.sh) consistent with existing
brain/note/sessions/decisions entrypoints.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…date order

- mq-mcp-review.py: replace direct from-imports with importlib.import_module
  so review_engine modules resolve via runtime sys.path injection without
  linter errors; openai unavailability now returns a clear error string
- b2tui.py: move errors>0 exit check after route-map warnings so all
  WARN lines print before early return
- ROADMAP.md: add B2 TUI MVP roadmap (phases 0–13); fix list markers to -

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Migrates b2tui from single-file tools/scripts/b2tui.py to a proper
Python package under mqlaunch/b2_tui/ matching the roadmap structure.

- config, models, core/{project_loader,router,prompt_composer,validator,history}
- adapters/obsidian_writer — saves compose runs to ~/mqobsidian/mq-stack/runs/
- CLI: list, categories, show, compose, route, validate, config, history, export-last, open-last
- project_loader reads from PROJECT_INDEX.md as canonical source
- 20 passing tests
- mqlaunch.sh routing updated to new package
- .gitignore: add __pycache__ / *.pyc rules

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… 21 tests

- route() returns (primary, support_routes, matched_keywords)
- ROUTE_SUPPORT map drives support project selection
- cmd_route prints Primary / Support / Reason blocks
- 21 router tests (was 7), 33 total passing

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- compose: empty task rejected immediately with clear error
- history: route and compose both saved with command field
- history last: show most recent entry
- history export: write b2-history.md to mq-stack/runs/
- router: saves route results to history
- roadmap: phases 6, 7, 8 marked done

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
dispatch_cli_command() in mqlaunch-command-mode.sh was still calling
tools/scripts/b2tui.py directly, shadowing the updated routing in
mqlaunch.sh. Updated to PYTHONPATH+module invocation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- B2App: two-panel layout (categories | projects) + preview pane
- j/k navigation, Tab to switch panels, / to search
- r=route, c=compose, h=history, v=validate, q=quit bindings
- RouteScreen, ComposeScreen, HistoryScreen, SearchScreen modal overlays
- mq b2 (no subcommand) now launches the TUI instead of printing help

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…GELOG

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Promotes [Unreleased] to [0.6.0]. All Phase 13 release checks pass:
40 tests green, all CLI commands smoke-tested, docs complete.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@MCamner MCamner changed the title feat(brain-bridge): second brain pipeline, fzf picker, gitlaunch fix feat: B2 Atlas Prompt OS TUI — v0.6.0 MVP Jun 9, 2026
…ridge

All three conflicts were additive. Kept feat/brain-bridge superset
(verified, systems, stack, roadmap, b2tui) and merged memory subcommand
from main.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@MCamner MCamner merged commit e1f9dd1 into main Jun 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant