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=1exported 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_modereads the explicit signals + the heuristic signals and returns aCiDetection.CiPolicyexpresses the behavioural rules CI mode flips on (env-store first, skipNotInstalledsilently, refuse local-vault unlock, refuseBIOMETRIC_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.
Nonewhen 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
doctornotice 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.