Skip to content

pyflightstream.commands (stable)

Generated from the docstrings at build time: every one of the 14 names in the __all__ of pyflightstream.commands has an entry below. The names a guide or an example uses come first; the others follow under Advanced.

The FlightStream command database and per-version registry.

Pipeline role: single source of truth for which ASCII commands exist in which FlightStream version, with typed arguments, script layout, emission phase, and one evidence citation per entry: the manual page documenting it (manual_ref), or a committed probe report measuring that the solver accepts a command no edition documents (probe_ref). The script builder validates every emission against this database.

Data lives in the YAML files next to this module, one file per manual chapter; _meta.yaml holds the ordered version list, which is the only ordering authority (CONTRIBUTING.md invariant 4). Version keys in the YAML files are quoted strings ("26.120"); an unquoted key would be parsed as a float and rejected by the loader.

Statuses follow the evidence rules of CONTRIBUTING.md invariant 3: documented cites the manual through manual_ref, or a committed report through probe_ref where no edition documents the command; verified and broken additionally cite a committed probe report; removed says which of three things happened, since an edition stating a withdrawal, an edition merely going quiet, and a probe measuring the solver refusing the name are not the same claim; the measured case cites its run, through report when the harness promoted it and through probe_ref for the removals recorded before the harness could; and a successor is recorded where one is known. The single home of that rule is docs/srs/data-model.md.

A command whose argument grammar differs between versions declares the grammar of the latest documented version in args and overrides it per version through versions.<v>.args; the per-version view resolves the override, so the script builder binds and renders the grammar of its target version (the four-versus-three argument forms of CREATE_BULK_SEPARATION, FSM-26.120 p.342 versus FSM-26.101 p.341, are the motivating case).

Used in the guides

pyflightstream.commands.CommandNotInVersionError

Bases: PyflightstreamError, LookupError

A command is unavailable in the requested FlightStream version.

Raised by a per-version view when the command is removed in that version or has no recorded evidence for it. The message carries the manual citation and the successor command when one is recorded.

Advanced

pyflightstream.commands.ArgSpec

Bases: BaseModel

Typed specification of one command argument.

Attributes:

Name Type Description
name str

Argument name, English, lowercase.

type ArgType

Value type; enum and enum_list restrict values to values.

values tuple of str, optional

Allowed tokens; required for enum and enum_list types and forbidden otherwise. THE ACCEPTED VOCABULARY: every spelling the manual page states or samples for the argument, digits included where the page takes an index beside a letter, because the emitter reads this list to refuse and a refusal of a token the solver accepts is a false refusal. A narrowing this library chooses to offer belongs to the helper that offers it, never here (docs/srs/data-model.md, PFS-2003.03). An integer that prints as a listed digit is accepted and printed as that digit (PFS-2003.04).

unit (str, optional)

Physical unit of the value as the solver expects it (for example "m/s"); absent for dimensionless or textual arguments.

required bool

Whether the argument must be supplied; optional arguments are the ones the manual marks as such (for example LOAD_SOLVER_INITIALIZATION of OPEN, FSM-26.120 p.282). Presence-keyword bool arguments default to optional; an explicit required declaration still takes precedence.

separator ListSeparator

How a list-typed argument joins its values when rendered; the manual fixes it per command (see :class:ListSeparator).

own_line bool

For mixed_inline commands whose file path follows on the line after the inline arguments (for example SET_PROP_ACTUATOR_PROFILE, FSM-26.120 pp.323-324), or a bare value line in param_lines.

joins_previous bool

The value is appended to the script line of the preceding argument instead of taking its own KEY VALUE line; the copy count that PERIODIC symmetry appends to the SYMMETRY line of INITIALIZE_SOLVER (FSM-26.120 p.337) is the documented case.

on_command_line bool

For a keyword_block command whose LEADING arguments sit on the command's own line rather than taking a KEY VALUE line of their own. WRAPPER_EDIT_LOCAL_CONTROL is the documented case: the control's id follows the command name and the surfaces and target size are keyword lines beneath it (FSM-26.120 p.314).

Distinct from joins_previous, which appends to the line the PRECEDING ARGUMENT wrote and therefore cannot apply to the first argument; this one appends to the command name. Modelling the wrapper command with joins_previous was refused by that rule, and rightly: the two say different things, and only one of them is true of an argument in first position.

fixed_length (int, optional)

The exact number of values a list argument takes, when the manual fixes it and no count argument precedes it. Absent means the length is free or a count governs it. SET_MOTION_6DOF_ACTIVE_VARIABLES is the documented case: six toggle lines, one per degree of freedom, with nothing counting them (FSM-26.120 p.334). A short payload makes the solver read the next command as data.

cites (EntityKind, optional)

The auxiliary entity this argument's index refers to, declared when the argument's name does not say so database-wide. The emitter resolves declared labels and checks index ranges from it. ABSENT MEANS THE ARGUMENT CITES NOTHING: no declared label resolves there and no index is range checked. Every argument that cites an entity declares it; the emitter does not infer the entity kind from the argument name (PLN-20260807-1410).

The maps could not carry a spelling that means different things on different pages, which is the reason the field exists: the Mesh Operations chapter spells a surface reference index, and three other chapters spell a section or separation index the same way (FSM-26.120 pp.309-313).

all_sentinel (int, optional)

The value this argument uses to select every entity of its kind, when the command's manual page states one. ABSENT MEANS THE PAGE STATES NONE, not that some default applies: the emitter has no per-kind default, so an argument without this refuses every index at or below zero.

The pages disagree three ways, which is why the fact lives on the argument. TRANSLATE_SURFACE_IN_FRAME and TRANSLATE_SURFACE_BY_FRAME state zero (FSM-26.120 p.309); seven boundary indices state -1 (pp.307, 310-312); six state nothing, and SURFACE_RENAME renaming every surface to one name is what accepting -1 there meant. Requires cites, since a sentinel is read only where the entity kind is known.

is_list property

is_list: bool

Whether the argument holds several values.

pyflightstream.commands.ArgType

Bases: StrEnum

Argument types a command can declare.

int_list is a comma-separated list of integer indices on one data line, the grammar FlightStream uses for boundary and surface selections (for example FSM-26.120 p.319). float_list is a list of real values, for example the custom sweep values of SWEEPER_SET_AOA_SWEEP (FSM-26.120 p.406). str_list is a list of preformatted composite tokens, one per data line, used where a single line pairs an index with a toggle, such as the per-surface index,ENABLE lines of INITIALIZE_SOLVER (FSM-26.120 p.337); the typed pair validation lives in the curated helper that emits it. bool is a presence keyword of a keyword_block: True emits the bare keyword line and False (or omission) emits nothing, the grammar of the CLEAR keyword of IMPORT (FSM-26.120 p.307).

pyflightstream.commands.CommandDatabaseError

Bases: PyflightstreamError, ValueError

The command database itself cannot be loaded as written.

Raised by :meth:CommandRegistry.load when the chapter files disagree with each other, for instance when two of them define the same command name. This is a defect in the database, not in the caller's script, and it is fatal: nothing downstream can be built from a registry that does not know which entry a name means.

Keeps ValueError as a base, so an existing except ValueError around a registry load catches what it caught before.

CATCH ValueError, NOT PyflightstreamError, and the difference is not pedantry on this class. Only the duplicate-name check in :meth:CommandRegistry.load reaches a caller as this type. Every other raise site is inside a pydantic model validator, and pydantic converts what a validator raises into pydantic.ValidationError, which IS a ValueError and is NOT a PyflightstreamError. FR-39's first clause is about the exceptions this package delivers itself; most of this class's raises are delivered by pydantic instead.

pyflightstream.commands.CommandEntry

Bases: BaseModel

One command of the FlightStream scripting interface.

Attributes:

Name Type Description
name str

Command name as the solver script expects it; supplied by the loader from the YAML mapping key.

chapter str

Stem of the chapter YAML file the entry came from; supplied by the loader and used to group the generated reference.

layout Layout

Script layout grammar.

terminator (str, optional)

Single keyword closing a keyword block, such as PHYSICS END.

phase Phase

Emission phase used by the script builder's ordering check.

args tuple of ArgSpec

Typed argument specifications, in emission order.

manual_ref (str, optional)

Manual page citation of an entry an edition documents, exclusive with probe_ref and required unless that is given; for example "FSM-26.120 p.352". Paraphrase evidence only; manual text is never reproduced.

probe_ref (str, optional)

Repository-relative path of a committed probe report, for the command that the SOLVER accepts and no manual edition documents. It stands where manual_ref would, and it exists because that command is real: RPT-018 measured DELETE_VALAREZO_SEPARATION_BOUNDARIES accepted on 26.100 while the name FSM-26.100 documents for the same erase is unrecognised, and RPT-015 measured CREATE_STRATFORD_BULK_SEPARATION accepted on 26.120, a build whose manual does not mention it.

A committed probe report may support a command that the manual does not document. The entry identifies that report, so the validating emitter can use the measured grammar without requiring Script.raw().

It does NOT relax the status rules. verified and broken still come only from a compat report applied by pyfs-qa apply-compat (CONTRIBUTING.md invariant 3); what probe_ref records is that the command EXISTS, which is a different claim from how it behaves.

versions mapping of str to VersionStatus

Evidence per canonical version identifier (quoted "YY.XXX" keys). Versions without an entry have no recorded evidence.

notes (str, optional)

Paraphrased usage caveats with citations.

default int, float, str, or tuple of int, optional

Documented default value the solver applies when the command is never issued (a tuple of boundary indices for a boundary-selection command, the empty one a default that emits no line), recorded only when the manual states it and always together with default_ref (evidence rule, CONTRIBUTING.md invariant 3). Consumed by the solver-setup snapshot (:mod:pyflightstream.script.solver_setup) so an unset flag with a documented default is recorded as such instead of unknown; a flag without this field stays honestly unknown.

default_ref (str, optional)

Manual page citation of default, for example "FSM-26.120 p.221"; required whenever default is set.

citation property

citation: str

The entry's evidence citation, whichever kind it carries.

Exactly one of manual_ref and probe_ref is set, and a message that reaches for the wrong one prints an empty pair of brackets. Callers writing a refusal a person reads want this rather than either field.

evidence_in

evidence_in(version: FsVersion) -> Evidence | None

Return the evidence for version together with its source.

A hotfix build inherits the record of its base release until probe evidence overrides it (SAD Section 2), when THE REGISTRY says it does. The lookup is by canonical identifier against commands/_meta.yaml, not a read of :attr:~pyflightstream.versions.FsVersion.inherits_base on the object handed in, so a caller cannot assert a descent in either direction and a canonical the registry has never heard of inherits nothing. Inheriting is the right default for a real hotfix: one that does not touch a command really does carry the base release's evidence, and the alternative, every hotfix starting from nothing, is worse.

Inheritance is stated per build, not derived from the last canonical digit. Independent vendor releases can occupy adjacent indices without sharing a command set. A hotfix index that leaves inheritance unstated is refused.

Inheritance must be visible to a reader. :meth:status_in returns only the record; this accessor also names the source build and whether the record is inherited. The compatibility matrix derives its Of which inherited count from those fields, and tests/tier1_offline/test_evidence_provenance.py verifies that count. A hotfix may change a command's behavior, so inherited evidence is an explicit assumption rather than a measurement of that hotfix.

This is the accessor to prefer when the answer is shown to a person or written into a report. :meth:status_in stays for callers that only need the record, and is implemented on top of this one so the two can never disagree.

Parameters:

Name Type Description Default
version FsVersion

Registered version to look up.

required

Returns:

Type Description
Evidence or None

The record and where it came from, or None when the command has no recorded evidence for this version, directly or by inheritance.

status_in

status_in(version: FsVersion) -> VersionStatus | None

Return the evidence record for version, honoring hotfix inheritance.

Parameters:

Name Type Description Default
version FsVersion

Registered version to look up.

required

Returns:

Type Description
VersionStatus or None

The evidence record, or None when the command has no recorded evidence for this version.

See Also

evidence_in : the same lookup, plus whether the record was inherited from the base release. Prefer it wherever the answer reaches a person or a report; this method cannot tell a probed record from an assumed one.

pyflightstream.commands.CommandRegistry dataclass

CommandRegistry(commands: Mapping[str, CommandEntry])

The whole command database, all versions.

Attributes:

Name Type Description
commands mapping of str to CommandEntry

Every command, keyed by name, loaded from the chapter YAML files next to this module.

load cached classmethod

load() -> CommandRegistry

Load and validate the whole database from the installed package.

Returns:

Type Description
CommandRegistry

Validated registry; every entry satisfied the schema and the evidence rules.

Raises:

Type Description
ValueError

If two chapter files define the same command name, or an entry violates the schema (pydantic validation error).

for_version

for_version(version: str | FsVersion) -> VersionView

Return the view of the commands available in one version.

Parameters:

Name Type Description Default
version str or FsVersion

Canonical identifier, a vendor release name that identifies exactly one registered build, or a resolved version.

required

Returns:

Type Description
VersionView

Per-version, read-only view.

pyflightstream.commands.EntityKind

Bases: StrEnum

An auxiliary object a command argument can cite by index.

These are the objects a script creates or declares and then refers to by a 1-based index: local coordinate systems, propeller actuators, motion definitions, and the mesh boundaries the opened geometry carries. The emitter tracks the inventory of each and refuses an index outside it (SAD Section 4.2).

The members must stay in step with the kinds :class:pyflightstream.script.entities.EntityTracker tracks; the dependency runs script -> commands and never the other way, so the agreement is asserted in tier 1 rather than imported.

pyflightstream.commands.Evidence dataclass

Evidence(
    record: VersionStatus, source: str, inherited: bool
)

One command's evidence for one version, and where it came from.

Returned by :meth:CommandEntry.evidence_in. The point of the type is inherited: a hotfix build falls back to its base release's record, and a caller that cannot see the fallback presents an assumption as a measurement.

Attributes:

Name Type Description
record VersionStatus

The evidence record itself, whichever version it belongs to.

source str

Canonical identifier of the version whose record this is. Equal to the version asked about when the record is direct.

inherited bool

True when the record was taken from the base release rather than recorded for the version asked about. Any report, matrix or message that shows the status to a person shows this too.

pyflightstream.commands.Layout

Bases: StrEnum

Script layout grammars a command can use.

bare has no arguments; inline takes arguments on the command line; mixed_inline adds explicitly declared following lines to an inline head; param_lines takes the command name alone and its parameters each on a following line, ended by a blank line (the multi-line function grammar of FSM-26.120 p.279, for example OPEN on p.282); payload_lines takes a count followed by that many data lines; keyword_block takes KEY VALUE lines until a terminator.

pyflightstream.commands.ListSeparator

Bases: StrEnum

How a list-typed argument joins its values in the script.

The manual samples show three grammars: comma-separated on one line (FSM-26.120 p.332), space-separated on one line (p.364), and one value per line (pp.338, 352).

pyflightstream.commands.Phase

Bases: StrEnum

Script phases, in emission order.

The script builder tracks the highest phase reached and rejects a command whose phase precedes it (SAD phase-ordering rule). control marks script-control commands (STOP, PRINT, log export; FSM-26.120 pp.281-283) that may appear anywhere; the builder exempts them from phase ordering.

pyflightstream.commands.Status

Bases: StrEnum

Evidence status of a command in one FlightStream version.

documented: the manual says so (manual_ref), or a committed report measured the solver accepting a command no edition documents (probe_ref). verified: a Tier 2 probe passed on a licensed machine. broken: a probe recorded a manual-versus-reality discrepancy. removed: the command is not available in this build.

removed arrives three ways and the row says which, because the three are not equally strong and a reader cannot tell them apart from the status alone. An edition may STATE the withdrawal, which is a fact about a supported build. An edition may simply STOP PRINTING the command, which is a fact about a document and not about the solver at all. Or a probe may MEASURE the solver refusing the name, which is the only one of the three that observes the solver. The note carries a manual page for the first two, and the measured case additionally cites its run, on the same reasoning that makes verified and broken require one: a claim about the solver rests on a run, never on a reading. WHICH FIELD carries that citation is the data model's to state (docs/srs/data-model.md), because two are live: the harness writes report, and probe_ref holds the removals recorded before the harness had the outcome.

pyflightstream.commands.VersionStatus

Bases: BaseModel

Evidence record of a command in one FlightStream version.

Attributes:

Name Type Description
status Status

Evidence status; see :class:Status.

successor (str, optional)

Replacement command name; only meaningful for removed.

note (str, optional)

Short paraphrased justification, with citation when needed.

report (str, optional)

Repository-relative machine-readable compat report, required for verified and broken (CONTRIBUTING.md invariant 3). Guards check its outcome. A documented row may cite an unprobed report with a note stating direct inconclusive evidence and the edition's page. That row prevents inherited verification without asserting a measured effect.

probe_ref (str, optional)

Repository-relative path of a committed NARRATIVE report (.md) of a solver run, admissible for removed alone and for no other status. The restriction is the whole point of the field: verified and broken are the harness's to write and stay cross-checkable against its own output, and a prose citation is not checkable at all.

A measured removal is promoted by pyfs-qa apply-compat and cites the compat yaml through report like any other promoted status. This field survives for the removals recorded before that, and for nothing else. The retention reason stated when the outcome landed named a second case, an edition that merely stopped printing a command, and the database refutes it: such a row cites pages in its note and no run at all, which is what the model requires of a reading. So the surviving population is finite and closable, and the field goes away when those rows are re-probed.

args tuple of ArgSpec, optional

Per-version argument grammar override. Declared when this version's manual documents a different signature than the entry-level args; the per-version view substitutes it, so emission for this version binds and renders the overridden grammar. Absent for a version whose grammar matches the entry-level one, and meaningless for removed.

layout (Layout, optional)

Per-version line layout, validated with the effective argument grammar. Absent means the entry-level layout; removed rows have none.

default int, float, str, or tuple of int, optional

Documented default for this build, overriding the entry-level value. It describes solver behavior; it does not insert an omitted argument.

default_ref (str, optional)

Manual page supporting the per-build default. Value and citation must be supplied together; absent means use the entry-level pair.

pyflightstream.commands.VersionView dataclass

VersionView(version: FsVersion, _registry: CommandRegistry)

Read-only view of the commands available in one FlightStream version.

Obtained through :meth:CommandRegistry.for_version. Mapping-style access raises :class:CommandNotInVersionError with the manual citation when a command is removed or has no recorded evidence.