This commit is contained in:
Nilton Constantino
2026-02-02 15:43:13 +00:00
parent 6732111328
commit ad1650592d
7 changed files with 51 additions and 55 deletions
-44
View File
@@ -1,47 +1,3 @@
## PR-13 — Build Plan v0: deterministic compilation order
**Why:** We need a stable, reproducible pipeline: compile dependencies first, then the root project.
### Scope
* Implement `prometeu_compiler::build::plan`:
* **Input:** `ResolvedGraph`
* **Output:** `BuildPlan` with topologically sorted build steps
* Each `BuildStep` MUST include:
* `project_id` — canonical project identity (`prometeu.json.name`)
* `project_dir` — absolute or normalized path
* `target` — `main` or `test`
* `sources` — ordered list of `.pbs` source files (from `src/<target>/modules`)
* `deps` — dependency edge map: `alias -> ProjectId`
### Determinism Rules (MANDATORY)
* Topological sort must be stable:
* when multiple nodes have indegree 0, choose by lexicographic `project_id`
* `sources` list must be:
* discovered only under `src/<target>/modules`
* sorted lexicographically by normalized relative path
* `deps` must be stored/exported in deterministic order (e.g. `BTreeMap`)
### Deliverables
* `BuildPlan { steps: Vec<BuildStep> }`
### Tests
* topo ordering stable across runs
* sources ordering stable regardless of filesystem order
### Acceptance
* BuildPlan is deterministic and contains all information needed to compile without further graph traversal.
---
## PR-14 — Compiler Output Format v0: emit per-project object module (intermediate)
**Why:** Linking requires a well-defined intermediate representation per project.