Repository navigation
Description
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.mdARCHITECTURE.mdSECURITY.mdCONTRIBUTING.mdsrc/devops_cli/ai/tasks/*.mdsrc/devops_cli/ai/knowledge_base/.devops/review.tomlsrc/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 docsruns on the change - THEN it exits 0 and resolves every
devopscommand in the new text
Requirement: Full gate passes
The change SHALL pass the full gate.
Scenario: Full gate
- WHEN
uv run devops ciruns 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.mdnames the defect and the root cause (a hosted gateway group set noapi_base, the reply named no backend, andis_localdecided from the gateway host instead of the deployment model), andCHANGELOG.md:325records 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_hostedundertests/and the requirementA gateway reply that names a deployment model and no backend is hostedto the livingai-spend-pricingspec; 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_SURFACESinsrc/devops_cli/github/defect_classifier.pyliststests/andopenspec/specs/, and thepr-hardening-auditspec 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.pyand a requirement inopenspec/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 addedtest_a_gateway_reply_that_names_a_deployment_model_and_no_backend_is_hosted, so a second test duplicates it. - Rejected: A line in
SECURITY.mdorARCHITECTURE.md. A document line states no check, so a regression in the audit's surface table would still pass.
- Chosen: Recorded-file-list test under
- How does the guardrail block a recurrence without a new required check?: The test runs in the existing
Tests & Coveragecheck, 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 & Coveragea 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.
- Chosen: Run the test in the existing Tests & Coverage check. ADR 0004 makes
- Where does the new test live and how is it named?: In
tests/github/test_defect_classifier.py, besidetest_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 pinsis_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 astests/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
devops-cli-service commentedon Nov 5, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
fixprefix of the title gives the type.hardening, and .github/labels.yml declares no scope/hardening label. Add the label to the file to give the scope to this item.A process compliance gap that risks recurrent regressions but does not break current functionality.Prevents future regressions by codifying root-cause guardrails, but does not change user-facing behaviour.Requires adding guardrails or lessons to one or more existing documentation surfaces.Both are unhardened defect PR audit findings from the same process, but each targets a different PR and requires its own root-cause guardrails.devops-cli-service commentedon Nov 7, 2026
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_premiseat 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"dan-petty commentedon Nov 11, 2026
Closed as not planned. The check that filed this item passes now.
uv run devops pr hardening-report --pr 3663is_hardened: true. The hardened surfaces aretests/andopenspec/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.