Skip to content

fix(planning): have export-ledger emit a confirmation recap that fits the restatement cap - #7801

Merged
melodic-automation-lanes[bot] merged 2 commits into
mainfrom
work-resolve-issue/issue-7759-39066464025-1
Oct 17, 2026
Merged

melodic-automation-lanes[bot] merged 2 commits into
mainfrom
work-resolve-issue/issue-7759-39066464025-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #7759

Summary

Opened by the work-resolve-issue lane. The run's own summary:

Adds export-ledger --recap, which writes the confirmation gate's compact recap: one line per live question, all withdrawn rows collapsed into one line, and answers cut in steps (240/120/60/30 characters) until the recap fits the 20,000-character restate cap. The Confirmation gate in surface.md now names this form.

Not verified

  • ruff check/format could not be run (command needs approval in this lane); long lines were wrapped by hand
  • surface test suite (test_server.py and others) not run beyond test_round.py and test_exporters.py

Fix

  • plugins/planning/surface/exporters.py: confirmation_recap and clip; merged rows carry a readable resolution
  • plugins/planning/surface/round.py: export-ledger --recap flag (honors --ledger, prints conflicts, exits 1 after writing if even the shortest cut cannot fit)
  • plugins/planning/surface/test_round.py: TestConfirmationRecap (128 ids, 79 withdrawn; apply accepts the recap; one line per live question; withdrawn collapsed)
  • plugins/planning/surface/README.md: documents export-ledger --recap
  • plugins/planning/skills/interview/context/surface.md: Confirmation gate names the exporter's compact form
  • .changes/planning/fix-export-ledger-compact-recap-7759a1c4.md: minor changelog fragment

Verification

The run reports:

Left out: the items under Not verified.

Related

#7759

… the restatement cap

Adds export-ledger --recap: one line per live question, withdrawn rows
collapsed into one line, long answers cut to fit the restate cap.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 01dbe016b793d3618cdf8357d3abf31b6e3dbc07: 0 finding(s), 0 as inline comments.

No security issues found in the incremental change (plugins/planning/surface/exporters.py, since e32bf77).

The diff adds recap_answer() and uses it in confirmation_recap. It reads only the ledger's own resolution text and passes it through the existing parse_named and readable functions.

  • No new trust boundary or sink. There is no shell, file, network or path use. The only output is the recap string.
  • Parse refusals are handled. parse_named refuses malformed rows by raising SystemExit. The new code catches it and falls back to clean(r["resolution"]), which is what the recap showed before. A malformed row therefore can't abort the recap or leak raw text that clean didn't already cover.
  • Escaping matches the other callers. readable unescapes the fields the same way as in its existing callers (the Brief and the report), so this adds no new exposure.
  • No instruction-surface deletion. The diff doesn't remove or soften a standing instruction.

Comment thread plugins/planning/surface/exporters.py Resolved
@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 01dbe016b793d3618cdf8357d3abf31b6e3dbc07: 0 finding(s), 0 as inline comments.

No findings on the incremental change to plugins/planning/surface/exporters.py (new recap_answer, used in confirmation_recap).

I read the diff against parse_named, readable, LEAD, clean, merged_register and ledger_row. I did not run the code or the tests. The diff includes no test change, and the recap path from confirmation_recap through merged_register is checked by reading only.

  • When the fallback runs: recap_answer falls back to parse_named only for rows with no readable. Those are ledger-only rows and ledger-settled rows, where merged_register sets readable=None.
  • Control flow: parse_named returns None for an older grammar and a (fields, marked) tuple otherwise, so the if named check is correct. The SystemExit it raises on a malformed row is caught the same way ledger_row catches it, so a bad ledger row falls back to the raw text and doesn't crash the recap.
  • Behavior kept: The older-grammar and malformed cases still return clean(r["resolution"]), as before.

One difference is below the reporting bar. recap_answer strips the [id] lead before parsing. So for non-contiguous ids, a ledger-settled named-field row shows no [id] in its recap answer, while a page row's display form keeps it. ledger_row also strips the lead, and the Q<N> label still identifies the row, so I didn't flag it.

…he confirmation recap

A ledger-only row, or a row where the ledger's settled status wins, has no
readable form, so the recap fell back to the raw `answer:: ...` grammar.
Parse the resolution through parse_named into readable() instead.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

pr-unblock / address-feedback finished round 1 of 3 on 01dbe01.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path enqueued this pull request at head 01dbe016b793d3618cdf8357d3abf31b6e3dbc07.

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Oct 17, 2026
Merged via the queue into main with commit 39cc6d9 Oct 17, 2026
31 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-7759-39066464025-1 branch October 17, 2026 22:23
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.

fix(planning): have export-ledger emit a confirmation recap that fits the restatement cap

0 participants