substrate-guard

command
v0.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 23, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Command substrate-guard fails the build if any claude-TUI substrate literal appears in pyrycode .go source outside an explicit allowlist.

The substrate — claude's on-screen literals, escape sequences, and glyphs — is owned by github.com/pyrycode/tui-driver. A consumer that hardcodes those literals drifts on every claude self-update and silently re-couples to the internals tui-driver exists to hide. The compiler seal (unexported buffer / pty, no public Write, no Mirror tap) stops a consumer reaching the substrate through the Session API; this guard is the second, different-fabric check for the hole the compiler cannot see: a hardcoded screen string or escape sequence in a string literal or comment.

Run via `make substrate-guard` (wired into `make check` and the check.yml PR gate). Scans every .go file under the repo root, skipping the allowlist; exits non-zero and prints file:line for every hit.

Allowlist: the two sanctioned fake-claude helpers, which legitimately emit these literals to simulate claude's TUI — internal/agentrun/ptyrunner/ helper_test.go for the ptyrunner integration tests, and internal/e2e/ internal/fakeclaude/main.go for the relay/send_message e2e flows (#603) — and this guard's own source, which must name the patterns it bans.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL