Search and contents

Public API changes

The breaking changes in each release of the public API, and how to move past them. The rules for what counts as breaking, and how the version responds, are in the stability policy.

There is one section per version, headed ## MAJOR.MINOR.PATCH. Each breaking change since the previous release gets a bullet that names the name or route it affects (a Python name such as ConnectorRegistry, a route such as GET /v1/status, or a Node Type directory such as node-types/erp) and says how to migrate. The release check (python -m engine.release_check) blocks a release whose breaking changes are not each named under the heading for the version in pyproject.toml. A section with nothing breaking in it is allowed.

0.1.0

First release. Nothing breaks: there is no earlier release to break.

0.2.0

Nothing breaks. This release only adds to the public API: the offline configuration check (check_candidate, preview_candidate, expand_source_keys and the report types they return) and the POST /v1/config/check route.

0.3.0

Nothing breaks. This release only adds to the public API: the sign-off routes (GET /v1/signoffs, GET /v1/signoffs/{record_id}, POST /v1/signoffs/{record_id}/resolve and POST /v1/signoffs/{record_id}/edit-and-resubmit), the identity-match routes (GET /v1/identity-matches, POST /v1/identity-matches/{match_id}/resolve and POST /v1/identity-matches/{match_id}/reopen), the token_file field of GET /v1/status and the version field of its identity block.

0.4.0

Nothing breaks. This release only adds to the public API: the GET /v1/revocations route, behind the new revocations scope, and the peer_revocations field of GET /v1/status.

The package now also ships a py.typed marker, so an integrator's type checker reads the annotations of the declared names and holds their code to them. From this release a change to one of those annotations is judged by the same rules as any other change to a signature or a field (see the stability policy). Nothing in the declared surface changed its annotations in this release.

0.5.0

One change to a covered command breaks scripts written for 0.4.0, and everything else only adds to the public API.

Breaking

  • python -m engine.management.tokens mint (and deployment/mint_management_token.sh, which runs it) no longer mints a token with no expiry by default. A token now carries an expiry, so a mint must say when it ends. A mint with none of the three options below is refused, and nothing is written or logged. --no-expiry is also refused for a token with the signoff, sync or check scope, which a person holds. To migrate, add one of:

    • --expires-in 90d (any number of days) or --expires-at 2027-03-01T00:00:00+00:00 to the mint command. An expiry is held to MANAGEMENT_TOKEN_MAX_LIFETIME_DAYS (180 days unless the node sets it).
    • --no-expiry for a token only a system holds, such as a read-only monitor.
    • MANAGEMENT_TOKEN_LIFETIME_DAYS in the node's settings, which gives every mint that names no expiry a default, so an existing script keeps working unchanged.

    Tokens already in the file are not touched and keep working; give one an expiry with the new set-expiry command (below).

Added

  • Token commands: set-expiry gives an existing token an expiry and keeps its secret; reset gives a token a new secret under the same scopes and ends the old one at once. list also shows each token's expiry. A token past its expiry is refused with the same 401 as an unknown token, and an authenticated response carries the expiry in X-Token-Expires-At.
  • POST /v1/tokens/rotate: a token holder replaces their own secret in place, under the same id and scopes, and the old secret works for a short grace window.
  • GET /v1/status: the token_file block gains expired_tokens, earliest_expiry and tokens_without_expiry.
  • POST /v1/documents, POST /v1/documents/activate, POST /v1/documents/deactivate and GET /v1/documents/{call_id}, behind the new documents scope: hand the Node a document, or an availability call, to apply, and read how it went.
  • GET /v1/orders/{order_id}/trail and GET /v1/orders/{order_id}/genealogy, behind the new correlation scope: what the Node and its peers hold for one order.
  • ChunkingStrategySpec and register_chunking_strategy in engine.public, for naming a chunking strategy a Node Type can ask for.
  • check_candidate takes an optional db_sample flag (off by default). With it, a database log connector also reads one row of its table and returns it as the sample.

0.6.0

The pull of other nodes' revoked token ids is removed, and a revoke now reaches another node only when an administrator sends it there (the cascade tool, deployment/management_tokens.sh revoke --nodes). What breaks is listed first, and the routes added after it.

Breaking

  • GET /v1/revocations is removed and answers 404. It listed the token ids a node had revoked, for another node to pull. To migrate, stop reading it: revoke on every node with management_tokens.sh revoke --id NAME --nodes nodes.txt, which sends the revoke to each node instead.
  • GET /v1/status no longer has the peer_revocations field. Nothing replaces it: a node pulls no peer, so there is no pull to report. To migrate, stop reading the field. token_file is unchanged.
  • POST /v1/tokens/rotate declares its scope rule as any_token in the description at GET /v1/openapi.json (x-required-scope), where it said not_revocations. The route now accepts every token, as the revocations scope it excluded is gone. To migrate, read any_token wherever not_revocations was handled.
  • The revocations scope is removed. mint_management_token.sh --scope revocations and python3 -m engine.management.tokens mint --scope revocations are refused. A token file that still holds a token with the scope loads: the service drops the scope, logs one line naming the tokens, and skips a token left with no scope. To migrate, revoke the node-to-node pull tokens (management_tokens.sh revoke --id NAME).
  • mint no longer takes --allow-unreachable, and makes no network call. A script that passes it fails with a usage error; remove the option.
  • MANAGEMENT_PEERS, MANAGEMENT_PEERS_TOKEN_FILE and MANAGEMENT_PEERS_INTERVAL_SECONDS do nothing. A node that still sets one starts, logs a warning naming it, and ignores it; doctor.sh names it too. Remove them from .env and from the environment.
  • python -m engine.management.tokens mint --no-expiry (and mint_management_token.sh) is also refused for a token with the correlation scope, which a person holds, as it is for signoff, sync, check and admin. A script that mints a correlation token with --no-expiry fails with a usage error. To migrate, give it --expires-in 90d (any number of days up to MANAGEMENT_TOKEN_MAX_LIFETIME_DAYS) or --expires-at. documents is unchanged: a system holds it, so it may still never expire.
  • POST /v1/tokens/rotate answers 429 with Retry-After when the same token rotated less than 60 seconds ago, where it answered 200. A caller that rotates in a loop, or retries a lost answer at once, must wait the seconds the header names.

Added

  • POST /v1/tokens/revoke: an administrator, authenticated by a site-CA client certificate, revokes a token id on this node. It is what the cascade tool calls on each node.
  • GET /v1/admin/tokens and POST /v1/admin/tokens/{token_id}/revoke, behind the new admin scope: list this node's tokens and revoke one of them.
  • GET /v1/status: the token_file block gains admin_tokens.
  • GET /v1/signoffs/record-types, behind the signoff scope: the distinct record types the sign-off records hold, which is what a filter's choices are built from.
  • GET /v1/status also gains scheduled_tasks (the state of each scheduled task), host_time_utc, time_sync and virtualization (the host's clock and what the host says about keeping it, with no verdict), coverage (when the Node was last known to be running, and its latest coverage gap) and schema_generation (whether the database's schema generation matches the engine's).
  • GET /v1/orders/{order_id}/trail gains coverage_gaps, the coverage gaps that overlap the order, and each entry of disagreements gains involves_this_node.
  • The responses of authenticated routes now declare the X-Token-Expires-At header in the description at GET /v1/openapi.json.

0.7.0

Nothing in the declared surface breaks. This release only adds to the public API: the alert routes and the scope that goes with them, and a new version of the MES Node Type.

Added

  • GET /v1/alerts, GET /v1/alerts/count, GET /v1/alerts/{alert_id} and POST /v1/alerts/{alert_id}/acknowledge, behind the new alerts scope: list the alerts a Node raised when a reading stayed outside a limit of a confirmed instruction, count those no one has acknowledged, read one, and record a person's acknowledgement of it. A token that carries the alerts scope always carries an expiry. See instruction conformance.

The MES Node Type is version 0.5.0

The MES Node Type gains the instruction_bindings section, so its version is now 0.5.0. A configuration is compared with the Node Type's version exactly, so each MES configuration must name 0.5.0 in node_type_version; one that still names 0.4.0 is refused as stale. A configuration that has no instruction_bindings section needs nothing else. The steps are in changelog actions.

0.8.0

Nothing in the declared surface breaks. This release only adds to the public API: a route that submits an approved case summary as a document, the document chunk-preview command, and a new version of the MES Node Type.

Added

  • POST /v1/signoffs/{record_id}/submit-as-document: a person submits an approved case summary as a past case, with a disposition they write, so that precedent retrieval can offer it. It needs a token that carries both the signoff and the documents scope; the description at GET /v1/openapi.json gives the first as x-required-scope and any further one in the new x-also-required-scopes. See submit an approved case summary as a document.
  • python3 -m engine.document_preview_cli, the document chunk-preview command: it shows how a document type would cut a file, connects to nothing and stores nothing. Its exit codes (0 to 3) and the names and meanings of its options are covered, and --json may only gain keys. See document chunk preview.

The MES Node Type is version 0.6.0

The MES Node Type gains the optional require_effective_range setting on a document type that keeps its revisions, so its version is now 0.6.0. A configuration is compared with the Node Type's version exactly, so each MES configuration must name 0.6.0 in node_type_version; one that still names 0.5.0 is refused as stale. A configuration that does not set require_effective_range needs nothing else, though a newer revision that arrives with no effective range is now stored with a warning instead of silently applying at every date. The steps are in changelog actions.

0.9.0

Nothing in the declared surface breaks. This release only adds to the public API: the routes and the Python function that carry a configuration to an appliance and back, and more that GET /v1/status and GET /v1/config say about the staged configuration.

Added

  • A configuration can be staged from a bundle built where the repository is reachable: POST /v1/config/bundle validates a bundle and stages it if it is valid, and the Python function build_config_bundle (with its result, ConfigBundleBuild) builds one from a ref of a git repository, for an appliance with no route to that repository. The route needs the configure scope. See the management API reference and the Python API reference.
  • POST /v1/config/rollback: swap the staged configuration with the prior one, if the prior is still valid. It needs the configure scope.
  • A draft configuration held on the appliance: GET /v1/config/draft reads it (every credential shown as a placeholder), PUT /v1/config/draft saves it, DELETE /v1/config/draft discards it, and POST /v1/config/draft/stage validates it and stages it. GET /v1/config/draft/export and POST /v1/config/draft/export give it back as a file, and as a starting-point file for the repository with no credential in it.
  • GET /v1/config/schema returns a Node Type's Configuration Schema, with its credential fields marked, and POST /v1/config/migration lists every schema problem of the staged configuration or the draft against the running Node Type. Neither writes.
  • POST /v1/config/assist turns a plain-language request into a checked change to the draft, on the site's own inference endpoint. It saves and stages only when asked, and the assistant is off where no inference endpoint is set.
  • GET /v1/status and GET /v1/config report more about the staged configuration: where it came from (source: a sync, a bundle, the draft or a rollback), when it was staged, whether its origin was stated or verified (provenance), and the one configuration it replaced (prior). GET /v1/config also reports the template or ref a draft started from (base) and whether the configuration is the repository's rather than a draft made on the appliance (in_repository). Each is a new key in an answer, so a client that ignores keys it does not know is unaffected.

Node Types

No Node Type changes its version. A field's help (a description in a Configuration Schema) is an annotation: it changes nothing a configuration means.

0.9.1

Nothing in the declared surface changes, and nothing breaks. This release exists because 0.9.0 was tagged in the private repository and never published: the review of its sync found a test that read an internal document, and a fix after a tag is a new release. Release 0.9.1 is the first to reach the public repository with everything 0.9.0 added, so every change listed under 0.9.0 above is published here, and the reference's "Since 0.9.0" on those names means 0.9.1 for anyone reading the public repository. The next release's changes begin at 0.9.1.

0.10.0

Nothing breaks. This release only adds to the public API.

Added

  • GET /v1/tokens/self: a token is told its own id and the scopes it carries, sorted, and nothing else. Any token may call it, as any token may rotate itself, so it needs no scope; it writes no Activity Log entry and its answer is never cached (Cache-Control: no-store). The scopes are advice to a client, which is the review page's use of it: every route still checks the token itself. See asking a token for its own scopes.

The MES Node Type is version 0.7.0

The MES Node Type's deviation_flagging, costing_variance, material_consumption and instruction_bindings sections can now read a field of each record beside an mqtt or database_log source, not only a node of an opcua server, so its version is now 0.7.0. Those four sections no longer require the opcua section; the keys that name an OPC UA node (node_id, and order_id where a check fixes one) are required only beside opcua; and new keys name the record fields (cycle_time_field, material_field, and field and time_field in an instruction binding). A configuration is compared with the Node Type's version exactly, so each MES configuration must name 0.7.0 in node_type_version; one that still names 0.6.0 is refused as stale. A configuration that reads an OPC UA server needs nothing else. The steps are in changelog actions.

No other Node Type changes its version.

0.11.0

One change to a covered command breaks a pipeline that gates on it, and the rest only adds to the public API.

Breaking

  • python -m engine.mapping_preview_cli now exits 1 for a rule that is never reached, which it did not report before, so a config that previewed clean can now preview with a gap. The same holds for the state of a PreviewReport, which is "gaps" where it was "clean". The meaning of exit code 1, a gap or a flagged event, is unchanged, and so is what a Node does with the config: a rule that is never reached has never run. A pipeline or script that fails a config unless the preview exits 0 now fails a config that passed before. To migrate, read the report's line for the rule (rule N is never reached: rule M matches every record it would, counted from 0) and move the more specific rule above the broader one, or delete the rule. A rule set with no catch-all prints a note and leaves the exit code alone.

Added

  • PreviewReport gains three fields, each with a default, so code that builds or reads a report is unaffected: dead_rules, the rules no record can reach as (position, shadowed_by) pairs counted from 0; dead_rules_omitted, how many of them the list left out; and no_catch_all, true for a rule set none of whose rules has an empty when. See a rule that is never reached.

Release: v0.11.0