Skip to content

feat(minimal): route bare min to a session; add the non-TTY state twin - #1138

Merged
norrietaylor merged 4 commits into
mainfrom
feat/bare-min-router
Aug 1, 2026
Merged

feat(minimal): route bare min to a session; add the non-TTY state twin#1138
norrietaylor merged 4 commits into
mainfrom
feat/bare-min-router

Conversation

@norrietaylor

@norrietaylor norrietaylor commented Jul 31, 2026

Copy link
Copy Markdown
Member

Bare min prints help and exits, so the promised one-keystroke entry point goes nowhere; in a terminal it now resolves-or-attaches (creating a session on first run), and without a TTY it prints the cwd's state and exact next commands on stderr and exits 0 — never creating anything implicitly.

  • Interactive: the same resolution rules as min session attach (cwd match / only session / picker), plus create-and-attach when nothing exists. No scaffold offer on this path; min --help unchanged.
  • Non-TTY: a read-only state report (sessions for the cwd, blueprint presence, next commands) on stderr; stdout stays empty; exit 0.
  • Unit tests cover the twin's rendering and the stderr routing classification.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KyZLpkRf9G4A2hUDgDvn5f

Note

Route bare min invocation to session attach or non-TTY state report

  • A bare min with a TTY now performs smart session resolution: it attaches to an existing session or creates and attaches one for the current directory, suppressing the scaffold prompt.
  • A bare min without a TTY prints a structured state report to stderr (session list, blueprint presence, suggested next commands) and exits 0 with empty stdout.
  • activate_session is extracted as a shared async function used by both the bare router and cmd_activate, with cmd_activate retaining the scaffold offer.
  • The install script guidance is updated to suggest min instead of min session activate --attach ..
  • Behavioral Change: bare min no longer prints top-level help; stdout is now empty or contains only the session id, making it a stdout data contract.

Macroscope summarized 348629e.

Bare min printed help and went nowhere. In a terminal it now resolves
or creates a session and attaches (the same smart-attach rules as
min session attach, creating on first run; never the scaffold offer).
Without a TTY it prints the cwd's session and blueprint state plus
exact next commands on stderr and exits 0 — read-only, stdout empty,
so pipelines and agents get orientation instead of a session they
cannot use.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KyZLpkRf9G4A2hUDgDvn5f
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 47 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d046be4b-3f9a-4b40-83f1-ecb2aedb9efd

📥 Commits

Reviewing files that changed from the base of the PR and between 996295a and 348629e.

📒 Files selected for processing (4)
  • crates/minimal/src/lib.rs
  • crates/minimal/src/main.rs
  • scripts/install.sh
  • scripts/install_test.sh

Comment @coderabbitai help to get the list of available commands.

@norrietaylor

Copy link
Copy Markdown
Member Author

Closing for now

Conflicts and reconciliation:
- crates/minimal/src/main.rs: stdout_is_data_contract doc + tests — kept
  both the bare-min contract (this branch) and the task-run contract
  (#1139); the match arm union auto-merged.
- crates/minimal/src/lib.rs (semantic, auto-merged textually): cmd_bare
  rewritten against #1142's SmartAttach enum — the picker's create row
  (CreateForCwd) and the first-run NoSessions case both create-and-attach
  on the bare path, scaffold offer suppressed; min session attach keeps
  its scaffold-offering activate_new_for_attach unchanged. Dropped this
  branch's status_label duplicate in favor of the identical helper #1144
  added for the ls table.
@norrietaylor
norrietaylor marked this pull request as ready for review July 31, 2026 22:11
@norrietaylor
norrietaylor requested a review from a team as a code owner July 31, 2026 22:11
The installer's parting line pointed at the long activate spelling
because bare min went nowhere. With the router in this same change,
the honest next command is min itself.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KyZLpkRf9G4A2hUDgDvn5f
@norrietaylor

Copy link
Copy Markdown
Member Author

Caught up to main (merge commit cde2817) and added the installer literal that ships with the router.

Merge reconciliation:

  • main.rs: stdout_is_data_contract doc + tests — kept both the bare-min contract (this branch) and the task run contract (#1139); the match-arm union auto-merged.
  • lib.rs: cmd_bare rewritten against #1142's SmartAttach enum — on the bare path, both NoSessions (first run) and the picker's + Create a new session row (CreateForCwd) create-and-attach with the scaffold offer suppressed, while min session attach's scaffold-offering activate_new_for_attach stays untouched. Dropped this branch's status_label duplicate in favor of the identical helper #1144 added.
  • The min task run command tree and the rest of main slotted in unchanged; the activate_session shared-core extraction stands.

Installer: the closing card's second command is now bare min (column alignment kept, docs.minimal.dev final-line discipline untouched); install_test.sh's card assertion updated to the new literal. just test-installer: shellcheck clean, 276/276 under sh and dash.

Re-verified after the merge: cargo build -p minimal, cargo clippy -p minimal --no-deps -- -D warnings, cargo fmt --check all green; smoke re-run (min </dev/null) renders the twin with empty stdout and exit 0 — now exercising the 0 here (N elsewhere) branch live — and min --help is unchanged.

@norrietaylor
norrietaylor merged commit f632712 into main Aug 1, 2026
32 checks passed
@norrietaylor
norrietaylor deleted the feat/bare-min-router branch August 1, 2026 00:18
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.

3 participants