Skip to content

Decisions can be recorded as proposed, and the extractor records a proposal's decisions as proposed - #214

Merged
zlareb1 merged 6 commits into
mainfrom
feat/decision-stage-proposed
Nov 4, 2026
Merged

zlareb1 merged 6 commits into
mainfrom
feat/decision-stage-proposed

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Improvement

Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):

decision.record takes stage: "proposed" for an option put forward and not yet chosen or built; its statement reads "Proposed …" instead of "Decided …" everywhere a decision is served. loom decisions extract records the decisions of proposals, plans and action items as proposed.

Why

Design material is full of decisions that were never made: proposals, RFCs, feature requests, action items and options under discussion. The extractor wrote every one of them as Decided <outcome> because …, and the pre-edit block, search and context.pack served them as choices the code follows. An agent then planned against a design that does not exist.

Measured on a private corpus of 60 real engineering documents across three components (design decks and docs, meeting notes, RFC issues, incident write-ups, runbooks, chat threads), with gold statuses taken from the code and its merge history, not from people: on main, 30-32% of extracted rows (two runs, 353 and 367 rows) state something that is not how the code is today, and 9 in 10 of those are proposals or unbuilt plans presented as decided. In a task check (324 questions and change requests answered with and without the served rows), change plans that followed a misleading row rose from 0.20 without Loom to 0.36 with it.

What changes

  • DecisionRecordInput.stage: "decided" (default) or "proposed". A proposed decision's row carries the decision:proposed tag and its statement reads Proposed <outcome> because <reasoning>.; context.pack lists it as → proposed: <outcome>, and decision.precedents and decision.chain answer stage on each decision. decision.outcome drops the stage, since an outcome records that the decision was acted on, and so does recording the decision again as decided. A caller's own decision:proposed tag never stands in for the stage.
  • The stage lives on the memory row, not the record: the active-record read says whether the record's writer row carries the tag, so context.pack, decision.precedents and decision.chain take the stage from the row that holds the record. The generic record ops (memory.record.query, memory.record.history) return the record as stored, which holds no stage. Why not a record field: adding a field to the built-in decision schema would make decision.record answer UNKNOWN_FIELD in every namespace that registered the schema already (ensure_schema leaves an active schema alone).
  • loom decisions extract asks the model for each candidate's stage; anything but a plain decided is recorded as proposed, because a proposal served as a choice misleads more than the reverse. When the document has a title, each window's text opens with a [document: <title>] line (clipped to 200 characters), so a proposal's sentences ("we use …") read as a proposal. For unchanged words a re-run keeps the row's stage and notes a different reading; a changed text is recorded at the stage it reads as.
  • The restated-reasoning check takes every form of propose (proposed, proposal) for a filler word, so a reasoning that only says the outcome was proposed ("We propose to spill into sorted runs.") is dropped like one that says it was decided.

Scope and risk

  • Touches the decision write path, its statement, the extractor's prompt, reconcile and restated-reasoning filler words, and the context.pack decision line. memory.for_file and search need no change: they serve the statement.
  • A proposed ban keeps its constraint tag, so memory.for_file still ranks it first: a ban a design puts forward is the warning an agent needs before it edits that code, and the statement says "Proposed". The kinds label is unchanged.
  • The context-pack tests no longer patch server.core.ch.get_client while context.pack imports modules lazily: a module first imported under the patch kept the fake client for the rest of the run (the startup tests' fake made 39 test_decision_retirement.py tests fail when they ran first, on main too). Where the patch was not needed (the sections are stubbed) it is gone; the startup tests set the client get_client returns instead.
  • One alternative was measured and dropped: also marking a candidate proposed when every code name it states is absent from the index. It cut misleading rows further but marked built decisions as proposed three times as often, because documents name things outside the repository (another system's engine, a product).
  • Read cost: the active-record read gains one subquery over loom.memory, the same shape _LIVE_WRITERS already runs on every decision.record and decision.outcome (filtered on org, namespace, the keys and memory_type), for the handful of keys a pack, precedents or chain call reads. Measured with system.query_log on a private ClickHouse holding one namespace of 1,000,000 memory rows and 100 decision records, ten keys per read, five reads each: the read went from 100 to about 1,250 rows read and from 9 ms to 39 ms on average (cold first reads included), memory 4.5 MB to 6.2 MB.
  • The stage is the model's reading and flips between runs: a second run of the extractor over the unchanged corpus read 22 of 361 kept rows (6%) at the other stage. So the same words keep a row's stage in either direction (matched by key, or, when the model reworded the key, by the outcome, reasoning and rejected options' reasons), with a note naming the stage the document reads as (none for a row whose outcome is recorded, which reads as decided). Taking a stage from each run, even in one direction only, would drift with every re-run. A changed text is recorded at the stage it reads as; a pinned or attested row is never re-recorded by a run.

Compatibility, rollout and rollback

  • Wire: one optional input field on decision.record (stage, default decided), and one output field stage on the decisions decision.precedents and decision.chain return. SDKs regenerated; the Python client's decision.record takes stage and sends it only when it is proposed.
  • Rolling upgrade: an N-1 server ignores stage and records the decision as decided. An N-1 decision.outcome on a proposed row rewrites its statement as "Decided" but keeps the tag (N drops both), and the readers take a decision with a recorded outcome as decided whatever its tag, so it is listed as decided; the next N decision.outcome or re-record drops the tag.
  • An N-1 loom decisions extract run that revises one of its own proposed rows (for files or tags) records it without a stage, so the row reads decided until a later run's text change or a person records it as proposed again.
  • An N-1 replica's context.pack, decision.precedents and decision.chain read no stage during the rollout, so they list a proposed decision as decided until every replica runs N.
  • A row written before this change that already carried a caller's own decision:proposed tag (the tag had no meaning then) is listed as proposed by context.pack, decision.precedents and decision.chain as soon as N serves (unless its outcome is recorded), while its statement still reads "Decided"; its next decision.outcome or re-record drops the tag.
  • memory.update replaces a row's tags, so it can add or drop decision:proposed like any tag; the readers then follow the tag while the statement keeps its wording until the decision is recorded again. decision.record is the op that sets the stage.
  • The stage read is a plain read like the record read beside it: on a replicated cluster a replica that has the new record before the writer's new row shows the old stage until the row arrives.
  • Operator steps: none required. Rows extracted before this change carry no stage tag, read as decided, and keep that stage on re-runs whose words are the same (the same-words rule), so the measured gain reaches new documents and changed text. To have the extractor read the stage of an already extracted document, delete its extracted rows that are not pinned or attested and extract it again.
  • Rollback: rows written as proposed keep the tag and the "Proposed" statement; nothing else is stored.

Tests

  • Integration (tests/integration/test_decision_record_source.py, against a server from this branch on its own ClickHouse, auth off): a decision recorded with stage="proposed" reads back tagged and worded "Proposed", decision.precedents and decision.chain answer stage: "proposed", recording it again as decided, or recording its outcome, drops the tag and the wording, compared on the whole row, and context.pack lists it as → proposed:; the file and test_memory_for_file_decisions.py passed (6) before the rebases over the latest decision changes on main, whose new integration tests in that file this run did not include.
  • Unit: statement wording; decision.record tags and words a proposed decision, decision.outcome drops the stage, a re-record as decided drops it, a caller's tag is ignored, the record carries no stage; extractor stage parsing (only a plain decided reads as decided), a reasoning that only says the outcome was proposed restates it, the title line on every read, the same words keep a row's stage in either direction, also under a key the model reworded, and a changed text is recorded at the stage it reads as; context.pack renders → proposed:; decision.precedents and decision.chain answer each decision's stage; a clickhouse-local test in test_decision_retirement.py pins that the record read takes the stage from the record writer's own live row, not another identity's; a stage change leaves a row with a recorded outcome as it is; the fake model answers a stage; SDK sends stage. Decision, context-pack and SDK test files pass; tests/analyzer/shapes.txt regenerated for the changed record read and python -m tests.analyzer.corpus --check against a migrated ClickHouse rejects no shape; make format lint typecheck clean; codegen and docs reference regenerated. Full unit and analyzer suite on the head before the last rebase: 26160 passed, 22 skipped, 1 failed (tests/analyzer/test_corpus.py::test_shapes_file_matches_builders, which fails on main too: its shapes.txt lacks the current shape of the memory.for_file read; this branch does not change that read); after rebasing over the latest decision changes on main, the decision, context-pack, memory.for_file, SDK, contract and gate test files (2109 passed) and test_decision_retirement.py (42) pass; make typecheck clean; the context-pack and decision test files pass in three random orders and in the order that failed before.
  • Measurement (private corpus, numbers only; extraction with the server's configured model, rows graded against gold built from the code index and merge history, the same grader for every arm; two runs of main give the noise):
main run 1 main run 2 this PR
rows 353 367 363
rows stating something the code does not do today 0.320 0.294 0.132
built decisions marked proposed 0 0 0.050
gold design statements recalled 0.371 0.376 0.460

Per component the misleading share fell from 0.375 / 0.400 to 0.143, 0.348 / 0.386 to 0.205 and 0.299 / 0.236 to 0.104. Extraction cost on the corpus: about $0.1 per run of 60 documents. The measurement predates the propose/proposal filler words, which can only drop rows whose reasoning restates the outcome.

AI assistance in the code (leave one; writing this description with AI is fine):

  • AI-generated (an agent wrote most of the diff): Claude Code. I checked the reconcile path, the outcome path's tag handling and the schema-registration constraint against the code, and measured the change on the corpus.

🤖 Generated with Claude Code

@zlareb1
zlareb1 force-pushed the feat/decision-stage-proposed branch 6 times, most recently from 78412bd to 14c9d18 Compare November 3, 2026 14:17
@zlareb1 zlareb1 changed the title A decision can be recorded as proposed, and the extractor records proposals so Decisions can be recorded as proposed, and the extractor records a proposal's decisions as proposed Nov 3, 2026
@zlareb1
zlareb1 force-pushed the feat/decision-stage-proposed branch 23 times, most recently from 811cc01 to 2e25dd5 Compare November 3, 2026 16:45
@zlareb1
zlareb1 force-pushed the feat/decision-stage-proposed branch 4 times, most recently from 86020e4 to 1138383 Compare November 3, 2026 21:20
zlareb1 and others added 6 commits November 4, 2026 01:54
…oposal's decisions as proposed

decision.record takes stage: decided (default) or proposed. A proposed
decision's statement reads "Proposed <outcome> ..." and its row carries
the decision:proposed tag; decision.outcome drops it (an outcome means the
decision was acted on), and so does a re-record as decided. context.pack,
decision.precedents and decision.chain read the stage from the row that
holds the record. The record schema is unchanged, so namespaces that
registered it keep writing.

loom decisions extract asks the model for each candidate's stage, records
anything but a plain "decided" as proposed, and opens each window with the
document's title. The stage is the model's reading and flips between runs,
so the same words keep a row's stage, also under a reworded key; a changed
text is recorded at the stage it reads as.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
A module first imported under a patched get_client kept the fake for the
rest of the run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…ead of repeating it

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
@zlareb1
zlareb1 force-pushed the feat/decision-stage-proposed branch from a150e91 to 9083ba5 Compare November 4, 2026 02:01
@zlareb1
zlareb1 merged commit ba69349 into main Nov 4, 2026
20 of 22 checks passed
@zlareb1
zlareb1 deleted the feat/decision-stage-proposed branch November 4, 2026 02:15
@pufit pufit mentioned this pull request Nov 4, 2026
9 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant