Skip to content

harden validation and safety boundaries - #2

Merged
NafYoung merged 4 commits into
mainfrom
agent/validation-closeout
Jul 28, 2026
Merged

harden validation and safety boundaries#2
NafYoung merged 4 commits into
mainfrom
agent/validation-closeout

Conversation

@NafYoung

@NafYoung NafYoung commented Jul 28, 2026

Copy link
Copy Markdown
Owner

What changed

  • remove the undeclared rg dependency from privacy checks and scan tracked plus non-ignored files through Git and Ruby
  • detect generic macOS home paths while allowing the documented YOUR_NAME placeholder
  • add regression checks for both failure modes and run them in GitHub Actions
  • clarify that only the original macOS split-routing case has runtime evidence; a fresh VPS/Mac deployment still requires staged validation
  • resolve the rule conflict around closing the only SSH entry and separate secret handling from revoking old peers or public keys
  • date the adoption snapshot and tighten the fixed-version source anchors

Why

Post-merge closeout found two validation gaps and two wording ambiguities. The GitHub macOS runner does not provide rg; the previous script swallowed that command failure and could report a passing privacy scan without running it. The old path pattern also recognized only one local username. Separately, the guide could be read as allowing the only SSH entry to be closed or as treating the new one-stop path as already tested on a fresh machine.

User impact

Readers and agents get portable privacy checks, clearer authorization boundaries, and a more accurate distinction between repository validation and real VPS/macOS runtime validation.

TDD evidence

RED on commit 3cf3105:

  • bash scripts/test-validate-repo.sh
  • failed because the validator exited successfully with rg removed from PATH
  • failed because a fixture containing a different macOS username was accepted

GREEN on commits b3ee5aa and e0eae9c:

  • with rg absent, the portable validator still runs its normal checks
  • with rg absent and a generic macOS path present, the same validator rejects the fixture
  • bash scripts/validate-repo.sh passed
  • git diff --check main...HEAD passed

The intermediate CI failures were retained as evidence that the new regression actually exercised the GitHub runner; they led to removing the undeclared dependency rather than installing it implicitly.

Coverage note: this repository has no line-coverage runner. Both identified validation journeys are covered by executable integration regressions, and the existing static suite covers shell syntax, YAML, plist, SSH examples, Markdown links, server invariants, private-looking artifacts, and whitespace.

@NafYoung
NafYoung marked this pull request as ready for review July 28, 2026 05:47
Copilot AI review requested due to automatic review settings July 28, 2026 05:47
@NafYoung
NafYoung merged commit bdf3437 into main Jul 28, 2026
2 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR tightens repository validation and documentation safety boundaries by making the privacy scan portable (no rg dependency), expanding detection of macOS user-home paths, adding regression checks in CI, and clarifying the guide’s staged-validation/authorization constraints.

Changes:

  • Reworked scripts/validate-repo.sh privacy scanning to use git ls-files + Ruby instead of rg, and added required-command checks plus a regression test invocation.
  • Added a new regression script (scripts/test-validate-repo.sh) and ran it in GitHub Actions before the main validator.
  • Updated docs to clarify validation/runtime boundaries, tighten “don’t close the only SSH entry” language, and date/source-anchor references.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
SOURCES.md Dates the GitHub snapshot reference and adjusts fixed-version source anchors.
SECURITY.md Clarifies destructive/credential actions must be staged and explicitly confirmed.
scripts/validate-repo.sh Removes rg dependency; adds portable scanning and regression invocation.
scripts/test-validate-repo.sh Adds integration regressions for missing-rg and generic macOS user-path detection.
README.md Clarifies that only the original macOS split-routing case has runtime evidence; one-stop path still requires staged validation.
docs/agent-runbook.md Tightens authorization boundaries for SSH closure, firewall enablement, and credential revocation.
.github/workflows/validate.yml Runs regression checks prior to the main repository validator on macOS runner.
Comments suppressed due to low confidence (1)

scripts/test-validate-repo.sh:54

  • This file cleanup uses unlink; using rm -f keeps deletion consistent with common shell portability expectations and avoids depending on the presence of unlink.
  unlink "$fixture"

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/validate-repo.sh
Comment on lines +123 to 124
if git ls-files | grep -nE \
'(^|/)(wireguard-private\.yaml|wg-private\.yaml|wg0\.conf|[^/]+\.key|[^/]+\.pem)$'; then
Comment thread scripts/validate-repo.sh
Comment on lines +136 to +137
content = File.binread(path)
next if content.include?("\0")
Comment thread scripts/validate-repo.sh
Comment on lines +145 to +147
rescue Errno::EACCES, Errno::ENOENT
next
end
Comment on lines +13 to +15
if [[ -e "$fixture" ]]; then
unlink "$fixture"
fi
@NafYoung
NafYoung deleted the agent/validation-closeout branch July 28, 2026 05:56
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.

2 participants