Skip to main content

Module ci

Module ci 

Source
Expand description

Explicit CI-mode detection per ADR-021 §8 (“CI mode (explicit, not heuristic)”).

ADR-021 deliberately separates selection from detection: CI behaviour is selected (env var, context flag, or --ci), and CI signals are merely observed and reported via doctor. This avoids two failure modes the previous draft suffered:

  • A developer running a CI script locally with CI=1 exported silently switching to env-store routing.
  • A CI runner that does not set the expected variables silently staying on interactive routing and failing on the first keychain-unlock prompt.

This module is the data layer:

  • detect_ci_mode reads the explicit signals + the heuristic signals and returns a CiDetection.
  • CiPolicy expresses the behavioural rules CI mode flips on (env-store first, skip NotInstalled silently, refuse local-vault unlock, refuse BIOMETRIC_PROMPT).

The actual orchestration that consumes the policy lives one layer up (the router, P11+). Splitting detection from orchestration keeps both halves trivial to unit test.

Structs§

CiDetection
Outcome of detect_ci_mode.
CiPolicy
Behavioural rules CI mode flips on, per ADR-021 §8.

Enums§

CiActivation
How CI mode was activated. None when CI mode is inactive.

Constants§

CI_HEURISTIC_VARS
Common env vars CI runners set. Their presence is only a heuristic signal — the router does not flip CI mode on them. Per ADR-021 §8 the only effect of these is the doctor notice when none of the explicit triggers fire.
DEVBOY_CI_ENV
Env var that explicitly opts into CI mode. Accepts 1 / true (case-insensitive) as truthy; 0 / false (or unset) as falsy.

Functions§

detect_ci_mode
Detect whether CI mode is active.