Skip to content

Lock test layout ownership before migration - #3984

Merged
kojiwakayama merged 4 commits into
mainfrom
test/test-layout-ownership
Aug 22, 2026
Merged

kojiwakayama merged 4 commits into
mainfrom
test/test-layout-ownership

Conversation

@kojiwakayama

Copy link
Copy Markdown
Contributor

Summary

  • define canonical leaf-suite ownership and deterministic test discovery
  • classify every executable test as unit, integration, E2E, or one finite migration entry
  • add a shrink-only Git-base ratchet and run the layout gate at the start of CI

Design boundary

  • runtime differences are suite variants, never competing test owners
  • unsupported test-like extensions and executable fixtures/support files fail closed
  • migration exceptions are 51 explicit paths with an owner and removal PR, and may only shrink
  • this first slice does not move tests or alter runner selection

This is PR 1 of a 12-stage, 25-PR migration. Every PR must be green and internally consistent when merged after its declared predecessors. Later slices rely on the ownership contract introduced here, but this PR has no dependency on another unmerged migration PR.

Verification

  • deno task test:layout: 2,338 executable tests; 2,287 canonical; 51 migration entries
  • deno task verify:quick
  • script tests: 151 tests / 517 steps; live tool-search: 12 tests
  • compiled-binary E2E: 65 steps
  • pre-push gate: format, lint, typecheck, and 3,986 unit/CWD tests passed with zero failures
  • full verification reached 4,526 passing tests; three deploy/up fixture assertions fail identically on the unchanged base and are unrelated to this taxonomy-only change
  • independent whole-branch and post-rebase reviews found no issues

Staging

Not applicable: this PR changes repository taxonomy and CI validation only; it has no deployed runtime surface.

Follow-up

PR 2 will add scripts/test/run-suite.ts, route existing selection and sharding through this registry, and prove exact selected-case parity without moving tests.

Related to #3974.

The first taxonomy slice needs a code-enforced inventory before later PRs move files or narrow runner tasks. This adds the canonical leaf-suite registry, a path classifier, and a temporary migration-count ratchet so every current executable test has exactly one owner without changing runner selection.

Constraint: Runtime is represented as one runtime suite with node and bun variants, not separate competing owners.

Constraint: This PR must inventory the existing tree without moving tests or changing runner commands.

Rejected: Per-file migration inventory | too large for the first taxonomy slice and harder to review than prefix counts with ratcheted totals.

Rejected: Grep-based validation | would not exercise the classifier behavior consumed by later PRs.

Confidence: high

Scope-risk: narrow

Directive: Shrink or split TEST_LAYOUT_MIGRATION_ENTRIES as tests move into canonical leaves; do not grow counts without a deliberate taxonomy decision.

Tested: npx --yes --package=deno@2.7.7 --call 'deno test --config=scripts/test.deno.json --no-check --allow-read scripts/test/suites.test.ts scripts/test/test-layout.test.ts scripts/test/run-test-file.test.ts'

Tested: npx --yes --package=deno@2.7.7 --call 'deno task test:layout'

Tested: npx --yes --package=deno@2.7.7 --call 'deno task fmt:check'

Tested: npx --yes --package=deno@2.7.7 --call 'deno task lint'

Tested: npx --yes --package=deno@2.7.7 --call 'deno task typecheck'

Tested: npx --yes --package=deno@2.7.7 --call 'deno task verify:quick'

Not-tested: Full verify/test suites beyond verify:quick; this slice is taxonomy-only.
The first taxonomy slice needs a fail-closed ownership registry that later movement PRs can shrink. This amends the layout gate to treat runtime as variant metadata, emits concrete inventory records, and replaces broad migration prefix counts with explicit temporary violation paths.

Constraint: Task 1 must not move tests or alter runner selection

Constraint: Controller ruling requires finite migration paths carrying owner and removal PR

Rejected: Keep prefix/count migration ownership | it can bless new off-layout tests by increasing a committed count

Rejected: Model tests/unit as canonical unit root | approved contract keeps unit tests colocated in source roots

Confidence: high

Scope-risk: narrow

Directive: Delete migration entries as files move; do not add broad prefixes or per-file canonical manifests

Tested: deno test --config=scripts/test.deno.json --allow-read --allow-write scripts/test/suites.test.ts scripts/test/test-layout.test.ts

Tested: deno task test:layout

Tested: deno check --config=scripts/test.deno.json scripts/test/suites.ts scripts/test/test-layout.ts scripts/test/test-layout-migration.ts scripts/test/suites.test.ts scripts/test/test-layout.test.ts

Tested: deno task fmt:check

Tested: deno task lint

Tested: deno task verify:quick

Not-tested: deno task test:scripts remains blocked by missing npm/esm/cli/commands/mcp/handler.js artifact outside this layout slice
The explicit migration list needs a historical ratchet, not only per-entry metadata. The layout gate now compares current migration paths to a Git-resolved base path set, fails on additions, allows shrinkage, and preserves the initial seed when the base lacks the migration file.

Constraint: Initial Task 1 seed is valid because origin/main has no test-layout migration file

Constraint: CI must pass event base evidence without changing unrelated checkout depth

Rejected: Validate only current explicit entries | adding a matching entry would still bless new off-layout tests

Rejected: Execute historical TypeScript from the base ref | validation should inspect evidence without running old code

Confidence: high

Scope-risk: narrow

Directive: Keep migration paths as explicit executable string literals until the temporary inventory is removed

Tested: deno test --config=scripts/test.deno.json --allow-read --allow-write scripts/test/test-layout.test.ts

Tested: deno test --config=scripts/test.deno.json --allow-read --allow-write scripts/test/suites.test.ts scripts/test/test-layout.test.ts

Tested: deno task test:layout

Tested: deno check --config=scripts/test.deno.json scripts/test/suites.ts scripts/test/test-layout.ts scripts/test/test-layout-migration.ts scripts/test/suites.test.ts scripts/test/test-layout.test.ts

Tested: deno task fmt:check

Tested: deno task lint

Tested: deno task test:scripts

Tested: deno task verify:quick

Not-tested: GitHub merge_group payload live execution
@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@kojiwakayama, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 30 minutes

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: eb272be7-2328-49a6-b0c7-dd7aec1557cd

📥 Commits

Reviewing files that changed from the base of the PR and between 1a3cda1 and ed9bb76.

📒 Files selected for processing (8)
  • .github/workflows/cicd.yml
  • deno.json
  • scripts/test/suites.test.ts
  • scripts/test/suites.ts
  • scripts/test/test-layout-migration.ts
  • scripts/test/test-layout.test.ts
  • scripts/test/test-layout.ts
  • tests/README.md

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

📦 Client bundle boundary

Entrypoint Modules Source size Server leaks
src/index.client.ts 327 1961 KiB ✅ 0

A server module in a client graph aborts hydration in the browser. New leaks fail CI; known leaks are tracked in scripts/lint/client-bundle-baseline.json to burn down.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fea18cea0a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/test/suites.ts Outdated
Comment thread scripts/test/test-layout.ts Outdated
Comment thread .github/workflows/cicd.yml Outdated
Late review exposed three boundary errors: E2E runner ownership conflated Deno journeys with Playwright, the migration ratchet could not represent its terminal empty state, and manual CI fetched a local tracking ref as though it were remote. The ratchet now reads only the exported syntax tree, so comments and templates cannot become baseline evidence.

Constraint: Historical baselines must be inspected without executing repository code

Rejected: Raw string-literal scanning | comments and templates can masquerade as migration paths

Rejected: One Playwright owner for tests/e2e | Deno critical-flow tests share that tree

Confidence: high

Scope-risk: narrow

Reversibility: clean

Directive: Keep future migration inventory shapes syntax-readable by parseMigrationBaselineSource and pin them with parity tests

Tested: Deno 2.7.7 verify:quick; 151 script tests / 484 steps; 12 live tool-search tests; focused adversarial parser tests

Not-tested: Live workflow_dispatch and merge_group event execution
@kojiwakayama
kojiwakayama added this pull request to the merge queue Aug 22, 2026
Merged via the queue into main with commit 8f530af Aug 22, 2026
40 checks passed
@kojiwakayama
kojiwakayama deleted the test/test-layout-ownership branch August 22, 2026 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant