Skip to content

secrets-collect --yes: low findings F1-F4 (exit 3 on failed clear, dated sentinel, printf rule, lock-path test) - #6

Merged
djbclark merged 3 commits into
sudo-mainfrom
fix/secrets-collect-yes-low
Oct 26, 2026
Merged

djbclark merged 3 commits into
sudo-mainfrom
fix/secrets-collect-yes-low

Conversation

@djbclark

@djbclark djbclark commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

Follow-up to PR #5 (base fix/secrets-collect-yes, PR 5 still open): the four low findings F1 to F4 deferred by its round-4 APPROVE.

  1. F1: the SKILL's follow-up printf 'cleared' | clip no longer runs after a run that cleared (it erased the consumer name in the sentinel). It runs only on exit 3, NOT cleared in stdout or stderr, or no report at all; a run that never read the clipboard is fixed and re-run, and the printf is only for giving up on the name.
  2. F2: in-process test of the production lock path (pwd.getpwuid faked, no env override, TMPDIR elsewhere): ~/Library/Caches/secrets-collect.lock, dir mode 0700.
  3. F3: a run that stored (or dry-ran) but could not clear the clipboard exits 3, with a last line saying so. Other failures keep 1, 2, 130.
  4. F4: the sentinel carries date, time and zone (2026-10-26T01:40:59-0400) and the other-name error adds its age. Round 5 BLOCKed a first version that turned a stale sentinel into "no re-collection needed" (a wrong-name store was reachable with latency over 60 s); the age is now information only and the other-name text is always conditional.

Adversary rounds (read-only, omp Opus 5.5 high; reports in ~/.local/state/bigteam/secrets-collect-yes/):

  1. Round 5 on 37c8044: BLOCK (reviewed head 37c80446db56b20ee9105d3840dedfadfe8f03d5, delta f6e6208..37c8044): the F4 fix makes the dangerous direction possible. Repaired in 65b51e8.
  2. Round 6 on 65b51e8, quoted: APPROVE (reviewed head 65b51e8a65231d99017001c56f0ba2c37749f4f1, delta 37c8044..65b51e8 and F1-F4 f6e6208..65b51e8): B1 is closed. No code path, docstring, help text, SKILL line or CHANGELOG line still says an old sentinel means "no other run" or "no re-collection"; another name's sentinel always gets the conditional. L2 is closed: A1 is killed by each TZ parameter on its own. L1 is only partly closed. Two wording fixes are recommended before merge, and neither blocks.
  3. Head f74f4cb adds only those two wording fixes (L1', L3) and nits N1 to N3, text and comments, no behaviour change; the reviewer said they can follow without another code round. That commit was not re-reviewed.

Tests: tests/sudo_postinstall/test_secrets_collect.py, 55 passed on f74f4cb (baseline 44 on PR 5), through bg. Mutants were killed one at a time (11 in round 6, including a naive-local timezone parse killed at TZ=UTC and TZ=America/New_York, and the production lock path reading $TMPDIR). No real clipboard, vault or lock file was touched.

CHANGELOG: two lines added to the existing --yes entry under Unreleased.

🤖 Generated with Claude Code


Note

Medium Risk
Changes agent-facing clipboard collection semantics and exit codes; mishandling could leave secrets on the pasteboard or mis-route re-collection after parallel runs.

Overview
secrets-collect.py (--clipboard --yes) tightens agent-safe clipboard handling: failed pbcopy after a successful store (or dry-run) now exits 3 with an explicit “NOT cleared” line, while other failure modes keep 1/2/130.

Clipboard sentinels now stamp date, time, and zone (with backward-compatible parsing of the old HH:MM:SS form), and other-name errors add informational age (“N s/min ago”). Re-collection guidance for a different secret’s sentinel stays always conditional—age never implies the race is harmless; if the operator may have copied for this name before the stamp, both names must be re-collected.

SKILL.md and the GitHub recipe no longer tell agents to run printf 'cleared' | clip after every run; manual overwrite is only for exit 3, NOT cleared, no output, or giving up after a run that never read the clipboard.

Tests add coverage for dated sentinels, timezone-aware age math, exit 3 on clear failure, and that the default lock lives under ~/Library/Caches, not $TMPDIR.

Reviewed by Cursor Bugbot for commit 79c0939. Bugbot is set up for automated code reviews on this repo. Configure here.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T06:25:31.691416Z f74f4cb PR opened
🔒 Security Review ✅ Completed 2026-10-26T06:29:03.040222Z f74f4cb PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cursor

cursor Bot commented Oct 26, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: 13438b3a-97ab-4da5-babc-c42f1aefb646)

djbclark and others added 3 commits October 26, 2026 02:41
…leftover), exit 3 when the clear failed, SKILL printf only after a failed or missing clear, production lock-path test

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… whatever its age (adversary round 5 B1); tz-offset age test; SKILL printf rule covers exit 2 and unreadable clipboard

Co-Authored-By: Claude <noreply@anthropic.com>
…e, L3 stamp vs copy, N1-N3)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@djbclark
djbclark force-pushed the fix/secrets-collect-yes-low branch from f74f4cb to 79c0939 Compare October 26, 2026 06:41
@djbclark
djbclark changed the base branch from fix/secrets-collect-yes to sudo-main October 26, 2026 06:41
@cursor

cursor Bot commented Oct 26, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: 9833b36a-7361-4d2a-ab4c-b7c784986595)

@djbclark
djbclark merged commit ab72e8c into sudo-main Oct 26, 2026
68 of 79 checks passed
@linear-code

linear-code Bot commented Oct 26, 2026

Copy link
Copy Markdown

VIB-119

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