Sentinel repository goldens#

Goldens are reviewed typed results that Sentinel compares with the output of the candidate, the installed SDK under test. They live in tests/sentinel/goldens/, together with historical SQLite databases that the current reader must still decode. Ordinary Sentinel runs read the catalog and never change it. Only the goldens commands on this page write it.

The Sentinel guide describes how a run uses goldens, and its glossary defines the Sentinel terms used here, such as case, variant, snapshot, cell, build tuple, shard and tuple file. The Sentinel reference describes the run’s evidence files. Paths on this page are relative to the ovclash directory.

What the ZIP files represent#

A golden is the reviewed expected result of one Sentinel case, variant and snapshot, for one set of frozen inputs and one build tuple. Sentinel captures the candidate’s typed result and compares it with that golden. Goldens are neither performance measurements nor the budgets of KPI, the performance benchmark.

The catalog keeps selection separate from storage:

Path in tests/sentinel/goldens/

Format

Required

Contents

manifest.json

JSON

Yes

Root catalog. Lists the input families, the tuple files and provenance.json with their revisions, and the historical database entries; see catalog files.

inputs/<family>.json

JSON

One per family that manifest.json lists

Frozen inputs of one case family, such as options or reports. Ten families exist.

expectations/<platform>-<architecture>-<backend>-<configuration>.json

JSON

One per approved build tuple

The tuple file, for example linux-x86_64-ovstage-release.json. Each row maps a case, variant and snapshot to an input profile, a provenance record and a typed bundle.

provenance.json

JSON

Yes

The generating revision and tool and the review reason of each review record. Attribution only.

engine/<scenario>/result_NNN.zip

ZIP

Each one that a row references

Immutable typed engine results. One ZIP can serve many rows.

databases/<folder>/

Directory

One per database entry of manifest.json

One historical fixture: historical.ovclashdb, its reviewed expected/ records and, for a live fixture, live.json.

An engine ZIP holds these members at its root:

Member

Format

Required

Contents

manifest.json

JSON

Yes

The bundle’s schema_version and required_cases. This is not the catalog’s manifest.json.

records.jsonl

JSON Lines

Yes

Expected typed records: field names, types, shapes, nullness, and values or payload references.

payloads/

Binary files

No

Exact binary data that the records reference.

The scenario folder is the case ID without its engine- prefix, in lowercase, with every run of other characters replaced by _, at most 64 characters long. For example, engine-optimization-fresh-schedulers stores its results in engine/optimization_fresh_schedulers/.

  • The archive number is a storage label. It is not a revision, a run order or an acceptance order.

  • A ZIP name does not identify the platform, backend, configuration or variant it serves. Follow the bundle path of the golden row.

  • Rows for different variants, schedulers and build tuples share one ZIP when their expected contents are identical. Each row is still approved separately.

Catalog files#

Every catalog file holds exactly the fields that its table lists, and readers reject any other field. The root manifest.json (schema 2) lists every shard with its revision:

{
  "schema_version": 2,
  "input_families": [{"family": "options", "path": "inputs/options.json", "revision": 4}],
  "expectations": [
    {
      "axes": {"architecture": "x86_64", "backend": "ovstage", "configuration": "Release", "platform": "linux"},
      "path": "expectations/linux-x86_64-ovstage-release.json",
      "revision": 5
    }
  ],
  "provenance": {"path": "provenance.json", "revision": 33},
  "databases": [{"id": "historical-synthetic", "database": "databases/historical_synthetic/historical.ovclashdb", "...": "..."}]
}

Field

Type

Required

Default or values

Description

schema_version

integer

Yes

2; the loader also accepts 3

Catalog schema.

input_families

array of objects

Yes

One per family, each with family (a family name), path (inputs/<family>.json) and revision

The input family shards.

expectations

array of objects

Yes

One per approved build tuple, each with axes, path (the tuple file) and revision

The tuple file shards.

provenance

object

Yes

path (provenance.json) and revision

The provenance shard.

databases

array of objects

Yes

One per historical fixture; see import historical databases

The historical database entries.

A shard revision is a positive integer. axes holds exactly platform (windows or linux), architecture (x86_64 or aarch64), backend (ovstage or openusd) and configuration (Release or Debug).

A tuple file holds one engine row per approved snapshot:

{
  "bundle": "engine/reports_floating_point/result_005.zip",
  "case_id": "engine-reports-floating-point",
  "id": "engine-0004298dee1c4f3fab05d79dbca50039",
  "input": "reports/mesh_static_028",
  "provenance": "review_014",
  "snapshot": "snapshot_bundles.oracle",
  "variant": "mesh-static"
}

Field

Type

Required

Default or values

Description

schema_version

integer

Yes

Equal to the root’s

Catalog schema.

revision

integer

Yes

Equal to the root’s descriptor

Shard revision.

axes

object

Yes

Equal to the root’s descriptor

The build tuple.

engine

array of objects

Yes

The golden rows.

Each golden row holds:

Field

Type

Required

Default or values

Description

id

string

Yes

Unique in the catalog

Stable entry identifier. Replacing a golden keeps it.

case_id

string

Yes

A case ID that FAMILY_CASES maps

The case.

variant

string

Yes

The case variant.

snapshot

string

Yes

Such as snapshot_bundles.oracle

The snapshot that the row approves.

input

string

Yes

<family>/<profile>, where <family> is the case’s family

The frozen input profile in inputs/<family>.json.

bundle

string

Yes

A path relative to the catalog

The ZIP that holds the expected typed result.

provenance

string

Yes

A key of provenance.json

The review record.

An input family file holds common_inputs shared by all its profiles and one entry per profile:

{
  "family": "options",
  "schema_version": 2,
  "revision": 4,
  "common_inputs": {"api_surface": "canonical", "state_sequence": "fresh"},
  "profiles": {
    "any_hit_all_001": {
      "derive": ["seed", "task_count", "detection_mode"],
      "values": {"fixture": {"generator": "options", "kind": "generated", "recipe": "any-hit-all", "seed": 0, "version": 1}, "...": "..."}
    }
  }
}

Field

Type

Required

Default or values

Description

schema_version

integer

Yes

Equal to the root’s

Catalog schema.

revision

integer

Yes

Equal to the root’s descriptor

Shard revision.

family

string

Yes

The family name of the root’s descriptor

The case family.

common_inputs

object

Yes

Only api_surface and state_sequence, each optional

Inputs shared by every profile. A profile must not repeat them.

profiles

object

Yes

Profile ID to an object with exactly values (object) and derive (array of strings)

The frozen input profiles.

values stores the frozen inputs: fixture, scopes, settings, timeline, actions, report mask, floating-point mode and the optional identity fields. derive names the fields, out of seed, task_count and detection_mode, that loading reconstructs from saved values; see catalog identity and storage. A profile ID starts with a letter or digit and holds only letters, digits, _ and -.

provenance.json holds schema_version, revision and entries, an object that maps each review record, such as review_014, to exactly these fields:

Field

Type

Required

Default or values

Description

generated_by

object

Yes

Exactly commit and tool, both nonempty strings

Who generated the reviewed results.

review_reason

string

Yes

Nonempty

What was reviewed.

The catalog is published source and names no commit, CI job, pipeline or merge request of the internal history: commit is verified-source for a verified clean candidate build, and a review reason describes what was reviewed instead of where it ran.

Rows per tuple file:

Tuple

Rows

Windows or Linux x86-64, ovstage, Release or Debug

1003

Windows or Linux x86-64, OpenUSD, Release or Debug

819

Linux AArch64, ovstage, Release or Debug

811

Linux AArch64, OpenUSD, Release or Debug

627

The twelve files hold 10,164 rows. The counts change whenever goldens are added or retired.

The loader also accepts schema 3, a catalog with one expectations.json shared by every tuple. No command creates one, and the repository catalog uses schema 2.

Understand a golden failure#

Independent checks verify a case’s geometry or API contract, and serialization checks verify round trips. A golden comparison asks only whether the candidate still produces the reviewed typed result. Passing one kind of check does not excuse a failure in the other.

Golden status

Meaning

Next step

PASS

The candidate’s typed result matches the selected golden.

None for this snapshot. The run passes only when all its other checks pass too.

MISSING

No golden exists for this identity and build tuple.

Review the candidate run, then propose only the intended additions. Never copy another tuple’s golden.

DIFFERENT

A golden exists, and the typed contents differ.

Read the differences. Decide whether this is a regression or an intended behavior change before you accept a replacement.

INVALID

A bundle cannot be decoded or breaks the typed contract, for example with a missing or extra field.

Check invalid_side to find the malformed bundle. goldens propose rejects any run with an INVALID comparison, so no proposal can replace that bundle.

A run’s golden_status is its most severe comparison status, in the order INVALID, DIFFERENT, MISSING, PASS.

A golden-only failure prints no failed check line: every engine cell passes, and so does Engine completion. The Sentinel guide shows the console output. To find the failing snapshots, open <evidence>/gate-summary.json, where <evidence> is the run’s evidence/ directory. Each golden_snapshots entry holds:

Field

Type

Required

Default or values

Description

cell

object

Yes

The frozen cell, including case_id, variant and id.

snapshot

string

Yes

Such as snapshot_bundles.oracle

The compared snapshot.

status

string

Yes

PASS, MISSING, DIFFERENT, INVALID

The comparison result.

actual

string

Yes

An absolute path

The candidate’s typed bundle.

differences

array of objects

Yes

Empty for PASS

The typed differences.

reason

string

Only when no golden exists

Why no golden was found, for MISSING and for INVALID without a golden.

invalid_side

string

Only for INVALID

actual, expected

The malformed bundle.

Each difference holds these fields, all required:

Field

Type

Required

Default or values

Description

case

string

Yes

A case ID, or <bundle> for a difference of no single record

The case of the differing record

entity

string

Yes

A record entity, or <bundle>

The kind of the differing record

occurrence

integer

Yes

0 or more; 0 for a difference of no single record

Which record of that case and entity

field

string

Yes

A field name, or a marker such as <record>, <case> or <inventory>

The differing field

element

integer or null

Yes

An array index, or null

The differing element of an array field

expected, actual

any JSON type

Yes

The golden’s value and the candidate’s value

reason

string

Yes

Such as payload bits changed

Why the values differ; the reasons below decide the status

A difference with one of these reasons makes a comparison DIFFERENT; any other reason makes it INVALID:

  • case contract changed

  • missing or extra record occurrence

  • ID policy changed

  • field policy changed

  • type/shape/count/null changed

  • parent identity changed

  • payload bits changed

A malformed candidate bundle fails its engine cell outright. An INVALID comparison in a completed run therefore has invalid_side set to expected and points at the stored golden.

This script, run from the run’s results directory, prints the run’s statuses and every snapshot that did not pass:

import json

with open("evidence/gate-summary.json", encoding="utf-8") as stream:
    report = json.load(stream)
print("checks:", report.get("checks_status"), "goldens:", report.get("golden_status"))
print("golden update error:", report.get("golden_update_error"))
for snapshot in report.get("golden_snapshots", []):
    if snapshot["status"] != "PASS":
        cell = snapshot["cell"]
        print(snapshot["status"], cell["case_id"], cell["variant"], snapshot["snapshot"], len(snapshot["differences"]))

For a golden-only failure of a changed depth case, it prints lines like these, where <variant> is the variant ID and <count> the number of typed differences:

checks: PASS goldens: DIFFERENT
golden update error: None
DIFFERENT engine-options-depth <variant> snapshot_bundles.snapshot <count>

<evidence>/junit.xml, the CI test report, marks each engine cell whose golden status is not PASS as failed.

Comparison has no numerical tolerance. A changed nbCollidingSegments value or array shape is a change in correctness output, not noise. Each of the twelve build tuples has its own goldens, and a proposal covers only the tuple of the run it comes from. A new case therefore needs an accepted golden from a run of every tuple; see changes that affect tuples you cannot run.

Do not regenerate or accept every current output just to make a run pass. Review the frozen inputs and the implementation change, keep unaffected goldens, and use the proposal and acceptance workflow. A run whose only failures are MISSING or DIFFERENT comparisons can supply a proposal, and writes a proposal of its changed snapshots to golden-proposal/. That eligibility does not approve its output.

Catalog identity and storage#

A golden’s identity is its case ID, variant, snapshot, frozen inputs and build axes. Sentinel reads the candidate’s platform, architecture, backend and configuration from the verified build manifest and loads only the tuple file of that exact tuple. There is no fallback to another tuple or to current output. The twelve approved tuples are Windows x86-64, Linux x86-64 and Linux AArch64, each with both backends, ovstage and OpenUSD, in Release and Debug.

A tuple without a tuple file still runs every independent engine and serialization check, including the historical database reads. It records every golden comparison as MISSING, so the run fails until results for that tuple are accepted. A malformed catalog or an inconsistent selected shard fails the run before any comparison.

Input families store the approved inputs as facts. They do not follow later edits to tests/sentinel/engine_cases.json or to setting defaults. A changed input gives the candidate a new identity, which has no golden yet. Loading derives only three fields from saved values: seed from the fixture, and task_count and detection_mode from the settings. tests/sentinel/golden_inputs.py defines these derivations.

For canonical cells, the resolved_settings mapping is not part of the identity. A change that affects only the mapping therefore needs no new golden. The run still checks the mapping against the requested and effective native settings it captures. Suite cells, the cells of a case that drives the Suite API, keep resolved_suite in their identity.

FAMILY_CASES in tests/sentinel/golden_catalog.py assigns every case ID to an input family. Add a new case there before you accept its results. Otherwise goldens accept fails with Unmapped golden case: <case>.

The two native floating-point cases, engine-reports-floating-point and engine-reports-floating-point-kernel0, check all eight runtime snapshots. Each backend compares only four representatives with goldens: sync, alternate, oracle and matched. Independent checks require each of the other four snapshots to equal its representative; see the floating-point matrix. Snapshots with the same names in other cases are not aliases and keep their own comparisons. Reports list the runtime checks in snapshot_checks and required_snapshot_checks, and the golden comparisons in golden_snapshots and required_golden_snapshots.

Comparison extracts each ZIP into its own sentinel-golden-* directory under _build/test_tmp, or under OVCLASH_TEST_TEMP_ROOT when it is set. It removes only that directory afterwards. It compares the case list, record occurrences, ID and field policies, types, shapes, counts, nullness, parent identities and payload bits. For records with generated IDs, such as those read from a live fixture, the ID value is not compared, and each generated timestamp must lie inside the recorded generation window.

Storage rules:

  • Catalog metadata is JSON with LF line endings, below 1,048,576 bytes per file, stored in ordinary Git.

  • A publish writes each new or changed metadata file as compact, deterministic JSON. A file whose value does not change keeps its bytes, so an indented shard stays indented until its content changes.

  • Engine ZIPs are deterministic and stored as ordinary Git binary files. Payloads and historical databases keep their exact bytes.

  • Paths are relative to the catalog.

  • generated_by and the review reason are attribution only. They select no source checkout or SDK, and no fingerprint or receipt authenticates any file.

Propose and accept results#

Before you begin, you need the Python runtime of an existing build or staged portable input bundle; the goldens commands never start a build. Run them from ovclash, with test_sentinel.bat on Windows or ./test_sentinel.sh on Linux. Every example on this page uses test_sentinel.bat; on Linux, replace it with ./test_sentinel.sh and keep the arguments.

In the commands, RUN is the results directory or the report of a completed run, CASE an engine case ID such as engine-options-depth, PROPOSAL a new directory outside the catalog, such as _build/proposal-depth, and OTHER_PROPOSAL a second proposal, such as the one of another build tuple.

A run that fails only on MISSING or DIFFERENT comparisons has already written a proposal of those snapshots, and its console names the accept command for it; see the proposal of a golden-only failure. Use propose to select other snapshots or to propose from a saved run.

Windows (cmd.exe):

test_sentinel.bat goldens propose --from-run RUN --case CASE --output PROPOSAL
test_sentinel.bat goldens propose --from-run RUN --all --output PROPOSAL
test_sentinel.bat goldens propose --from-run RUN --changed --output PROPOSAL
test_sentinel.bat goldens accept --proposal PROPOSAL --reason "Reviewed intentional change"
test_sentinel.bat goldens accept --proposal PROPOSAL --proposal OTHER_PROPOSAL --reason "Reviewed intentional change"

Linux:

./test_sentinel.sh goldens propose --from-run RUN --case CASE --output PROPOSAL
./test_sentinel.sh goldens propose --from-run RUN --all --output PROPOSAL
./test_sentinel.sh goldens propose --from-run RUN --changed --output PROPOSAL
./test_sentinel.sh goldens accept --proposal PROPOSAL --reason "Reviewed intentional change"
./test_sentinel.sh goldens accept --proposal PROPOSAL --proposal OTHER_PROPOSAL --reason "Reviewed intentional change"

The three propose commands are alternatives: propose named cases, every eligible case, or only the MISSING and DIFFERENT snapshots. The two accept commands are alternatives too: accept one proposal, or several, such as one per build tuple, in one catalog update. A failed command prints Golden update failed: <error> and exits 1; invalid arguments exit 2.

Propose#

propose selects snapshots from a completed run and copies their typed bundles into a review directory. It never edits the catalog.

  • Repeat --case to select every snapshot of several cases, or use --all for every snapshot of every eligible case. --changed selects every MISSING and DIFFERENT snapshot and nothing that passed, so the accepted entries of unchanged snapshots keep their review reason; it fails when the run has no such snapshot.

  • --output must be a directory that does not exist yet, outside the catalog.

  • --from-run takes the combined report or a results directory. In a directory, it uses the first of evidence/gate-summary.json, gate-summary.json, summary.json, evidence/differential/summary.json and differential/summary.json that exists. When it selects a differential summary.json and an enclosing gate-summary.json exists, it uses that instead, so a child report cannot hide the controller’s failure. An engine-only report is not enough.

A run can supply a proposal only when all of these hold:

  • The run completed, and every serialization execution and planned engine cell passed its independent checks.

  • The runtime snapshot-check and golden-comparison ledgers agree between the cells, the engine report and the combined report.

  • Every golden comparison is PASS, MISSING or DIFFERENT, and the run status is PASS only when all of them are PASS.

  • Repeated inputs produced equal typed results.

Failed controls, timeouts, INVALID comparisons and incomplete runs are not eligible. When the independent checks pass but the run is still not eligible, evidence/gate-summary.json sets checks_status to FAIL and records the reason in golden_update_error. Floating-point proposals accept only the representative snapshots. eligible_run_snapshots in tests/sentinel/goldens.py holds the exact run checks.

propose prints the path of the new proposal.json. The proposal directory holds:

File

Contents

proposal.json

The proposal that accept reads.

differences.json

An array with each entry’s identity and typed differences.

summary.md

One line per entry: case, snapshot and previous status.

bundles/NNNN/

The selected typed bundles. Identical bundles are stored once.

proposal.json holds:

Field

Type

Required

Default or values

Description

schema_version

integer

Yes

2

Proposal schema. accept refuses any other version.

from_run

string

Yes

The report that the proposal came from.

generated_by

object

Yes

commit (the candidate revision) and tool (sentinel)

Attribution of the proposed results.

entries

array of objects

Yes

Nonempty

One entry per selected snapshot.

relocation

object

No

original_run_root and local_run_root

Present when --original-run-root was used.

Each entry of entries holds these fields, all required:

Field

Type

Required

Default or values

Description

cell

object

Yes

The run’s frozen cell, including case_id, variant and id

The cell that produced the snapshot

snapshot

string

Yes

Such as snapshot_bundles.oracle

The proposed snapshot

identity

object

Yes

Projected from the cell’s frozen inputs and axes

The catalog identity. accept recomputes it and refuses a mismatch

bundle

string

Yes

A bundles/NNNN path inside the proposal

The proposed typed bundle

previous_status

string

Yes

PASS, MISSING or DIFFERENT

The run’s comparison status

differences

array of objects

Yes

The run’s typed differences; empty for PASS

The differences to review; see understand a golden failure

For example, summary.md of a proposal for a changed depth case reads:

# Sentinel golden proposal

Review the typed differences before accepting.

- engine-options-depth / snapshot_bundles.snapshot: DIFFERENT

The proposal of a golden-only failure#

When every independent check of a run passes and its only failures are MISSING or DIFFERENT comparisons, the run proposes those snapshots itself, as goldens propose --changed would, into golden-proposal/ beside evidence/ in its results directory. The verdict stays FAIL. After the Sentinel summary block the console prints the proposal’s path, its snapshot count per status and the accept command:

Golden proposal: <results>/golden-proposal (1 DIFFERENT, 2 MISSING)
  It covers this run's build tuple only. Review its summary.md and differences.json; to accept
  an intended change, run from ovclash:
  test_sentinel.bat goldens accept --proposal "<results>/golden-proposal" --reason "<what changed and why>"

A proposal that cannot be written, for example because golden-proposal/ already exists, prints WARN Golden proposal not written: <error> and leaves the verdict unchanged. A proposal holds its own copy of every selected bundle, so another machine can accept it without the run’s evidence.

Accept#

Review summary.md, differences.json, the case behavior and the implementation change before you accept. accept takes one or more proposals, such as one per build tuple, and publishes them in one catalog update. It:

  • refuses an identity that two selected proposals both hold;

  • checks the typed structure of each bundle;

  • takes the catalog writer lock;

  • replaces the catalog entry with the same identity, or adds a new one;

  • records the review reason on every accepted entry;

  • records verified-source as generated_by.commit when the candidate was a verified clean build, whose 40-digit source revision only the proposal keeps; any other candidate identity, such as unversioned-sdk-sha256:<digest> of an unversioned SDK, is recorded as it is. A candidate revision that is an abbreviated commit ID (7 to 39 hexadecimal digits with at least one letter and one digit) is refused with Candidate revision must not be a commit ID; the catalog is published source before anything is written, as add-database refuses a commit-like writer revision;

  • reuses a ZIP that the catalog already references, or that this update already added, when its bundle manifest.json fields, records.jsonl bytes and payload bytes are identical;

  • otherwise writes the lowest unused result_NNN.zip in the case’s scenario folder.

It never overwrites a stored ZIP, never removes an unreferenced one and never changes historical databases. Unreferenced ZIPs are never reused. It prints the number of accepted entries and the catalog root:

{'updated': 4, 'manifest': '<ovclash>/tests/sentinel/goldens/manifest.json'}

Include the resulting catalog and data changes in normal code review. Proposals trust the local reports: they neither rerun semantic checks nor authenticate saved results directories.

Propose from a run on another machine#

A run on another machine, such as a CI job, can supply a proposal for its own tuple. Its MISSING or DIFFERENT comparisons fail the run, and its complete independent checks are the evidence that goldens propose needs. Do not copy another tuple’s goldens to make the first run pass. Before you begin, you need a local build or staged bundle whose Python runtime the goldens commands can use, and either the run’s golden-proposal/ directory or its complete evidence/ directory.

When the run left a golden-proposal/ directory, copy that directory and accept it as it is; it needs no relocation. Keep it with the proposals of the other affected tuples and accept them together.

To propose from the evidence instead, for example to select other snapshots:

  1. Copy the run’s complete evidence/ directory, including gate-summary.json, to the machine where you propose. Run Sentinel in CI lists what a CI job keeps. EVIDENCE is the copied directory. A copy without gate-summary.json or a recorded bundle makes goldens propose print Golden update failed: <error> and exit 1; copy the whole directory again.

  2. Find the recorded root. The report records absolute bundle paths from the machine that ran it. RECORDED_ROOT is the part of each actual path before its differential component. From the copied evidence/ directory, run this with any Python 3:

    import json
    import re
    
    with open("gate-summary.json", encoding="utf-8") as stream:
        actual = json.load(stream)["golden_snapshots"][0]["actual"]
    print(re.split(r"[\\/]differential[\\/]", actual)[0])
    

    It prints RECORDED_ROOT.

  3. Propose from ovclash with the copied directory and its recorded root. Windows:

    test_sentinel.bat goldens propose --from-run EVIDENCE --original-run-root RECORDED_ROOT --case engine-options-depth --output _build/proposal-linux-ovstage-release
    

    Linux:

    ./test_sentinel.sh goldens propose --from-run EVIDENCE --original-run-root RECORDED_ROOT --case engine-options-depth --output _build/proposal-linux-ovstage-release
    
  4. Review summary.md and differences.json in the proposal directory.

  5. Accept the proposal with a reason that names the change.

  6. Repeat steps 1 to 5 for every affected tuple.

  7. Run goldens verify --report _build/goldens-verify.json.

The catalog is consistent when goldens verify prints a verification-only: PASS line; see verify and recover a catalog.

With --original-run-root:

  • --from-run must be the directory that contains the report.

  • Only bundle paths are remapped. Each recorded path must be absolute and lie under the original root, and its mapped path must stay inside the copied directory. Any mismatch fails without trying the original location.

  • Recorded POSIX, drive-letter and UNC (Windows network share) paths keep their own syntax, so a Linux run can be reviewed on Windows.

  • proposal.json records both roots in its relocation object.

Without --original-run-root, absolute actual paths are used as recorded, and relative ones resolve against the report’s directory.

Changes that affect tuples you cannot run#

Each of the twelve build tuples has its own tuple file, and a proposal covers only the tuple of the run it comes from. A change that alters a typed result, changes a frozen input or adds a case therefore needs an accepted result from a run of every affected tuple. When you can run all of them, follow propose and accept results for each.

When you can run only some of them, for example only Linux x86-64 ovstage Release, follow these steps. Before you begin, you need a source checkout of the change and, for each tuple that you can run, a local build or staged bundle whose Python runtime the goldens commands can use, as in propose and accept results.

  1. Run Sentinel on every affected tuple you can run.

  2. Collect the proposal of each run: the golden-proposal/ that a golden-only failure wrote, as in the proposal of a golden-only failure, or one you propose from the run, as in propose.

  3. Accept the reviewed proposals together in one accept, with one --proposal per run, as in accept.

  4. Leave the tuple files of the other tuples unchanged. Never copy, edit or derive their rows from a tuple you ran: Sentinel loads only the exact tuple’s file, and a copied row is no evidence for that tuple.

  5. Submit the change with the catalog updates of the tuples you ran.

  6. In the change description, name the tuples you ran and the tuples that still need results.

  7. In the change description, list the entries of each proposal’s summary.md, so that reviewers know which comparisons to expect on the other tuples.

Your part is complete when goldens verify prints a verification-only: PASS line and the change description names every tuple that still needs results.

Until a run of a remaining tuple supplies its results, Sentinel on that tuple still runs every independent check and records:

  • MISSING for a new case or a changed frozen input: the new identity has no golden yet;

  • DIFFERENT for an existing identity whose typed result changed.

Either status fails that tuple’s run, but the run stays eligible for a proposal when every independent check passed. Someone who can run the tuple then proposes from that run, reviews the differences against your description, accepts them and runs goldens verify. A run with a failed independent check or an INVALID comparison cannot supply a proposal: that is a defect to fix, not a result to accept.

Verify and recover a catalog#

Before you begin, you need the Python runtime of an existing build or staged portable input bundle, as for propose and accept results. The two commands are independent: verify checks the catalog, and recover finishes or undoes an interrupted publication. From ovclash:

Windows (cmd.exe):

test_sentinel.bat goldens verify --report _build/goldens-verify.json
test_sentinel.bat goldens recover

Linux:

./test_sentinel.sh goldens verify --report _build/goldens-verify.json
./test_sentinel.sh goldens recover

verify checks the complete catalog without changing it:

  • every shard and reference, every referenced typed bundle and the representative set of each floating-point case;

  • for each historical database: the declared schema, SQLite quick_check, the typed structure of the expected bundle and a readable live manifest;

  • that rewriting the catalog would change no reference or revision.

It runs no reader; the next normal run checks decoding. It writes only the --report JSON, which must be outside the catalog. A relative --report resolves against the current directory, and _build/ is ignored by Git. A passing check prints one line:

verification-only: PASS; engine 10164 -> 10164; retired 0; publication unchanged; report: <ovclash>/_build/goldens-verify.json

accept, add-database, migrate --write and compact --write are the only commands that publish catalog changes. Each of them:

  1. takes exclusive ownership through .catalog-writer.lock and creates .catalog-transaction/;

  2. reloads the complete catalog;

  3. renders the changed metadata, incrementing the revision of each changed shard by one;

  4. stages that metadata and backups of the replaced files in .catalog-transaction/;

  5. replaces manifest.json last, as the commit point.

Git ignores both the lock file and the transaction directory. A revision is a positive integer that keeps the root and its shards coherent. It is not a Git pin, a content hash or authentication. Readers reject a pending transaction and mismatched shard revisions.

After an interrupted publication, every read fails with Pending catalog transaction; run goldens recover --golden-root "<catalog>". recover then prints one outcome:

Outcome

Meaning

no pending transaction

Nothing to recover.

discarded incomplete preparation

The writer stopped before it journaled any change.

rolled back

The root was not replaced; the replaced files are restored.

committed

The root was replaced; only the cleanup is finished.

recover changes files only to finish or undo such a publication. Ordinary runs never write or recover the catalog.

goldens migrate converts a schema 1 catalog to schema 2. goldens compact converts loose engine bundle directories to ZIP archives. Both require --report and only audit unless --write is given. Review the audit report before you rerun with --write. accept, add-database and compact refuse a schema 1 catalog until migrate --write converts it. The repository catalog already uses schema 2 and ZIP storage, so these commands matter only for an older catalog. compact prints compaction: PASS; files <before> -> <after>; bytes <before> -> <after>; publication <state>; report: <path>.

Import historical databases#

Before you begin, you need a real database written by a historical writer, its reviewed decoded records as a typed bundle and a metadata file that describes both, and the Python runtime of an existing build or staged portable input bundle. In the command:

  • OLD.ovclashdb is the closed database file;

  • EXPECTED_BUNDLE is the typed bundle of its reviewed decoded records;

  • METADATA.json is the metadata file that this section describes;

  • FIXTURE is the new fixture ID, such as historical-synthetic;

  • VERSION is the writer’s ovclash version, such as 0.2.0;

  • REVISION is the writer revision, such as verified-source.

From ovclash, on Windows (cmd.exe):

test_sentinel.bat goldens add-database --database OLD.ovclashdb --expected EXPECTED_BUNDLE --metadata METADATA.json --fixture-id FIXTURE --writer-version VERSION --writer-revision REVISION --reason "Reviewed historical fixture"

On Linux:

./test_sentinel.sh goldens add-database --database OLD.ovclashdb --expected EXPECTED_BUNDLE --metadata METADATA.json --fixture-id FIXTURE --writer-version VERSION --writer-revision REVISION --reason "Reviewed historical fixture"

add-database checks the declared schema, runs SQLite quick_check and checks the typed structure of the expected bundle. It runs no historical writer or reader. The next normal run checks that the current reader decodes the database to the expected records. The writer revision is attribution only; a commit ID is refused. The command cannot replace an existing fixture ID. On success it prints {'imported': '<fixture id>', 'manifest': '<catalog>/manifest.json'}; a failure prints Golden update failed: <error> and exits 1.

The fixture folder is databases/<folder>/. <folder> is the fixture ID in lowercase, with every run of other characters replaced by _. For example, historical-synthetic is stored in databases/historical_synthetic/. When that folder is taken, a numeric suffix such as _002 is added, and existing fixtures stay where they are. The folder name is a storage location, not a comparison key.

The metadata file contains exactly these two objects:

{
  "schema_identity": {
    "user_version": 0,
    "tables": {"sample": ["id", "value"]}
  },
  "reader_options": {
    "case": "example",
    "verify_models": true,
    "live_manifest": "live-validation.json"
  }
}

Field

Type

Required

Default or values

Description

schema_identity

object

Yes

Exactly user_version and tables

The declared database schema.

schema_identity.user_version

integer

Yes

0 or more

The database’s PRAGMA user_version.

schema_identity.tables

object

Yes

Nonempty; table name to a nonempty array of column names

Every table with its columns in order, including generated and hidden columns. Tables whose names start with sqlite_, in any letter case, are SQLite internals and are left out. A table such as sqliteAudit is an ordinary table and must be listed.

reader_options

object

Yes

Only case, verify_models and live_manifest; may be empty

Options of the current reader.

reader_options.case

string

No

Nonempty

The expected bundle must hold exactly one case. Import records that case and rejects a different case value.

reader_options.verify_models

boolean

No

true

false skips the Python model checks for a fixture that lacks that data.

reader_options.live_manifest

string

No

A path relative to the metadata file, inside its directory

Needed by a fixture written by live detection: its audit window lets the reader check generated IDs and timestamps. Import copies it to live.json in the fixture folder.

  • A live fixture records the recording user in audit.user and in every last_modified_by it writes. The user name comes from LOGNAME, USER, LNAME or USERNAME, in that order, before the OS account, so record with LOGNAME=sentinel: the public-reference test, tests/python_tests/test_public_references.py, refuses a developer login in the published catalog. Its SentinelDatabaseUserTests also reads the user columns (clash_info.last_modified_by, clash_info.person_in_charge and clash_query.last_modified_by) of every committed golden database and fails on a value that its SENTINEL_DATABASE_USERS does not list.

The catalog entry in the databases array of manifest.json holds exactly these fields:

Field

Type

Required

Default or values

Description

id

string

Yes

Unique; one path component

The fixture ID.

database

string

Yes

databases/<folder>/historical.ovclashdb

The stored database.

expected

string

Yes

databases/<folder>/expected

The reviewed expected records.

writer

object

Yes

Exactly version and revision, both nonempty strings

The historical writer.

schema_identity

object

Yes

As in the metadata file

The declared database schema.

reader_options

object

Yes

As in the metadata file, with case always set and live_manifest naming the copied live.json

Options of the current reader.

generated_by

object

Yes

commit (the writer revision) and tool (sentinel-database-import)

Attribution of the import.

review_reason

string

Yes

Nonempty

The --reason of the import.

A database must be a materialized SQLite file, closed, with no -wal, -shm or -journal sidecar. Each run checks the declared schema and gives the current reader a fresh copy in the run’s results directory, so the repository fixture never changes. The console labels these checks Golden database read: <fixture> and Compare: golden database <fixture>, where <fixture> is the fixture ID without its historical- prefix.

Sentinel covers databases from a historical writer read by the current reader. Sentinel never calls the schema migration API (migrate_data_structures_to_latest_version). The migration tests in tests/python_tests/test_suite_api_store_migration.py and tests/python_tests/test_suite_legacy_migration.py run in regular build validation. Older readers that consume newly written databases are out of scope.

goldens command reference#

test_sentinel.bat goldens SUBCOMMAND and ./test_sentinel.sh goldens SUBCOMMAND forward to scripts/update_sentinel_goldens.py. Its help therefore shows usage: sentinel_ci.py. Every subcommand also accepts these options:

Option

Default

Meaning

--source-root PATH

The repository root above the script’s ovclash/

Repository root that contains ovclash/.

--golden-root PATH

SOURCE_ROOT/ovclash/tests/sentinel/goldens

Golden catalog.

--contract PATH

SOURCE_ROOT/ovclash/tests/sentinel/contract.json

Typed bundle contract.

--version, -h, --help

Version and help.

Subcommand

Options

Prints

propose

--from-run PATH (required); --original-run-root RECORDED_ROOT; --case ID (repeatable), --all or --changed (one is required); --output PATH (required, new)

The path of proposal.json.

accept

--proposal PATH (required, repeatable; the directory or its proposal.json); --reason TEXT (required)

{'updated': N, 'manifest': PATH}

add-database

--database, --expected, --metadata, --fixture-id, --writer-version, --writer-revision, --reason (all required)

{'imported': ID, 'manifest': PATH}

verify

--report PATH (required, outside the catalog)

verification-only: PASS; ...

migrate

--report PATH (required); --write

migration: PASS; ... for a schema 1 catalog, otherwise verification-only: PASS; ...

compact

--report PATH (required); --write

compaction: PASS; ...

recover

None

One recovery outcome.

A failed command prints Golden update failed: <error> and exits 1. Invalid arguments exit 2.