[E00-S01-T11] apps/packages/extensions separated #378

Merged
kpcto merged 1 commits from feature/164 into main 2026-08-28 22:50:39 +00:00
Member

What changed

Locks in the [E00-S01-T11] apps/packages/extensions workspace separation (#164). The three top-level group directories (apps/server, packages/core, extensions/example) were bootstrap-committed in E00-S01-T01 and are already reflected in pnpm-workspace.yaml, dependency-boundaries.json and pnpm-lock.yaml; this PR adds the regression suite that makes both acceptance criteria enforceable rather than incidental:

  • tests/workspace-layout.test.mjs (new) — a node:test suite (zero dependencies, lockfile untouched) that fails if the workspace layout ever drifts:
    • asserts the repo root contains exactly the three top-level package group directories apps/, packages/, extensions/;
    • walks the whole tree and asserts every workspace package.json sits exactly one level below one of the three groups — never at the root (besides the root workspace manifest), never in another directory, never nested deeper;
    • asserts each expected bootstrap package sits in its correct top-level directory (@personal-blog/server → apps/server, @personal-blog/core → packages/core, @personal-blog/example-extension → extensions/example) and that the discovered package set is exactly the expected one;
    • asserts pnpm-workspace.yaml declares exactly apps/*, packages/*, extensions/* and dependency-boundaries.json maps the same three groups to the same three directories (layout ↔ workspace/boundary config parity);
    • asserts every discovered package has a lockfile importer (layout ↔ lockfile parity);
    • includes a non-vacuous placement probe proving the validation actually flags mis-placed paths (lib/shared/, apps/package.json, packages/a/b/, docs/).

Explicitly out of scope per the brief (not touched): strict base tsconfig (E00-S01-T10), root build/test/typecheck commands (E00-S01-T12), frozen lockfile clean install (E00-S01-T13). No CI workflow changes — test-suite wiring in CI is E00-S05 by design (same as T05–T10); the existing CI job (frozen install + pnpm -r list on Node 24) stays green.

Criterion → test table

Acceptance criterion Test (fails without the committed layout)
apps, packages and extensions are separated in the workspace layout tests/workspace-layout.test.mjs: "the workspace root contains exactly the three separated top-level group directories" — asserts apps/, packages/, extensions/ all exist; "every workspace package.json sits exactly one level below its top-level group directory" — walks the tree and rejects any package.json outside <group>/<name>/package.json. Mutation-probed: a package moved to a non-group directory fails this test
each package sits in the correct top-level directory tests/workspace-layout.test.mjs: "each expected package sits in the correct top-level directory" — asserts @personal-blog/server is declared by apps/server/package.json, @personal-blog/core by packages/core/package.json, @personal-blog/example-extension by extensions/example/package.json; "the discovered workspace package set is exactly the expected bootstrap set" — no extra/missing packages anywhere in the tree. Mutation-probed: moving packages/core → apps/core fails both plus the lockfile-parity test
layout ↔ workspace config parity tests/workspace-layout.test.mjs: "pnpm-workspace.yaml declares one group glob per top-level group directory" and "dependency-boundaries.json maps the three groups to the same top-level directories"
layout ↔ lockfile parity tests/workspace-layout.test.mjs: "every discovered workspace package has a lockfile importer (layout ↔ lockfile parity)"
placement validation is non-vacuous tests/workspace-layout.test.mjs: "the placement validation flags mis-placed packages (non-vacuous probe)" — valid placements pass, lib/shared/, apps/package.json, packages/a/b/, docs/ are flagged

Test plan executed

  • Clean-state install from the branch (no node_modules), Node 24 (v24.20.0): pnpm install --frozen-lockfile via corepack → success, using pnpm v11.23.0, lockfile unchanged ✓
  • pnpm -r list --depth -1 (second CI step), Node 24 → lists all four workspace projects, exit 0 ✓
  • node --test tests/workspace-layout.test.mjs → 8/8 pass ✓
  • Full suite node --test "tests/**/*.test.mjs" on Node 24 (v24.20.0) → 36/36 pass (10 architecture-import + 6 workspace-config + 5 node-engine + 3 typescript-pin + 4 strict-tsconfig + 8 workspace-layout), exit 0 ✓
  • Mutation probe: with packages/core temporarily moved to apps/core, three tests fail ("each expected package sits in the correct top-level directory", "the discovered workspace package set is exactly the expected bootstrap set", "every discovered workspace package has a lockfile importer") — restoring the layout returns to 36/36 ✓

Risks / notes

  • The suite pins the exact bootstrap package set and group globs; a deliberate workspace change (new group directory or new package) must update this suite in the same change.
  • Pure layout/regression change; rollback is a revert of the single commit.

Refs #164

## What changed Locks in the [E00-S01-T11] apps/packages/extensions workspace separation (#164). The three top-level group directories (`apps/server`, `packages/core`, `extensions/example`) were bootstrap-committed in E00-S01-T01 and are already reflected in `pnpm-workspace.yaml`, `dependency-boundaries.json` and `pnpm-lock.yaml`; this PR adds the regression suite that makes both acceptance criteria **enforceable** rather than incidental: - **`tests/workspace-layout.test.mjs`** (new) — a `node:test` suite (zero dependencies, lockfile untouched) that fails if the workspace layout ever drifts: - asserts the repo root contains exactly the three top-level package group directories `apps/`, `packages/`, `extensions/`; - walks the whole tree and asserts every workspace `package.json` sits exactly one level below one of the three groups — never at the root (besides the root workspace manifest), never in another directory, never nested deeper; - asserts each expected bootstrap package sits in its correct top-level directory (`@personal-blog/server` → `apps/server`, `@personal-blog/core` → `packages/core`, `@personal-blog/example-extension` → `extensions/example`) and that the discovered package set is exactly the expected one; - asserts `pnpm-workspace.yaml` declares exactly `apps/*`, `packages/*`, `extensions/*` and `dependency-boundaries.json` maps the same three groups to the same three directories (layout ↔ workspace/boundary config parity); - asserts every discovered package has a lockfile importer (layout ↔ lockfile parity); - includes a non-vacuous placement probe proving the validation actually flags mis-placed paths (`lib/shared/`, `apps/package.json`, `packages/a/b/`, `docs/`). Explicitly out of scope per the brief (not touched): strict base tsconfig (E00-S01-T10), root build/test/typecheck commands (E00-S01-T12), frozen lockfile clean install (E00-S01-T13). No CI workflow changes — test-suite wiring in CI is E00-S05 by design (same as T05–T10); the existing CI job (frozen install + `pnpm -r list` on Node 24) stays green. ## Criterion → test table | Acceptance criterion | Test (fails without the committed layout) | | --- | --- | | apps, packages and extensions are separated in the workspace layout | `tests/workspace-layout.test.mjs`: "the workspace root contains exactly the three separated top-level group directories" — asserts `apps/`, `packages/`, `extensions/` all exist; "every workspace package.json sits exactly one level below its top-level group directory" — walks the tree and rejects any `package.json` outside `<group>/<name>/package.json`. Mutation-probed: a package moved to a non-group directory fails this test | | each package sits in the correct top-level directory | `tests/workspace-layout.test.mjs`: "each expected package sits in the correct top-level directory" — asserts `@personal-blog/server` is declared by `apps/server/package.json`, `@personal-blog/core` by `packages/core/package.json`, `@personal-blog/example-extension` by `extensions/example/package.json`; "the discovered workspace package set is exactly the expected bootstrap set" — no extra/missing packages anywhere in the tree. Mutation-probed: moving `packages/core` → `apps/core` fails both plus the lockfile-parity test | | layout ↔ workspace config parity | `tests/workspace-layout.test.mjs`: "pnpm-workspace.yaml declares one group glob per top-level group directory" and "dependency-boundaries.json maps the three groups to the same top-level directories" | | layout ↔ lockfile parity | `tests/workspace-layout.test.mjs`: "every discovered workspace package has a lockfile importer (layout ↔ lockfile parity)" | | placement validation is non-vacuous | `tests/workspace-layout.test.mjs`: "the placement validation flags mis-placed packages (non-vacuous probe)" — valid placements pass, `lib/shared/`, `apps/package.json`, `packages/a/b/`, `docs/` are flagged | ## Test plan executed - Clean-state install from the branch (no `node_modules`), Node 24 (v24.20.0): `pnpm install --frozen-lockfile` via corepack → success, `using pnpm v11.23.0`, lockfile **unchanged** ✓ - `pnpm -r list --depth -1` (second CI step), Node 24 → lists all four workspace projects, exit 0 ✓ - `node --test tests/workspace-layout.test.mjs` → **8/8 pass** ✓ - Full suite `node --test "tests/**/*.test.mjs"` on Node 24 (v24.20.0) → **36/36 pass** (10 architecture-import + 6 workspace-config + 5 node-engine + 3 typescript-pin + 4 strict-tsconfig + 8 workspace-layout), exit 0 ✓ - Mutation probe: with `packages/core` temporarily moved to `apps/core`, three tests fail ("each expected package sits in the correct top-level directory", "the discovered workspace package set is exactly the expected bootstrap set", "every discovered workspace package has a lockfile importer") — restoring the layout returns to 36/36 ✓ ## Risks / notes - The suite pins the exact bootstrap package set and group globs; a deliberate workspace change (new group directory or new package) must update this suite in the same change. - Pure layout/regression change; rollback is a revert of the single commit. Refs #164
bot-implementer added 1 commit 2026-08-28 22:43:13 +00:00
Member
---
role: tester
phase: start
issue: 164
pr: 378
head: feature/164
head_sha: 729a67b79ddeb0ae5d32555b0958aa9620032a85
base: main
objective: "independently probe the PR for #164"
scope_files: []
constraints:
  - "never edit the implementer's tests in the same PR"
acceptance:
  - "apps, packages and extensions are separated in the workspace layout"
  - "each package sits in the correct top-level directory"
plan:
  - "Inspect PR #378 diff (tests/workspace-layout.test.mjs, +190/-0)"
  - "Verify workspace layout at head SHA (tree + package.json names)"
  - "Verify pnpm-workspace.yaml and dependency-boundaries.json parity"
  - "Run the workspace-layout suite locally (zero-dependency, node:test)"
  - "Run independent mutation probes to confirm non-vacuous enforcement"
  - "Confirm CI run for the head SHA is green"
---
```yaml --- role: tester phase: start issue: 164 pr: 378 head: feature/164 head_sha: 729a67b79ddeb0ae5d32555b0958aa9620032a85 base: main objective: "independently probe the PR for #164" scope_files: [] constraints: - "never edit the implementer's tests in the same PR" acceptance: - "apps, packages and extensions are separated in the workspace layout" - "each package sits in the correct top-level directory" plan: - "Inspect PR #378 diff (tests/workspace-layout.test.mjs, +190/-0)" - "Verify workspace layout at head SHA (tree + package.json names)" - "Verify pnpm-workspace.yaml and dependency-boundaries.json parity" - "Run the workspace-layout suite locally (zero-dependency, node:test)" - "Run independent mutation probes to confirm non-vacuous enforcement" - "Confirm CI run for the head SHA is green" --- ```
Member
---
role: tester
phase: end
issue: 164
pr: 378
head: feature/164
head_sha: 729a67b79ddeb0ae5d32555b0958aa9620032a85
verdict: pass

acceptance_check:
  - criterion: "apps, packages and extensions are separated in the workspace layout"
    status: pass
    detail: >-
      Repo tree at head SHA contains exactly the three group dirs (apps/,
      packages/, extensions/). All workspace package.json manifests sit
      exactly one level below a group dir; none at root (besides the
      workspace manifest) and none nested deeper.
  - criterion: "each package sits in the correct top-level directory"
    status: pass
    detail: >-
      apps/server/package.json -> "@personal-blog/server";
      packages/core/package.json -> "@personal-blog/core";
      extensions/example/package.json -> "@personal-blog/example-extension".

evidence:
  layout:
    - "apps/server/package.json  -> @personal-blog/server"
    - "packages/core/package.json -> @personal-blog/core"
    - "extensions/example/package.json -> @personal-blog/example-extension"
    - "no stray package.json anywhere else in the tree"
  workspace_config:
    - "pnpm-workspace.yaml packages: ['apps/*', 'packages/*', 'extensions/*']"
    - "dependency-boundaries.json groups apps/packages/extensions -> apps//packages//extensions/"
  tests_local:
    - "node --test tests/workspace-layout.test.mjs  -> 8/8 pass (Node v22.23.2, zero deps)"
    - "full suite: 32/36 pass; 4 failures are environmental and unrelated to this PR"
    - "  - node-engine test 13: local Node 22 vs required 24.x"
    - "  - strict-tsconfig tests 18/19: tsc absent (no pnpm install in probe env)"
    - "  - typescript-pin test 22: corepack pnpm exec tsc unavailable"
  mutation_probes:
    - "packages/core -> apps/core: 3 tests fail (correct-group, exact-set, lockfile parity)"
    - "stray lib/shared/package.json: 4 tests fail incl. one-level-below-group placement"
    - "=> placement validation is non-vacuous and enforces both acceptance criteria"

ci:
  run: "http://gitea:3000/Fabrika/PersonalBlog/actions/runs/53"
  job: "http://gitea:3000/Fabrika/PersonalBlog/actions/runs/53/jobs/65"
  event: pull_request
  conclusion: success
  steps:
    - "actions/checkout@v4"
    - "Install Node.js 24"
    - "corepack enable (pnpm 11.23.0)"
    - "pnpm install --frozen-lockfile"
    - "pnpm -r list --depth -1"

notes:
  - "PR adds only tests/workspace-layout.test.mjs (+190/-0); layout dirs were bootstrap-committed in E00-S01-T01."
  - "Implementer's tests were not edited."
---
```yaml --- role: tester phase: end issue: 164 pr: 378 head: feature/164 head_sha: 729a67b79ddeb0ae5d32555b0958aa9620032a85 verdict: pass acceptance_check: - criterion: "apps, packages and extensions are separated in the workspace layout" status: pass detail: >- Repo tree at head SHA contains exactly the three group dirs (apps/, packages/, extensions/). All workspace package.json manifests sit exactly one level below a group dir; none at root (besides the workspace manifest) and none nested deeper. - criterion: "each package sits in the correct top-level directory" status: pass detail: >- apps/server/package.json -> "@personal-blog/server"; packages/core/package.json -> "@personal-blog/core"; extensions/example/package.json -> "@personal-blog/example-extension". evidence: layout: - "apps/server/package.json -> @personal-blog/server" - "packages/core/package.json -> @personal-blog/core" - "extensions/example/package.json -> @personal-blog/example-extension" - "no stray package.json anywhere else in the tree" workspace_config: - "pnpm-workspace.yaml packages: ['apps/*', 'packages/*', 'extensions/*']" - "dependency-boundaries.json groups apps/packages/extensions -> apps//packages//extensions/" tests_local: - "node --test tests/workspace-layout.test.mjs -> 8/8 pass (Node v22.23.2, zero deps)" - "full suite: 32/36 pass; 4 failures are environmental and unrelated to this PR" - " - node-engine test 13: local Node 22 vs required 24.x" - " - strict-tsconfig tests 18/19: tsc absent (no pnpm install in probe env)" - " - typescript-pin test 22: corepack pnpm exec tsc unavailable" mutation_probes: - "packages/core -> apps/core: 3 tests fail (correct-group, exact-set, lockfile parity)" - "stray lib/shared/package.json: 4 tests fail incl. one-level-below-group placement" - "=> placement validation is non-vacuous and enforces both acceptance criteria" ci: run: "http://gitea:3000/Fabrika/PersonalBlog/actions/runs/53" job: "http://gitea:3000/Fabrika/PersonalBlog/actions/runs/53/jobs/65" event: pull_request conclusion: success steps: - "actions/checkout@v4" - "Install Node.js 24" - "corepack enable (pnpm 11.23.0)" - "pnpm install --frozen-lockfile" - "pnpm -r list --depth -1" notes: - "PR adds only tests/workspace-layout.test.mjs (+190/-0); layout dirs were bootstrap-committed in E00-S01-T01." - "Implementer's tests were not edited." --- ```
kpcto merged commit 0ad2d4db0b into main 2026-08-28 22:50:39 +00:00
kpcto deleted branch feature/164 2026-08-28 22:50:39 +00:00
Sign in to join this conversation.