Skip to content

test(secret_scanning_custom_patterns): drop the read-port case the contract tests already pin - #398

Merged
Vivswan merged 1 commit into
mainfrom
wt/r2s-secret_scanning_custom_patterns
Sep 22, 2026
Merged

Vivswan merged 1 commit into
mainfrom
wt/r2s-secret_scanning_custom_patterns

Conversation

@Vivswan

@Vivswan Vivswan commented Sep 22, 2026 •

Copy link
Copy Markdown
Owner

Before

$ grep -cE '^\s*test(\.each)?\(' src/sections/secret_scanning_custom_patterns/*.test.ts
compilable-form.test.ts:1
secret_scanning_custom_patterns.test.ts:11

After

$ grep -cE '^\s*test(\.each)?\(' src/sections/secret_scanning_custom_patterns/*.test.ts
compilable-form.test.ts:1
secret_scanning_custom_patterns.test.ts:10

The typed tables (test.each<...>, four in the section file and six in the compilable-form file) are not matched by that grep; all stay, so the section file keeps fourteen cases.

How

One case leaves src/sections/secret_scanning_custom_patterns/secret_scanning_custom_patterns.test.ts.
It was put under a mutant on today's main before it went: the mutant reddens the deleted case and its named pin together, so nothing the case held is lost.

  • The read port exposes exactly the list role in its denied posture.
    The runtime assertion restates the endpoint table; the port's derivation is pinned once for every section by the canonical read-port case in test/sections/contract.test.ts.
    Mutant: src/sections/contract/plan.ts binds every route into the port regardless of method.
    Red: this case and the branches read-port case that stays.

No source changes.

Proof

  • bun test src/sections/secret_scanning_custom_patterns on the merge result with main: 161 pass; bun run typecheck green.
  • The full suite runs in this PR's CI.

Line accounting

Test-only: 0 additions, 13 deletions in one file.

Kept

  • Executing the plan against the mock fragment converges: the re-plan is empty.
    Slated as a twin of the secret-scanning-custom-patterns-apply-converges scenario, which asserts the write order and the fixpoint, never the stored delimiter.
    Mutant: index.ts skips start_delimiter in the update filter, so a declared delimiter drift is never PATCHed.
    Red: only this case (the stored "\\b" is lost).
    Green: every other case in the section directory.
  • A live pattern with %s reads back verbatim (four rows).
    Slated as pinned by the secret-scanning-patterns-snapshot-hyperscan-forms scenario, which asserts required substrings, never an empty detail.
    Mutant: index.ts appends a snapshot note for every string pattern a plain RegExp refuses (every translated form).
    Red: only the three PCRE rows (detail: [] gains the note).
    Green: the plain control row and every other case in the section directory.
  • Two entries with the same name are a validate issue, so the document fails before any API call.
    Slated as a duplicate-entry case the validate-hook census covers; kept after its census came back green.
    Mutant: index.ts names the resource pattern instead of custom pattern in the duplicate issue.
    Red: only this case's message assertion.
    Green: the validate-hook census, the list-section and engine validate tests, and all eleven scenarios.
  • Every other plan case stays: the full-shape case, the plans-nothing and plans-one-PATCH tables, the plural describe case, the rename case, the resolve_alerts DELETE case, the contract-violation table, and the empty-delimiter refusal.
  • Every other snapshot case stays: the left-out-note case, the BUG table, and the all-left-out case; and all of compilable-form.test.ts.
Reviewer note
  • Landing order: this PR lands after the test/sections change that adds the canonical read-port case for every section.
  • Copilot: the duplicate-noun comment named a concrete lost assertion; its mutant reddened only the deleted case, so the case is kept above.

BEGIN_COMMIT_OVERRIDE
test(secret_scanning_custom_patterns): drop the read-port case the contract tests already pin

The read-port shape case restates the endpoint table at runtime; the canonical read-port case in the contract tests pins the port's derivation for every section.
The convergence case stays: a mutant that skips start_delimiter in the update filter reddens only it, so the stored delimiter has no other pin.
The verbatim snapshot table stays: a mutant that appends a note for every translated pattern reddens only its three PCRE rows, so the empty detail has no other pin.
The duplicate-name validate case stays: its message assertion is the only pin of the section's resource name in the duplicate issue.
Test-only; no source changes.
END_COMMIT_OVERRIDE

Copilot AI balanced review requested due to automatic review settings September 22, 2026 00:03
@Vivswan Vivswan added the merge-when-green Owner approved: merge once every gate is green label Sep 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

File size check

0 over a hard cap (fails), 30 warning(s).

File Size Tier Cap
.github/scripts/release-pipeline.ts:6 156 chars warn 150
.github/scripts/release-pipeline.ts:468 151 chars warn 150
.github/scripts/release-pipeline.ts:1417 153 chars warn 150
.github/scripts/release-pipeline.ts:1 30 comment lines (header) warn 25
.github/scripts/release-pipeline.ts:464 14 comment lines warn 10
.github/workflows/post-green.yml:27 153 chars warn 150
.github/workflows/post-green.yml:140 16 comment lines warn 10
docs/upgrading/v2-to-v3.md 1257 lines warn 1040
src/engine/layers.ts:217 157 chars warn 150
src/flows/settings-write.ts:142 159 chars warn 150
src/flows/settings-write.ts:30 11 comment lines warn 10
src/flows/snapshot.ts:189 13 comment lines warn 10
src/github/secret-scan.ts:42 11 comment lines warn 10
src/schema.ts:186 153 chars warn 150
src/schema.ts:197 176 chars warn 150
src/sections/contract/errors.ts:14 14 comment lines warn 10
src/sections/contract/module.ts:963 185 chars warn 150
src/sections/contract/module.ts:627 12 comment lines warn 10
src/sections/contract/module.ts:897 12 comment lines warn 10
src/sections/secret_scanning_custom_patterns/compilable-form.ts:382 161 chars warn 150
src/sections/shared/roles.ts:43 13 comment lines warn 10
src/types.ts:16 156 chars warn 150
test/docs/guides.test.ts:451 155 chars warn 150
test/e2e/generators.ts 2639 lines warn 2560
test/e2e/generators.ts:1709 166 chars warn 150
test/e2e/generators.ts:1863 161 chars warn 150
test/e2e/generators.ts:1672 12 comment lines warn 10
test/engine/execute.test.ts:617 152 chars warn 150
test/flows/merge-parity.test.ts:63 164 chars warn 150
test/scripts/auto-fix-allowlist.test.ts:8 12 comment lines warn 10

Split the file, wrap the line, shorten or exempt the comment, or list the path in .file-size-allow.local with a # reason.

5 managed file(s) skipped; repo-platform owns them.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The deleted validation test was the only assertion of the section-specific duplicate-error wording.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Removes section-level tests considered redundant with contract and end-to-end coverage.

Changes:

  • Deletes four duplicate test cases.
  • Removes unused test helpers and mock imports.
File Description
src/​sections/​secret_scanning_custom_patterns/​secret_scanning_custom_patterns.test.ts Reduces overlapping validation, planning, port, and snapshot tests.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI review requested due to automatic review settings September 22, 2026 00:11
@Vivswan
Vivswan force-pushed the wt/r2s-secret_scanning_custom_patterns branch from 823288d to 82d073d Compare September 22, 2026 00:11

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The removed coverage is demonstrably preserved by existing contract tests and end-to-end scenarios.

Review effort: Balanced
Findings: None

Resolved since last review (1)

…ntract tests already pin

The read-port shape case restates the endpoint table at runtime; the canonical read-port case in the contract tests pins the port's derivation for every section.
The convergence case stays: a mutant that skips start_delimiter in the update filter reddens only it, so the stored delimiter has no other pin.
The verbatim snapshot table stays: a mutant that appends a note for every translated pattern reddens only its three PCRE rows, so the empty detail has no other pin.
The duplicate-name validate case stays: its message assertion is the only pin of the section's resource name in the duplicate issue.
Test-only; no source changes.
@Vivswan Vivswan changed the title test(secret_scanning_custom_patterns): drop the cases the contract tests and scenarios already pin test(secret_scanning_custom_patterns): drop the read-port case the contract tests already pin Sep 22, 2026
Copilot AI review requested due to automatic review settings September 22, 2026 00:55
@Vivswan
Vivswan force-pushed the wt/r2s-secret_scanning_custom_patterns branch from 82d073d to aff917f Compare September 22, 2026 00:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The deleted assertions are covered by the canonical cross-section contract test.

Review effort: Balanced
Findings: None

@Vivswan
Vivswan marked this pull request as ready for review September 22, 2026 01:05
@Vivswan
Vivswan merged commit c19d37e into main Sep 22, 2026
32 checks passed
@Vivswan
Vivswan deleted the wt/r2s-secret_scanning_custom_patterns branch September 22, 2026 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-when-green Owner approved: merge once every gate is green

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants