Repository navigation
Description
Problem Description
Five defect pull requests that merged on 2026-10-28 add no guardrail or lesson to a declared hardening surface. The audit .github/workflows/defect-pr-hardening-audit.yml (devops pr hardening-report) found each one, but its intake step crashed before it filed the finding (#2524: the ZeroDivisionError in the embedder). This issue holds the five findings in one item, because they have one cause and one change surface.
| PR | Issue | Change |
|---|---|---|
| #2446 | #2106 | scan_uv_audit runs one uv audit --frozen adapter |
| #2470 | #1632 | Loki runs from the grafana-community chart on Loki 3.7.9 (CVE-2026-21729) |
| #2488 | #1110 | a reply names its server by the origin of the URL called, with no userinfo |
| #2521 | #2431 | the sandbox metrics scrape and the whitelist NetworkPolicy resolve each host one time, through the egress check |
| #2522 | #1652 | a pod that does not call the Kubernetes API mounts no service account token |
The declared hardening surfaces are docs/TESTING.md, ARCHITECTURE.md, SECURITY.md, CONTRIBUTING.md, src/devops_cli/ai/tasks/*.md, src/devops_cli/ai/knowledge_base/, .devops/review.toml and src/devops_cli/review/rules/.
Reproduction Steps
- Run
uv run devops pr hardening-reportfor each PR in the table (read its--help). - See that each PR is reported as unhardened.
Expected vs Actual Behavior
Expected: each defect fix adds its root-cause lesson to at least one declared surface, for example a SECURITY.md rule for the egress check of every client, a review rule for userinfo in a display string, or a docs/TESTING.md rule, so that the defect class does not return.
Actual: the five PRs changed code, tests and other documents only.
Environment Diagnostics
main at 2026-10-28.
Logs, Traces, or Terminal Output
Audit runs 40726982400, 40739487773, 40747696823, 40758319104 and 40758364472 (step "Audit defect PR hardening" failed, then the intake step crashed).
Proposed design
Problem statement
Six defect pull requests merged on 2026-10-28 changed code, tests and documents, but none added its root-cause lesson to a declared hardening surface. The audit found each one, but its intake step crashed before it filed the finding. This issue holds the six findings in one item because they share one cause and one change surface. The change adds a guardrail for each defect class to the declared surface that best fits it, so the defect class does not return.
Acceptance criteria
Requirement: guardrail_per_defect
Each of the six defect PRs SHALL have its root-cause lesson recorded in at least one declared hardening surface.
Scenario: hardening_report_passes
- WHEN devops pr hardening-report runs for each of the six PRs (fix(security): scan_uv_audit runs a uv audit adapter that audits the lockfile as it is #2446, fix(k8s): loki runs from the grafana-community chart on loki 3.7.9, out of reach of CVE-2026-21729 #2470, fix(ai): a reply names its server by the origin of the URL called, so a password in an AI URL stays out of every record #2488, fix(sandbox): the metrics scrape and the whitelist NetworkPolicy resolve each host one time, through the egress check #2521, fix(k8s): a pod that does not call the Kubernetes API mounts no service account token #2522, fix(config): devops config audit-keys scans each config file that the settings merge #2516)
- THEN each PR is reported as hardened, not unhardened
Requirement: guardrail_names_defect_class
Each guardrail entry SHALL name the defect class it prevents and the rule that prevents it.
Scenario: guardrail_text_is_specific
- WHEN a reviewer reads each guardrail entry in its surface
- THEN the entry names the defect class, the prevention rule, and the surface where it is enforced
Requirement: guardrail_in_best_fit_surface
Each guardrail SHALL appear in the declared surface that best fits its defect class, not in every surface.
Scenario: single_surface_per_guardrail
- WHEN a guardrail is added to a surface
- THEN it appears in exactly one declared surface, and that surface has existing content that the guardrail extends
Existing Tool Considered
No open, maintained tool or library covers this need. The project writes its own guardrail text into its declared surfaces. The cost is the tokens to write, keep and fix six guardrail entries across the declared surfaces, and the elapsed time for a person to review each entry.
Key questions
- Which declared surface receives the guardrail for each of the six defect PRs?: Each guardrail goes to the surface that best fits its defect class. fix(security): scan_uv_audit runs a uv audit adapter that audits the lockfile as it is #2446 goes to SECURITY.md item 7 (tool execution). fix(k8s): loki runs from the grafana-community chart on loki 3.7.9, out of reach of CVE-2026-21729 #2470 goes to CONTRIBUTING.md (dependency management). fix(ai): a reply names its server by the origin of the URL called, so a password in an AI URL stays out of every record #2488 goes to SECURITY.md item 1 (zero secret leakage). fix(sandbox): the metrics scrape and the whitelist NetworkPolicy resolve each host one time, through the egress check #2521 goes to SECURITY.md item 2 (SSRF protection). fix(k8s): a pod that does not call the Kubernetes API mounts no service account token #2522 goes to SECURITY.md item 5 (least privilege). fix(config): devops config audit-keys scans each config file that the settings merge #2516 goes to CONTRIBUTING.md (config management). (best practice) [sources: SECURITY.md, CONTRIBUTING.md, .github/workflows/defect-pr-hardening-audit.yml]
- Rejected: All six to SECURITY.md. Three fit better in CONTRIBUTING.md because they are process and dependency rules, not security rules.
- Chosen: Best-fit surface per defect class. Each surface has existing content that the guardrail extends, and the defect class matches the surface scope.
- Rejected: All six as Semgrep rules in src/devops_cli/review/rules/. The defects are architectural and process lessons, not code patterns that a rule can express.
- Should any guardrail be a Semgrep rule in src/devops_cli/review/rules/?: No. The six defect classes are architectural and process lessons. None is a code pattern that a Semgrep rule can express. They are prose rules in the declared surfaces. (best practice) [sources: SECURITY.md, CONTRIBUTING.md, .devops/review.toml]
- Rejected: Semgrep rules for all six. The defects are process and architecture lessons, not code patterns.
- Chosen: Prose in declared surfaces. The declared surfaces already hold prose rules for similar defect classes.
- Does the change require a code change under src/?: No. The change adds text to existing documents. It changes no source file under src/. The declared surfaces are all documents, configuration or rules. [sources: SECURITY.md, CONTRIBUTING.md, docs/TESTING.md, ARCHITECTURE.md, .devops/review.toml]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Oct 28, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
The change adds root-cause lessons and rules to declared documentation and review-rule surfaces.The code fixes are merged; this prevents recurrence of five defect classes but is not an active outage.The failed run 40726982400 does not set P0: the author has no write access, and no caller attached it as evidence. A person can set P0 with the label priority/p0-critical.Guardrails stop five known defect classes from returning, which protects long-term reliability.Five distinct guardrails must be written across multiple surfaces, but each is a focused addition.Both concern defect PR hardening; #697 delivers the audit mechanism that detects missing guardrails, while this candidate delivers the guardrail content itself.dan-petty commentedon Oct 28, 2026
A sixth defect PR has the same finding: #2516 (issue #2426,
devops config audit-keysscans each config file that the settings merge). Audit run 40761500518 failed on 2026-10-28 at 20:14 UTC, and its intake step crashed with the sameZeroDivisionError(#2524), so the finding was not filed. This issue holds it with the other five.devops-cli-service commentedon Oct 29, 2026
Status set to Ready at 0f7bc26 (see proposed design in issue body).
devops-cli-service commentedon Nov 1, 2026
Staged: branch
fix/2526-the-five-defect-fixes-merged-on, draft pull request #2994. The pull request plans the item and closes no issue.The task groups, with the tokens of the inputs of each step, for a budget of 40000 tokens:
docs(openspec): plan #2526 add guardrails to hardening surfaces (#2994)
docs(openspec): fix plan #2526 cover six defects, no spec delta (#3048)
dan-petty commentedon Nov 4, 2026
The plan of this item must change before an implement run takes it. A second finding of the same kind joins it from #2660, and the plan has two other defects.
Open a
docs(openspec)pull request that editsopenspec/changes/2526-the-five-defect-fixes-merged-on/:design.md. The folder holds onlyproposal.mdandtasks.md, andplan_read.py:121reads all three.vet_addresses.src/devops_cli/sandbox/metrics.pyholds novet_addressesand nogetaddrinfo. Read the code, and state what it does.NetworkReputationRecord.outcomedefaulted took, so a client that forgot the outcome gave a record that read as verified. The fix made the field required. The sentence: the result model of a lookup or a check has no default that reads as clean. The model names how the lookup ended, and a missing value is an error. The surface is section 7.2 ofARCHITECTURE.md(End-to-End Pydantic Resource Model Interoperability), beside theStrict Typingbullet at line 171. A search finds no such line on any surface today.ARCHITECTURE.mdto## Impact, which now says "No other file changes", and to a task group. Add#2504to the grep of task 2.3, and change its expected count from six lines to seven.Do not take the scenario that the audit exits 0. The plan already shows that a later pull request cannot change the report of an old pull request:
audit_pr_hardeningsums the additions of the audited pull request.Check the plan against the result of the new issue
fix(ci): the hardening audit files no issue for a tested fix, because that issue can change what the audit asks for. The pull request of this item delivers only this item.[-]fix(hardening): the five defect fixes merged on 2026-10-28 add their root-cause guardrail to a declared hardening surface[/-][+]fix(hardening): add guardrails to hardening surfaces[/+]dan-petty commentedon Nov 6, 2026
The job shortened the title of this item. The summary had 105 characters, and the limit is 60. The type and the scope stay.
fix(hardening): the five defect fixes merged on 2026-10-28 add their root-cause guardrail to a declared hardening surfacefix(hardening): add guardrails to hardening surfacesdan-petty commentedon Nov 6, 2026
Closed as superseded by #3479 (fixed in #3684). The premise of this item is no longer true.
Evidence, from
mainat c714551 on 2026-11-06:audit_pr_hardeningnow counts additions undertests/andopenspec/specs/as a guardrail, and.github/workflows/defect-pr-hardening-audit.ymlsays so in its header.uv run devops pr hardening-report --pr <n> -f jsonnow prints"is_hardened": truefor fix(security): scan_uv_audit runs a uv audit adapter that audits the lockfile as it is #2446, fix(k8s): loki runs from the grafana-community chart on loki 3.7.9, out of reach of CVE-2026-21729 #2470, fix(ai): a reply names its server by the origin of the URL called, so a password in an AI URL stays out of every record #2488, fix(sandbox): the metrics scrape and the whitelist NetworkPolicy resolve each host one time, through the egress check #2521, fix(k8s): a pod that does not call the Kubernetes API mounts no service account token #2522, fix(config): devops config audit-keys scans each config file that the settings merge #2516 and fix(security): a failed shodan internetdb lookup is no ok record #2647. The hardened surfaces aretests/andopenspec/specs/for each one.tests/security/test_vulnerability_lookup.py::test_reputation_record_needs_a_known_outcomefor fix(security): a failed shodan internetdb lookup has outcome failed, so a review never shows its address as safe #2504, and the K8s manifest invariants for fix(k8s): workloads that never call the kubernetes api mount no service account token #1652 and fix(k8s): loki runs from the grafana-community chart on loki 3.7, out of reach of cve-2026-21729 #1632.docs/SELF_IMPROVEMENT.md(Continuous self-hardening) says that a check guards a defect, and that a rule goes into a document only when no check is possible. A prose sentence inSECURITY.md,CONTRIBUTING.mdorARCHITECTURE.mdfor each class would copy a rule that a test already holds.No code was written and no branch was pushed. The worktree of this run is removed. If the owner still wants a prose lesson in a declared document for one class, file a new item for that class alone.