Skip to content

test(deploy_keys): drop the cases the contract tests and scenarios already pin - #392

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

Vivswan merged 1 commit into
mainfrom
wt/r2s-deploy_keys

Conversation

@Vivswan

@Vivswan Vivswan commented Sep 21, 2026 •

Copy link
Copy Markdown
Owner

Before / After

file cases before cases after
src/sections/deploy_keys/deploy_keys.test.ts 14 13

The count is test( and test.each( lines: two cases leave, and the two-row validation table becomes one plain test.

How

Two deletions are censused by a mutant of the shared source that reddened the deleted case and its named twins in one bun test run, with the source restored afterwards.
One deletion is a shape case whose compile-time pins move to the canonical case in test/sections.

  • two live keys under one title fail loudly, declared or not: GitHub does not enforce title uniqueness.
    Twins: the deploy_keys row of test/sections/duplicate-live.test.ts (two live "ci" titles) and the sibling "the guard runs before the section's live conflicts", which asserts the same refusal and empty mutations.
    Mutant: src/sections/contract/live.ts, the collisions.length > 0 guard in liveByIdentity becomes false; the deleted case, the sibling, and every duplicate-live row red, 65 pass.
  • duplicate declared titles (the first row of the "validation before any read" table).
    It restates the identity wiring every listSection (src/sections/shared/list-section.ts) gets from duplicateIssues in src/sections/contract/module.ts.
    That wiring is pinned by test/sections/list-section.test.ts and eighteen rows of test/sections/validate-hook.test.ts.
    Mutant: module.ts, duplicateIssues never records a second sighting; the deleted row and those generic pins red together, 80 pass.
  • the read port exposes exactly the list role in its denied posture.
    Its one runtime assertion is the port's key list, which test/sections/setup-section.test.ts pins generically and sibling suites pin for their own ports.
    Control: flipping the list's notFound posture in src/sections/deploy_keys/index.ts left this file green (57 pass); tsc and the posture assertion in test/sections/registry.test.ts refuse it.

Proof

  • Unit: bun test src/sections/deploy_keys 54 pass (13 counted cases plus seven typed test.each<...> tables the count regex skips).
    The full bun test is 4225 pass, 0 fail.
  • Gates: bun run check (lint, arch lint, compat, typecheck, build:check) green; bun run knip green.
  • Scenarios: bun run test:e2e --sections deploy_keys 6/6 passed.

Kept

  • duplicate declared MATERIAL under different titles stays as a plain test: it is the section's own conflicts.declared hook.
    The validate-hook row for deploy_keys cannot separate it from the title duplicate because its doubled entry repeats both.
  • The other cases stay.
    They pin the public-key and stored-key parses, the private-key refusal at parse, the live-holder conflict table, the ordering guard, and the loud live extraction.
    They also pin the reconcile shapes with the read_only table, the phantom-key note, the undeclared-policy table, the convergence run, and the mock's material uniqueness.
  • Every @ts-expect-error pin outside the deleted read-port case stays; there were none elsewhere in this file.
Technical details
  • Line accounting: git diff --numstat origin/main...HEAD is 13 added, 52 deleted, in one file.
    The added lines are the material row rewritten as a plain test; the deleted lines are the table scaffold, the two-live-keys case, and the read-port case.
  • Reviewer note: the read-port deletion relies on the canonical negative read-port case in test/sections, which lands in a separate PR before this one merges.
  • Reviewer note: the census mutants are source edits that were never committed; each was reverted with git checkout -- src before the next.
  • Reviewer note: no fixture here is derived from real data; every key is the hand-written one already in the file.

BEGIN_COMMIT_OVERRIDE
test(deploy_keys): drop the cases the contract tests and scenarios already pin
END_COMMIT_OVERRIDE

…ready pin

Two cases and one table row leave the section suite.
The two-live-keys-under-one-title case is a twin of the duplicate-live suite's deploy_keys row and of its sibling ordering case, which fail first under the same source change.

The duplicate-title validate row restates the generic list-section identity wiring that the validate-hook and list-section suites pin; the material row stays as a plain test.
The read-port shape case's one runtime assertion is the port's key list, which test/sections/setup-section.test.ts pins generically; its compile-time pins move to the canonical case in test/sections.
@Vivswan Vivswan added the merge-when-green Owner approved: merge once every gate is green label Sep 21, 2026
Copilot AI balanced review requested due to automatic review settings September 21, 2026 23:24
@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 removed cases are adequately covered by shared contract tests and the remaining section-specific tests.

Review effort: Balanced
Findings: None

What changed in this PR

Removes redundant deploy-key tests now covered by shared contract suites.

Changes:

  • Removes duplicate declaration and live-identity cases.
  • Simplifies the remaining material-conflict test.
  • Removes redundant read-port assertions.
File Description
src/​sections/​deploy_keys/​deploy_keys.test.ts Deduplicates deploy-key tests while retaining section-specific coverage.

💡 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:11
@Vivswan
Vivswan merged commit 7c86120 into main Sep 22, 2026
35 checks passed
@Vivswan
Vivswan deleted the wt/r2s-deploy_keys branch September 22, 2026 00:12
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