Purpose
Add an append-only causal spacetime memory for CI so every run records what changed, where a signal appeared, what preceded it, what fixed it, and whether the fix remained effective.
This is a follow-up to #230 / PR #231 and complements #232. It must not make CI self-modifying or grant merge authority.
Core idea
The current Lotus system graph models one audit trajectory through repository, workflow, job, step, shell, test, evidence, verdict, and governance space.
The new layer connects multiple exact-head runs over time:
commit/change
→ workflow/job/step
→ observation/failure signature
→ causal hypothesis
→ fix commit
→ validation run
→ regression guard
→ later recurrence or durable prevention
CI “learning” means accumulating deterministic evidence and producing advisory rule or regression-test proposals. It must never silently rewrite gates, tests, workflows, or policies.
Spatial model
Every observation must be located in a stable hierarchy:
- repository
- ref and exact commit
- workflow
- job
- step
- shell and working directory
- command/test target
- changed file/module/path
- artifact/log span
- detector or policy rule
Required spatial edges include:
contains
executes
reads
writes_artifact
tests
depends_on
observed_at
affects_path
Temporal model
Each run is immutable and linked through explicit time relations:
preceded_by
supersedes
first_seen_in
last_seen_in
recurred_after
fixed_by
validated_by
stale_after_head_change
Evidence from run N may not be reused for run N+1 unless the relevant commit, workflow, policy, environment, and tested bytes are unchanged and the reuse rule is explicit.
Causal model
Nodes:
run
change_set
environment_state
workflow_topology
observation
failure_signature
hypothesis
confirmed_cause
fix
validation
regression_guard
recurrence
learning_proposal
human_decision
Edges:
may_cause
correlates_with
reproduces
confirms
contradicts
mitigated_by
prevented_by
recurs_despite
proposed_from
approved_by_human
A cause is never marked confirmed from correlation alone.
Per-run observation artifact
Each CI run emits a deterministic artifact such as:
ci-causal-observation-v0.1.json
Minimum fields:
- schema version
- repository identity
- ref
- exact commit SHA
- tree SHA when trusted materialization exists
- workflow run ID and attempt
- workflow/job/step identity
- command/test target
- start/end timestamps and duration
- conclusion
- normalized failure signature
- changed paths
- evidence hashes
- detector/policy versions
- environment fingerprint with secrets removed
- predecessor run reference
- authority boundary
Logs must be reduced to stable fingerprints and bounded excerpts; secrets and personal data must not enter memory.
Durable learning pipeline
1. Observe
The PR workflow emits only the immutable observation artifact. It cannot write repository memory.
2. Aggregate
A separate trusted workflow_run job on the default branch downloads completed-run artifacts without executing PR code.
3. Link
The aggregator links the observation to prior exact-head runs and deduplicates normalized signatures.
4. Score
Deterministic confidence levels:
observed_once
repeated
reproduced
fix_correlated
fix_validated
regression_protected
No opaque ML score is allowed in the gate path.
5. Propose
Repeated or validated patterns create advisory proposals:
- add a regression fixture;
- expand an existing graph route;
- improve a detector;
- narrow noisy CI;
- mark an obsolete rule;
- investigate a flaky environment dependency.
6. Human acceptance
A proposal may open a draft issue or draft PR. It cannot directly modify protected CI, approve, merge, deploy, or close findings.
Storage
Do not commit observations from untrusted PR workflows directly to main.
Initial options, in preferred order:
- immutable Actions artifacts per run;
- a trusted aggregator-generated artifact/index;
- a dedicated
ci-memory branch updated only by the default-branch workflow;
- draft PRs for durable accepted fixtures and graph changes.
The repository source of truth remains reviewed code, not ephemeral learned state.
Suggested files
standards/lotus-family/ci-memory/
SCHEMA.md
ci-causal-observation-v0.1.schema.json
ci-causal-memory-v0.1.schema.json
example-observation.json
example-memory.json
standards/lotus-family/conformance/
lotus_family_ci_observation.py
lotus_family_ci_memory.py
test_ci_observation.py
test_ci_memory.py
.github/workflows/
lotus-ci-observation.yml
lotus-ci-memory-aggregate.yml
Graph integration
Extend the Lotus graph with at least these nodes:
time.run_observed
time.prior_run_linked
evidence.failure_signature
evidence.change_set
cause.hypothesis
cause.confirmed
fix.applied
fix.validated
guard.regression_added
memory.pattern_repeated
memory.proposal_created
authority.human_acceptance_required
Required trajectories:
New failure
change_set → observation → failure_signature → hypothesis → UNKNOWN/advisory investigation
Confirmed fix
failure_signature → confirmed_cause → fix → validation_run → regression_guard → durable prevention
Recurrence
prior_signature → later_run → same_signature → recurrence → proposal to strengthen detector
Stale learning
policy/workflow/test semantics changed → prior inference stale → no automatic reuse
Acceptance criteria
- Every completed CI run can emit one schema-valid immutable observation.
- Two identical normalized failures are linked without duplicating the signature node.
- A changed exact head invalidates run-specific approval/review evidence.
- Correlation alone cannot produce
confirmed_cause.
- A fix becomes
fix_validated only after a later exact-head run passes the previously failing path.
- A regression guard records the exact fixture/test/policy that protects the cause.
- Unknown or conflicting evidence remains visible as
UNKNOWN.
- PR code cannot modify durable memory or the aggregator.
- Learning output is advisory and requires human acceptance.
PASS != APPROVED != MERGED remains explicit.
First vertical slice
Pilot only on Lotus Family conformance:
- emit observation JSON from the conformance workflow;
- normalize the failing unittest/test identity and reason code;
- link consecutive exact-head runs;
- recognize a repeated signature;
- generate a draft issue body suggesting a regression fixture;
- verify that no repository or CI mutation occurs automatically.
Authority boundary
The graph remembers evidence and proposes improvements. It grants no ownership, approval, execution, delivery, deployment, or merge authority.
Purpose
Add an append-only causal spacetime memory for CI so every run records what changed, where a signal appeared, what preceded it, what fixed it, and whether the fix remained effective.
This is a follow-up to #230 / PR #231 and complements #232. It must not make CI self-modifying or grant merge authority.
Core idea
The current Lotus system graph models one audit trajectory through repository, workflow, job, step, shell, test, evidence, verdict, and governance space.
The new layer connects multiple exact-head runs over time:
CI “learning” means accumulating deterministic evidence and producing advisory rule or regression-test proposals. It must never silently rewrite gates, tests, workflows, or policies.
Spatial model
Every observation must be located in a stable hierarchy:
Required spatial edges include:
containsexecutesreadswrites_artifacttestsdepends_onobserved_ataffects_pathTemporal model
Each run is immutable and linked through explicit time relations:
preceded_bysupersedesfirst_seen_inlast_seen_inrecurred_afterfixed_byvalidated_bystale_after_head_changeEvidence from run N may not be reused for run N+1 unless the relevant commit, workflow, policy, environment, and tested bytes are unchanged and the reuse rule is explicit.
Causal model
Nodes:
runchange_setenvironment_stateworkflow_topologyobservationfailure_signaturehypothesisconfirmed_causefixvalidationregression_guardrecurrencelearning_proposalhuman_decisionEdges:
may_causecorrelates_withreproducesconfirmscontradictsmitigated_byprevented_byrecurs_despiteproposed_fromapproved_by_humanA cause is never marked
confirmedfrom correlation alone.Per-run observation artifact
Each CI run emits a deterministic artifact such as:
ci-causal-observation-v0.1.jsonMinimum fields:
Logs must be reduced to stable fingerprints and bounded excerpts; secrets and personal data must not enter memory.
Durable learning pipeline
1. Observe
The PR workflow emits only the immutable observation artifact. It cannot write repository memory.
2. Aggregate
A separate trusted
workflow_runjob on the default branch downloads completed-run artifacts without executing PR code.3. Link
The aggregator links the observation to prior exact-head runs and deduplicates normalized signatures.
4. Score
Deterministic confidence levels:
observed_oncerepeatedreproducedfix_correlatedfix_validatedregression_protectedNo opaque ML score is allowed in the gate path.
5. Propose
Repeated or validated patterns create advisory proposals:
6. Human acceptance
A proposal may open a draft issue or draft PR. It cannot directly modify protected CI, approve, merge, deploy, or close findings.
Storage
Do not commit observations from untrusted PR workflows directly to
main.Initial options, in preferred order:
ci-memorybranch updated only by the default-branch workflow;The repository source of truth remains reviewed code, not ephemeral learned state.
Suggested files
Graph integration
Extend the Lotus graph with at least these nodes:
time.run_observedtime.prior_run_linkedevidence.failure_signatureevidence.change_setcause.hypothesiscause.confirmedfix.appliedfix.validatedguard.regression_addedmemory.pattern_repeatedmemory.proposal_createdauthority.human_acceptance_requiredRequired trajectories:
New failure
change_set → observation → failure_signature → hypothesis → UNKNOWN/advisory investigationConfirmed fix
failure_signature → confirmed_cause → fix → validation_run → regression_guard → durable preventionRecurrence
prior_signature → later_run → same_signature → recurrence → proposal to strengthen detectorStale learning
policy/workflow/test semantics changed → prior inference stale → no automatic reuseAcceptance criteria
confirmed_cause.fix_validatedonly after a later exact-head run passes the previously failing path.UNKNOWN.PASS != APPROVED != MERGEDremains explicit.First vertical slice
Pilot only on Lotus Family conformance:
Authority boundary
The graph remembers evidence and proposes improvements. It grants no ownership, approval, execution, delivery, deployment, or merge authority.