quickstop icon indicating copy to clipboard operation
quickstop copied to clipboard

Verification commands find the pinned Python themselves, so the allowlisted forms are the documented ones

Open Batcomputer67 opened this issue 1 month ago • 2 comments

Why. Since #171 the project allowlist covers bin/ci, bin/sdlc check and bin/check-marketplace --base origin/main. But docs/repository.md tells agents to run them as export PATH=... && bin/ci, which always prompts (Claude Code asks on every PATH write and no narrow rule can approve it). The checks agents are told to run should be the ones that run without a prompt. Part of the Claudit dogfood cycle.

Scope.

  • bin/ci and bin/check-marketplace select the repo's pinned Python (.python-version, same version rule as today) themselves, and fail with a clear message naming the needed version if it isn't found. bin/sdlc is invoked the same way, but it is SDLC-managed: see the constraint below.
  • docs/repository.md then shows the bare commands.
  • Constraint. .sdlc/managed.json hash-pins AGENTS.md, bin/sdlc, bin/sdlc-evidence, bin/sdlc-release and others. Do not edit managed files. Change only what the repo owns; report in the PR what can't change and why (for example whether bin/sdlc check needs the pinned interpreter at all, or must be reached through bin/ci).

Acceptance criteria.

  1. From a shell whose PATH lacks the pinned Python first, each bare command that the repo owns runs the pinned version (show python --version evidence or the script's own report). For any managed command that can't change, state the result and the reason.
  2. With no suitable Python, a clear error naming the version and a non-zero exit.
  3. In a headless session with project settings (use a throwaway git worktree of the job's own trusted clone, as on #171), the documented forms run with no prompt.
  4. bin/ci, bin/check-marketplace --base origin/main and claude plugin validate . pass.
  5. Normal SDLC: review receipt published before the merge and bin/sdlc audit passes on the merge commit. No plugin bytes change and no version bump.

Out of scope. Changing managed files, widening the allowlist beyond exact rules, other tools.

Done means. Merged on main with the acceptance evidence posted on this issue.

Batcomputer67 avatar Oct 31 '26 18:10 Batcomputer67

Triage (factory): a bounded contract with checkable acceptance criteria; no clarification needed.

Plan: bin/ci (repo-owned, currently asserts python3 equals .python-version and fails otherwise) and bin/check-marketplace (repo-owned, #!/usr/bin/env python3) locate or re-exec under the pinned Python (for example via mise or a version-named interpreter on PATH), with a clear error naming the version if none is found. bin/sdlc is managed and hash-pinned (.sdlc/managed.json), so it must not change: determine whether bin/sdlc check needs the pinned interpreter at all, or is reached through bin/ci, and report what can't change. Update docs/repository.md (repo-owned) to the bare commands; do not touch AGENTS.md.

Budget and release: 3 review rounds. No release and no version bump (plugin bytes must not change); the PR uses Closes #175. Criterion 3 uses a throwaway git worktree of the job's own trusted clone (lesson from #171; a fresh clone is untrusted and ignores project allow rules); remove it afterwards. The reviewer publishes the bin/sdlc-evidence receipt on the exact head before approving; bin/sdlc audit must pass after the merge. Python for the gates: pinned 3.11.15 (the stock macOS python3 is 3.9), and note mise exec can put the pinned Python after /usr/bin. No generated-tool trailers.

Batcomputer67 avatar Oct 31 '26 18:10 Batcomputer67

Accepted and merged in #179, as rebase merge b4580b0972e6e96b596e8504ed48518fa3c8e0c3 on main (pre-merge bb1a07c). This change has no release and no version bump.

Merge checks

  • I re-ran factory.mjs check-pr on the reviewed head 3007284901007caf2220e39adfcf17ce1554b2c2 just before merging: "ok": true.
  • The merge used --match-head-commit with that SHA.
  • The merge commit's tree 3b9b471 is identical to the reviewed head's tree.
  • bin/sdlc audit --before bb1a07c --sha b4580b0: "Entire pushed range has documentation authority or independent code review", exit 0.

Acceptance criteria, verified on the reviewed head (full detail in the review, receipt)

  1. With /usr/bin/python3 3.9.6 first on PATH, and with the mise exec ordering, bare bin/ci and bin/check-marketplace --base origin/main run on 3.11.15 and exit 0. Before this change, on main bb1a07c, bin/ci failed with found 3.9.6. bin/sdlc is managed and doesn't change; bin/sdlc check passes on 3.9.6, and bin/ci runs it on 3.11.15.
  2. With no suitable Python, both commands print Python 3.11.15 (pinned in .python-version) not found on PATH or through mise; … and exit 1.
  3. I ran a headless claude -p --setting-sources project,local --strict-mcp-config --permission-mode dontAsk session in a throwaway worktree of the reviewer's trusted clone, then removed the worktree.
    • The three documented bare commands ran with no denial.
    • --write, bin/ci --verbose and export PATH=… && bin/ci were denied.
  4. bin/ci, bin/check-marketplace --base origin/main, claude plugin validate . and claude plugin validate ./plugins/claudit pass.
  5. The review receipt was published before the merge, and the audit passes on the merge commit. No plugin bytes and no .sdlc/managed.json content changed.

Batcomputer67 avatar Oct 31 '26 19:10 Batcomputer67