osmose.engine_cs.capabilities

Can the C# engine run this config? Fail closed (spec decision D11, plan task 1.1).

Three layers, all pure Python (no CLR):

  1. The catalogue (features.json, shipped with this package and embedded in the C# assembly): every optional feature, its phase or status, and whether the C# engine implements it. core is the Phase 1 engine itself and is always required.

  2. Detectors, one per catalogue feature, decide from the parsed EngineConfig (and the raw dict for the few switches the engine reads outside it) whether a config uses the feature. Where the Python engine has a predicate for the switch, the detector calls it rather than re-parsing the key, so the two cannot disagree about a spelling.

  3. Key coverage. Detectors only catch features someone listed. So every config key the Python engine reads must also match a rule in KEY_RULES: Phase 1 core, inert, or owned by a named feature (whose detector then decides). A set key that the Python engine reads but no rule classifies blocks the run, naming the key. Keys the Python engine never reads (unknown, or Java-only per config_validation) follow Python: they have no effect on either engine.

Spec Q4, as decided: catch-based fishing, by-class rates and selectivity types other than -1, 0 and 1 are refused. They are parsed but not applied by the Python engine.

Module Attributes

KEY_RULES

Ordered (regex on the pattern-form key, owner) rules.

Functions

catalog_contract_versions()

classify_pattern(pattern)

The owner of a pattern-form key (species.linf.sp{idx}), or None if unclassified.

csharp_engine_block_reason(raw)

Why the C# engine cannot run this (raw, reader-produced) config, or None if it can.

load_catalog()

The catalogue, by name, in id order.

required_features(config, raw)

Catalogue features this config needs, in id order (core always first).

unclassified_keys(raw)

Keys set in raw that the Python engine reads but no rule classifies (fail closed).

Classes

Feature(id, name, phase, status, ...)