Skip to content

fix(hardening): defect PR #3663 missing declared surface hardening #3674

Closed as not planned

Description

@github-actions

Unhardened Defect PR Audit Finding

Defect Pull Request #3663 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 reported defect pull request #3663 as unhardened at merge, because the audit then counted neither a regression test nor a living spec as a declared surface; #3479 corrected the audit. Pull request #3663 did add a regression test and a living spec requirement, but the repository records no real case for it, so a regression in the audit's surface table would go unnoticed. The change records the file list of pull request #3663 as a fixture, pins the audit's verdict in a test, and states the requirement in the pr-hardening-audit living spec.

Acceptance criteria

Requirement: Recorded file list of pull request 3663 reports hardened

The change SHALL record the file list of pull request 3663 in tests/fixtures/github/pull_request_3663_view.json, and the audit SHALL report it as hardened.

Scenario: Audit of the recorded file list

  • WHEN the test audits the file list recorded for pull request 3663
  • THEN the audit reports the pull request as hardened and names tests/ with more than 0 additions

Requirement: Living spec states the case

The change SHALL add the requirement that the audit reports pull request 3663 as hardened to openspec/specs/pr-hardening-audit/spec.md.

Scenario: Living spec check

  • WHEN uv run devops ci docs runs on the change
  • THEN it exits 0 and resolves every devops command in the new text

Requirement: Full gate passes

The change SHALL pass the full gate.

Scenario: Full gate

  • WHEN uv run devops ci runs on the change
  • THEN it exits 0

Existing Tool Considered

No alternatives check has run. pytest (https://pytest.org) is open and maintained, and the existing Tests & Coverage check runs the new test in tests/github/test_defect_classifier.py. pytest lacks the recorded file list of pull request 3663 until the change writes tests/fixtures/github/pull_request_3663_view.json. The change builds no checker: a bespoke checker costs about 40,000 tokens to build, 10,000 tokens a year to keep and fix, and 3 hours of elapsed time.

Key questions

  • Where does the change find the defect that PR fix(ai): a hosted gateway call is priced, not counted local #3663 fixed and its root cause?: In the archived change that fixed it: openspec/changes/archive/2026-11-05-3656-hosted-gateway-priced-local/proposal.md names the defect and the root cause (a hosted gateway group set no api_base, the reply named no backend, and is_local decided from the gateway host instead of the deployment model), and CHANGELOG.md:325 records the fix in 0.62.7. [sources: openspec/changes/archive/2026-11-05-3656-hosted-gateway-priced-local/proposal.md:5, CHANGELOG.md:325]
  • Did PR fix(ai): a hosted gateway call is priced, not counted local #3663 already add a guardrail to a declared hardening surface?: Yes. It added the regression test test_a_gateway_reply_that_names_a_deployment_model_and_no_backend_is_hosted under tests/ and the requirement A gateway reply that names a deployment model and no backend is hosted to the living ai-spend-pricing spec; the finding that it hardened no surface comes from the audit before fix(ci): the hardening audit files no issue for a tested fix #3479 counted tests and living specs. [sources: tests/ai/spend/test_ai_spend_pricing.py:714, openspec/specs/ai-spend-pricing/spec.md:162, openspec/changes/archive/2026-11-05-3479-hardening-audit-counts-tests-and-specs/proposal.md:5]
  • Does the project count a test and a living spec as declared hardening surfaces?: Yes. _HARDENING_SURFACES in src/devops_cli/github/defect_classifier.py lists tests/ and openspec/specs/, and the pr-hardening-audit spec states that an addition under either one makes a defect pull request hardened. [sources: src/devops_cli/github/defect_classifier.py:29, openspec/specs/pr-hardening-audit/spec.md:8]
  • Which declared hardening surface holds the new guardrail?: A recorded-file-list test in tests/github/test_defect_classifier.py and a requirement in openspec/specs/pr-hardening-audit/spec.md, the same pair that pins the real case of pull request 3467. (best practice) [sources: openspec/specs/pr-hardening-audit/spec.md:33, tests/github/test_defect_classifier.py:303, docs/TESTING.md:92]
    • Chosen: Recorded-file-list test under tests/ plus a living spec requirement. Both are declared surfaces, and the project already pins the real case of pull request 3467 with this pair (openspec/specs/pr-hardening-audit/spec.md:33).
    • Rejected: A second regression test of is_local. PR fix(ai): a hosted gateway call is priced, not counted local #3663 already added test_a_gateway_reply_that_names_a_deployment_model_and_no_backend_is_hosted, so a second test duplicates it.
    • Rejected: A line in SECURITY.md or ARCHITECTURE.md. A document line states no check, so a regression in the audit's surface table would still pass.
  • How does the guardrail block a recurrence without a new required check?: The test runs in the existing Tests & Coverage check, which ADR 0004 pins as a required check. (best practice) [sources: docs/adr/0004-ci-is-the-authoritative-gate.md:3]
    • Chosen: Run the test in the existing Tests & Coverage check. ADR 0004 makes Tests & Coverage a required check, and the suite already runs every test.
    • Rejected: Add a new required check. A required check is a repository setting that only a person changes.
  • Where does the new test live and how is it named?: In tests/github/test_defect_classifier.py, beside test_defect_pr_3467_recorded_file_list_is_hardened, named after the recorded case: test_defect_pr_3663_recorded_file_list_is_hardened. (best practice) [sources: tests/github/test_defect_classifier.py:303, docs/TESTING.md:92]
    • Chosen: Beside the 3467 test in the audit's behaviour file. docs/TESTING.md:92 puts a regression test in the file of the behaviour it pins, and the 3467 case is the existing precedent.
    • Rejected: In tests/ai/spend/test_ai_spend_pricing.py. That file pins is_local, and the new case pins the audit's verdict, not pricing.
  • Where does the recorded file list of pull request 3663 come from?: From gh pr view 3663 --json number,title,labels,files,state,mergedAt, recorded as tests/fixtures/github/pull_request_3663_view.json, as the 3467 fixture was. [sources: tests/fixtures/github/pull_request_3467_view.json:2, openspec/changes/archive/2026-11-05-3479-hardening-audit-counts-tests-and-specs/design.md:12]

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 process compliance gap that risks recurrent regressions but does not break current functionality.
    • Value: Medium. Prevents future regressions by codifying root-cause guardrails, but does not change user-facing behaviour.
    • Effort: Low. Requires adding guardrails or lessons to one or more existing documentation surfaces.
    • Related: fix(hardening): defect PR #3649 missing declared surface hardening #3653, which asks for a different change. Both are unhardened defect PR audit findings from the same process, but each targets a different PR and requires its own root-cause guardrails.
  3. devops-cli-service commented on Nov 7, 2026

    @devops-cli-service
    Contributor

    Refine cannot set this item to Ready at 163a5c2. 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 problem_statement: The plan says the audit counts tests and living specs as declared surfaces, but the issue lists neither. The input does not support the claim that the finding predates fix(ci): the hardening audit files no issue for a tested fix #3479. The new test and spec requirement may not satisfy the issue. Evidence: "- docs/TESTING.md - ARCHITECTURE.md - SECURITY.md - CONTRIBUTING.md"
  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 3663
    • 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 #3663 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