@kavishdua/proctor 1.5.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +29 -0
  2. package/dist/cli.js +36 -34
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -478,6 +478,35 @@ jobs:
478
478
  The example pins the commit behind the `v1.0.0` release. You can use the `v1.0.0` tag instead, but
479
479
  a full commit SHA is immutable, so it keeps builds reproducible.
480
480
 
481
+ ### Make the gate independent
482
+
483
+ Local hooks are agent-writable; only CI outside the agent's write scope is an independent check.
484
+ For that to hold, the workflow itself must survive the agent:
485
+
486
+ 1. Require the proctor status check on the protected branch (repo Settings > Branches), so a red
487
+ proctor run blocks merging.
488
+ 2. Cover `.github/` in `CODEOWNERS` (for example `/.github/ @you`) AND enable "require review
489
+ from code owners", so a pull request that weakens or deletes the workflow needs your review.
490
+ 3. Keep the agent's own credentials away from repo settings: nothing the agent can authenticate
491
+ as should be able to edit branch protection or dismiss the required check.
492
+
493
+ `proctor doctor` audits what it can see: ruleset deployed and undrifted, pre-commit hook and
494
+ unresolved gate installed, agent Stop hooks, the CI workflow, and CODEOWNERS coverage. It reports
495
+ each layer as MISSING, CONFIGURED, or UNVERIFIED. CONFIGURED means the file exists - it never
496
+ means independently verified, because branch protection, required review, and who holds admin
497
+ cannot be checked from a working tree.
498
+
499
+ Doctor is offline by default. With explicit `proctor doctor --github` opt-in and a github.com origin remote, doctor asks the owning source: it
500
+ makes read-only GET requests to the GitHub API for repository metadata, branch rules, and ruleset
501
+ configuration, and reports what the server actually enforces as SERVER-OK (or MISSING when the
502
+ server confirms a rule is absent). SERVER-OK means server-verified configuration, not proof of
503
+ agent-independent enforcement: an agent whose credentials have admin or settings write access
504
+ could still change or bypass those rules, and doctor cannot see the agent's credentials. Only the
505
+ repository owner and name appear in the request URLs; no file contents or block records are sent. If you already have `GITHUB_TOKEN` or `GH_TOKEN` set, it is sent as an Authorization
506
+ header so private repositories can be read; without one, only public rulesets are visible and
507
+ anything unreadable is reported UNVERIFIED, never as absent. Redirects outside the HTTPS GitHub API origin are refused before following them. The number of requests is printed
508
+ with each run, and `--offline` skips the network entirely.
509
+
481
510
  ## Dynamic checks
482
511
 
483
512
  `proctor check --dynamic` runs extra checks using a runnable project test suite. The default