Skip to main content

Module gate

Module gate 

Source
Expand description

G6, the test gate of process v1 (leanctx-cloud 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 Cloud completes with ci.
  • CloudG6RecordV1: the G6 record Cloud 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-cloud 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.
CloudG6RecordV1
The G6 record Cloud 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 CloudG6RecordV1::green lets a verify on.
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. Cloud adds what only it knows (id, task, author, checker, ci) when it stores the record.
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.
TaskProcessGateV1
What G6 needs beyond a task’s process fields (model v1 task.process_gate, core only): for M/H the feature list’s locked paths, commands and feature ids at spec_commit, for S the repo’s declared command, and the newest G6 record Cloud stored. Response type: unknown fields are accepted.
TaskProcessPassedGateV1
One passed gate and its record.
TaskProcessRefV1
task-process.schema.json task: the task the process fields belong to.
TaskProcessRiskChangeV1
One change of the risk level; from is null for the first.
TaskProcessStageEntryV1
One entry into a stage (§13).
TaskProcessV1
The process fields of a task view, exactly process v1 task-process.schema.json (model v1 task.process). A task view without them is not a process task. Response type: unknown fields are accepted; every member the contract requires is required here.
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§

CLOUD_CLOUD_PG_JOB
CLOUD_CLOUD_PROJECT
The Postgres job every LeanCTX Cloud (relay project 37) record requires.
GATE_RECORD_SCHEMA
The gate record’s schema id (process v1).
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.
TASK_PROCESS_SCHEMA
The schema id of a task’s process fields (process v1).

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-cloud 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).