Skip to content

A refused shim lists the options: the tool on PATH and the layers that carry it (REQ-SHIMFALLBACK-001) - #292

Merged
avrabe merged 4 commits into
mainfrom
feat/shimfallback
Oct 28, 2026
Merged

avrabe merged 4 commits into
mainfrom
feat/shimfallback

Conversation

@avrabe

@avrabe avrabe commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Implements REQ-SHIMFALLBACK-001 (#273), which the maintainer decided as "refuse, but list the options". Also carries the v0.44.0 agent-docs plan update, which is rivet only.

Behaviour. A shim, or varve run, asked for a tool the pinned layer does not carry still refuses and still exits 1. No ambient binary ever runs through varve. The existing refusal now ends with what the person can do instead:

varve ran nothing. Options (varve will not pick one for you):
  - 'ghost' is on PATH at /opt/bin/ghost — it is NOT part of the pinned layer. Run it directly, outside the layer: '/opt/bin/ghost' '--version'
  - installed layer 2026.09.0 (rolling) carries 'ghost'. To select it, set in <project>/varve.toml: layer = "2026.09.0"; channel = "rolling"

With neither, it says so: "Nothing else provides 'ghost': no executable of that name is on PATH (outside the shim directory) and no installed layer carries it."

Design

  • New file, varve-core/src/shimfallback.rs:
    • on_path walks PATH in order and skips the shim directory, however it is spelled, after canonicalizing. It checks the executable bit and lists each match once.
    • carriers covers realm partitions as well as the top-level store. It excludes the pinned layer and sorts its results.
    • The direct command is shell-quoted, so a PATH directory with a space pastes as one word.
  • New mutation shard, varve-core (shim-fallback).
  • Docs: cmd-shim.md describes the refusal.

Evidence

  • Tests failed first: all 4 CLI tests went red before the change. They cover:

    • a tool on PATH only, where a marker file proves it did not run;
    • a tool carried by another layer;
    • the shim directory on PATH, which is not reported;
    • neither.

    There are 9 unit tests, including the quoting case, which also failed first.

  • Locally on e062327:

    • fmt and clippy -D warnings are clean;
    • cargo test --workspace -j 2 exits 0, with 36 suites ok;
    • rivet validate passes, and so does the trace gate.
  • Mutants, unfiltered, -j 2 --timeout 60:

    • shimfallback.rs: 24 tested, 23 caught, 1 unviable;
    • with shadow.rs added, which this PR only makes pub(crate): 46 tested, 3 missed. All 3 are in shadow.rs, which CI does not gate yet (not-yet in mutation-scope.toml). Two are the cfg(not(unix)) branch, which macOS never compiles. The third, is_shadowed → true, was already there.

The implementation was delegated to a subagent and reviewed. The quoting fix came out of the review.

🤖 Generated with Claude Code

https://claude.ai/code/session_019TNtfRjLNhEz82G2ggeeNu

avrabe and others added 4 commits October 28, 2026 09:29
…t carry it (REQ-SHIMFALLBACK-001)

Refuse, but list: a shim for a tool the pinned layer lacks still exits 1 and
runs nothing. The refusal now names the executable on PATH (shim dir excluded)
with the direct command, and every installed layer carrying the tool with the
varve.toml lines that would select it, or says nothing else provides it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019TNtfRjLNhEz82G2ggeeNu
…space pastes as one word

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019TNtfRjLNhEz82G2ggeeNu
…fore MCP

Decided by the maintainer on 2026-10-28. The benefit is orientation: an agent
told "check in here" learns what the pin holds and where to look without
running every tool. That is the two-step shape agents already use with
Context7, answered locally from verified material.

- REQ-AGENTDOCS-001: `varve-serve context`. Per-tool summary and docs-command
  come from new signed layer.toml fields. Where a tool declares neither, the
  pinned verified binary is harvested, cached by manifest digest, and the
  entry is marked harvested. Metadata and topic names only, within a size
  budget.
- REQ-AGENTDOCS-002: `varve-serve ask <id> "<question>"` returns pointers into
  verified docs and built-in topics, and the command that reads each one.
- REQ-AGENTDOCS-003 (MCP) moves to the backlog. It is a thin wrapper over
  those two calls, built when a client needs it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019TNtfRjLNhEz82G2ggeeNu
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019TNtfRjLNhEz82G2ggeeNu
@avrabe
avrabe merged commit 1cef49c into main Oct 28, 2026
38 checks passed
@avrabe
avrabe deleted the feat/shimfallback branch October 28, 2026 11:48
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