The browser viewer's JavaScript, drawn the way you'd read a section through a building — each stratum sits on the one below it and never reaches back down. Derived from the actual call graph, not the folder tree.
A module's stratum is the longest dependency chain beneath it. Stratum 0 modules import nothing from their siblings — they are the bedrock. Nothing in a lower stratum ever calls upward.
Two numbers from the same codebase, measured the same afternoon.
No module pair imports each other. The 5 strata resolve cleanly, so the architecture is sound as drawn.
Elements in one strongly-connected component on Hospital — 78% of the building — inside a dependency graph the engine builds at runtime.
An IDE's component view would show you the left-hand number and give this codebase a clean bill of health. The problem this project is actually chasing lives in data the engine constructs at load time — roughly 2.46 million inferred "supports before" relations on Hospital, about 39 per element — which no static tool can see. Worth knowing before investing in tooling that only reads source.
Thirteen modules, 16,084 lines. This is where 4D lives, and it is the only cluster spanning three strata.
| Module | Stratum | Lines | Depends on | Role |
|---|---|---|---|---|
| schedule_gate.js | 0 | 1,223 | — | Physics gates and the generative pass. Depends on nothing — the true bedrock of 4D. |
| schedule_read_4d.js | 0 | 268 | — | Reads the IFC-native task tables. |
| foreign_schedule.js | 0 | 548 | — | Imports P6 / MS Project. |
| export_5d.js | 0 | 466 | — | Cost export. |
| schedule_diff.js | 0 | 284 | — | Baseline comparison. |
| schedule_author.js | 1 | 1,704 | schedule_gate | Builds schedule elements from the DB. Declares the IFC-native tables the source of truth. |
| cpm_schedule.js | 1 | 651 | schedule_gate | The critical-path solver. Where the 49,436-element cycle forms and gets contracted. |
| schedule_engine.js | 2 | 141 | cpm_schedule, schedule_gate | Zero callers. Built as stage 1 of the current refactor and never wired in. |
| time_machine.js | 2 | 9,244 | 6 modules | The Gantt drawer, the 4D clock, the editing surface. 58% of the subsystem in one file. |
storey | phase into Gantt bars. Each bar's span is the earliest start to the latest end of its members — a hull, not a scheduled activity.Hospital schedules 63,182 elements individually, then draws them as roughly 54 bars. One outlier element stretches its whole bar — the effect the code itself calls "one pile, full project length." The same hulls are what the acceptance metric measures, so a stray element registers as a phase-ordering failure. Three symptoms, one cause: the unit of scheduling is not the unit anyone looks at.
Fan-in — how many of the 128 modules call into each. These are the ones where a change reaches furthest.
| Module | Exports | Callers | Blast radius |
|---|---|---|---|
| loader.js | THREE, OrbitControls | 43 | The 3D datum. A third of the codebase. |
| kernel_ops.js | KernelOps | 14 | Op-log write path — every mutation. |
| universal_history.js | UniversalHistory | 8 | Undo / redo / time travel. |
| section_cut.js | SectionCut | 5 | Clipping planes. |
| schedule_gate.js | ScheduleGate | 4 | All of 4D, plus the audit judges. |
| grid_dims.js | GridDims | 3 | Grid geometry. |
| cpm_schedule.js | CpmSchedule | 2 | The live solver. |
schedule_engine.js — all of it derivable from source, which is how this page was built.task_sequences — an IFC-native table that already exists and holds zero rows on every shipped building. Once dependencies are data, they become reviewable, editable, and diffable. Until then no tool, IDE or otherwise, can inspect them.