Skip to content

feat: plan mode — read-only planning constraint (registry-filtered) #109

Closed

Description

@ajianaz

What (description of the change)

Add a first-class plan mode to tole (pattern reference: ZCode permission/plan-mode-policy, Apache-2.0 — pattern only, no code lifted): when planning, the registry exposes ONLY Risk::ReadOnly tools, so the model physically cannot mutate anything.

  • CLI: --plan-mode on tole run and tole chat. When set, the registry build skips every non-ReadOnly registration (write_file/edit_file/delete_file/run_command/git/gh/jobs/uteke_document/MCP tools) — not approval-hardened, NOT REGISTERED at all, which is the hard guarantee (no specs on the wire → the model cannot even see them).
  • The default system prompt gains one appended sentence in plan mode: read-only exploration, produce a plan, no changes. Explicit --system / TOLE_SYSTEM_PROMPT overrides win as today (B2 precedence unchanged; plan-mode sentence only applies to the default prompt path).
  • The durable session header already pins the system prompt; plan mode is a session-level property — resume re-applies it exactly.

Why (the problem you're solving)

Today the only safety tiers are the approval gate (Write) and interactive-only registration (Destructive). There is no way to say "explore and plan, touch nothing" — e.g. handing tole an unfamiliar repo to map before letting it act. Read-only planning is the cheapest possible hard constraint (registry filtering, zero new enforcement machinery) and it composes with the existing approval gate instead of replacing it.

Testing (how you verified this works)

  • Unit: registry built in plan mode contains only ReadOnly tools (assert names + specs array).
  • Live E2E: plan-mode mission that asks to create a file → session log shows zero write intents, zero approval-gate firings; the final text is a plan. Non-plan-mode control run behaves as today.
  • Tier-1 suite green; --no-default-features (mobile) profile still builds/tests (plan mode is profile-independent — read_file exists in both).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions