Skip to content

Capture lede decisions as an accumulating corpus #1122

Description

@williamthorsen

Problem

Every lede rewrite discards the knowledge that produced it. A ## What section gets replaced with a better one, and the pair -- what was wrong, what fixed it -- exists only for the moment of the edit. Nothing accumulates, so doctrine refinement has no evidence base and proceeds from recall.

Context

#1056's blind comparison returned 20-0 for the current doctrine against no doctrine, which changes the question a corpus has to answer: not whether the doctrine helps, but which of its rules are load-bearing and which are accretion. A record of what still went wrong under the doctrine already in force answers that directly.

Both texts are already on disk. The _pull-request.md artifact holds the ## What the agent published, and the _merge.md artifact holds the lede that actually merged, which merge-pr sources from the final pull-request body. Across 501 ticket directories, 225 pairs are comparable and 86 differ. What is missing is not the text but the author's judgment about it.

That judgment cannot be recovered from the text. Of the 86 differing pairs, roughly a third are heavy rewrites that partly reflect content changes from commits landed during review rather than lede refinements. A lede shipped unchanged is likewise ambiguous between "this was good" and "there was no time to fix it" -- the expedience that makes the existing pairs unfit as models.

Proposed solution

Record a lede decision at merge, after the merge completes: the agent's lede, the merged lede, the doctrine version in force, and an optional comment.

The corpus stores positive signals only. A record exists because the author looked and decided -- accepted the agent's lede, or revised it. Declining to decide writes nothing, and the absence of a record carries no meaning; in particular it is not an acceptance. A busy week then yields less data rather than misleading data, which is the failure that makes the existing pairs unusable.

Records land in the shared knowledge substrate alongside the knowledge base and the agent-mistake record, not in a store of their own.

Four alternatives were considered and rejected:

  • No backfill of the 86 existing pairs. They were edited for expedience rather than as models.
  • Merge is the only capture point. The changelog-writer dispatch is not one: no skill dispatches its rewrite mode, and the caller's pruned-draft population is 10 pairs across the whole history.
  • The comment is free text, not a doctrine-rule picker. A fixed rule list at capture time would presuppose which rules matter, which is the question the corpus exists to answer. Categorization belongs to the refinement pass reading the corpus.
  • No second candidate and no quality rating. An A/B between two independent samples, and a rating on accepted ledes, are both worth revisiting once the single-decision record is earning its keep.

Acceptance criteria

Must have

  • A decision record pairs the agent's lede with the merged lede and carries the work type, tier, and scope of the change, provenance reaching the change it described, and a fingerprint of the doctrine version in force.
  • A record is written only when the author affirms a decision. Declining writes nothing, and a merge that never reaches the prompt leaves no trace.
  • A lede accepted unchanged is recorded as distinctly as one that was revised.
  • The author can explain the decision in free text, and can decline to.
  • Records are queryable as a group and by work type, so a refinement pass can read them without walking the store.
  • The store states that its contents are outcome-selected, that absence of a record is not an acceptance, and that neither may seed a comparison's fixture draw.
  • Records group by doctrine version with nothing recorded at install time.
  • New and modified behavior is covered by tests.
  • The capture command and the record shape are documented where a later refinement pass can find them.

Should have

  • A pull request merged outside the merge flow can still be recorded.

Related: #1056 (supplied the 20-0 result that reframes the question), #1055 (consumes decision records in place of the twenty hand-built golds), #1090 (the general doctrine derived downstream).

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureAdded or improved external functionalityscope:agents

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions