Skip to content

feat: Orders/formulas structural asymmetry #362

@donbox

Description

@donbox

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureNew capabilitypriority/p3Backlog — good idea, reviewed when there's bandwidthwastelandTracked by Wasteland sync

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions