All docsStellar ControlMission control · by Stellar Systems v1.1.0

Procedure Language

Libraries and Validation

Step libraries: their manifest, their catalogue dependencies, their lock file, and how a change is validated again through review.

Steps and procedures live in libraries: versioned packages of the configuration repository, next to the catalogue packages they depend on. A library records in a lock file which steps and procedures were validated, and against what. Changing a shared step, or a catalogue, marks every procedure that depends on it for revalidation; the review of the merge request that updates the lock is the validation. Stellar Control imposes no editing role: the review process of the team on the Git repository decides.

Layout#

The packages/ directory of the Test bench automation use case:

text
packages/
  tvac-chamber/catalogue.yaml      catalogue packages
  lab-psu/catalogue.yaml
  hsc-100/catalogue.yaml
  tvac-ops/                        a library
    package.yaml                   its manifest
    tvac.proc                      steps and procedures, in any number of files
    stellar.lock                   validated versions, written by `stellar lock`

Every directory under packages/ is one package version. The shared steps of a platform are typically in a library versioned with its catalogue: hsc-100-ops@1.0.0 for hsc-100@1.x in the Payload integration use case.

Manifest: package.yaml#

YAML
# Operations of the TVAC chamber: the thermal vacuum cycle of a unit under test, and the reaction
# that makes the chamber safe on a leak.
package: tvac-ops
version: 1.0.0
status: released
depends:
  tvac-chamber: 1.x
  lab-psu: 1.x
  hsc-100: 1.x
KeyMeaning
packageName of the library
versionSemantic version, major.minor.patch
statusdraft (default) or released: a draft library runs only in environments with allow_draft: true (run::draft-not-allowed)
dependsThe catalogue packages its roles may use, each with a version requirement

A version requirement is an exact version (1.4.0), any patch of a minor version (1.4.x) or any version of a major one (1.x, or 1). The highest catalogue version of the repository that satisfies it is used (package::unresolved when none does). The platform of a uses must be one of these dependencies (procedure::unknown-platform).

stellar schema library prints the JSON Schema of the manifest, for editors and CI.

A role of a package also accepts a target whose platform imports components of that package, in the version the library was compiled against: the procedures of a subsystem run unchanged on the platform that integrates it, under the names of the package, and their lock stays valid. A procedure that uses a component the platform does not import is refused (run::not-imported). See Imports, drivers and procedures.

Names in a library#

Step names are unique in a library, and so are procedure names; do and run resolve them in the library of the caller. A run request names a procedure; when several libraries of the snapshot have a procedure of that name, it also names the library (library:, see Running Procedures).

The lock: stellar.lock#

The lock records, like a Cargo.lock, the hash of the compiled form (IR) of every validated step and procedure, and the hashes of all its dependencies, direct or not: the steps it calls, the sub-procedures it runs, the catalogues of its roles.

The lock of tvac-ops (shortened):

YAML
# Generated by `stellar lock`: IR hashes of the validated steps and procedures of this
# library and of their dependencies. Updating it validates them again: review it.
version: 1
catalogues:
  hsc-100@1.0.0: 9f072328cdcaa10210a52f2150a89bbe4845205e977dc3b695e852efd460638f
  lab-psu@1.0.0: 0e0fd3516f289edfc4a436efd83386941e9ae3a83a5516f0a641dee9556ac64d
  tvac-chamber@1.0.0: 98f090ef365e71baeb1dc797f85ee1eed77895e14c5df6341c9fdafdace264e5
steps:
  Plateau:
    hash: c05dfce0033a8628ed6b57e6d77ec4514ffde711c559108553049469f84d8186
    depends:
      catalogue hsc-100@1.0.0: 9f072328cdcaa10210a52f2150a89bbe4845205e977dc3b695e852efd460638f
      catalogue lab-psu@1.0.0: 0e0fd3516f289edfc4a436efd83386941e9ae3a83a5516f0a641dee9556ac64d
      catalogue tvac-chamber@1.0.0: 98f090ef365e71baeb1dc797f85ee1eed77895e14c5df6341c9fdafdace264e5
procedures:
  TVAC cycle:
    hash: 59df810f4877a8056c6c1e7f106113cad49a6c92c3f4a42dd5060b432ae18b28
    depends:
      catalogue hsc-100@1.0.0: 9f072328cdcaa10210a52f2150a89bbe4845205e977dc3b695e852efd460638f
      catalogue lab-psu@1.0.0: 0e0fd3516f289edfc4a436efd83386941e9ae3a83a5516f0a641dee9556ac64d
      catalogue tvac-chamber@1.0.0: 98f090ef365e71baeb1dc797f85ee1eed77895e14c5df6341c9fdafdace264e5
      step Chamber ready: f5aa48d2ae1d538ba29de1df38428e8b164ecbafd2b4119ca17871860d5a5603
      step Plateau: c05dfce0033a8628ed6b57e6d77ec4514ffde711c559108553049469f84d8186
      step Pumpdown: 37c24faf32f3b134d4d42cd720153cfdeed004ae0e126c98b4ee04141c6a6c1d
      step Repressurization: aaae82eb66cdb26fcc3c12400acc7a3c1fdc5ee3c2fb52ba96b259e863ba47ed
      step Unit off: d45a95d3aaafa5859dfb636b47b3879c3f077dd70add01b83c02d071e96fdb5e
      step Unit powered: 079a83cb2b06f89c12f5d9f6ceb4bc2d397627e0502af8714435f60a9900a6af

The IR holds neither positions in the sources nor comments nor descriptions: reformatting a file, commenting it or rewording a description changes no hash, so it needs no revalidation.

What must be validated again#

A step or procedure must be validated again when:

Reason, as printedCause
it was never validatedIt is not in the lock (new, renamed, or no lock yet)
it changedIts own hash differs
step …, procedure … or catalogue … changedA dependency changed, however deep
it now uses …, it no longer uses …Its dependencies changed

Changing a shared step therefore signals every procedure that uses it, even through sub-procedures.

In the Test bench automation repository, the hold of the step « Plateau » lengthened from wait 30 s to wait 60 s, then a verification removed from the hazardous open_vent_valve of the tvac-chamber catalogue:

Shell
stellar check .
text
catalogue::hazardous-without-verify

  ⚠ hazardous telecommand `open_vent_valve` has no verification
    ╭─[packages/tvac-chamber/catalogue.yaml:85:9]
 84 │       open_vent_valve:
 85 │         description: Vents the chamber with dry nitrogen; never with the turbo spinning.
    ·         ────────────────────────────────────────────────────────────────────────────────
 86 │         hazardous: true
    ╰────
  help: add `verify: [echo]` or a condition on measures, so that its effect is checked
To validate again (`stellar lock` records the validation):
  tvac-ops: step `Chamber ready`: catalogue `tvac-chamber@1.0.0` changed
  tvac-ops: step `Plateau`: it changed; catalogue `tvac-chamber@1.0.0` changed
  tvac-ops: step `Pumpdown`: catalogue `tvac-chamber@1.0.0` changed
  tvac-ops: step `Repressurization`: catalogue `tvac-chamber@1.0.0` changed
  tvac-ops: procedure `Safe chamber`: catalogue `tvac-chamber@1.0.0` changed
  tvac-ops: procedure `TVAC cycle`: catalogue `tvac-chamber@1.0.0` changed; step `Plateau` changed
Checked 3 catalogues, 1 library, the topology, 3 simulations (6 steps, 2 procedures): 0 errors, 1 warning.

« TVAC cycle » is flagged for « Plateau », which it calls four times, and every step and procedure whose roles use tvac-chamber for the catalogue. stellar lock then validates them:

text
tvac-ops: validated step `Chamber ready`, step `Plateau`, step `Pumpdown`, step `Repressurization`, procedure `Safe chamber`, procedure `TVAC cycle`

With --format json, each revalidation is a JSON line {"revalidate": "procedure", "library": …, "name": …, "reasons": […]} after the diagnostics.

The validation workflow#

flowchart LR
    A[Edit steps or<br/>catalogues] --> B[stellar check]
    B --> C[stellar lock]
    C --> D[Merge request:<br/>the lock diff lists<br/>what is validated]
    D --> E[CI: stellar check --locked]
    E --> F[Review and merge]
    F --> G[CI: stellar compile --publish]
  1. The author changes catalogues, steps or procedures and runs stellar check until it reports no error; it lists what must be validated again.
  2. Once the change is ready for review, stellar lock rewrites every stellar.lock (it refuses while there are errors).
  3. The merge request shows the diff of the lock: every step and procedure it validates again, including those that only use a changed step. Approving the merge request is the validation.
  4. CI runs stellar check --locked, which fails on any error and on any change whose lock was not updated: an unreviewed change cannot be merged.
  5. After the merge, the CI of the default branch publishes the snapshot with stellar compile --publish; the reconciler applies it at the next safe point of each target.

See Compilation, Snapshots and Locks for the CI configuration of GitHub and GitLab.

Diagnostics of libraries#

CodeMeaning
package::invalid-name, package::invalid-versionInvalid name or version in package.yaml
package::unresolvedNo catalogue version satisfies a requirement of depends
package::duplicateTwo packages with the same name and version
package::unreadableA manifest or lock that cannot be read
procedure::duplicate-step, procedure::duplicate-procedureA name defined twice in the library
procedure::unknown-platformA uses of a catalogue that is not a dependency

↑↓ to moveEnter to open