Skip to content

fix(hardening): defect PR #3649 missing declared surface hardening #3653

Closed as not planned

Description

@github-actions

Unhardened Defect PR Audit Finding

Defect Pull Request #3649 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 #3649 fixed a defect and merged with no guardrail on a declared hardening surface. The same defect can return without a warning. The change adds the missing root-cause guardrail to a declared surface, so the hardening audit reports the pull request hardened.

Acceptance criteria

Requirement: Guardrail fails on the defect

The change SHALL add a guardrail that fails on the pattern of the defect that pull request #3649 fixed.

Scenario: Fix reverted

Requirement: Guardrail passes on the default branch

The guardrail MUST pass on the default branch with the change applied.

Scenario: Clean tree

  • WHEN The guardrail runs on the default branch with the change applied
  • THEN The guardrail exits 0.

Requirement: Declared surface changes

The pull request that delivers the change MUST change at least one declared hardening surface.

Scenario: Hardening audit

  • WHEN The pr-hardening-audit reads the paths that the pull request changes
  • THEN The report states that the pull request is hardened and names the surface.

Requirement: Guardrail runs in the gate

The guardrail MUST run in a row of devops ci, not only by hand.

Scenario: Gate run

  • WHEN uv run devops ci runs the row that holds the guardrail
  • THEN The row fails when the guardrail fails.

Existing Tool Considered

No alternatives check has run. No new tool is needed, because the project already runs the tools that carry a guardrail. ast-grep (MIT, maintained) carries a source-tree rule in the constructs row of devops ci, and it cannot express a behaviour of the code. Semgrep (LGPL-2.1, maintained) carries a rule of the pack with its ruleid: and ok: tests, and it runs in a review, not in the gate. pytest carries a regression test, and it reaches no construct of the source tree. The pr-hardening-audit workflow reports the surface, and the change writes no new code.

Key questions

  • Which defect did pull request fix(mcp): mark tools that write not read-only and test the schema #3649 fix, and which root cause must the guardrail catch?: Refine reads the squash commit of pull request fix(mcp): mark tools that write not read-only and test the schema #3649 and its archived change folder, and names the defect and its root cause. The guardrail catches that cause. [sources: CHANGELOG.md]
  • Which declared hardening surface holds the guardrail?: A gate check in the form of the defect class: an ast-grep rule in .ast-grep/rules/ for a construct of the source tree, a Semgrep rule in src/devops_cli/review/rules/ for a security pattern, and a pytest regression test in the file of the behaviour for any other defect. (best practice) [sources: AGENTS.md, docs/TESTING.md, openspec/specs/pr-hardening-audit/spec.md]
    • Chosen: A gate check in the form of the defect class. It fails when the defect returns, as rule 11 of AGENTS.md requires, and the audit counts a test as a surface.
    • Rejected: A prose paragraph alone in a document. Prose states the lesson but fails on no defect, so the regression returns unseen.
    • Rejected: A line in a prompt of src/devops_cli/ai/tasks/. A prompt advises a model and fails nothing; it can go with the check, not in its place.
    • Rejected: A suppression in .devops/review.toml. A suppression hides a finding; it is no guardrail against a defect.
  • Does a test or a living spec count as a declared surface for this issue?: Yes. The pr-hardening-audit counts a test and a living spec as a surface, so a guardrail under tests/ satisfies the audit. The list in the issue body adds no limit. (best practice) [sources: openspec/specs/pr-hardening-audit/spec.md, AGENTS.md]
    • Chosen: Follow the surface set of the audit. The audit computes its verdict from the changed paths, and its requirements count a test and a living spec.
    • Rejected: Follow the list in the issue body only. The list holds no test, so a document change would pass it and add no check that fails.
  • How does the change prove that the guardrail catches the defect?: Revert the fix of pull request fix(mcp): mark tools that write not read-only and test the schema #3649 in a worktree and run the guardrail to see it fail. Run the guardrail on the default branch with the change to see it pass. Cite the run as the fail-to-pass evidence when the change touches src/. (best practice) [sources: CONTRIBUTING.md, docs/TESTING.md]
    • Chosen: Revert the fix and run the guardrail. The check shows the defect on the reverted tree and its absence on the fixed tree, as the fail-to-pass rule asks.
    • Rejected: Describe the defect in prose. A description proves nothing about the check, and a later change can remove the check unseen.
    • Rejected: Rely on the review of a person. A review verdict is no repeatable check, and the gate cannot run it.
  • Which document holds the lesson that goes with the check?: The document that owns the guarded surface: docs/TESTING.md for a test convention, SECURITY.md for a security pattern, ARCHITECTURE.md for a structural rule and CONTRIBUTING.md for a process rule. A review rule stays in .devops/review.toml or in the rule pack. (best practice) [sources: AGENTS.md, CONTRIBUTING.md, docs/TESTING.md]
    • Chosen: The document that owns the guarded surface. Rule 8 of AGENTS.md keeps each rule in one document, and the owner already routes a reader to that surface.
    • Rejected: The change folder only. An archived change is a record, and a reader of the document finds no lesson there.

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. A required process invariant was violated, but the impact is on regression prevention rather than a live user-facing defect.
    • Value: Medium. Adding the missing guardrails prevents the same class of regression from recurring in future defect fixes.
    • Effort: Low. The work is to write guardrail text into one or more existing declared surface files.
    • Related: fix(hardening): defect PR #3639 missing declared surface hardening #3643, which asks for a different change. Both are unhardened defect PR audit findings that require adding guardrails to declared surfaces, but each targets a different PR and its unique root cause.
  3. devops-cli-service commented on Nov 6, 2026

    @devops-cli-service
    Contributor

    Refine cannot set this item to Ready at ffaea53. 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[2]: The plan says the audit counts a test as a declared surface. The issue list holds no test path, and files is empty, so nothing supports the claim. The plan thus allows a change that touches no declared surface and fails criterion 3. Evidence: "Yes. The pr-hardening-audit counts a test and a living spec as a surface, so a guardrail under tests/ satisfies the audit."
    • false_premise at key_questions[0]: The plan does not name the defect of PR fix(mcp): mark tools that write not read-only and test the schema #3649 or its root cause. It defers that work to refine and cites only CHANGELOG.md, which is not in files. The guardrail therefore has no defined target, and the claim that no new code is written conflicts with an added rule or test. Evidence: "Refine reads the squash commit of pull request fix(mcp): mark tools that write not read-only and test the schema #3649 and its archived change folder, and names the defect and its root cause."
  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 3649
    • 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 #3649 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