Skip to content

test(teams): drop the case the contract tests already pin - #393

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

Vivswan merged 1 commit into
mainfrom
wt/r2s-teams

Conversation

@Vivswan

@Vivswan Vivswan commented Sep 21, 2026 •

Copy link
Copy Markdown
Owner

Before / After

file cases before cases after
src/sections/teams/teams.test.ts 10 9

How

One shape case leaves; its compile-time pins move to the canonical case in test/sections.

  • the read port exposes the public org probe, the list in its denied posture, and the team probe, never a write.
    Its runtime assertions are the port's key list and the presence of three helpers every other case here calls.
    The key list is pinned for every section by the canonical read-port case in test/sections/contract.test.ts ("the port exposes exactly the declared reads of every section, each narrowed to its posture, and neither a write role nor the raw client").
    Control: flipping the list's notFound posture in src/sections/teams/index.ts left this file green (9 pass); tsc and test/sections/registry.test.ts refuse it.

Proof

  • Unit: bun test src/sections/teams 18 pass across teams.test.ts and mock.test.ts.
    The full bun test is 4227 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 teams 12/12 passed.

Kept

  • Nine cases stay.
    They pin the personal-account no-op, the grant plan with the pull/push vocabulary, the undeclared revoke and its empty re-plan, the bare 204 probe body, and the 404-only org probe tolerance.
    They also pin the case-folded duplicate slug, the convergence run, and the two snapshot cases.
  • src/sections/teams/mock.test.ts is untouched: nothing in it was ruled for deletion.
  • No @ts-expect-error pin outside the deleted case existed in this file, so none was touched.
Technical details
  • Line accounting: git diff --numstat origin/main...HEAD is 0 added, 16 deleted, in one file: the case and its preceding blank line.
  • Reviewer note: the deletion relies on the canonical negative read-port case in test/sections, which landed in test(sections): pin the read port and planned-op contracts once, drop the restatements #382 before this one.
  • Reviewer note: the census control is a source edit that was never committed; it was reverted with git checkout -- src.
  • Reviewer note: no fixture here is derived from real data; every value is the hand-written one already in the file.

BEGIN_COMMIT_OVERRIDE
test(teams): drop the case the contract tests already pin
END_COMMIT_OVERRIDE

The read-port shape case leaves the section suite.
Its runtime assertions are the port's key list and the presence of three helpers, which test/sections/setup-section.test.ts and the registry suite pin generically; its compile-time pins move to the canonical case in test/sections.
Copilot AI balanced review requested due to automatic review settings September 21, 2026 23:30
@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

🟡 Changes recommended

The replacement contract coverage is not present on this branch, leaving the teams read-port shape unpinned.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Removes a teams read-port shape test intended to be covered by shared contract tests.

Changes:

  • Deletes one teams read-port contract case.
  • Reduces teams test cases from 10 to 9.
File Description
src/​sections/​teams/​teams.test.ts Removes the read-port shape test.

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

Comment thread src/sections/teams/teams.test.ts
@Vivswan
Vivswan marked this pull request as ready for review September 22, 2026 00:11
@Vivswan
Vivswan merged commit 101673f into main Sep 22, 2026
35 checks passed
@Vivswan
Vivswan deleted the wt/r2s-teams branch September 22, 2026 00:11
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