Skip to content

feat: unified compute entry (exfa/compute@1), FitSpec shorthand, projected select - #10

Merged
elwina merged 1 commit into
mainfrom
feat/compute-envelope-select
Oct 8, 2026
Merged

elwina merged 1 commit into
mainfrom
feat/compute-envelope-select

Conversation

@elwina

@elwina elwina commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

docs/27 §5.3/5.5 — the engine-side half of the unified compute design. One input object, one output object: operation=calc takes a FitSpec, operation=batch takes the existing BatchRequest; batch remains a first-class operation, workspaces/groups never reach the engine.

  • compute RPC + compute_json + exfa compute [FILE] CLI; WASM picks it up via exfa_core::rpc with zero changes
  • FitSpec shorthand, engine-side only, recursive into projected/booster/scenario-target fits: omitted skills.default_level → 5, omitted module state → active-if-activatable else online, omitted drone active → quantity. Explicit values win; DEFAULTED adjustments on calc
  • batch base/fits[].fit normalized before expansion — patches act on a normalized base
  • projected[kind=fit].select = strict per-kind whitelist by stable item id; source fit still built completely; unmatched ids → warnings
  • CONTRACT.md compute section; contract_version unchanged

Test plan

  • cargo test -p exfa-core — all suites green incl. new tests/compute.rs (8 tests: shorthand↔explicit, explicit-wins, batch echo/equivalence, select whitelist, error envelopes)
  • cargo build core/cli/wasm
  • CI

Generated with Devin

…ected select

docs/27 §5.3/5.5 — one input object, one output object; batch stays a
first-class operation of the same media; workspaces/groups never reach the
engine.

- compute.rs: `compute` RPC method + compute_json() (never panics) +
  `exfa compute [FILE]` CLI. exfa/compute@1 {operation:calc|batch} ->
  exfa/compute-result@1 {result|error} (UNSUPPORTED_FORMAT / BAD_REQUEST /
  BAD_JSON envelopes, inner errors wrapped).
- FitSpec shorthand normalization, engine-side only, recursive into
  projected[kind=fit].fit / fleet.booster_fits / scenarios[].target.fit:
  skills.default_level -> 5, module state -> active when the type can
  activate else online, drone active -> quantity. Explicit values win;
  calc reports DEFAULTED adjustments, batch normalizes silently pre-expansion
  (patches act on the normalized base).
- model: id? on ModuleReq/DroneReq/FighterReq; projected[kind=fit].select
  {module_ids,drone_ids,fighter_ids} = strict per-kind whitelist of the
  fully-built source fit's items; absent kind list contributes nothing;
  unmatched ids -> warnings. select ignored (warned) on non-fit kinds.
- contract/CONTRACT.md: new `compute` section; contract_version unchanged.

Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@elwina
elwina merged commit 5d487c2 into main Oct 8, 2026
3 checks passed
@elwina
elwina deleted the feat/compute-envelope-select branch October 8, 2026 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant