Skip to content

fix: audit and eliminate 23 of 25 dryrun baseline exemptions#118

Merged
fullstackjam merged 3 commits into
mainfrom
fix/dryrun-baseline-audit
Jun 1, 2026
Merged

fix: audit and eliminate 23 of 25 dryrun baseline exemptions#118
fullstackjam merged 3 commits into
mainfrom
fix/dryrun-baseline-audit

Conversation

@fullstackjam
Copy link
Copy Markdown
Collaborator

Summary

  • Found and fixed 2 real dry-run bugs in install.go: saveSyncSourceIfRemote was called without a dry-run gate after installer.RunContext succeeds (so openboot install @user/slug --dry-run was writing ~/.openboot/sync_source.json); updateSyncedAt in the "already up to date" path was called before the dry-run check.
  • Eliminated 21 baseline entries by adding dryRun bool to helper functions that were previously exempted as "caller gated": backupConflicts/backupFile/restoreFile (dotfiles), patchZshrcBlock (shell), SaveLocal (snapshot), SaveSource/DeleteSource (sync). Each function now self-protects; a future caller without a gate will be caught by archtest.
  • Moved 8 read-only probe entries off the baseline and into dryRunExemptFiles: snapshot/capture.go (brew list, npm list, defaults read, git config --get, version probes) and sync/diff.go (git remote get-url). All calls in those files are system.RunCommandOutput read-only queries — they belong in the exempt-files list, not the violation baseline.
  • 2 entries remain (doctor.go diagnostic probes), now with explicit audit comments.

Baseline: 25 entries → 2.

Test plan

  • make test-unit passes (all archtest rules green, all L1 unit + integration tests pass)
  • go vet ./... clean
  • TestDryRunGuard passes with only the 2 documented doctor entries remaining
  • No behavior change for non-dry-run paths (all callers pass false explicitly, maintaining current semantics)

@github-actions github-actions Bot added tests Tests only snapshot Snapshot capture/restore labels Jun 1, 2026
Two categories of fix:

1. Real dry-run bugs (state written despite --dry-run):
   - install.go: saveSyncSourceIfRemote called unconditionally after
     installer.RunContext succeeds; gate with !installCfg.DryRun
   - install.go: updateSyncedAt called in the "already up to date" path
     before the dry-run check; gate identically

2. Structural: add dryRun bool to helper functions so the archtest can
   see the guard mechanically, removing the need for baseline entries:
   - dotfiles: backupConflicts, backupFile, restoreFile
   - shell: patchZshrcBlock
   - snapshot/local: SaveLocal
   - sync/source: SaveSource, DeleteSource

For the remaining two exemptions (doctor.go read-only diagnostic probes)
and the seven capture.go + one diff.go read-only system probes, the
latter group is now handled by adding those files to dryRunExemptFiles
(all their RunCommandOutput calls are read-only queries). The doctor
entries are kept in the baseline with explicit audit comments.

Baseline: 25 entries → 2 (only doctor read-only probes remain).
@fullstackjam fullstackjam force-pushed the fix/dryrun-baseline-audit branch from 8afe0b2 to c3ed3b6 Compare June 1, 2026 15:06
The dry-run baseline regeneration (ARCHTEST_UPDATE_BASELINE=1) stripped the
hand-authored exemption reasons from no-raw-http.txt as a side effect. That
file is unrelated to this PR's dry-run audit, so revert it to main: the
two entries and line numbers are unchanged, only the audit-trail comments
explaining why each raw-http site is exempt are restored.
@fullstackjam fullstackjam merged commit 7a91db8 into main Jun 1, 2026
11 checks passed
@fullstackjam fullstackjam deleted the fix/dryrun-baseline-audit branch June 1, 2026 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

snapshot Snapshot capture/restore tests Tests only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant