Skip to content

fix(hardening): defect PR #3534 missing declared surface hardening #3538

Closed as not planned

Description

@github-actions

Unhardened Defect PR Audit Finding

Defect Pull Request #3534 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

The hardening audit reports an unhardened defect pull request in the job summary only. Pull request 3534 merged with no change to a declared hardening surface, so nothing pins its root cause. This change makes the audit fail inside a check that the merge already requires. It also adds the guardrail for pull request 3534 to a declared surface.

Acceptance criteria

Requirement: A defect pull request without hardening fails the audit

The hardening audit SHALL exit with a failure status when a defect pull request changes no declared hardening surface.

Scenario: A fix pull request changes no hardening surface

  • WHEN The audit reads a pull request whose title type is fix and whose changed paths hold no declared hardening surface.
  • THEN The audit exits 1, and its report names the pull request and every declared surface that the pull request does not change.

Requirement: The audit blocks the merge through a required check

The hardening audit MUST run inside the job Static Analysis, which the main ruleset already requires, so a failed audit blocks the merge.

Scenario: The required job runs the audit

  • WHEN A test reads the workflow that holds the job Static Analysis.
  • THEN The workflow runs the hardening audit, and no new check name joins the required checks of the main ruleset.

Requirement: The guardrail for pull request 3534 names its root cause

The change SHALL add a guardrail to a declared hardening surface that names pull request 3534 and the root cause that it pins.

Scenario: The audit reports this pull request as hardened

  • WHEN The audit reads the changed paths of the pull request that closes issue 3538.
  • THEN The audit reports the pull request as hardened, and the added text of the surface holds #3534.

Requirement: A pull request that is no defect passes

The audit MUST pass a pull request that is not a fix, or whose changed paths hold no file under src/ outside src/devops_cli/ai/knowledge_base/.

Scenario: A documentation pull request passes the audit

  • WHEN The audit reads a pull request whose title type is docs.
  • THEN The audit exits 0, and its report states not-applicable.

Requirement: The audit writes no issue

The hardening audit MUST keep its report in the job summary and hold no permission to write an issue.

Scenario: A failed audit opens no issue

  • WHEN The audit reads an unhardened defect pull request.
  • THEN The job summary holds the report, the workflow declares no issues: write permission, and the workflow opens no issue.

Existing Tool Considered

No alternatives check has run. No open, maintained tool covers the need: the check reads this repository's declared hardening surfaces and its pull request titles, and no outside tool knows them. The project extends its own hardening audit, which the spec pr-hardening-audit already describes. Cost to build and keep instead of adopting a tool: about 25,000 tokens to build, 8,000 tokens to keep and fix, and 2 days elapsed.

Key questions

  • How does the hardening audit block a merge?: The audit runs inside the job Static Analysis, which the main ruleset already requires. A failed audit then blocks the merge with no change to the ruleset. (best practice) [sources: docs/adr/0004-ci-is-the-authoritative-gate.md, AGENTS.md, .github/workflows/ci.yml]
    • Chosen: Run the audit inside the required job Static Analysis. ADR 0004 pins that job name as a required check, so no repository setting changes.
    • Rejected: Add the audit workflow name to the main ruleset. Only a person changes repository settings, and a missing entry leaves the gate open.
    • Rejected: Keep the report in the job summary only. That is the defect: pull request 3534 merged with no hardening.
  • Which kind of guardrail pins the root cause of a defect?: A test that fails on the base commit pins the root cause, and the spec delta of the change folder records it. A root cause that no test can express gets a line in docs/TESTING.md with the command that shows the problem. (best practice) [sources: AGENTS.md, docs/TESTING.md, docs/adr/0005-review-findings-come-from-tools-not-models.md]
    • Chosen: A test that fails on the base commit. AGENTS.md rule 11 and docs/TESTING.md make a failing test the guardrail that fails when the problem returns.
    • Rejected: A line in a document only. No check fails when the defect returns.
    • Rejected: A rule in src/devops_cli/review/rules/. A rule fits a scanner pattern, not every root cause, and a person must merge each rule.
    • Rejected: An entry in src/devops_cli/ai/tasks/*.md or the knowledge base. ADR 0005 makes model text explain a defect, and no test fails on that text.
  • Does the hardening audit count a test and a living spec as declared hardening surfaces?: Yes. The spec pr-hardening-audit counts a test and a living spec as hardening surfaces. [sources: openspec/specs/pr-hardening-audit/spec.md]
  • Which pull requests does the audit judge?: The audit judges a pull request whose title type is fix and that changes src/ outside src/devops_cli/ai/knowledge_base/, the set of the fail-to-pass check. Every other pull request passes as not-applicable. (best practice) [sources: CONTRIBUTING.md, docs/TESTING.md]
    • Chosen: The set of the fail-to-pass check: a fix that changes src/. CONTRIBUTING.md gives that set for a fix, and a fix without a test or a code change needs no guardrail.
    • Rejected: Every pull request. It blocks a document, a chore and a dependency update that fixes no defect.
    • Rejected: A fix of any changed path. A fix of a test or a document pins no product root cause, and the gate fails a correct change.
  • Does the audit open an issue when it fails?: No. The job summary holds the report, and the check fails on the pull request. The workflow holds no issues: write permission. (best practice) [sources: openspec/specs/pr-hardening-audit/spec.md, SECURITY.md]
    • Chosen: Report in the job summary and fail the check. The author fixes the pull request in place, and the workflow keeps least privilege.
    • Rejected: File an issue for each unhardened pull request. It needs issues: write, and the spec says the workflow files no issue.

Open questions

  • Which defect did pull request 3534 fix, and which root cause does its guardrail pin? (missing verified source)

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. Project invariant violation that prevents future regressions but is not user-facing.
    • Value: Medium. Prevents recurrence of a specific defect class without changing user-facing behavior.
    • Effort: Low. Adding guardrail text to one or more existing documentation files.
    • Related: fix(hardening): defect PR #3513 missing declared surface hardening #3516, which asks for a different change. Both are hardening audit findings for unhardened defect PRs, but each addresses a different PR and its specific root cause.
  3. devops-cli-service commented on Nov 6, 2026

    @devops-cli-service
    Contributor

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

    • Which defect did pull request 3534 fix, and which root cause does its guardrail pin? (missing verified source)
  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 3534
    • 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 #3534 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