Repository navigation
Description
Problem Description
The post-merge hardening audit failed for PR #2647, which delivers #2504. The audit table says Missing with no addition on a declared hardening surface. The audit then tried to hand the finding to intake, and that step failed with the ZeroDivisionError of #2524. So no issue holds the finding.
The root cause of #2504 is a model default: NetworkReputationRecord.outcome was ok, so a client that forgot the outcome gave a record that read as verified. The fix made the field required. No document tells the next author of a lookup result model to give it no clean default.
Reproduction Steps
- Run
uv run devops pr hardening-report --pr 2647 --fail-on-missing.
Expected vs Actual Behavior
Expected: one line on a declared hardening surface (CONST_HARDENING_SURFACES, for example ARCHITECTURE.md or CONTRIBUTING.md) says that 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.
Actual: the audit reports Missing and exits with 1.
Environment Diagnostics
devops-cli 0.16.1 from main, after the merge of #2647. The run is the Audit Defect PR Hardening job of that merge.
Logs, Traces, or Terminal Output
#2647 fix(security): a failed shodan internetdb lookup is no ok record label:type/security, title:fix Missing —
✗ PR #2647 failed hardening audit: no additions on declared hardening surfaces.
Pre-Submission Checklist
- I have verified that no sensitive credentials, private keys, or internal tokens are contained in this issue report.
- I have checked existing issues and pull requests to ensure this is not a duplicate.
Source: found after the merge of #2647.
Alternatives check of 2026-11-04: not-applicable.
Class: docs, no search.
Tool: none found.
Proposed design
Problem statement
The post-merge hardening audit reports PR #2647 as Missing: it added no guardrail to a declared hardening surface. #2504 fixed the root cause in code (NetworkReputationRecord.outcome is now required), but no declared surface states the general rule, so the next author of a lookup or check result model can give its outcome a clean default again. This issue adds that one-sentence guardrail to ARCHITECTURE.md section 7.2, which lists the Pydantic model design rules. The audit report of PR #2647 itself cannot change: audit_pr_hardening counts the additions of the audited pull request.
Acceptance criteria
Requirement: Guardrail line present in ARCHITECTURE.md section 7.2
ARCHITECTURE.md section 7.2 SHALL hold a bullet that states the result model of a lookup or a check has no default that reads as clean.
Scenario: The model design rules list holds the guardrail bullet
- WHEN A test reads the bullets of section 7.2 of ARCHITECTURE.md
- THEN One bullet names the result model of a lookup or a check and says its outcome field has no clean default.
Requirement: Guardrail line names the two rules
The guardrail bullet SHALL state that the model names how the lookup ended and that a missing value is an error.
Scenario: The bullet names the outcome and the error
- WHEN A test reads the guardrail bullet
- THEN The bullet names the outcomes ok, unavailable and failed and says a model that omits the outcome is refused with a validation error.
Requirement: Guardrail bullet cites its source issues
The guardrail bullet SHALL cite #2504 and #2636 so a reader reaches the fix and the follow-up that apply the rule.
Scenario: The bullet names both issues
- WHEN A test reads the guardrail bullet
- THEN The text holds both fix(security): a failed shodan internetdb lookup has outcome failed, so a review never shows its address as safe #2504 and fix(models): make clean-default model fields required #2636.
Requirement: Documentation checks stay green
The change SHALL keep the documentation checks green.
Scenario: Docs check after the edit
- WHEN uv run devops docs check runs on the branch
- THEN The command exits 0 and reports no problem with ARCHITECTURE.md.
Existing Tool Considered
The alternatives check of 2026-11-04 is not-applicable: it is a docs item, so the check made no search and no model call. It found no tool, and no open, maintained tool or library writes a project-specific model-design rule into a project's own architecture document. The change is one bullet in an existing Markdown file; the written cost is one line of text, with no code to build, keep or fix. The check that holds the rule is the existing devops docs check, which validates the argv references of every hand-written document (tests/docs/test_docs_inventory.py:1).
Key questions
- Should this issue add the guardrail line itself?: Yes. This issue adds the one bullet to ARCHITECTURE.md section 7.2 in one docs pull request. The reply's proposal to move the sentence into the plan of fix(hardening): add guardrails to hardening surfaces #2526 is rejected: that plan writes six sentences for six other pull requests into SECURITY.md and CONTRIBUTING.md only, so it does not touch ARCHITECTURE.md section 7.2 and its edit for fix(security): a failed shodan internetdb lookup is no ok record #2647 is not in the repository yet. The recurring defect class (fix(models): make clean-default model fields required #2636 removes the same clean default from four more models and adds no surface line) makes a general rule in ARCHITECTURE.md worth landing now rather than after another plan pull request. (best practice) [sources: openspec/changes/2526-the-five-defect-fixes-merged-on/proposal.md:7, openspec/changes/2526-the-five-defect-fixes-merged-on/proposal.md:39, openspec/changes/2636-a-result-that-no-lookup-marked/proposal.md:5, ARCHITECTURE.md:169]
- Chosen: Add the bullet in this issue. One sentence in ARCHITECTURE.md section 7.2, which already lists the Pydantic model rules. It fits one docs pull request, needs no other change, and no fix(hardening): add guardrails to hardening surfaces #2526 task edits section 7.2, so it duplicates no text.
- Rejected: Move the sentence into the fix(hardening): add guardrails to hardening surfaces #2526 plan and close this issue after that plan pull request merges. The merged plan of fix(hardening): add guardrails to hardening surfaces #2526 covers six other pull requests and lists only SECURITY.md and CONTRIBUTING.md as its documents (proposal.md:7-14, 39). The fix(security): a failed shodan internetdb lookup is no ok record #2647 row is not in the repository, so this issue would wait on a plan edit that does not exist, and a close before it would lose the sentence.
- Rejected: Close this issue as not planned now. Nothing in the repository records the guardrail of fix(security): a failed shodan internetdb lookup has outcome failed, so a review never shows its address as safe #2504, so a close loses it.
- What does the guardrail line say?: A bullet after the Strict Typing bullet of ARCHITECTURE.md section 7.2: "No Clean Default on a Result: A result model of a lookup or a check names how the lookup ended (
ok,unavailableorfailed), and its outcome field has no default. A model that omits the outcome is refused with a validation error, so a result that no lookup markedoknever reads as verified (fix(security): a failed shodan internetdb lookup has outcome failed, so a review never shows its address as safe #2504, fix(models): make clean-default model fields required #2636)." (best practice) [sources: openspec/specs/threat-intel-lookup-outcome/spec.md:9, openspec/changes/archive/2026-10-29-2504-shodan-failed-lookup-outcome/proposal.md:25, src/devops_cli/models/vulnerability.py:112, openspec/changes/2636-a-result-that-no-lookup-marked/design.md:5, ARCHITECTURE.md:171]- Chosen: Two-rule bullet: the outcome has no default, and a missing value is a validation error. It states both halves of the fix(security): a failed shodan internetdb lookup has outcome failed, so a review never shows its address as safe #2504 rule: the field names how the lookup ended, and pydantic refuses a record that omits it. The spec of fix(security): a failed shodan internetdb lookup has outcome failed, so a review never shows its address as safe #2504 states the same two rules, and the code comment at vulnerability.py:112 names the reason.
- Rejected: One-rule bullet: the outcome field has no default. It leaves out that a missing value is an error, which is the half that makes a forgetful client fail instead of reading as clean (fix(models): make clean-default model fields required #2636 design.md:5).
- Rejected: Name only NetworkReputationRecord.outcome. It binds the rule to one model. fix(models): make clean-default model fields required #2636 shows the same defect in four other models, so the rule belongs at the level of a lookup or check result model.
- Which declared hardening surface holds the guardrail line?: ARCHITECTURE.md, section 7.2 (End-to-End Pydantic Resource Model Interoperability), as a bullet after Strict Typing. The section already lists the Pydantic model design rules (Strict Typing, Bi-Directional JSON Schema Generation, Closed Tool Schemas), and the guardrail is a model design rule. (best practice) [sources: ARCHITECTURE.md:169, ARCHITECTURE.md:171, .github/workflows/defect-pr-hardening-audit.yml:70]
- Chosen: ARCHITECTURE.md section 7.2. The section lists the Pydantic model design rules, and the guardrail is a model design rule. ARCHITECTURE.md is a declared hardening surface.
- Rejected: CONTRIBUTING.md section 1. The section lists core invariants for every contributor, is broader than model design, and already receives two bullets from fix(hardening): add guardrails to hardening surfaces #2526.
- Rejected: SECURITY.md. The guardrail is a model design rule, not a security control, and fix(hardening): add guardrails to hardening surfaces #2526 already writes four sentences there.
- Rejected: docs/TESTING.md. The guardrail is about model design, not about how to test.
- Which surfaces does the audit check?: CONST_HARDENING_SURFACES lists eight surfaces: 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/. The audit reports a defect pull request as hardened when any one of them gains an addition, and it counts the additions of the audited pull request only. [sources: src/devops_cli/config/constants.py:3993, src/devops_cli/github/defect_classifier.py:155, .github/workflows/defect-pr-hardening-audit.yml:70]
- Should the acceptance criterion that the audit exits 0 for PR fix(security): a failed shodan internetdb lookup is no ok record #2647 stay?: No. Drop it. audit_pr_hardening sums the additions of the files of the audited pull request, so no later pull request can change the report of PR fix(security): a failed shodan internetdb lookup is no ok record #2647. The deliverable is the guardrail bullet, and the new criteria check its text in ARCHITECTURE.md and the docs check. (best practice) [sources: src/devops_cli/github/defect_classifier.py:155, openspec/changes/2526-the-five-defect-fixes-merged-on/proposal.md:58, openspec/changes/2526-the-five-defect-fixes-merged-on/proposal.md:67]
- Chosen: Drop the exit 0 scenario. The audit reads the additions of PR fix(security): a failed shodan internetdb lookup is no ok record #2647 itself. A later pull request cannot make that report pass, so the scenario can never be asserted.
- Rejected: Keep the exit 0 scenario. It cannot pass for any later pull request, which would leave the criterion permanently red.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Oct 29, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
The change adds a documentation line to ARCHITECTURE.md or CONTRIBUTING.md.The audit fails without this line, but it is a documentation addition, not a code or security fix.It prevents the next author from repeating the clean-default mistake and satisfies the hardening audit.The change is one line in an existing markdown file.Both add a root-cause guardrail to a declared hardening surface for a defect fix, but #2526 holds five findings while the candidate is the single finding for #2504.devops-cli-service commentedon Oct 30, 2026
Refine cannot set this item to Ready at 46fd02d until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.
devops-cli-service commentedon Nov 4, 2026
Alternatives check: not-applicable
Class: docs. The check makes no search and no model call for an item of this class.
Tool: none found
Checked on 2026-11-04. A person decides what this means for the item. The check changes no label and closes no issue.
dan-petty commentedon Nov 4, 2026
This item moves into the plan of #2526, after a plan pull request changes that plan. Both ask for the same kind of guardrail sentence from the same audit, and #2526 has a merged plan.
Keep this item open until that plan pull request merges. A close before it loses the sentence, because the plan of #2526 now names only
SECURITY.mdandCONTRIBUTING.mdand expects six lines. A comment on #2526 lists the plan edit: the root cause, the sentence with its two rules, the surface inARCHITECTURE.md, and PR #2647 with issue #2504.After the merge, this item ends as not planned, with a link to the plan. Its scenario "the audit reports the surface as present and exits with 0" is dropped:
audit_pr_hardeningsums the additions of the audited pull request, so no later pull request can change the report of PR #2647. This item has no change folder, so no cleanup is necessary.devops-cli-service commentedon Nov 4, 2026
Status set to Ready at 1ad0e59 (see proposed design in issue body).
docs(docs): add a no clean default rule for result models (#3844)