TC-ADR-0010: Use fractal directory ownership

Context

Repeated filename prefixes were moved into responsibility-owned directories, but several non-leaf directories still mix many implementation files with many child directories. In those locations the filesystem no longer communicates a clear ownership tree. A reader must inspect filenames and imports to discover the structure that the directory hierarchy should already express.

PixieCore is intended to remain fractal. The same ownership grammar should be visible at repository, core layer, plugin, subsystem, and implementation-leaf levels.

Decision

Organize source and maintained documentation as a recursively self-similar tree of ownership boundaries.

  1. A non-leaf directory primarily owns child responsibility directories.
  2. A leaf directory owns the implementation files for one cohesive responsibility and normally owns no child responsibility directory.
  3. A non-leaf may retain only structural boundary files whose location is part of the architecture, such as an index.ts entry, one public facade, or a plugin identity manifest and entry file.
  4. When a non-leaf contains three or more non-structural implementation files beside child directories, split those files into responsibility-named child directories before adding more peers.
  5. Do not create one-file wrapper directories merely to satisfy a file-count rule. Every directory must name a stable responsibility, policy boundary, lifecycle, or public entry point.
  6. Avoid generic common, misc, or utils directories. Shared code belongs to the smallest named responsibility that owns its contract.
  7. Tests mirror the responsibility tree of the code they own. Documentation mirrors the conceptual ownership tree rather than accumulating in one flat directory.

The bundled and third-party plugin root is a canonical fractal unit:

plugins/<name>/
├── <name>.ts
├── <name>.yaml
├── src/
└── tests/

The two files identify the boundary; src/ recursively applies this decision to implementation ownership, and tests/ owns that plugin's tests. This required shape is not treated as accidental file-and-directory mixing.

Consequences

Compatibility

The directory policy does not itself change a documented package specifier, runtime export, plugin identity, Recipe lock, Blueprint contract, or error contract. Each physical migration must preserve those surfaces or record a separate compatibility decision.

Evidence