Skip to main content

Module gate

Module gate 

Source
Expand description

G6, the test gate of process v1 (leanctx-hive docs/process-v1.md §5, contracts/process-v1/gate-record.schema.json): what the Instance checks and records on submit (E47) and again before verify (E48).

  • LockedPathsV1: every locked path is byte-identical to spec_commit in the judged commit; ok exactly when changed is empty, each path once, each under a checked path (under_locked).
  • RerunV1: the gate’s own run of the declared command at the judged commit (rerun.commit == artifact.ref), never a worker’s report.
  • G6RecordV1: both, as the Instance sends them, with G6RecordV1::validate keeping the contract’s rules (locked_paths_changed, locked_paths_unique, locked_paths_changed_unchecked, locked_paths_spec_commit, rerun_commit, S: nothing checked and no feature results; M/H: a non-empty check). The Instance does not read CI (§5.1), so its record is never a pass: its best is blocked on ci_pipeline, which Hive completes with ci.
  • HiveG6RecordV1: the G6 record Hive stores and serves (lenient: the whole contract record), green only with ci for the judged commit and every required job green (ci_commit, ci_required_jobs).

The checks themselves run in the Instance (lean-ctx-hive tasks::gate), never through an agent’s shell.

Structs§

ArtifactRefV1
artifact of a stored gate record: what was judged.
ChangedPathV1
One differing locked path.
CiJobV1
One CI job of a pipeline (§5.1).
CiV1
gate_record.ci (§5.1, gate-record.schema.json#/$defs/ci) in its three forms: a pipeline, no pipeline yet (status: missing), or no CI (provider: none). Response type: unknown fields are accepted.
FeatureResultV1
One feature’s result from the gate’s own run.
G6RecordV1
The G6 part of a gate record as the Instance builds and sends it: the judged commit, the locked-path check and the gate’s own rerun. Hive adds what only it knows (id, task, author, checker, ci) when it stores the record.
HiveG6RecordV1
The G6 record Hive stores and serves for a task (process.g6): the whole contract record, read leniently (unknown fields accepted), so a contract-complete record with id, task, author, checker, evidence and at parses. Only HiveG6RecordV1::green lets a verify on.
LockedPathsV1
gate_record.locked_paths (G6, required on every G6 record).
RerunReportV1
gate_record.rerun.report: what the test harness itself reported, so a green exit_code from code that ended the test binary early does not count (§5, the contract follow-up). format is libtest-json or libtest-text; names_checked lists every locked test the feature list names with its reported status (empty for an S task).
RerunV1
gate_record.rerun: the gate’s own run of the locked tests.
TaskProcessV1
The process part of a task view, as far as G6 needs it (process v1 task-process.schema.json, its feature list and the repo’s CI declaration). A task view without it is not a process task. Response type: unknown fields are accepted.
TestStatusV1
One locked test with the status the harness report gives it (§5, bb1a533e): passed, failed, ignored, or not_run (absent).

Enums§

GateResult
A gate’s result.
LockedChange
How a locked path differs from spec_commit (§5).
NotGreen
Why a stored G6 record does not let a verify on.
TaskRisk
A process task’s risk level (§2).

Constants§

GATE_RECORD_SCHEMA
The gate record’s schema id (process v1).
HIVE_CLOUD_PG_JOB
HIVE_CLOUD_PROJECT
The Postgres job every Hive Cloud (relay project 37) record requires.
MAX_LOCKED_PATHS
At most this many checked or changed paths in one record.
MISSING_CI_PIPELINE
The evidence kind a G6 record without a pipeline misses (§5.1).
PROCESS_VERSION
The process contract version a record names.
RULE_LOCKED_PATHS_CHANGED
The one rule a locked-path failure names.

Functions§

under_locked
path lies under the locked path pattern: the path itself, a file below it, or a glob match (* within one segment; **/ zero or more whole segments; a trailing ** everything below). The same matcher as leanctx-hive under_locked (routes/tests_process_v1.rs, process v1 §5).
validate_repo_path
A locked path is repository-relative: not absolute, no .. segment (feature-list.schema.json#/$defs/repo_path).