Developer tools · template execution
Source Materializer
A Go tool that produces repeatable file plans, verifies inputs and then applies accepted templates.
- Period
- 2026 — present
- Role
- Tool developer
PROJECT / DECISION RECORD
From the problem to the implementation
- 01Problem
Template authority and filesystem execution have different responsibilities and risks.
- 02Design decision
Use inspect, plan and apply phases bound to deterministic hashes and explicit receipts.
- 03Implementation
Go implementation of safe paths, SHA-256 plans, preflight, no-replace publishing and partial-failure receipts.
Problem
13Template authority and filesystem execution have different responsibilities and risks.
Source Materializer / file creation
- 01 / InspectValidate inputs
Check template boundaries and input definitions.
- 02 / PlanPlan · SHA-256
Bind the file plan to source content hashes.
- 03 / ApplyCREATE only
Revalidate before publishing without replacing targets.
A map of MAT-001/002 source contracts; it does not imply every filesystem race is resolved.
Constraints
- Reject traversal, conflicts and drift; never generate product logic or run arbitrary package installers.
- Reject traversal, duplicate targets and accidental replacement.
- Record partial-failure receipts instead of treating an interrupted apply as success.
Engineering decisions
- Use inspect, plan and apply phases bound to deterministic hashes and explicit receipts.
- Recheck plan digests against source and target state immediately before applying.
- Use CREATE-only operations rather than overwriting existing files.
Implementation
- Go implementation of safe paths, SHA-256 plans, preflight, no-replace publishing and partial-failure receipts.
- Preflight checks digest/source/target drift.
- Apply uses temporary files, hash verification, fsync, mode setting, no-replace publication and failure receipts.
Verification / evidence
README and Go 1.25.12 module describe MAT-001/002 implementation and plan/apply contracts.
Result / current state
MAT-001/002 source exists while remaining filesystem races are still tracked.