Skip to content

fix(hardening): defect PR #3475 missing declared surface hardening #3623

Closed as not planned

Description

@github-actions

Unhardened Defect PR Audit Finding

Defect Pull Request #3475 was merged without adding guardrails or lessons to any declared hardening surface.

Declared Hardening 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
  • src/devops_cli/review/rules/

Per project invariants (AGENTS.md), defect fixes must codify root-cause guardrails into at least one declared surface to prevent recurrent regressions.

Proposed design

Problem statement

Pull request #3475 merged a defect fix and added no guardrail to a declared hardening surface. The same root cause can return, and nothing fails when it does. This change adds the missing guardrail and proves that the guardrail fails on the defect.

Acceptance criteria

Requirement: Guardrail on a declared surface

The change SHALL add the root-cause guardrail of PR #3475 to at least one declared hardening surface.

Scenario: Declared surface changed

  • WHEN git lists the files that the branch changes against origin/main
  • THEN the list holds at least one path of a declared hardening surface

Requirement: The check fails on the defect

The guardrail check SHALL fail on a tree that holds the defect pattern.

Scenario: Small tree with the defect

  • WHEN the guardrail check runs on a small tree that holds the defect pattern
  • THEN the check fails and its message names the rule and the path

Requirement: The check passes on the default tree

The guardrail check MUST pass on the tree of the default branch.

Scenario: Default tree without the defect

  • WHEN the guardrail check runs on the tree of the default branch
  • THEN the check passes with no finding

Requirement: Spec delta records the rule

The change folder SHALL hold a spec delta whose requirement states the guardrail with SHALL or MUST.

Scenario: OpenSpec check of the change folder

  • WHEN uv run devops openspec check runs on the change folder
  • THEN the check passes and the delta holds the guardrail requirement with one scenario

Existing Tool Considered

No alternatives check has run. No open, maintained tool or library covers this need: the guardrail is a rule of this repository, and the repository's own hardening audit detects the gap but adds no guardrail. The change builds a small invariant check: about 25k tokens to build, 5k a year to keep and 20k to fix, and about 3 hours elapsed.

Key questions

  • Does the fail-to-pass check apply to this change?: No. The check runs only for a fix pull request that changes src/ outside the knowledge base. This change touches tests and documents. [sources: CONTRIBUTING.md]
  • Which declared surface carries the guardrail?: A test under tests/, with the requirement in the spec delta of the change folder. (best practice) [sources: AGENTS.md, docs/TESTING.md]
    • Chosen: A test under tests/. A test fails when the defect returns. AGENTS.md rule 11 asks for a check that fails on the return of the problem, and the audit counts a test as a surface.
    • Rejected: A rule in CONTRIBUTING.md or AGENTS.md. A document states the rule and fails on no change.
    • Rejected: A living spec requirement. Only openspec archive writes the spec, and a spec fails on no change. The spec delta records the rule beside the test.
    • Rejected: A suppression in .devops/review.toml. A suppression hides a finding and guards nothing.
  • How does the change prove that the guardrail works?: The logic of the check runs on a small tree that holds the defect pattern, fails there, and passes on a tree without it. (best practice) [sources: docs/TESTING.md]
    • Chosen: A small tree that holds the defect pattern. docs/TESTING.md gives a check a small tree and starts no program. The check shows its failure offline.
    • Rejected: A fail-to-pass replay. The defect is already fixed on the base, so an added test passes there and the replay proves nothing.
    • Rejected: A manual check. A manual check cannot run again with the same answer.

Open questions

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    type/bug
    status/new
    value/medium
    effort/low
    on Nov 5, 2026
  2. devops-cli-service commented on Nov 5, 2026

    @devops-cli-service
    Contributor

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

    • Type: type/bug. The fix prefix of the title gives the type.
    • Scope: none. The title has the scope hardening, and .github/labels.yml declares no scope/hardening label. Add the label to the file to give the scope to this item.
    • Priority: P2-Medium. It enforces a project invariant but does not block a user-facing feature or fix a live defect.
    • Value: Medium. It prevents recurrent regressions from the same root cause but does not change user-visible behaviour.
    • Effort: Low. It requires adding guardrail text to one or more existing documentation or rule files.
    • Related: fix(hardening): defect PR #3467 missing declared surface hardening #3469, which asks for a different change. Both follow the same audit template for unhardened defect PRs, but each targets a different PR and its specific root-cause guardrails.
  3. devops-cli-service commented on Nov 6, 2026

    @devops-cli-service
    Contributor

    Refine cannot set this item to Ready at 27c7019 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.

  4. dan-petty commented on Nov 11, 2026

    @dan-petty
    Owner

    Closed as not planned. The check that filed this item passes now.

    • Command: uv run devops pr hardening-report --pr 3475
    • Result: is_hardened: true. The hardened surfaces are tests/ and openspec/specs/.

    #3684 (merged 2026-11-05) counts tests and specs as hardening guardrails. Thus PR #3475 has the guardrail that the audit did not find. #3661 closes this family of items under the issue stewards plan #4780 (AGENTS.md rule 2). If the check fails again, reopen this item.

  5. removed
    status/new
    on Nov 11, 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/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions