Skip to content

feat(hygiene): continuum-core declares a layer order, and imports up it can only fall - #4964

Closed
joelteply wants to merge 1 commit into
canaryfrom
ca5d2bd9/continuum-core-layering-imports-point-do
Closed

joelteply wants to merge 1 commit into
canaryfrom
ca5d2bd9/continuum-core-layering-imports-point-do

Conversation

@joelteply

@joelteply joelteply commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Card ca5d2bd9 (first PR). This PR is a gate only and changes no runtime code.

Why

Joel, 2026-10-11: "The architecture is why it's so slow to build … It's always refine and consolidate into better and more diverse centralized abstractions."

Measured (canary c19533f, 2026-10-11)

Edge References
cognition → persona 242
persona → modules 78
cognition → modules 48
runtime → routing 33
inference → cognition 28
genome → forge 24
persona → airc 23
persona → ipc 20

Change

New rule source-hygiene/src/layering.rs.

  • LAYERS holds the order in one place: primitives < substrate < inference < cognition < persona/genome/live < surfaces.
  • Every crate::<module> reference up the order is counted, test mods included, since they weld crates too.
  • Baseline 722; it may only fall. The failure message names the largest edges.

The plan on the card:

  1. Untangle edge by edge. The shared type or trait moves DOWN (dependency inversion), callers migrate, and the old path is deleted. Never a re-export.
  2. A layer at zero up-references leaves as its own crate, with the build time measured before and after.

The order is open for review. Cognition below persona is the least certain call: 242 references may mean shared types live in persona that belong lower, or that the two belong in one layer.

Tests

  • cargo test -p source-hygiene: 30 passed, 0 warnings.
  • only_references_up_the_order_count covers four exclusions: a sibling in the same layer, a downward import, a comment, and an identifier ending in crate.
  • Mutation: at baseline 721 the rule reads 722 and fails.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

…it can only fall

Joel, 2026-10-11: the architecture is why it's so slow to build; refine and consolidate into
better centralized abstractions instead of patching. Measured on canary c19533f: continuum-core
is ~670k lines in one crate, PR core tests ran 19.9 min and canary core-binaries 87-94 min per
push, and splitting it was impossible: 81 module pairs import each other and 722 crate::
references point up the order primitives < substrate < inference < cognition <
persona/genome/live < surfaces (cognition->persona 242, persona->modules 78, cognition->modules 48,
runtime->routing 33, inference->cognition 28).

The layering rule holds that order in one place (LAYERS) and counts every reference up it, test
mods included since they weld crates too. Baseline 722; it may only fall, and a layer at zero
leaves as its own crate. The failure message lists the largest edges so the next untangling is
named. Proven: at baseline 721 it reads 722 and fails.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
@joelteply

Copy link
Copy Markdown
Contributor Author

Closing per Codex's review (28347f40), which I accept. #4963 counts literal cuts, so a budget-sized cut passes it; it cannot enforce whole-or-handle, and lowering its baseline by swapping 1,500 for a budget would not be a fix. #4964 orders today's directory names, which writes the tangle into a rule: same-layer cycles pass, grouped and aliased imports are missed, and zero up-references does not prove a crate can be extracted. Joel asked for architectural compression, not more rules around unchanged code. The work moves to real boundaries: card 49318958 (the CLI compiles core) and, for 735a3183, a domain source that owns complete units with one budgeted projection that adapters consume.

@joelteply joelteply closed this Oct 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant