Expand description
Component Compiler (EPIC-040, docs/SYSTEM_DESIGN.md §7).
Deterministic MVP signals:
- explicit intent (
.scc/intent.yamlcomponents withpaths) - package.json workspace members
- docker-compose service build contexts
- top-level directory boundaries
Each component aggregates: responsibilities (routes owned, docstrings INFERRED, intent DECLARED), ownership (store write edges), dependency edges (cross-component calls), and implementation (paths/symbols).
Structs§
- Component
Candidate - Component
Signal - One plugin component signal (§31 ComponentSignalProvider): a
component candidacy claim.
nameis the component name,dirsthe repo-relative directories it owns. Plugin candidates enter with thepluginboundary kind (rank 1, same as packages — never above declared/deployment/cli), merge by name with builtin candidates, and lose every conflict: a plugin may nominate architecture, never rename it.
Constants§
- BOUNDARY_
CLI - BOUNDARY_
CODE_ REGION - BOUNDARY_
DECLARED - Evidence class that created a component candidate (Wave 5, plan §27-30).
The
boundary_kindattribute records it on every compiled component;code-regionis the bare top-level directory fallback and is never authoritative architecture. - BOUNDARY_
DEPLOYMENT - BOUNDARY_
PACKAGE - BOUNDARY_
PLUGIN - Boundary kind for plugin-nominated candidates. Rank 1 (package tier): visible in compilation, never overriding declared/deployment/cli.
- BOUNDARY_
ROOT - LAYER_
CODE_ REGION - LAYER_
COMPONENT - LAYER_
SERVICE - LAYER_
SUBSYSTEM - MERGE_
THRESHOLD - Greedy merge threshold for the first (subsystem) pass.
- RELPREFIX
- SERVICE_
THRESHOLD - Greedy merge threshold for the second (service) pass.
Functions§
- compile_
components - compile_
components_ with_ signals compile_componentsplus plugin component signals. Signals merge by name into the builtin candidate set before clustering; empty names and empty dir lists are skipped (a contributor that cannot name a component abstains).- component_
for_ path - Determine the component for a path: longest matching dir prefix wins.
Returns a
String(candidate names are owned). - component_
role - is_
production_ path - True when no path segment places the path outside production.
- parse_
prov - path_
role - Repository role of a component from its implementation paths, by generic
directory convention (never repository names): test, fixture, benchmark,
example, and docs trees are structure, not production architecture.
A single non-production role when every path shares it,
mixedwhen production and non-production mix,productionotherwise. Deterministic. Repository role of ONE path by generic directory convention (never repository names).Nonemeans no non-production segment matched — the caller maps that toproduction. Shared by component aggregation, skeleton labeling, and atlas scope filtering so all three agree on what “fixture” (etc.) means. - prov_
rank - rel