Repository navigation
Description
Unhardened Defect PR Audit Finding
Defect Pull Request #3676 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
PR #3676 fixed issue #2662: redact_text and mask_uri_credentials left the user name of a URL as written when the URL had no password, so a token used as the user name reached error output. The defect pull request did add regression tests, and its change records the rule in openspec/specs/secret-masking/spec.md; since #3684 made tests/ and openspec/specs/ declared hardening surfaces, the audit now counts #3676 as hardened. The gap that remains is the lesson: no owning document tells the next author the rule. This change adds that sentence to SECURITY.md item 1 and names the two tests that fail when the defect returns.
Acceptance criteria
Requirement: Security document states the URL user-name rule
SECURITY.md item 1 (Zero Secret Leakage) MUST state that the user name of a URL is masked when the URL has no password.
Scenario: The rule is searched in the security document
- WHEN A check runs
grep -n 'user name of a URL' SECURITY.md. - THEN The match lies in item 1 and the sentence says that the user name is masked when the URL has no password.
Requirement: The lesson names the merged checks
The sentence in SECURITY.md MUST name the two regression tests that fail when the masker leaves a URL user name as written.
Scenario: The check names are searched
- WHEN A check searches
SECURITY.mdfortest_redact_text_masks_a_url_user_with_no_passwordand fortest_a_url_user_with_no_password_is_masked_and_the_rest_stays. - THEN Both names are found in the sentence of item 1.
Requirement: The named checks pass
The two tests that the lesson names SHALL pass on the head.
Scenario: The named tests run
- WHEN
uv run devops ci test tests/security/test_secret_redaction.py tests/security/test_redaction_properties.pyruns. - THEN The command exits 0 and both named tests pass.
Requirement: The documentation checks pass
The documentation checks SHALL pass after the edit to SECURITY.md.
Scenario: The documentation checks run
- WHEN
uv run devops docs checkruns on the head. - THEN The command exits 0.
Requirement: The changed file is a declared surface
The changed file SECURITY.md MUST lie under a declared hardening surface.
Scenario: The changed path is matched
- WHEN A test passes
SECURITY.mdtomatch_hardening_surface. - THEN The function returns
SECURITY.md.
Requirement: No spec delta for a documentation change
The change MUST set skip_specs: true and MUST carry no spec delta, because it alters no behavior that a consumer observes.
Scenario: The change folder is validated
- WHEN
openspec validate --strictruns on the change folder. - THEN The validation passes,
.openspec.yamlholdsskip_specs: true, and the folder holds nospecs/delta.
Existing Tool Considered
None. No open, maintained tool writes a project security rule into the project's own document, and the rule is project-specific: AGENTS.md sends the subject of secrets to SECURITY.md. The change is one sentence in an existing Markdown file and builds no code, so it needs no library and replaces no tool. Cost: about 1,500 tokens to write, about 300 tokens per quarter to keep, and about 15 minutes of elapsed time. The guardrail it names is kept by the existing tests/, so no internal code is deleted.
Key questions
- Which defect did PR fix(security): mask the user name of a URL with no password #3676 fix, and what is its root cause?: PR fix(security): mask the user name of a URL with no password #3676 fixed issue fix(security): redact_text leaves the user name of a URL with no password, so a token used as the user name shows in text #2662:
redact_textandmask_uri_credentialsleft the user name of a URL as written when the URL had no password. The root cause was the guard on the userinfo:_mask_url_candidatemasked it only whenparts.password is not None, andmask_uri_credentialsonly whenu.passwordwas set, sohttp://<token>@example.com:11434/api/embedcame back unchanged. The fix added the branch for a user name with no password, which shows<masked-user>inredact_textand***inmask_uri_credentials. [sources: CHANGELOG.md:316, openspec/changes/archive/2026-11-05-2662-mask-url-user-name-without-password/proposal.md:7, src/devops_cli/security/sanitizer.py:90, src/devops_cli/security/sanitizer.py:97, src/devops_cli/security/sanitizer.py:512] - Does PR fix(security): mask the user name of a URL with no password #3676 already add guardrails under a declared hardening surface?: Yes. It added
test_redact_text_masks_a_url_user_with_no_passwordand the propertytest_a_url_user_with_no_password_is_masked_and_the_rest_stays, and its archived change records the rule inopenspec/specs/secret-masking/spec.md. fix(ci): count tests and specs as hardening guardrails #3684 addedtests/andopenspec/specs/to the surface table, so a replay of the audit now counts PR fix(security): mask the user name of a URL with no password #3676 as hardened. The issue's premise that it hardened no surface is out of date. [sources: tests/security/test_secret_redaction.py:176, tests/security/test_redaction_properties.py:66, openspec/specs/secret-masking/spec.md:110, src/devops_cli/github/defect_classifier.py:38, CHANGELOG.md:315] - Which declared hardening surface holds the lesson of PR fix(security): mask the user name of a URL with no password #3676?:
SECURITY.mditem 1 (Zero Secret Leakage). One sentence states that the user name of a URL is masked even when the URL has no password, because a parser cannot tell a token from a harmless name, and it names the two merged tests. The sentence points at the checks; it does not replace them. (best practice) [sources: AGENTS.md:33, SECURITY.md:17, docs/SELF_IMPROVEMENT.md:165, src/devops_cli/github/defect_classifier.py:32]- Chosen: A sentence in SECURITY.md item 1.
AGENTS.mdsends the subject of secrets toSECURITY.md, item 1 already owns Zero Secret Leakage, andSECURITY.mdis a declared surface, so the change also hardens its own pull request. - Rejected: A new test that pins the defect. The tests that pin the defect already exist and pass; a second test would pin the same behavior twice, and
docs/TESTING.mdputs a regression test in the file of the behaviour it pins, not in a hardening pass. - Rejected: A bullet in ARCHITECTURE.md.
ARCHITECTURE.mdowns code architecture, andAGENTS.mdroutes secret handling toSECURITY.md. docs(architecture): add the guardrail of #2504 to a declared hardening surface #2660 usedARCHITECTURE.mdfor a model rule, which is a different subject. - Rejected: A line in docs/TESTING.md.
docs/TESTING.mdowns test conventions, not the masking rule; it already says that a regression test joins the file of the behaviour it pins. - Rejected: An entry in src/devops_cli/ai/knowledge_base/. The knowledge base teaches a subsystem to a model; it is not the security guarantee that a person reads, and the rule is one sentence in the owning document.
- Chosen: A sentence in SECURITY.md item 1.
- Which paths count as 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/,tests/andopenspec/specs/. [sources: src/devops_cli/github/defect_classifier.py:29, src/devops_cli/github/defect_classifier.py:112] - What does the hardening audit read to decide that a pull request is hardened?: The files of the pull request and their addition counts.
audit_pr_hardeningmatches each path withmatch_hardening_surface, sums the additions of each path that lies under a surface, and reports the pull request as hardened when any surface count is above zero. The workflow writes the report in the job summary and files no issue. [sources: src/devops_cli/github/defect_classifier.py:139, src/devops_cli/github/defect_classifier.py:149, src/devops_cli/github/defect_classifier.py:167] - Does the audit block the merge of a defect pull request that hardens no surface?: No. The workflow runs after the pull request closes, writes the report to the job summary, passes no
--fail-on-missing, files no issue and holds noissues: writepermission. A required check is a repository setting, and only a person sets it. [sources: .github/workflows/defect-pr-hardening-audit.yml:4, .github/workflows/defect-pr-hardening-audit.yml:50, openspec/specs/pr-hardening-audit/spec.md:47, AGENTS.md:23] - Does the change carry a spec delta?: No. The change adds one sentence to a document and alters no behavior that a consumer observes, so it sets
skip_specs: trueand carries no delta; ADR 0010 reserves a delta for a change to a command, option, message, manifest or service behavior, and the rule is already recorded inopenspec/specs/secret-masking/spec.md. (best practice) [sources: docs/adr/0010-openspec-is-the-spec-and-change-proposal-layer.md:81, openspec/specs/secret-masking/spec.md:110]- Chosen: No spec delta, skip_specs: true. ADR 0010 names documentation as a change that alters nothing a consumer observes, and the rule is already recorded in
openspec/specs/secret-masking/spec.md. - Rejected: A delta on secret-masking. The behavior and its requirement are unchanged; a delta would restate a requirement that the living spec already holds and would make the change look like a behavior change.
- Chosen: No spec delta, skip_specs: true. ADR 0010 names documentation as a change that alters nothing a consumer observes, and the rule is already recorded in
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Alternatives check of 2026-11-08: none.
Tool: none found.
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 required process step was skipped, but no user-facing defect is active.It closes a compliance gap and prevents a known regression class from recurring.The work is to add guardrails to one or more declared surfaces for a single PR.Both are hardening audit findings for a specific defect PR, but the candidate covers PR #3676 while item 3674 covers PR #3663.devops-cli-service commentedon Nov 7, 2026
Status set to Ready at 9ca54d1 (see proposed design in issue body).
devops-cli-service commentedon Nov 8, 2026
Alternatives check: none
Reason: The searches turned up only general documentation and PR-review guidance (MDN pages) and nothing that writes a project-specific security rule plus the names of two repository tests into the project's own SECURITY.md. The remaining need is a single sentence in a declared surface owned by AGENTS.md, with the regression tests already present under tests/, so no open, maintained tool or library covers it.
Tool: none found
Lacks:
Searches run:
Sources:
Checked on 2026-11-08. A person decides what this means for the item. The check changes no label and closes no issue.
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 3676is_hardened: true. The hardened surfaces aretests/andopenspec/specs/.#3684 (merged 2026-11-05) counts tests and specs as hardening guardrails. Thus PR #3676 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.