Skip to content

Plan library-owned dispatch for host/token-daemon/ps/stop (6.1.1b) - #104

Draft
leynos wants to merge 1 commit into
mainfrom
6-1-1b-subcommand-dispatch
Draft

Plan library-owned dispatch for host/token-daemon/ps/stop (6.1.1b)#104
leynos wants to merge 1 commit into
mainfrom
6-1-1b-subcommand-dispatch

Conversation

@leynos

@leynos leynos commented May 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Drafts docs/execplans/6-1-1b-subcommand-dispatch.md, an ExecPlan
    for roadmap task 6.1.1b that extends the library-owned request
    boundary already established for run and exec to the remaining
    four operator subcommands (host, token-daemon, ps, stop).
  • Pulls in the latest AGENTS.md guidance from upstream
    (memoryd@1-1-1-record-evidence-store-engine-and-migration-policy)
    so this branch picks up the observability, expanded testing-level,
    and documentation-update expectations before implementation starts.
  • Plan only — no source changes yet. The plan must be approved before
    implementation begins.

What the plan covers

  • New library-owned request types under podbot::api: HostRequest,
    TokenDaemonRequest, ListContainersRequest, and StopRequest,
    each mirroring the RunRequest template (private fields, validating
    constructor, accessor methods).
  • Dispatch rewiring in src/main.rs and src/cli/mod.rs: every
    subcommand parses through Clap, constructs the library-owned
    request, and routes through the library API.
  • A hard constraint that podbot host emits zero bytes on stdout from
    the moment Clap finishes parsing through library return, with a
    behavioural test that asserts the stdout-purity rule. Cited against
    the MCP stdio transport MUST and the project's developers' guide.
  • Stage A-G work breakdown (orient, types, rewire, tests, docs,
    validation, CodeRabbit) with explicit Constraints, Tolerances,
    Risks, Progress, Surprises & Discoveries, Decision Log, and
    Outcomes & Retrospective sections. The plan is scoped narrowly to
    dispatch hardening; orchestration for each subcommand stays with
    roadmap steps 6.3.1, 6.4.1, and 6.5.1.

Prior art cited in the plan

  • Jujutsu's "Separation of library from UI" architecture rule.
  • The Model Context Protocol stdio transport spec ("MUST NOT write
    anything to stdout that is not a valid MCP message").
  • Alexis Lozano's "Hexagonal architecture in Rust" series (Rust CLI
    as a thin adapter over a library-owned Request value).

Test plan

Plan-only PR. Validation performed locally on the draft:

  • make markdownlint passes for the new ExecPlan and the
    refreshed AGENTS.md.
  • make nixie passes (no Mermaid diagrams added).
  • (Deferred until implementation) make check-fmt, make lint,
    and make test will be run after each implementation milestone, as
    required by the project's quality-gate policy.
  • (Deferred until implementation) coderabbit review --agent
    will be run after each milestone.

Roadmap

This plan covers roadmap task 6.1.1b. Implement subcommand dispatch
for run, host, token-daemon, ps, stop, and exec.
Scope
narrows to the four still-pending subcommands; run and exec are
already routed through library-owned request types. The plan does not
tick the parent 6.1.1 entry; it will tick only the four sub-checkboxes
on completion.

Issues referenced

References

🤖 Generated with Claude Code

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @leynos, you have reached your weekly rate limit of 2500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@coderabbitai

coderabbitai Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 3eee350e-82f2-4961-9275-e83c17739ed2

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 6-1-1b-subcommand-dispatch

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

codescene-delta-analysis[bot]

This comment was marked as outdated.

@lodyai
lodyai Bot force-pushed the 6-1-1b-subcommand-dispatch branch from 38043d5 to f3f7d33 Compare June 2, 2026 13:28
codescene-delta-analysis[bot]

This comment was marked as outdated.

Draft an ExecPlan for roadmap task 6.1.1b that extends the
library-owned request boundary already in place for `run` and `exec`
to the four remaining operator subcommands. The plan introduces
`HostRequest`, `TokenDaemonRequest`, `ListContainersRequest`, and
`StopRequest` under `podbot::api`; rewires the CLI dispatch in
`src/main.rs` and `src/cli/mod.rs` to construct each request before
calling the library; and enforces stdout purity for `podbot host` so
the dispatch path never writes a banner before the future
protocol-hosting orchestration arrives in step 6.5.1.

The plan stops at dispatch hardening: actual orchestration for each
subcommand stays scoped to its own roadmap step (6.3.1, 6.4.1, 6.5.1).
It cites prior art from Jujutsu's library/UI split, the MCP stdio
transport stdout-purity MUST, and Alexis Lozano's hexagonal Rust CLI
example for the adapter pattern.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@lodyai
lodyai Bot force-pushed the 6-1-1b-subcommand-dispatch branch from f3f7d33 to 3399dbf Compare June 4, 2026 01:09
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