Report security-control capability separately from state - #54
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1468122e88
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (status === 404) { | ||
| return { | ||
| capability: "unknown", | ||
| enabled: null, |
There was a problem hiding this comment.
Preserve Dependabot’s disabled 404
For dependabotSecurityUpdates: false, GitHub documents GET /repos/{owner}/{repo}/automated-security-fixes returning 404 when Dependabot security updates are not enabled (https://docs.github.com/rest/repos/repos#check-if-dependabot-security-updates-are-enabled-for-a-repository). Because endpoint reads now share this 404 branch, a successful DELETE is converted to enabled: null/unknown instead of disabled; then configureRepositorySecurity can never mark that requested disable as verified. Please special-case the automated-security-fixes 404 as the documented disabled state where appropriate.
Useful? React with 👍 / 👎.
Summary
stateand top-leveloksemanticsCompatibility decision
The additive
controlsresult is authoritative for capability diagnostics. Legacystatebooleans remain available, andokremains their logical AND. A 404 isunknownwith reasonnot_found_or_masked; it is never treated as proof that a control is unsupported or disabled. Configuration verification now requires an observable available state, so unknown capability cannot falsely verify a requested disabled value.Validation
npm cinpm run verify(9 files, 69 tests; coverage thresholds passed)npm audit --audit-level=high(0 vulnerabilities)npm pack --dry-run(63 packaged files)Recovery and rollback
Recovery strings are static and sanitized; raw GitHub failure messages are not copied into results. Rollback is a normal revert of this PR; no persistence, migration, deployment, or release is involved.
Closes #46