Skip to content

docs(architecture): add the guardrail of #2504 to a declared hardening surface #2660

Closed

Description

@dan-petty

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

  1. 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

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

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/docs
    status/new
    value/medium
    effort/low
    on Oct 29, 2026
  2. dan-petty commented on Oct 29, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/docs. The change adds a documentation line to ARCHITECTURE.md or CONTRIBUTING.md.
    • Priority: P2-Medium. The audit fails without this line, but it is a documentation addition, not a code or security fix.
    • Value: Medium. It prevents the next author from repeating the clean-default mistake and satisfies the hardening audit.
    • Effort: Low. The change is one line in an existing markdown file.
    • Related: fix(hardening): add guardrails to hardening surfaces #2526, which asks for a different change. 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.
  3. added
    priority/p2-medium
    on Oct 29, 2026
  4. devops-cli-service commented on Oct 30, 2026

    @devops-cli-service
    Contributor

    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.

    • What does the guardrail line say? (missing verified source)
  5. devops-cli-service commented on Nov 4, 2026

    @devops-cli-service
    Contributor

    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.

  6. dan-petty commented on Nov 4, 2026

    @dan-petty
    OwnerAuthor

    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.md and CONTRIBUTING.md and expects six lines. A comment on #2526 lists the plan edit: the root cause, the sentence with its two rules, the surface in ARCHITECTURE.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_hardening sums 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.

  7. added
    status/ready
    and removed
    status/new
    on Nov 4, 2026
  8. devops-cli-service commented on Nov 4, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at 1ad0e59 (see proposed design in issue body).

  9. added
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 6, 2026
  10. added a commit that references this issue on Nov 6, 2026
    64b8959
  11. removed
    status/in-review
    owner/agent
    on Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p2-mediumsource/agenttype/docsvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions