Problem
Orders and formulas have inconsistent structure in three ways:
1. Orders use subdirectories for single files. Each order requires formulas/orders/<name>/order.toml — a directory containing one file. No order directory in the codebase contains anything besides order.toml. Meanwhile, formulas use flat files: formulas/pancakes.formula.toml. The directory exists solely to provide the order name.
2. Orders are nested under formulas but aren't formulas. Orders reference formulas — they schedule dispatch. They're a peer concept (scheduling vs. workflow definition), not a child. Nesting them under formulas/ misrepresents the relationship.
3. Two locations, different rules. Cities support both formulas/orders/ and top-level orders/. Packs only support formulas/orders/. There's no semantic difference between the two locations — same scanning, same priority, same behavior. The divergence is arbitrary.
4. [formulas].dir is configurable; no other convention-based directory is. scripts/, commands/, doctor/, overlays/ are all discovered by fixed directory name. Only formulas/ has a configurable path via [formulas].dir. This is an odd inconsistency — if someone needs formulas in a non-standard location, that's what packs and imports are for.
Proposed change
- Standardize on top-level
orders/ for both cities and packs
- Adopt flat files:
orders/<name>.order.toml (matches formula convention — name from filename, no wrapper directory)
- Deprecate
formulas/orders/ nesting
- Make
formulas/ a fixed convention (remove [formulas].dir), consistent with every other convention-based directory
Alternatives considered
- Keep
formulas/orders/ nesting. Preserves current behavior but cements the incorrect parent-child relationship.
- Keep
[formulas].dir configurable. Would require making all other convention directories configurable too for consistency — unnecessary complexity.
Problem
Orders and formulas have inconsistent structure in three ways:
1. Orders use subdirectories for single files. Each order requires
formulas/orders/<name>/order.toml— a directory containing one file. No order directory in the codebase contains anything besidesorder.toml. Meanwhile, formulas use flat files:formulas/pancakes.formula.toml. The directory exists solely to provide the order name.2. Orders are nested under formulas but aren't formulas. Orders reference formulas — they schedule dispatch. They're a peer concept (scheduling vs. workflow definition), not a child. Nesting them under
formulas/misrepresents the relationship.3. Two locations, different rules. Cities support both
formulas/orders/and top-levelorders/. Packs only supportformulas/orders/. There's no semantic difference between the two locations — same scanning, same priority, same behavior. The divergence is arbitrary.4.
[formulas].diris configurable; no other convention-based directory is.scripts/,commands/,doctor/,overlays/are all discovered by fixed directory name. Onlyformulas/has a configurable path via[formulas].dir. This is an odd inconsistency — if someone needs formulas in a non-standard location, that's what packs and imports are for.Proposed change
orders/for both cities and packsorders/<name>.order.toml(matches formula convention — name from filename, no wrapper directory)formulas/orders/nestingformulas/a fixed convention (remove[formulas].dir), consistent with every other convention-based directoryAlternatives considered
formulas/orders/nesting. Preserves current behavior but cements the incorrect parent-child relationship.[formulas].dirconfigurable. Would require making all other convention directories configurable too for consistency — unnecessary complexity.