fix(review): keep trailing markers within their HTML comments - #1070
Conversation
…m spanning visible prose
…s bug pf trailing html comment parsing
…d for clawsweeper for fixed bug
There was a problem hiding this comment.
Pull request overview
Fixes trailingHtmlComments so it can’t fabricate a “comment” that spans visible prose when a stray --> appears outside of an actual HTML comment, ensuring durable ClawSweeper markers remain safely recoverable from published review bodies.
Changes:
- Harden
trailingHtmlCommentsby rejecting backward-paired<!-- ... -->candidates unless the opener’s first-->is the terminator being matched. - Add targeted regression/property tests covering the stray-terminator-in-prose case and a realistic mid-body review-history marker layout.
- Add a Crabbox/Node 24 proof contract + scripts under
docs/proof/to demonstrate well-formedness, boundedness, and no-loss behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/review-comment-markers.ts | Adds an interior-terminator guard so backward pairing can’t bridge across prose. |
| test/review-comment-markers.test.ts | Adds regression and property-guard tests for well-formed trailing comment extraction. |
| docs/proof/trailing-html-comment-parsing/run-proof.sh | Container proof runner that builds, compiles a pre-fix baseline, and runs proof + focused tests. |
| docs/proof/trailing-html-comment-parsing/run-proof.mjs | Proof script asserting well-formed, bounded, and no-loss claims against dist/. |
| docs/proof/trailing-html-comment-parsing/README.md | Documents the proof contract, claims, fixtures, and expected outputs. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Codex review: needs maintainer review before merge. Reviewed September 1, 2026, 5:08 AM ET / 09:08 UTC. ClawSweeper reviewWhat this changesThe branch prevents trailing review markers from being parsed across visible prose containing a closing HTML-comment delimiter, with a focused regression test and contract documentation. Merge readinessKeep this PR open: current main still has the unguarded marker parser, while this PR’s final three-file delta adds the narrowly targeted delimiter check and regression coverage. The supplied current-head compiled-parser proof and successful hosted checks support normal maintainer review. Priority: P3 Review scores
Verification
How this fits togetherClawSweeper stores durable review state in trailing HTML comments on published review comments. The trailing-marker parser feeds review-state and recovery consumers that synchronize and recover those results. flowchart LR
A[Published review comment] --> B[Trailing marker parser]
B --> C[Contiguous marker block]
C --> D[Review state consumers]
D --> E[Comment sync and recovery]
Before merge
Agent review detailsSecurityNone. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Land the focused parser guard and regression so durable review-marker recovery cannot treat visible prose as hidden marker content. Do we have a high-confidence way to reproduce the issue? Yes, source provides a high-confidence path: current main’s unguarded parser can be given the documented earlier-comment, visible- Is this the best way to solve the issue? Yes. Requiring the candidate terminator to be the opener’s first terminator directly enforces the contiguous-comment contract without changing valid trailing marker blocks. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1d79ae6c9f2d. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (26 earlier review cycles; latest 8 shown)
|
…proof tests and rerunning it fixing problems
…enclaw#1295) Co-authored-by: Peter Steinberger <steipete@gmail.com>
* fix(dashboard): make telemetry coverage explicit * fix(dashboard): fail closed during telemetry recovery * fix(dashboard): reject contradictory freshness metadata * fix(dashboard): harden cached telemetry freshness * style(dashboard): format reconciliation guard
* fix(dashboard): correlate exact-review queue failures * test(dashboard): retain queue failure proof * fix(dashboard): keep queue log calls statically bounded * fix(dashboard): retain telemetry reconciliation correlation
* fix(review): bootstrap pinned local scanner * test(review): preserve scanner refusal coverage * fix(review): reject in-checkout scanner caches * fix(review): bound scanner bootstrap downloads * fix(review): validate preflight scanner cache * fix(review): reject symlinked scanner cache entries * fix(review): require private scanner cache authority * fix(review): preserve bootstrap proxy settings * fix(review): allow read-only cache ACLs
…claw#1324) * fix(queue): use saved lease authority for direct requeues Follow up on openclaw#1251 by reading direct-requeue authority from the saved lease decision. Preserve accepted and deduplicated receipt ownership, reject superseded completion authority, and keep newer command decisions intact. The original lost-completion fix is already upstream; retain its existing contributor credit. * test(queue): document the saved-lease authority repro
) Share leading-front-matter structure across report metadata, repair intake, workflow selection, and decision packets while preserving each reader's decoding and legacy promotion guards. Keep duplicate and competing metadata fail-closed without treating ordinary body examples as authority. Add regression coverage and inspectable consumer proof. Exact-head controlled apply proof also verifies that a persisted conflicting record is rejected before GitHub transport, while valid controls reach the close boundary on synthetic state. Co-authored-by: Dwin Gharibi <dwin.gharibi@email.kntu.ac.ir>
…aw#1323) * fix(review): classify test support consistently * test(review): preserve unknown surface counts after integration
* fix(review): provision pinned Codex source * fix(review): refresh OpenClaw review caches
) Fix hosted exact-event review ancestry acquisition for pull requests that merge the base branch. Preserve complete blobless history while retaining bounded fail-closed hydration for genuinely incomplete ancestry. Co-authored-by: Goutam Adwant <8672451+goutamadwant@users.noreply.github.com> Co-authored-by: roboclaw-bot <309084314+roboclaw-bot@users.noreply.github.com> Co-authored-by: Vito Cappello <3279061+VACInc@users.noreply.github.com>
* refactor(review): let Codex judge changed PR content Remove the compiler-backed semantic cache and its patch, tree-mode, revalidation, telemetry, and runtime-install plumbing. Keep exact-input caches, restricted checkout hydration, scanner admission, and durable publication gates. Bundle matching runtime configuration, prompts, and schemas. * docs(review): describe exact-input cache ownership
Keep the runtime-budget preload fixed and move timestamps and paths into sibling JSON state. Pass the terminal fixture's checkout directory directly as inherited fd 9 instead of constructing a shell command. Remove the unnecessary temporary Node helper module while retaining all clock, readiness, descriptor and cleanup assertions. This is test-only fixture hardening with no production, configuration, dependency, deadline or threshold change. The maintainer cleanup removes four lines and one temporary program lifecycle relative to the contributor proposal; the final two-file change is +61/-57 against its integrated base. Validated published head 2e11ef4 on fresh AWS: 34/34 focused fixture cases, 4,248 full-check passes with eight explicit platform/capability skips, and 13/13 changed-coverage script tests. Exact-head CI and both CodeQL analyses passed. Precommit and committed Codex reviews had no accepted/actionable P0 findings. The unchanged macOS viewport cleanup deadline failure remains documented; it passed on AWS, and no workaround was added here. The current ClawSweeper review found no patch defect but reported missing blobs in its partial clone. Maintainer verification independently materialized all 25 relevant historical/current blobs without lazy fetch and confirmed that current main 1bcce8b leaves the fixture, helper, terminal-cleanup and runtime-budget owners unchanged from the integrated base. That covers this PR's source-review gap without claiming the reviewer infrastructure itself is fixed. Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
Rewrite the contributor proposal on current main, preserving its ancestry and first-terminator guard while dropping historical proof-only scaffolding. An already-closed comment must not bridge visible prose ending in -->. Keep contiguous trailing markers recoverable and add the narrow regression. Build, 75 focused tests, controlled compiled-parser/consumer before-after proof, and managed P0 Codex review passed. Local full check was stopped after stalling with two untouched fixture failures; exact-head CI remains required. Bay API, UI and schema contracts are unchanged. Fixes openclaw#1069 Co-authored-by: Dwin Gharibi <dwin.gharibi@email.kntu.ac.ir>
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Fixes #1069.
An earlier HTML comment followed by visible prose ending in
-->could be returned as one malformed trailing comment. Require the opener's first closing delimiter to match the candidate's closing delimiter. Marker recovery stops at intervening prose while retaining valid contiguous trailing markers.This rewrites the original proposal on current main, preserving @dwin-gharibi's commit ancestry and credit. The final change is 23 added lines across three files: the guard, one focused regression, and the active documentation contract. The historical proof-only scaffold is removed from the proposed tree.
OpenClaw Bay impact: no observer API, UI, schema, route, or control change. Current production verdict normalization already retains visible prose and markers; this patch fixes marker parsing and does not add a body-stripping path. No changelog or dependency change.
Controlled real behavior proof
Base
7cc443fe363386e197a0b19fde0c4b534df6c943and candidate8d583a05915f737926cd54e8943aee471e2d35acwere built and exercised on macOS / Node 24.20.0. The actual built parser, review-state marker consumer, and durable verdict normalizer received synthetic comment strings. The proof was replayed after committing; the compiled parser SHA-256 is66b36a3f2a8733dd343ac392645e884c4125492f2a612c105baba4ad605d5fd2.-->+ two valid markerssha=headMinimal reproduction of the changed production parser after
pnpm run build:This is controlled execution of compiled production functions, with no network or GitHub mutation. It proves the parser/consumer boundary, not a confirmed production incident or a live publishing workflow.
Validation
The regression fails on the base (3 pass / 1 fail), then 75 focused tests pass with the guard. Build, formatting, lint, static checks, and 13 changed-coverage tests passed. Managed Codex reviews before commit and on the committed branch both found no accepted/actionable P0 findings.
The local full
pnpm run checkwas stopped after 7m07s without recent output. Buffered output revealed failures in two untouched fixtures: managed-scanner symlink handling and pinned Codex-source setup (EDITOR unset). Their causes were not established; local full-suite success is not claimed. Current-head hosted CI is required before landing.