Skip to content

Settle Unquoted Placeholders in Copy-and-Run Commands, and Gate the Class #1615

Done

Description

@ptr727

An inline command in a Markdown file is something a reader copies and runs. Where it carries a bare <placeholder>, the shell reads < as an input redirection and the paste dies with syntax error near unexpected token before the command runs at all. Nothing in this repository checks for it: shellcheck reads *.sh files discovered in the tree, and no linter reads a command inside a Markdown file, inline or fenced.

Three instances were found and fixed one at a time while driving #1611 and #1614, each in a different shape, which is why this is filed as a class rather than left to the next one:

  • a fenced block's repo=<owner>/<repo>, in AUDIT.md section 6
  • a shell-labeled fenced block's --repo <path-to-target-checkout>, in AUDIT.md section 0
  • an inline span's gh repo view <owner>/<repo> --json visibility, in AUDIT.md section 6, raised by Copilot on the promotion PR

The fenced half now has a guard: scripts/tests/test_release_guards.py parses every fenced shell block in AUDIT.md with its placeholders intact. That guard covers one file and no inline spans, so the class is open everywhere else.

The inventory

Below is every inline span in a source file (the generated .github/skills/ and .claude-plugin/ trees are excluded, since they are regenerated from .agents/skills/) holding a git, gh, python3 or bash command with an unquoted <placeholder>. Spans already carrying quotes around the placeholder are excluded, and there are a number of those: merge-and-release and drive-pr quote most of theirs, so the convention is already partly applied and this is finishing it rather than introducing it.

.agents/skills/audit-a-repo/SKILL.md:16:`python3 scripts/host_gate.py --repo <target-checkout>`
.agents/skills/backlog-burndown/SKILL.md:193:`git diff --name-only origin/develop...<branch>`
.agents/skills/backlog-burndown/SKILL.md:194:`git -C <worktree> status --porcelain`
.agents/skills/backlog-burndown/SKILL.md:337:`gh pr view <branch>`
.agents/skills/drive-pr/SKILL.md:93:`gh pr merge <number> --squash --repo <owner>/<repo>`
.agents/skills/git-commit-conventions/SKILL.md:167:`git branch -D <exact-task-branch>`
.agents/skills/local-strict-review/SKILL.md:161:`git fetch origin <target>`
.agents/skills/local-strict-review/SKILL.md:29:`git fetch origin <target>`
.agents/skills/merge-and-release/SKILL.md:189:`git merge-base --is-ancestor <branch> develop`
.agents/skills/operational-vs-release-workflow/references/branch-protection-and-promotion.md:35:`git checkout --theirs <file>`
.agents/skills/operational-vs-release-workflow/references/release-publish-mechanics.md:115:`gh api repos/{owner}/{repo}/branches/<branch>`
.agents/skills/operational-vs-release-workflow/references/release-publish-mechanics.md:115:`gh run view <id> --json headSha`
.agents/skills/operational-vs-release-workflow/references/release-publish-mechanics.md:117:`gh run rerun <id>`
.agents/skills/repo-worktree/SKILL.md:232:`git branch -d <exact-branch>`
.agents/skills/repo-worktree/SKILL.md:232:`git branch -D <exact-branch>`
.agents/skills/repo-worktree/SKILL.md:232:`git worktree remove <exact-path>`
.agents/skills/resync-a-repo/SKILL.md:49:`python3 scripts/host_gate.py --repo <path-to-target-worktree>`
docs/host-setup.md:254:`Bash(git -C <worktree-parent>:*)`
docs/repo-config.md:35:`gh api -X POST repos/<owner>/<repo>/rulesets --input repo-config/<name>.json`
GOVERNANCE.md:121:`git rm --cached <path>`
GOVERNANCE.md:319:`gh api -X PATCH repos/<owner>/<repo> -f description=...`
host-setup/agent-safety/README.md:160:`git --git-dir=<value> rev-parse ...`
RESYNC.md:106:`git log origin/main -1 --format=%H -S'<path>' -- .github/actions/prose-gate/prose_lint.py`
RESYNC.md:106:`git merge-base --is-ancestor <exemption-sha> <pinned-sha>`
scripts/README.md:125:`git ls-files -- <pattern>`

What settling this needs

A decision on scope first, since not every one of these is the same. A span a reader pastes whole, such as the gh api and host_gate.py invocations, is the harmful case. A span naming a single argument in prose, such as git branch -d <exact-branch>, is notation a reader would never paste on its own, and quoting it may read worse than leaving it. Whichever way that goes, it should be stated once rather than decided per site, because deciding per site is what produced the current mix.

Then the mechanical half: a check that reads inline spans as well as fenced blocks, across the tree rather than in one file, so the next instance fails a gate instead of a review round. Note that a fleet repository carries no scripts/, so where such a check lives decides whether it protects the fleet's docs or only the hub's.

Activity

  1. added
    prose
    on Sep 14, 2026
  2. ptr727 commented on Sep 14, 2026

    @ptr727
    OwnerAuthor

    Two corrections to the inventory above, both from a review of the branch that fixed AUDIT.md's own instances.

    The inventory misses the bracket form, which is the same class with a worse failure mode. spec/audit.py [RepoName] is a glob rather than notation: in a directory holding a one-character file named R, e, p, o, N, a or m, it expands silently and the tool audits a target nobody named, where a bare < at least dies loudly. The grep behind the inventory matched only <placeholder> spans, so no bracket-form site is listed. Known sites are .agents/skills/audit-a-repo/SKILL.md, .agents/skills/resync-a-repo/SKILL.md, OPERATIONS.md, docs/repo-config.md, and repo-config/configure.sh's own terminal note, plus the generated copies of the two skills.

    It also misses at least one < site, spec/audit.py <RepoName> in .agents/skills/resync-a-repo/SKILL.md, which is squarely what this issue is about. Treat the inventory as a floor rather than a complete list: settling this needs its own sweep rather than a re-run of that one grep.

    One input to the scope question. spec/audit.py's own usage line is [RepoName ...], so the bracket form mirrors the tool's help and carries an optional-and-repeatable sense that "<RepoName>" loses. AUDIT.md now uses the quoted form, because that section was under review and a silent expansion is the worse failure, and that divergence from five other surfaces is deliberate rather than settled. Whichever way the decision goes, it should reach every surface at once.

    And one measured consequence of a half-fix, worth recording because it shaped the decision above. Quoting only the placeholder in repo-config/configure.sh check "<owner>/<repo>" release|operational changed that span's paste behaviour rather than fixing it: before, the redirection aborted the left side and the script never ran, and after, the script ran against a literal <owner>/<repo> while the shell printed operational: command not found and the script's own output vanished into the dead pipe. It is read-only so nothing was mutated, and it went from failing loudly before running to running with its output swallowed. The alternation is now a placeholder too, "<release|operational>", so the whole span is paste-safe and fails with one clear message. That shape is offered as a candidate answer to the scope question rather than as the settled convention.

  3. ptr727 commented on Sep 14, 2026

    @ptr727
    OwnerAuthor

    Three more from the review of the branch that fixed AUDIT.md's instances. The first widens this issue's class, and it reaches a write.

    The unquoted alternation is a second shape, and this issue does not cover it. This issue is scoped to a <placeholder> read as an input redirection, where the paste dies before the command runs. An unquoted release|operational does the opposite: the left side runs and its output goes into a dead pipe, so the reader sees only operational: command not found and nothing the command itself said. Measured.

    OPERATIONS.md carries it on an apply line, inside a fenced block whose prose says "Run these commands from a hub checkout at main":

    repo-config/configure.sh check owner/repo release|operational
    repo-config/configure.sh apply owner/repo release|operational

    apply is the write mode, so a reader pasting the second line runs a live configuration write whose output they never see. The paragraph directly below that block already warns that a bare invocation "performs a live write instead", so the file is alert to this hazard class and carries an instance of it three lines up. The same shape is at docs/repo-config.md, repo-config/README.md in three places, STANDUP.md, RESYNC.md, and .agents/skills/operational-vs-release-workflow/references/branch-protection-and-promotion.md plus its two generated copies.

    The bracket form is still at three source sites, spec/audit.py [RepoName] and --issue [RepoName] in .agents/skills/resync-a-repo/SKILL.md and OPERATIONS.md, plus the two generated copies, after this branch determined it to be a silently-expanding glob. Confirmed again: with a file named a in the working directory the argument resolves to a rather than staying literal.

    And one note against the fix this branch shipped. AUDIT.md now writes repo-config/configure.sh check "<owner>/<repo>" "<release|operational>", which is a fourth notation for one command and is used nowhere else. .agents/skills/resync-a-repo/SKILL.md already states it paste-safely as repo-config/configure.sh check "<owner>/<repo>" release with a parenthetical for operational, needing one substitution rather than two and mixing no notations. That is a better candidate for the convention than the one just shipped, and choosing between them is exactly what this issue asks to settle once.

  4. ptr727 commented on Nov 1, 2026

    @ptr727
    OwnerAuthor

    Decision needed (decision triage, 2026-11-01)

    Question: For copy-and-run commands in Markdown, should every command span be paste-safe (no bare <placeholder>, no bracket glob like [RepoName], no bare a|b alternation) or only spans a reader pastes whole, and should the check live in the fleet-reaching prose gate (prose_lint.py) or only in hub tests?

    Options, recommended first:

    1. Every command-opening span paste-safe, gated in the prose gate (recommended): Whether a reader pastes a span whole is a judgment no gate can test, and per-site judgment produced the current mix, while "the span opens with a command" is checkable. State it once in "Documentation Style Conventions" with the form resync-a-repo already uses (a literal default plus a parenthetical alternative). The prose gate reaches downstream repos, covering carriers' own operations docs. Edits a carried section and the gate, so a resync is owed. No work in flight.
    2. Same rule, hub-only test: Extends the AUDIT.md fenced-block guard in tests/test_release_guards.py to all hub sources and inline spans. Simpler, but misses carriers' own docs, where the apply write case in the comments lives. No work in flight.
    3. Quote only paste-whole spans, no gate: Keeps notation like git branch -d <exact-branch> readable but has no check, so the class keeps returning through review rounds. No work in flight.

    Evidence: No placeholder convention in GOVERNANCE.md, CODESTYLE.md, or comment-and-doc-style. Unquoted <placeholder> command spans remain in 13 source files (GOVERNANCE.md has 3). The only guard is tests/test_release_guards.py:1015. The maintainer's comments add the bracket-glob and alternation shapes and name the resync-a-repo form "a better candidate for the convention". prose_lint.py has no command-span rule. Earlier fixes were one-off (7b7af5c, 0914c42).

    Blocks: none

  5. added
    decision
    on Nov 1, 2026
  6. ptr727 commented on Nov 1, 2026

    @ptr727
    OwnerAuthor

    Maintainer answer (decision triage, 2026-11-01): Option 1: every command-opening span is paste-safe (no bare , bracket glob, or a|b alternation), using resync-a-repo's literal-default-plus-parenthetical form. State it in GOVERNANCE.md 'Documentation Style Conventions' and enforce it in the prose gate. A resync is owed. This is now work for the next burndown round.

  7. removed
    decision
    on Nov 1, 2026
  8. ptr727 commented on Nov 22, 2026

    @ptr727
    OwnerAuthor

    Maintainer approval, 2026-11-22: the prose-only edits that #1615's paste-safe rule needs in host-setup/agent-safety/README.md (its bare placeholders) are approved for an attended run. The pull request still waits on the maintainer's diff read before it merges.

  9. ptr727 commented on Nov 22, 2026

    @ptr727
    OwnerAuthor

    Released (2026-11-22): the branch merged as #4353 and was cleaned up, so this claim holds no files.

    Backlog burndown claim (round 4, group 6, 2026-11-22): branch burndown/r4-paste-safe-placeholders, issue #1615.

    Adjudicated 2026-11-22, with the maintainer's scope answer: enable the rule and fix every instance in files no other group holds. host-setup/agent-safety/README.md is dropped from this claim, so this pull request edits nothing under host-setup/agent-safety/.

    Files: GOVERNANCE.md, AGENTS.md, CODESTYLE.md, AUDIT.md, RESYNC.md, STANDUP.md, OPERATIONS.md, TODO.md, docs/eol-lf-rollout.md, docs/reusable-workflows.md, catalog/snippets/configs/AUDIT.md, catalog/snippets/pre-commit/README.md, .github/actions/prose-gate/prose_lint.py, .github/actions/prose-gate/prose-gate.json, scripts/prose_lint.py, tests/test_prose_lint.py, and under .agents/skills/: backlog-burndown, pr-review-conduct, merge-and-release, drive-pr, repo-worktree, python-codestyle (with references/profiles.md and references/testing.md), audit-a-repo, branching-and-release-model (with references/branch-protection-and-promotion.md and references/release-publish-mechanics.md), upstream-contribution-workflow, local-strict-review, session-handoff, git-commit-conventions (with references/history-rewrite.md), check-this-repo, workflow-ci-contract, resync-a-repo, comment-and-doc-style. Generated trees follow.

    Granted 2026-11-22, after group 5 merged as #4351: scripts/README.md (its default-rule list line only).

    Grown set granted (2026-11-22): tests/test_release_guards.py (one docstring sentence), scripts/README.md (also the two whole-tree-clean sentences near lines 66 and 124), host-setup/linux/README.md (its one paste-safe instance).

  10. ptr727 commented on Nov 23, 2026

    @ptr727
    OwnerAuthor

    Released (2026-11-22): the branch merged as #4357 and was cleaned up, so this claim holds no files.

    Backlog burndown claim (round 4, promotion fix for #4356, 2026-11-22): branch burndown/r4-promotion-fixes, issue #1615 (the paste-safe instances in two files).

    Predicted files: docs/repo-config.md, repo-config/README.md, host-setup/linux/install-tools.sh (one comment), .github/workflows/validate-task.yml (only if the nested-glob finding is upheld).

  11. ptr727 commented on Nov 23, 2026

    @ptr727
    OwnerAuthor

    Released (2026-11-22): the branch merged as #4358 and was cleaned up, so this claim holds no files.

    Backlog burndown claim (round 4, second promotion fix for #4356, 2026-11-22): branch burndown/r4-promotion-fixes-2, issue #1615 (defects the paste-safe quoting introduced).

    Predicted files: .agents/skills/drive-pr/SKILL.md, .agents/skills/repo-worktree/SKILL.md, .agents/skills/resync-a-repo/SKILL.md, .agents/skills/session-handoff/SKILL.md, AGENTS.md, AUDIT.md, .github/actions/repo-gate/repo_gate.py (docstring wrap only). Generated trees follow.

  12. ptr727 commented on Nov 23, 2026

    @ptr727
    OwnerAuthor

    Released (2026-11-22): the branch merged as #4359 and was cleaned up, so this claim holds no files.

    Backlog burndown claim (round 4, third promotion fix for #4356, 2026-11-22): branch burndown/r4-promotion-fixes-3, issue #1615 (sibling sweep of the quoted-tilde defect).

    Predicted files: .agents/skills/backlog-burndown/SKILL.md, .agents/skills/merge-and-release/SKILL.md, .agents/skills/pr-review-conduct/SKILL.md, .agents/skills/audit-a-repo/SKILL.md. Generated trees follow.

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

    prose

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions