Skip to content

The short form said bypass where the long form says narrower - #431

Merged
tobert merged 1 commit into
mainfrom
docs/wrapped-command-framing
Sep 2, 2026
Merged

The short form said bypass where the long form says narrower#431
tobert merged 1 commit into
mainfrom
docs/wrapped-command-framing

Conversation

@tobert

@tobert tobert commented Sep 1, 2026

Copy link
Copy Markdown
Owner

Reading the 0.17.0 release notes, Amy asked whether wrapped commands bypass allow_external_commands. They do not, and the notes said they did because they were quoting our changelog.

The long form has always been right. docs/wrapped_command.md says the switch has two settings — nothing spawns, or everything on $PATH spawns with any arguments — and that a wrapped command is the setting between. Every short restatement dropped that and kept only the half that reads as a hole:

CHANGELOG.md          "Runs with allow_external_commands off."
docs/wrapped_command  "It runs when allow_external_commands is false."

Both sentences are true. Both invert the feature, because a reader who meets a policy switch and a thing that runs regardless concludes the thing defeats the switch. The direction is the load-bearing half and it was the half that kept getting cut for length.

The behavior was never in doubt, and a test already discriminates it: wrapped_command_exec_tests.rs:373 runs /bin/true two ways in one kernel, once as a registered wrapper and once as a bare command, and asserts the wrapper runs while the bare command is still refused.

The module doc gained the statement outright. It is the docs.rs entry point for an embedder deciding whether to register a wrapper, and it described the mechanism while saying nothing about the policy the mechanism serves — which is what that reader is actually deciding about.

The rule going forward: a one-line summary of wrapped commands carries "narrower, not wider," or it teaches the opposite of what the feature does.

Gates: clippy -D warnings, cargo test --all, rustdoc -D warnings.

…rrower

Amy read the 0.17.0 release notes and asked whether wrapped commands bypass
allow_external_commands. They do not, and the draft said they did because it
was quoting our changelog.

The long form has always been right. docs/wrapped_command.md's "What it is
for" says the switch has two settings, nothing spawns and everything on PATH
spawns, and a wrapped command is the setting between. Every short restatement
dropped that and kept only the half that reads as a hole:

  CHANGELOG.md          "Runs with allow_external_commands off."
  docs/wrapped_command  "It runs when allow_external_commands is false."

Both sentences are true. Both invert the feature, because a reader who meets
a policy switch and a thing that runs regardless concludes the thing defeats
the switch. The direction is the load-bearing half and it was the half that
kept getting cut for length.

The behavior was never in doubt and a test already discriminates it:
wrapped_command_exec_tests.rs:373 runs /bin/true two ways in one kernel, once
as a registered wrapper and once as a bare command, and asserts the wrapper
runs while the bare command is still refused.

The module doc gained the statement outright. It is the docs.rs entry point
for an embedder deciding whether to register a wrapper, and it described the
mechanism while saying nothing about the policy the mechanism serves, which
is what an embedder is actually deciding about.

The rule going forward: a one-line summary of wrapped commands carries
"narrower, not wider," or it teaches the opposite of what the feature does.
@tobert

tobert commented Sep 1, 2026

Copy link
Copy Markdown
Owner Author

I feel like we should rename allow_external_commands to allow_path_commands or something like that so that it's distinct from wrapped commands.

@tobert

tobert commented Sep 2, 2026

Copy link
Copy Markdown
Owner Author

Good idea — that flag name is exactly the thing this PR's confusion was rooted in. Queuing it for 0.18 rather than folding it into this docs fix or this morning's micro bump: it's a public field on the capability surface (~15 call sites across kernel/dispatch/scheduler/builtins/docs/tests), so the rename is breaking and deserves its own PR with a migration note. Recorded in exomemory (kaish/0.17.1-queue.md, item 9). 🤖

@tobert
tobert merged commit b268df2 into main Sep 2, 2026
3 checks passed
@tobert tobert mentioned this pull request Sep 2, 2026
tobert added a commit that referenced this pull request Sep 2, 2026
Version bump and changelog stamp for v0.17.1, a patch release covering
six PRs merged since v0.17.0: help/kaish-tools nested-subcommand
recursion (#430), the wrapped-command allow_external_commands framing
correction (#431), a changelog correction plus a new zero-padded
date/time migration note (#432), nested verb groups for wrapped commands
(#433), mount-point ancestor navigation when a backend also covers `/`
(#435), and VfsRouter-shared path canonicalization closing a containment
leak in `readlink -f`/`realpath` (#434).

This bump also carries two documentation fixes surfaced by the
release-gate review below rather than opening a separate PR for
text-only changes: `docs/EMBEDDING.md` claimed `realpath` passes
`allow_missing_final: true` and rechecks existence, when it actually
passes `false` directly; and the canonicalize changelog entry overstated
the default implementation as containment-checked, when containment is a
property of `LocalFs`'s and `VfsRouter`'s overrides, not the shared
default.

Reviewed with kaibo (`consult`, cast `deepseek`) against the full
`v0.17.0..HEAD` diff. Verdict: no undocumented semver breaks — the two
new `canonicalize` trait methods are defaulted and every changed public
type is either `#[non_exhaustive]` or privately fielded, so the patch
framing holds. Two smaller findings from that review are real but scoped
as code changes rather than release-blocking text, so they're queued as
follow-up work rather than folded into this bump: a wrapped-command node
can silently accept a no-op `json_output` declaration instead of being
refused, and the new `canonicalize` default's symlink-hop cap has thin
test coverage.

Gates: `cargo test --all` (2231 passed), `cargo clippy --all
--all-targets -- -D warnings` (clean), `cargo insta test --check` (no
pending snapshots).
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