Skip to content

v0.11.0 — per-task resource quantity / pooled resources

Choose a tag to compare

@rnwolf rnwolf released this 28 Jul 18:24

Per-task resource quantity / pooled resources (Phase 5)

A task may now request a specific number of units of a pooled resource,
not just "uses this resource": resources: {"crew": 3} (JSON) or
resource_ids token crew:3 (CSV) means the task consumes 3 of that
resource's daily capacity. A whole number > 1 is a pool draw (e.g. 3 of a
4-capacity crew); a fraction < 1 is a time-share (e.g. 0.5 of one person) -
the same mechanism at either end of one continuum, not two features.
Default remains 1 - every existing network is unaffected (all 5
reference-project golden tests stay byte-identical).

  • validate_network: the old "allocation must equal exactly 1" rule is
    gone. Replaced by E_BAD_ALLOCATION (non-numeric or <= 0) and new
    E_ALLOCATION_EXCEEDS_CAPACITY (a task asking for more than a resource
    has at all, which could never be satisfied).
  • The CSV round trip now understands the id:qty notation in
    resource_ids (previously unparsed entirely - an id:qty token became
    one malformed resource id). Schedule output encodes quantity the same
    way, so it survives the round trip through schedule.csv.
  • The leveling engine and check_schedule both sum quantity per resource
    per day instead of counting tasks, so pooled contention is scheduled
    and verified correctly.
  • The network graph and Gantt utilization panel show quantity consumed.

Also fixed while implementing this: network_from_json's dict-form
allocation parsing crashed on a bad value instead of deferring to
validate_network, inconsistent with this module's own "loading is
lenient" design; and network_to_json could silently drop a resource id
missing from a partial allocations dict.

22 new tests. See PLAN.md Phase 5 for the full design writeup.

Also included in this release

Accumulated since v0.10.0: comprehensive docs + GitHub Pages site, ruff
pre-commit hooks and lint fixes, property-based (hypothesis) testing,
a 100-task large-network test, pytest-cov coverage tooling, and README
updates.