Skip to content

refactor(h21): settle run - #24

Merged
lg2m merged 3 commits into
mainfrom
refactor/h21-settle-run
Sep 12, 2026
Merged

lg2m merged 3 commits into
mainfrom
refactor/h21-settle-run

Conversation

@lg2m

@lg2m lg2m commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

… teardown proof for a started run's terminal event (H21.1c)

settle_run replaces finalize_run and complete_run_in_transaction. It pre-reads
outcome_json and writes nothing when the run already carries an outcome, so a
replayed settlement (a compaction settled by its own transaction and again by
the prompt's teardown, or a recovery sweep racing a just-committed settlement)
no longer overwrites the outcome, appends a second RunFinished, or clears an
active_run_id that a newer run now owns. SettlementCause::{Executor, Recovery}
selects the event's caused_by and whether the row's committed usage/cost is
overwritten or preserved. The queued path gains the same null predicate and
complete_run / complete_compaction check the guard before any write.

RunResources::{drain, stop} now return TeardownComplete, a zero-sized proof
type that Store::finish_run and Store::finish_compaction_run require by value,
so publishing a started run's terminal event without draining its tools and
children does not compile. Seven pre-stream exits that settled a started row
without any teardown now stop the unpolled provider stream first.

Regression tests settling_a_settled_run_is_a_no_op_on_every_path and
a_committed_compaction_is_not_resettled_by_the_prompts_teardown fail on the
previous source and pass here.

Slice: speed-first H21.1 (part 3 of 3). ADR-0012.
…e speed-first ledger

Writes the reserved ADR-0012 as implemented (one guarded settle_run,
TeardownComplete token), marks it Accepted in the ADR index and root.md,
adds a settlement paragraph to architecture.md § Persistence, updates the
plan's H21 status row, and appends the H21.1c receipt to the ledger.
Add docs/design/harness-catalog-2026-09.md, a per-feature catalog of the
Codex, OpenCode V2, Pi, and fx snapshots under .source/ against QQ: tool
bounds, output bounding, shell safety and sandboxing, input ergonomics,
extensions and sessions, ranked QQ gaps, and differentiators no audited
harness ships.

Add docs/plans/tool-layer.md (T1-T14): shared Bounds/bound_text/ToolOutput
primitives with header convention, secret masking, and a per-turn output
budget; search v2 (ignore-aware, regex, definition/references, cursor),
read_file v2 (gutter, ranges, outline, if_changed_since), tree, batched
edit_file with matching cascade and dry_run, spill store with
read_tool_result, tree-sitter shell classifier with a Forbidden decision,
exec argv tool and prefer-built-in nudge, fetch, ask_user, view_image,
gated terminal, @-mention grammar, and an A0-A5 ablation plan.

Wire the plan into docs/README.md, docs/plans/README.md, and the progress
ledgers; reserve ADR-0019..0021 and file root requests; point the
terminal-bench Phase 6 candidates at the new plan.
@lg2m
lg2m added this pull request to stack #29 September 12, 2026 03:51
@lg2m
lg2m merged commit e6a1399 into main Sep 12, 2026
4 checks passed
@lg2m
lg2m deleted the refactor/h21-settle-run branch September 12, 2026 03:52
@lg2m lg2m mentioned this pull request Sep 14, 2026
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