openclaw/scripts/pr-lib
Jason Cat 17e09c778e
fix: streamed answers with a list after a code block no longer re-project the whole list (#181511)
* fix: streamed answers with a Markdown list no longer re-project the whole list

A streamed reply that reaches a plain-text tool-call activation token (any
brace, so every JSON or code block) and then a Markdown list re-projected the
entire list for every delta: the checkpoint scan marks list lines ambiguous and
falls back to the canonical owner's block start, and a whole list is one block.

A list item with content now closes the ambiguous paragraph before it, so the
checkpoint can settle at the latest item boundary while the list continues.
Paragraphs, fences, reference definitions, images, setext headings, and
ambiguous container content keep the canonical path.

* fix: keep numbered markers that cannot interrupt a paragraph on the canonical path

An independent review found that the first revision treated any numbered
marker after a seen list item as a block boundary. A marker above 1 cannot
interrupt a paragraph even inside a list item, so the checkpoint could settle
inside a paragraph whose open inline code still owned later candidate lines,
and the streamed text dropped a tool-call block that the batch sanitizer keeps
as visible code.

Numbered markers now count only after a completed block, which is the case the
checkpoint can prove without a full parse. Multi-line numbered lists keep the
conservative path; bullets, single-line numbered lists, and nested bullets keep
the settled checkpoint.

* test: cover the list-heading checkpoint boundary reported in review

The reviewed head treated a numbered marker after a heading as a list boundary
even though the marker cannot interrupt the paragraph whose open inline code
owns the next line, so the delivery trace filter dropped a line the canonical
sanitizer keeps. The two-chunk case now pins that behaviour.

* fix: keep numbered markers inside an open item paragraph on the canonical path

A numbered marker cannot interrupt the paragraph of the item that contains it, so
treating the previous marker line as a completed block settled the checkpoint inside
that paragraph. When the paragraph's inline code closed later, the delivery trace
filter removed a literal line the canonical sanitizer keeps.

Markers now count only when they start at 1, follow a completed block, or sit outside
the open item's content column; headings, blockquotes, fences, and thematic breaks
close the tracked item.

* perf: scan list-ending blocks without adding regex work to the stream path

The checkpoint harness counts characters passed to regular expressions, so the
two per-line block tests are char scans like the rest of the checkpoint loop.

* test(agents): bound list checkpoint work through the subscriber handler

* fix(text): avoid rescanning completed streamed list items

Use canonical Markdown item boundaries for streaming settlement instead of
maintaining a second list parser. Refresh checkpoint metadata on complete
lines and retain the owning item for mutable reference definitions.

Keep subscriber work-budget coverage and literal-text correction cases.
Fixes #181493.

Co-authored-by: JasonBuildAI <jasonbuildai@gmail.com>

* fix(tooling): include list retention in PR wrapper inventory

Keep the extracted wrapper import closure complete after the Markdown list
checkpoint rewrite. CI exposed the missing helper in both inventory checks.

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
Co-authored-by: JasonBuildAI <jasonbuildai@gmail.com>
2026-10-23 22:49:13 -07:00
..
baseline-refresh.mjs
changelog.sh
ci-dispatch.mjs
common.sh fix(scripts): compare orphaned PR clones with their seed (#181041) 2026-10-22 15:58:20 -07:00
correction-continuation.mjs
correction-review.mjs
crabbox-gate-contract.mjs
crabbox-gate-plan.mts
crabbox-gate-transport.mts
crabbox-merge-bypass.mjs
crabbox-merge-bypass.sh
darwin-process-identity.py
gates.sh
gh-api-preflight.mjs
github.mjs
github.sh
host-tools.sh
incoming-review.mjs
materialize-dependencies.mjs fix(pr): keep in-flight landings working after dependency refreshes (#182147) 2026-10-23 21:39:17 -07:00
materialized-anchor.mjs fix(scripts): PR wrapper leaks materialized trust-anchor dirs in TMPDIR on failures and interrupts (#180848) 2026-10-22 11:15:59 -07:00
merge-body.mjs
merge-legacy-refusal.mjs
merge-outcome.sh
merge-pre-dispatch-refusal.mjs
merge-prior-ci-cancellation.mjs
merge-prior-ci-security.mjs fix: admit security reviews for the selected CI attempt (#180929) 2026-10-22 19:44:09 +00:00
merge-prior-ci.mjs fix: admit security reviews for the selected CI attempt (#180929) 2026-10-22 19:44:09 +00:00
merge-rest.mjs
merge.sh fix(pr): recover rejected admin merges with current tooling (#179545) 2026-10-21 14:14:47 +00:00
operation-lock.sh
prepare-core.sh
process-group-runner.mjs fix(scripts): PR wrapper leaks materialized trust-anchor dirs in TMPDIR on failures and interrupts (#180848) 2026-10-22 11:15:59 -07:00
push.sh
review-artifacts.mjs
review-transition-state.mjs
review.sh
worktree-provision-error.mts
worktree-provision.mts fix(pr): review-init fails with a client credential custody error on pre-cutover PR registries (#179173) 2026-10-22 18:34:00 -07:00
worktree.sh fix(pr): surface review workspace paths before setup (#182013) 2026-10-23 23:42:56 +00:00
wrapper-components.txt fix: streamed answers with a list after a code block no longer re-project the whole list (#181511) 2026-10-23 22:49:13 -07:00