Skip to content

fix(hardening): defect PR #3527 missing declared surface hardening #3530

Closed as not planned

Description

@github-actions

Unhardened Defect PR Audit Finding

Defect Pull Request #3527 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 #3527 fixed a defect and merged with no guardrail on a declared hardening surface. AGENTS.md requires a defect fix to codify its root cause so that the defect cannot return. This change adds the missing guardrail to a declared surface and proves that the guardrail fails on the defect.

Acceptance criteria

Requirement: Guardrail on a declared surface

The change SHALL add at least one guardrail to a surface that the issue declares as a hardening surface.

Scenario: The hardening audit reports the change as hardened

  • WHEN the hardening audit runs on the pull request that closes this issue
  • THEN the report says hardened and names the guardrail and its declared surface.

Requirement: Guardrail fails on the defect

The guardrail MUST fail on the commit before the merge of pull request #3527.

Scenario: Replay against the commit before the fix

Requirement: No second fix of the defect

The change MUST add no second fix to the code of the defect.

Scenario: The change touches no module of the defect

  • WHEN a person lists the Python modules that the change touches under src/
  • THEN the list holds no module of the defect's code.

Requirement: The test joins the behaviour's file

A test that the change adds SHALL sit in the file that pins the behaviour, and its name SHALL hold no issue number.

Scenario: No file is named after the work

  • WHEN a person lists the files that the change adds under tests/
  • THEN each name is the name of a behaviour, and none holds 3527, hardening or a date.

Requirement: The guardrail cites its owning document

The guardrail SHALL name the document that owns the rule that it enforces.

Scenario: The guardrail names its owning document

  • WHEN a person reads the guardrail
  • THEN a comment or a docstring in it holds the path of the owning document.

Existing Tool Considered

No check has run for this item. No open tool or library writes a root-cause guardrail for one named defect. The guardrail uses the machinery that the repository already holds: pytest with the fixture floor of docs/TESTING.md, the ast-grep rules in .ast-grep/rules/, and the pr-hardening-audit workflow. The change builds no code, so it pays no cost to build, keep or fix one.

Key questions

  • Where does the repository record the defect and the root cause of pull request fix(roadmap): a new runner image clears only a stop that it can fix #3527?: In the squash commit of fix(roadmap): a new runner image clears only a stop that it can fix #3527 on main. Its subject is the pull request title and its message is the pull request body, so git log --grep '#3527' reads both. [sources: CONTRIBUTING.md]
  • Which surfaces does the project declare as hardening surfaces?: The eight surfaces of the issue: 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 pr-hardening-audit spec adds a test and a living spec. [sources: CONTEXT.md, openspec/specs/pr-hardening-audit/spec.md]
  • Which declared surface holds the guardrail for the defect of pull request fix(roadmap): a new runner image clears only a stop that it can fix #3527?: The surface that owns the broken rule. A behaviour defect gets a regression test in the test file that pins the behaviour. A rule that a document states gets the rule in that document, with a check that fails when the rule breaks. (best practice) [sources: AGENTS.md, docs/TESTING.md]
    • Chosen: A regression test in the test file of the behaviour. docs/TESTING.md puts a regression test in the file of the behaviour that it pins, and AGENTS.md rule 11 adds a check that fails if the problem returns.
    • Rejected: An invariant test under tests/invariants/. The subject of an invariant test is a committed file, not the behaviour of the code, so it pins no behaviour.
    • Rejected: A rule in the Semgrep rule pack src/devops_cli/review/rules/. A rule joins only with passing ruleid:/ok: tests and a person's merge, and it fits only a pattern that a static rule expresses.
    • Rejected: A prose rule in the document that owns the rule. Prose states the rule and fails nothing, so it joins only with a check.
    • Rejected: A suppression in .devops/review.toml. A suppression hides a finding and adds no guardrail.
  • How does the change prove that the guardrail catches the defect?: Run the guardrail on a worktree at the commit before the merge of fix(roadmap): a new runner image clears only a stop that it can fix #3527, and report the failing run in a comment on the pull request. The fail-to-pass check of CI replays nothing for a change that touches no file under src/. (best practice) [sources: docs/TESTING.md, CONTRIBUTING.md]
    • Chosen: A by-hand replay against the commit before fix(roadmap): a new runner image clears only a stop that it can fix #3527. The guardrail passes on main, so only a replay at the old commit shows that it catches the defect.
    • Rejected: The fail-to-pass check of CI. It runs only for a pull request that changes src/, and it needs a changed test that fails on the base.
    • Rejected: The passing guardrail on main alone. A guardrail that passes proves nothing about the return of the defect.
  • Does the change also repair the code of the defect?: No. The guardrail pins the behaviour, and the fix of fix(roadmap): a new runner image clears only a stop that it can fix #3527 stays as it is, because AGENTS.md stops work that puts a second fix on a fix. (best practice) [sources: AGENTS.md]
    • Chosen: Add the guardrail only. AGENTS.md rule 2 stops a second fix on a fix, and the defect is already fixed.
    • Rejected: Add the guardrail and repair the defect's code again. A second fix on a fix hides which change made the defect go away.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    type/bug
    status/new
    value/medium
    effort/low
    on Nov 4, 2026
  2. devops-cli-service commented on Nov 4, 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. Process compliance gap that prevents regression but is not user-facing.
    • Value: Medium. Prevents recurrent regressions from the specific defect fixed in PR #3527.
    • Effort: Low. Adding guardrail text to one or more existing declared surface files.
    • Related: fix(hardening): defect PR #3521 missing declared surface hardening #3525, which asks for a different change. Both are audit findings for unhardened defect PRs, but each requires guardrails for a different PR's specific defect.
  3. devops-cli-service commented on Nov 6, 2026

    @devops-cli-service
    Contributor

    Refine cannot set this item to Ready at be8d18a. A bot opened the item, so a review of the issue and of the proposal must approve it first. The review found the defects below. A person edits the body to answer them. The next refine round looks at the item again only after a body edit.

    • false_premise at key_questions: Which surfaces does the project declare: The plan says the pr-hardening-audit spec adds more declared surfaces. The issue lists only eight surfaces, and no input text supports the extra ones. Evidence: "The pr-hardening-audit spec adds a test and a living spec."
  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 3527
    • 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 #3527 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