Consequences Nobody Wrote Down
Chapter 9 handles work the history states: promises, assignments, follow-ups with an established expectation behind them. This chapter pushes Question 5 past conventional task tracking, to consequences nobody wrote down. The migration broke assumptions encoded in fixtures, documentation, and configuration that no session mentions. A memory that tracks only stated intentions will report the open list as empty while the project quietly rots. Whether anything can be done about that β reliably, without inventing obligations β is treated here as a difficult hypothesis, not a capability.
Explicit versus derived
The distinction organises the whole chapter.
Explicit open loop
The history directly says it:
Update the migration docs.
Commitment evidence exists, and the transition logic from Chapter 9 decides its standing. Hard problems remain β silent completion, supersession β but the obligation itself is given.
Derived open loop
The system concludes it:
The database changed, but the backup configuration still references the old database.
No utterance promised this. The conclusion combines three things the system already maintains:
current architecture (PostgreSQL is the store β Ch 8 belief)
+
historical decision (the July migration β Ch 4/5 events)
+
current artifact state (backup config still names SQLite β present fact)
That combination is much stronger than retrieval. It resembles reasoning over remembered state: the past supplies what the world should look like, the present supplies what it does look like, and the difference is the debt. Every inferred loop should ideally be traceable to exactly that triple:
current state
+
expected state
+
difference
The triple is also the honesty criterion. An inferred obligation without an expected-state source is a guess wearing a uniform. An inferred obligation whose current-state evidence is stale β a configuration snapshot from before the fix landed β is a resolved loop reported as open, the derived-world twin of Chapter 9’s stale tasks.
The corpus_import case
A second running example carries the cases the migration cannot. The team removes a legacy domain:
Decision (adr-013, 13 January 2025):
Remove the legacy corpus_import domain.
Consequences, only two stated:
- migrate CLI callers (issue-088, completed 22 January)
- migrate web callers (issue-089, completed 29 January)
Unstated:
- update docs (docs still describe corpus_import flags)
- delete compatibility facade (facade kept "temporarily")
- remove old tests (old tests still run, still pass)
Five genuine consequences, two with commitment evidence. Now add the traps a serious fixture set needs. The facade was kept deliberately: partner-note-004 records that one external partner still imports through it “until the end of Q1 2025”, so “delete the facade” is a false apparent consequence β acting on it breaks a commitment in the other direction. The old tests are intentionally preserved (tests-compat-122) as regression coverage for the migration itself; removing them destroys evidence the team chose to keep. A deferred-cleanup note (docs-note-012) explicitly parks the docs update until after release, which makes it an explicit intention with a scope condition, not a derived loop at all. A partial migration β half the CLI callers moved, half not β would leave the loop neither open nor closed but fractionally discharged.
A system that lists all five unstated items as obligations scores well on recall and fails the project: it deletes a facade under contract, removes tests under purpose, and duplicates a scoped intention. A system that lists none misses real rot. The operating point between them is the chapter’s entire subject, and it is why the metric must punish plausible-but-invented obligations.
Why precision dominates
A memory that produces fifty speculative todos is not better than one that misses one genuine loop. The asymmetry is practical: each invented obligation costs attention, and attention spent verifying phantom debts is attention taken from real ones. Worse, invented obligations with fluent justifications acquire false provenance β Chapter 7’s machinery manufacturing authority for claims the history never supported. The spec’s open-loop precision therefore leads, with recall reported alongside it rather than aggregated away, and the harness scores a third property the earlier questions never needed: abstention quality. On fixtures where the ledger records no derivable loop β the facade under contract, the intentionally preserved tests β the correct output is silence, and silence must score above confident invention.
Stages and evidence carry this. A derived loop arrives with the triple that produced it and a reason-coded verdict the scorer can audit: admitted only when all three legs are present, traceable, stated rather than inferred, fresh as of the standpoint, and uncancelled. The representation stays minimal, illustratively:
def infer_open_loops(state, now):
# Illustrative: compare remembered expectations against
# present artifact state; every candidate carries its
# (current, expected, difference) triple and a gate decision.
candidates = propose_differences(state, now)
return [c for c in candidates if gate_admits(c, now)]
No scalar confidence threshold ships in v1. A staged, reason-coded pipeline attributes failures where a weighted score cannot, and this chapter’s errors must be debuggable before they are trusted. A scalar may earn itself later only if it adds something a stage did not already decide; the backtest harness below is the instrument that would promote it, with gates, if the evidence said so.
The experiment
Fixtures contain explicit tasks, hidden consequences, false apparent consequences (the contracted facade), intentionally preserved stale references (the regression tests), deferred cleanups with scope conditions, and partial migrations. Queries ask what remains unfinished in a scope; the ledger records which loops are derivable, which are explicitly stated, and which apparent loops are traps. Measurement extends the Question 5 family with inferred-consequence precision and recall scored separately from explicit-task metrics, plus abstention scoring on trap-only fixtures and evidence correctness on the reported triple.
The frozen run is experiments/benchmark/runs/ch11-20260920T171039Z-derived-loops/, from solution/derived_loops/ (staged-triple-gate-v1, standpoint 2025-02-07, eight scope tasks, zero model calls). Conditions hold corpus, standpoint, and candidate proposal fixed and change only the derivation mechanism: unconstrained obligation listing, the staged S0βS4 triple gate, three ablations removing one leg each, the ledger oracle ceiling, and a trivial always-abstain control. Zero-positive trap tasks score null, never zero; the macro averages defined values only, with micro totals and the separate abstention metric alongside (see planning/chapter-11-metric-audit.md).
Mean over the eight tasks (macro over defined values; micro in parentheses):
condition inferred-precision inferred-recall harmful-tasks abstention
unconstrained 0.458 (0.476) 1.000 (1.000) 4/8 0.000
staged 1.000 (1.000) 1.000 (1.000) 0/8 1.000
no-current 0.929 (0.909) 1.000 (1.000) 0/8 1.000
no-expected 0.857 (0.833) 1.000 (1.000) 0/8 1.000
no-cancel 0.646 (0.556) 1.000 (1.000) 4/8 0.000
oracle 1.000 (1.000) 1.000 (1.000) 0/8 1.000
abstain null (null) 0.000 (0.000) 0/8 1.000
Recall is 1.0 for every listing condition including the oracle: no genuine positive is missed anywhere, and the contest is fought entirely in precision and harm. The unconstrained baseline lists everything proposed, including the facade under live contract, and pays for it: precision 0.458 with harmful listings on four of eight tasks. The staged gate matches the oracle exactly (macro and micro 1.0/1.0) with zero harmful listings. Each leg earns its place in the ablations: removing the freshness leg admits the pre-fix backup snapshot and drops macro precision to 0.929; removing the stated-expectation leg admits the inferred guess and drops it to 0.857; removing the cancelling-evidence leg re-admits the facade, the preserved tests, and the scoped deferral, returning precision to 0.646 with harmful listings on four tasks.
The full-scope task shows the mechanism working. Six candidates are proposed; three are genuine (docs flags, half-migrated CLI callers, unmigrated web callers) and three are traps. The staged gate admits exactly the three genuine loops and rejects each trap with its stage: the facade at S4 (contract partner-note-004), the preserved tests at S4 (intentional preservation tests-compat-122), the scoped deferral at S4 (docs-note-012). The stale-leg control rejects the pre-fix backup snapshot at S3, and the guess control rejects the inferred expectation at S2. Every rejection carries the stage and the cited legs; no candidate is explained after the fact.
The always-abstain control sits where it should: perfect abstention with zero recall and zero precision, the floor against which the abstention metric can be believed. The trap-only task (facade plus preserved tests, silence correct) is abstained on correctly by the staged gate and failed by every condition that drops the cancelling leg.
Policy learning follows the Chapter 10 discipline. The tempting loosening β drop the cancelling-evidence leg to recover the deferred-docs candidate β is proposed as an immutable gate version, replayed over all eight tasks, and rejected: primary gain β0.354 with breaches on harmful-task rate (0.0 to 0.5) and abstention rate (1.0 to 0.0). A locally correct repair that is globally harmful stays out, for the same reason Chapter 10 kept its own.
Book result. The triple structure buys precision on traps and stale-reference fixtures while recall holds on hidden-consequence cases (staged macro/micro 1.0/1.0 against unconstrained 0.458/1.0 macro, 0.476/1.0 micro; harmful tasks 0 vs 4; oracle matched). Derived-loop inference is earned as a guarded capability with an explicit gate version. Demotion clauses apply: crisp fixtures with ledger adjudication, no reader, synthetic corpus, deterministic links. The staged gate equalling the oracle here flatters crisp traps; ambiguous rot with graded evidence remains untested and is recorded as the next failure class.
What this chapter earns, and the problem it exposes
The run reaches something genuinely beyond retrieval: memory as reasoning over maintained state, where the past sets expectations the present is checked against. The capability accumulates rather than resets β intentions keep their provenance, intervals keep their temporal resolution, superseded evidence stays out of the expected-state leg β which is why the chapter sits after Chapters 7 and 8 rather than beside them.
But success creates the next failure, and it is immediate. Suppose the system knows every unresolved item: the backup migration, the docs update, the fixture revision, the CLI and web caller migrations, the deferred cleanup with its scope condition. It cannot put all of them into every context. A migration task needs the fixture warning and the prior failure; a documentation task needs the scope condition; a release task needs the backup debt. The open list is too large to be the answer, and the question changes from what is unfinished? to which of it matters for what I am doing now? β a question Chapter 10 answers for obligations the history recorded, and cannot answer for these.
What remains unsolved. Even complete knowledge of every unresolved consequence creates a selection problem. Remembering everything unfinished is not the same as bringing the right unfinished thing to the present task. Chapter 10 has already built the machinery for that selection and shown it working on stated obligations β the same question about unfinished work draws different evidence under a release objective and a prose objective. Chapter 10 can select and rank a derived consequence after this chapter has produced it; what it cannot do is originate a consequence absent from the memory representation, which is why this chapter sits behind it rather than in front of it.
What experiential-agent research adds
ExpeL extracts reusable knowledge from agent trajectories. Reflexion carries verbal feedback between attempts. Voyager accumulates skills through interaction, and SWE-bench grounds software-agent evaluation in real issues and repositories.
These works support the premise that useful state may be derived from relations among observations, actions, and outcomes rather than copied from an explicit task sentence. They also reveal the danger: fluent retrospective lessons can sound causal when a trajectory does not establish causality. An inferred loop is a hypothesis, not an extracted fact.
The closest classical precedent is older than any of them. Doyle’s truth maintenance system maintains each belief together with the reasons that support it and revises the belief set by dependency-directed backtracking when an assumption changes. That is the conceptual engine this chapter needs in miniature: a derived loop is a maintained expectation checked against present state, and when a leg changes β the snapshot refreshes, the contract lapses, the belief revises β the loop must be reconsidered or retracted rather than served stale. The system does not implement a general TMS; it borrows the discipline of recorded justifications with retraction as a primitive.
The (current, expected, difference) triple therefore needs provenance and falsification for every leg. Current state supports what exists; a decision or contract supports what should exist; the mismatch supports the candidate loop. Trap fixturesβcontracted facades, intentional stale references, scoped deferralsβsupply evidence that cancels apparent mismatches. The decisive metric is inferred-consequence precision at matched recall with abstention rewarded. Unrestricted production of plausible debts is not memory.
Research foundations
Work on agents learning from trajectories shows why unresolved consequences may be distributed across actions, observations, and later outcomes rather than written as explicit tasks. ExpeL extracts reusable knowledge from experience; Reflexion stores linguistic feedback across trials; Voyager accumulates skills from interaction; SWE-bench grounds software-agent evaluation in real issues and repositories. These papers motivate cross-artifact reasoning, but they do not remove the chapterβs central requirement: inferred loops must outperform correct abstention on trap cases.
References
- Jon Doyle, A Truth Maintenance System, Artificial Intelligence 12(3), 1979.
- ExpeL: LLM Agents Are Experiential Learners (2023).
- Reflexion: Language Agents with Verbal Reinforcement Learning (2023).
- Voyager: An Open-Ended Embodied Agent with Large Language Models (2023).
- SWE-bench: Can Language Models Resolve Real-World GitHub Issues? (2023).