Conversation
@tui and @Headless are the runtime entries, @tui/types and @headless/types the type entries; the CLI no longer imports either surface by path. Nothing in @tui renders: the Ink pieces (startTUI, the playground, the family picker) load through loadStartTui, loadPlayground and loadFamilyPicker, and the control server through @Headless's loadControl, so the startup closure still holds no Ink and no server. The run-failure check the TUI runner reads after a run loads with it. Generated-By: PostHog Desktop Task-Id: d14e92bb-6ee1-49b5-8502-39cb80079589
Inside agent, programs, tui and cli, a module imported its own layer through the layer alias (`@agent/progress`, `@programs/program-step`). The compiler enforcement that follows reads other layers only through their emitted declarations, which keep each import's specifier: an own-layer alias there would force consumers to resolve deep aliases, which is exactly what the enforcement forbids. Relative paths resolve inside the declarations themselves. Tests keep their aliases; no behavior change. Generated-By: PostHog Desktop Task-Id: d14e92bb-6ee1-49b5-8502-39cb80079589
Each layer is its own TypeScript project (src/<layer>/tsconfig.layer.json, generated for env, shared, agent, programs, tui, headless, cli and bin) that compiles its own source and sees the other layers only through their built declarations, mapped to their public entries. A forbidden layer fails by any spelling (alias, relative path, dynamic import, type query), a deep import into an allowed layer fails, the TUI gets agent types and no agent values, shared and env cannot reach the agent at all, and ink and react resolve to empty stubs outside the TUI. `pnpm typecheck` builds tsconfig.layers.json and runs scripts/boundary-probes.ts, 25 probes that must fail or compile as declared; CI now runs it. The import scanner, known-violations.json, the architecture Vitest project and the ESLint boundary overrides are deleted. Building the layers found two edges the scanner let through, both fixed here: program-store imported agent and shared source by relative path, and shared's skill error map imported agent types (InstallSkillResult now lives in shared). bin.ts drops the dead NODE_ENV=test mock-server hook, which reached into e2e-tests. Generated-By: PostHog Desktop Task-Id: d14e92bb-6ee1-49b5-8502-39cb80079589
🧙 Wizard CIRun the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands: Test all apps:
Test all apps in a directory:
Test an individual app:
Show more apps
Test against a Context Mill branch:
Add Results will be posted here when complete. |
…rcement Generated-By: PostHog Desktop Task-Id: d14e92bb-6ee1-49b5-8502-39cb80079589
Merge the restacked C2c (611c5bb) into C2d. The conflicts are import blocks: C2d's rule that a layer imports its own modules by relative path applies to the fix's new imports too, including `pi/gateway.ts`. The root `tsconfig.json` keeps only the `.tsbuild` exclude, because the e2e-tests package is gone. Generated-By: PostHog Desktop Task-Id: d14e92bb-6ee1-49b5-8502-39cb80079589
Merge the joined C2c (a944edc) into C2d: - The scanner, its allowlist and the ESLint boundary overrides stay deleted, and so do the deck wrappers B removed. - B's new imports follow C2d's rule that a layer imports its own modules by relative path: the skill preflight in `tools.ts`, `signals` in the Anthropic harness, credentials in detection, `flows` in the learn-deck demo, and the CLI's own modules. Generated-By: PostHog Desktop Task-Id: d14e92bb-6ee1-49b5-8502-39cb80079589
One tsc -b project per layer, UI stubs outside the TUI, 32 boundary probes, and a per-program isolation rule in the arch test. The allowlist is gone: zero violations. Generated-By: PostHog Desktop Task-Id: d14e92bb-6ee1-49b5-8502-39cb80079589
Base automatically changed from
posthog/functional-c2c-control
to
posthog/functional-c2b-headless
September 27, 2026 15:19
gewenyu99
force-pushed
the
posthog/functional-c2d-enforcement
branch
from
September 27, 2026 15:24
90b8d71 to
abcff7b
Compare
gewenyu99
changed the base branch from
posthog/functional-c2b-headless
to
posthog/functional-c2c-control
September 27, 2026 15:26
gewenyu99
added this pull request to stack #1372
September 27, 2026 15:28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Layer boundaries were enforced by an arch test allowlist and ESLint rules, which don't stop a bad import at compile time.
Change
tsc -bproject whosepathsexpose only the entries it may import: env, shared, agent, programs, legacy, headless, tui, cli.pnpm typecheckrunstsc --noEmit, thentsc -b tsconfig.layers.json --force, thenscripts/boundary-probes.ts(32 probes).Checks
Typecheck, lint, unit tests, the arch test and the bundle build pass.
Created with PostHog Desktop