Skip to content

test(autolinks): drop the case the contract tests already pin - #395

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

Vivswan merged 1 commit into
mainfrom
wt/r2s-autolinks

Conversation

@Vivswan

@Vivswan Vivswan commented Sep 21, 2026

Copy link
Copy Markdown
Owner

Before

$ grep -cE '^\s*test(\.each)?\(' src/sections/autolinks/*.test.ts
autolinks.test.ts:8

After

$ grep -cE '^\s*test(\.each)?\(' src/sections/autolinks/*.test.ts
autolinks.test.ts:7

The typed schema table (test.each<...>) is not matched by that grep; it stays, so the file keeps eight cases.

How

One case leaves src/sections/autolinks/autolinks.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/autolinks 11 pass; bun run typecheck and bun run knip green.
  • bun run test:e2e --sections autolinks 9/9 passed.
  • The full suite runs in this PR's CI.

Line accounting

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

Kept

Two cases slated for deletion stay, each after its census came back green.

  • Duplicate prefixes inside the wrapper are a validate issue under .entries, so the document fails before any API call.
    Mutant: src/sections/autolinks/index.ts drops the identical-prefix guard from the overlapping-prefix rule, so a duplicate also raises an overlap issue.
    Red: only this case (it asserts exactly one issue).
    Green: the validate-hook census (it accepts any number of issues at the later entry's path), the list-section tests, the engine validate tests, and all nine autolinks scenarios.
  • Executing the plan against the derived mock converges: DELETE then POST for the replace, and the re-plan is empty.
    Mutant: src/sections/autolinks/index.ts spreads the live flag after the declared write on the recreate, so a live true flag survives a declared false.
    Red: only this case's final-state assertion (declared false, live true).
    Green: all nine autolinks scenarios (every one declares the flag true) and the list-section tests.

Every other case in the directory is untouched.

Reviewer note
  • Landing order: this PR lands after the test/sections change that adds the canonical read-port case for every section.
  • Codex rounds: 3. Round 1 found the convergence case's flag-precedence assertion unpinned elsewhere; round 2 found the duplicate case's single-issue assertion unpinned elsewhere. Both were restored with mutants above. Round 3 converged.
  • Copilot: deletions only; a comment earns a change only if it names a concrete lost assertion with no other pin.

BEGIN_COMMIT_OVERRIDE
test(autolinks): drop the 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 duplicate-prefix validate case stays: it is the only pin that identical prefixes raise the duplicate issue alone, without an overlapping-prefix issue beside it.
The convergence twin stays: its final-state assertion is the only pin that a declared false flag wins over a live true one on the recreate.
Test-only; no source changes.
END_COMMIT_OVERRIDE

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 duplicate-prefix validate case stays: it is the only pin that identical prefixes raise the duplicate issue alone, without an overlapping-prefix issue beside it.
The convergence twin stays: its final-state assertion is the only pin that a declared false flag wins over a live true one on the recreate.
Test-only; no source changes.
Copilot AI balanced review requested due to automatic review settings September 21, 2026 23:46
@Vivswan Vivswan added the merge-when-green Owner approved: merge once every gate is green label Sep 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

File size check

0 over a hard cap (fails), 31 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
test/scripts/gen-docs.test.ts:588 155 chars warn 150

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

🟢 Approval recommended

The focused test deletion preserves coverage through existing contract and read-port tests.

Review effort: Balanced
Findings: None

What changed in this PR

Removes a redundant autolinks read-port test, relying on the shared contract coverage specified in the landing order.

Changes:

  • Deletes one section-specific read-port shape test.
  • Leaves runtime source code unchanged.
File Description
src/​sections/​autolinks/​autolinks.test.ts Removes the redundant read-port contract case.

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

@Vivswan
Vivswan marked this pull request as ready for review September 22, 2026 00:20
@Vivswan
Vivswan merged commit 5b38e99 into main Sep 22, 2026
34 checks passed
@Vivswan
Vivswan deleted the wt/r2s-autolinks branch September 22, 2026 00:20
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