Different pipes. One standard.

Начните вводить запрос.

Поиск работает прямо в браузере по статическому индексу, собранному вместе с сайтом (Pagefind). Ваш запрос никуда не отправляется.

Lock-файл

Описывает файл openflange.lock.yaml, который закрепляет за каждой ссылкой на пайп (шаг обработки данных) точное расположение, версию, ревизию и контрольную сумму. Запуск с lock-файлом не начнётся, если что-то отличается, поэтому тот же пайплайн завтра сделает то же самое.

Коротко

Идентификатор
openflange.org/lock/v0.1 — открывается по адресу https://openflange.org/lock/v0.1/
Статус
Экспериментально
Версия
v0.1 (документ 0.1.0-draft), последняя · все версии
Обновлено
Схемы
Связанные
Пайплайн · Реестр
Форматы
HTML (эта страница) · Открыть в формате Markdown (на английском) · лицензия CC BY 4.0

Нормативным является английский текст

Ниже приведена спецификация «OpenFlange Lockfile Specification» на языке оригинала — английском. Нормативную силу имеет только английский текст; краткое описание и подписи на этой странице носят справочный характер.

This specification defines openflange.lock.yaml, the file that records what each pipe reference of a project was resolved to: exact location, contract version, revision and an integrity hash. It defines how the hash is computed, how references are resolved and fetched safely, and what a locked run must verify.

This document is published at https://openflange.org/lock/v0.1. Its identifier, openflange.org/lock/v0.1, is that URL without the scheme, and is the value documents of this kind carry in spec:.

At a glance #

Minimal example #

The smallest valid lockfile with one local dependency (the hash is illustrative):

yaml
spec: openflange.org/lock/v0.1
dependencies:
  "./pipes/lowercase":
    resolved: pipes/lowercase
    version: 0.1.0
    integrity: sha256-2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae

1. Introduction #

Pipeline files refer to pipes flexibly: a version range, a branch, a registry name. A lockfile records what each of those references was resolved to — the exact location, the contract version, the revision and an integrity hash — so that the same pipeline runs the same code tomorrow, on another machine and in CI.

The lockfile is named openflange.lock.yaml. It is meant to be committed to version control.

1.1 Conventions #

The key words MUST, MUST NOT, REQUIRED, SHALL, SHALL NOT, SHOULD, SHOULD NOT, RECOMMENDED, MAY and OPTIONAL are to be interpreted as described in RFC 2119 and RFC 8174 when, and only when, they appear in capitals.

Fenced examples whose info string contains openflange:<kind> are normative and machine-checked against https://openflange.org/schemas/lock-v0.1.schema.json.

1.2 Citing this document #

Normative statements are cited by section number, for example lock/v0.1 §4.2, and numbered or bulleted rules within a section by their position, for example lock/v0.1 §4.2(3). Section numbers are stable within v0.1: sections are appended, never renumbered. Every heading has a stable fragment identifier derived from its text (lower-cased; characters other than letters, digits, spaces, hyphens and underscores removed; spaces replaced by hyphens), so a section is addressable as https://openflange.org/lock/v0.1#<fragment>. Cross-references to other OpenFlange specifications are absolute URLs of that form. This document does not rely on images; its diagrams are text.

2. Terminology and maturity #

The terms pipe, source, sink, pipeline, subpipeline, node, port, stream, run and dataset are defined in the Pipe specification, section 2; workflow is reserved and not used here. In this document:

  • reference — the value of a node's pipe key (Pipeline specification, section 4).
  • project root — the directory containing the lockfile.
  • resolution — turning a reference into an exact location and content.
  • locked run — a run that must not deviate from the lockfile.
Feature Maturity
Lockfile format (3) experimental
Integrity computation (4) experimental
Resolution of path, std:, git:, npm:, https: and registry references (5) experimental
pypi:, cran:, oci: recognised; resolution reports E_UNSUPPORTED in v0.1
Locked runs, resolve, update (6) experimental
Safe fetching rules (7) experimental

Nothing is stable or deprecated in v0.1.

3. Format #

yaml
spec: openflange.org/lock/v0.1
dependencies:
  "./pipes/lowercase":
    resolved: pipes/lowercase
    version: 0.1.0
    revision: null
    integrity: sha256-2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae
  "./pipes/mask-email":
    resolved: pipes/mask-email
    version: 0.1.0
    revision: null
    integrity: sha256-fcde2b2edba56bf408601fb721fe9b5c338d10ee429ea04fae5511b68fbf8fb9
  "std:filter@0.1":
    resolved: std:filter@0.1.0
    version: 0.1.0
    revision: null
    integrity: sha256-18ac3e7343f016890c510e93f935261169d9e3f565436429830faf0934f4f8e4
  "openflange/normalize-and-mask-email@^0.1":
    resolved: git:https://github.com/openflange/openflange-go#3f1c2b7a9d0e4f5a6b7c8d9e0f1a2b3c4d5e6f70:examples/email
    version: 0.1.2
    revision: 3f1c2b7a9d0e4f5a6b7c8d9e0f1a2b3c4d5e6f70
    integrity: sha256-3e23e8160039594a33894f6564e1b1348bbd7a0088d42c4acb73eeaed59c009d
    dependencies:
      - "./pipes/lowercase"
      - "./pipes/mask-email"
  "npm:@acme/geo-pipes@^2#pipes/geocode/OPENFLANGE.md":
    resolved: npm:@acme/geo-pipes@2.3.1#pipes/geocode/OPENFLANGE.md
    version: 2.3.1
    revision: 5d41402abc4b2a76b9719d911017c592
    integrity: sha256-ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb
  "https://pipes.example.com/v1/pipes/validate-email":
    resolved: https://pipes.example.com/v1/pipes/validate-email
    version: 0.1.0
    revision: 9f2c1e7
    integrity: sha256-252f10c83610ebca1a059c0bae8255eba2f95be4d1d7bcfa89d7248a82d9f111

(All hashes, commits and packages in this example are illustrative.)

The file is YAML, parsed with the safe YAML rules of the Pipe specification, section 4.2.

Key Meaning
spec REQUIRED. The constant openflange.org/lock/v0.1.
dependencies REQUIRED. Map from reference to lock entry.

Keys. The key is the reference exactly as written in the pipeline file, with one normalisation: a relative path reference is rewritten to be relative to the project root (still beginning with ./ or ../, with / separators), so that the same pipe referenced from pipeline files in different directories has one entry and different pipes never collide.

Entries.

Key Required Meaning
resolved yes The exact location: a path relative to the project root; std:<name>@<exact version>; npm:<pkg>@<exact version>[#subpath]; git:<url>#<full commit hash>[:subpath]; or the HTTPS URL of a remote pipe.
version yes The pipe's contract version, from its manifest or definition.
revision no The immutable revision where one exists: Git commit hash, npm dist shasum, the revision reported by a remote server; null otherwise.
integrity yes sha256-<64 lower-case hex digits> (section 4).
dependencies no The references of this pipe's own dependencies (the pipe values of a composite's nodes), each of which is itself a key of the lockfile. Relative references inside a fetched package are written relative to that package's root.

A tool writing a lockfile MUST write keys in a stable (sorted) order and MUST preserve x- extension keys. Entries no longer referenced SHOULD be pruned by resolve.

4. Integrity #

integrity is the SHA-256, in lower-case hexadecimal with the prefix sha256-, of a byte string that depends on the kind of dependency.

Packages (path, git:, npm:, registry). The hash covers the manifest and the implementation files it references:

  1. Collect the file set: the pipe's OPENFLANGE.md, plus every file its frontmatter references — implementation.path, a relative implementation.command[0], and every port schema.path. For a pipeline implementation this is the pipeline file; the pipes that pipeline uses are separate dependencies with their own entries.

  2. Express each file's path relative to the directory of the manifest, with / separators and no leading ./.

  3. Sort the paths by their UTF-8 byte sequences.

  4. For each file in order, append a length-prefixed record:

    text
    <path> 0x00 <length> 0x00 <content>

    where <path> is the path's UTF-8 bytes, <length> is the number of bytes of the file's content written in ASCII decimal with no sign, no leading zeros and no separators (0 for an empty file), and <content> is the file's bytes exactly as stored. Nothing is appended after the content.

  5. Hash the concatenation of all records.

The length prefix makes the encoding unambiguous: no choice of file names and contents can make two different file sets produce the same byte string.

Worked example. A package with two files (they are in the specification repository under examples/lock-integrity/, and the hash below is recomputed by the repository's checker). OPENFLANGE.md, 251 bytes, every line ending with a single LF:

markdown
---
spec: openflange.org/pipe/v0.1
id: double
version: 0.1.0
inputs:
  in: {}
outputs:
  out: {}
implementation:
  type: script
  language: starlark
  path: double.star
---
# Double

Implements the [OpenFlange](https://openflange.org/) specification.

double.star, 47 bytes:

python
def process(item, params):
    return item * 2

The file set is {OPENFLANGE.md, double.star}. Sorted by bytes, OPENFLANGE.md comes first (O is 0x4F, d is 0x64). The hash input is therefore, in order (331 bytes in total):

Bytes Content
13 OPENFLANGE.md
1 0x00
3 251
1 0x00
251 the bytes of OPENFLANGE.md
11 double.star
1 0x00
2 47
1 0x00
47 the bytes of double.star

and the lock entry's integrity is:

text
sha256-15d63b847e6f49f702c034416dbb06ec405c907576f0d452d32a4a8fc8bbf042

It can be reproduced with ordinary tools:

sh
{ printf 'OPENFLANGE.md\000251\000'; cat OPENFLANGE.md
  printf 'double.star\00047\000';   cat double.star; } | sha256sum

Files are hashed as bytes: no newline normalisation, no trimming. A referenced file that is missing or escapes the package root is an error (E_PATH), not an empty contribution.

Supporting files that the manifest does not reference (data read by a script, a node_modules tree) are not covered. For git: and npm: dependencies the revision pins them; for local paths nothing does, and authors who need them covered SHOULD reference them from the manifest.

Standard library (std:). The hash of the runner's canonical manifest file for that pipe, computed as above (a single record). It changes when the contract changes.

Remote pipes (https:). The SHA-256 of the served definition: the exact response body of GET {base}/pipes/{pipeId}. A remote contract version does not guarantee an immutable implementation; the server may redeploy without changing the definition. The runner records the revision the server reports, if any, and that is the most that can be pinned.

Local relative paths are locked by integrity only: there is no revision, and resolved is just the path.

5. Resolution #

openflange resolve (or an equivalent API) walks every pipeline file and composite manifest reachable from the project, and for each reference:

  1. Classifies it by form (Pipeline specification, section 4). An unrecognised form is E_REF; pypi:, cran: and oci: are E_UNSUPPORTED.
  2. Resolves it to an exact location:
    • path — the directory or manifest, after path-safety checks;
    • std: — the highest standard-library version the runner implements that satisfies the range;
    • registry — through the configured index (Registry specification, section 8), to a git:, npm: or https: location; the registry's manifest integrity is verified;
    • git: — the ref is resolved to a full commit hash; without a ref, the default branch's head at resolution time;
    • npm: — the highest published version satisfying the range; the package tarball is fetched and unpacked without running lifecycle scripts;
    • https: — the definition is fetched.
  3. Reads the manifest, validates it, and computes version, revision and integrity.
  4. Recurses into composite pipes, recording their references under dependencies.

Rules:

  • Consistency. Within one lockfile a reference key resolves to exactly one entry. Transitive and local dependencies are resolved by the same procedure as direct ones.
  • Cycles. A composite that directly or transitively depends on itself is E_CYCLE.
  • Completion, not churn. resolve keeps existing entries that are still valid (the reference is unchanged and, for local paths, the integrity still matches) and adds missing ones. It does not move a locked dependency to a newer version.
  • openflange update [ref] re-resolves every entry, or only the named reference and the entries reachable only through it, to the newest versions the references allow.
  • A runner MUST check before execution that it can actually run what was resolved (adapter, language, features) and report E_UNSUPPORTED otherwise; resolving a reference does not imply being able to execute it.

Where the lockfile lives: next to the pipeline file or manifest being run, or in the nearest ancestor directory that contains one. Resolved packages are kept in a cache outside the project; the cache is not part of this specification and MUST NOT be needed to interpret a lockfile.

6. Locked runs #

openflange run --locked (and equivalent APIs):

  • every reference encountered MUST have an entry — otherwise E_LOCK;
  • the content obtained for each entry MUST hash to its integrity — otherwise E_LOCK; this includes local paths (a locally edited pipe fails a locked run until resolve or update is run);
  • no reference is re-resolved: no registry lookup, no range evaluation, no branch lookup. Content may be fetched from the exact resolved location if it is not cached;
  • for a remote pipe, the definition fetched at run time MUST hash to integrity; if the server now reports a different revision, the runner MUST warn, and MAY be configured to fail (E_LOCK);
  • a lockfile that is malformed, or whose spec is not supported, is E_LOCK.

Without --locked, a runner uses lock entries when present and valid, resolves what is missing, and SHOULD say when it had to resolve something that was not locked. It MUST NOT silently rewrite the lockfile during run.

7. Security considerations #

Resolution fetches and unpacks content chosen by untrusted references. A resolver MUST:

  • Bound every fetch in size and time, and bound unpacked size and file count.
  • Use HTTPS only; plain HTTP is permitted for loopback addresses.
  • Prevent SSRF: refuse private, loopback, link-local and other non-public address ranges (checked on the connected address), unless the user addressed such a host explicitly; and not follow redirects to such ranges, to another scheme, or — with credentials — to another host.
  • Never run package lifecycle scripts: npm installs use --ignore-scripts (or an equivalent that does not execute package code); Git checkouts run no hooks, filters or submodule commands from the repository; nothing is built.
  • Prevent path traversal during unpacking: reject archive entries with absolute paths, .. segments or symbolic links pointing outside the destination; apply the package-root rules of the Pipe specification to every manifest path.
  • Treat fetched manifests as malicious until validated: safe YAML, size limit, schema validation, before anything else is read.
  • Keep secrets out of the lockfile: resolved URLs MUST NOT contain credentials; registry and Git credentials come from the user's configuration and are sent only to the host they belong to.
  • Resist resource exhaustion: bound recursion depth and the number of dependencies.

Limits of what a lockfile gives:

  • Integrity proves that content is unchanged, not that it is safe. Permissions are still enforce-or-refuse at run time, a subprocess is still not a sandbox, and trusted mode still grants real authority.
  • A remote pipe's implementation is not pinned (section 4).
  • Unreferenced supporting files of local pipes are not covered.

8. Compatibility and versioning #

  • The format is identified by openflange.org/lock/v0.1 in spec. A tool MUST refuse (E_LOCK) a lockfile whose spec it does not support rather than guess.
  • Tools MUST preserve entries and x- keys they do not understand when rewriting.
  • A change to the integrity computation is a new lock spec version; lockfiles are regenerated with openflange update.
  • While experimental, a later 0.x version MAY change incompatibly, with a CHANGELOG.md entry.

See COMPATIBILITY.md in the specification repository.

9. Deferred #

Not part of v0.1: signatures and provenance attestations; multiple integrity algorithms; lockfile entries for pypi:, cran: and oci: distributions; workspaces with several lockfiles; vendoring commands; hashing of whole package trees; WASM artifacts. Execution-related deferrals (event-time watermarks, session windows, checkpointing, distributed scheduling, reconnect, dynamic ports) are listed in the Pipeline specification and do not affect the lockfile.

Источник: specs/lock/v0.1.md в репозитории спецификаций. Ключевые слова, такие как MUST и SHOULD, используются в значении, определённом в RFC 2119.