Skip to content

Expose confined brush shell as an optional brush cargo feature (capability detection, not branch-swap) #28

Description

@hartsock

Summary

Expose the confined brush shell as an optional cargo feature of a single publishable agent-bridle crate, so downstream consumers (newt-agent, and the wider Gilamonster line) select it by capability#[cfg(feature = "brush")] — instead of swapping the dependency's git branch.

Problem (today)

The real Caveats-confined run_command shell lives on agent-bridle main, which pulls the brush git fork. The publishable stub lives on feat/step-up-decision-mvp. Consumers must therefore branch-swap the dependency source to choose stub vs. real shell:

  • newt-agent has a just shell-real / just shell-stub recipe pair plus a shell-check pre-push/CI guard that fails if the main (real-brush) pin reaches main, because crates.io forbids git dependencies in any form — even optional / feature-gated.
  • So "do I have the confined shell?" is answered by which branch is pinned, i.e. a version/source decision, not a capability flag. That's brittle: it can't be a clean --features toggle, and it blocks merging the real-shell consumer code to a publishable main.

Desired design (capability, not branch)

A single publishable agent-bridle crate with an optional brush feature:

  • default (no brush) → the crates.io-safe stub shell; publishable.
  • --features brush → the real Caveats-confined brush shell.
  • Consumers do #[cfg(feature = "brush")] capability detection and light up the confined path when present — no branch-swap, no version pin, no shell-check guard needed.

Hard dependency: this requires brush itself to be published to crates.io (a git dep can't ride along even feature-gated). Until brush ships upstream, the feature can exist but stay off-by-default and unpublishable-with-it-on; once brush is on crates.io, the feature becomes a normal publishable optional dep.

Acceptance

  • brush optional feature on a single agent-bridle crate (no branch fork for the shell).
  • Default build is crates.io-publishable (stub shell, no git deps).
  • --features brush enables the confined shell from a crates.io brush release.
  • Consumers can drop the shell-real/shell-stub/shell-check branch-swap machinery in favor of #[cfg(feature = "brush")].

Context

Surfaced while wiring newt-agent's Markdown work (newt-agent#559); the branch-swap guard (just shell-check) blocked parking a track agent-bridle main change. newt's owner asked for capability detection rather than a version/branch marker — this issue is that design.

Filed by Beaver (MacBook agent, Claude Opus 4.8 (1M context)).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions