Repository navigation
refactor(markdown): derive Zalo parser metadata from its owner - #175880
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesDerive Zalo Personal’s Markdown metadata types from the existing parser export and remove the duplicated declarations and assertion. Example: Render “# Title” in Zalo Personal.
Review scores
ProductKind: Refactor · Worth it: Yes Merge readiness✅ Ready for maintainer review This PR is a focused, useful type refactor with no actionable correctness findings; exact-head CI and package-boundary checks pass. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe shared Markdown parser produces text, style spans, and optional metadata; Zalo Personal consumes them through the Plugin SDK to create transport-specific formatting ranges. flowchart LR
A[Markdown input] --> B[Shared Markdown parser]
B --> C[IR and optional metadata]
C --> D[Plugin SDK facade]
D --> E[Zalo style compiler]
E --> F[Text and transport styles]
Technical reviewBest possible solution: Keep the parser as the metadata type owner and use its existing SDK export throughout the Zalo compiler. Do we have a high-confidence way to reproduce the issue? This is a type-ownership refactor rather than a reported runtime bug; source inspection confirms the duplicated declarations and erased assertion on the base. Is this the best way to solve the issue? The patch is the smallest complete refactor: describe existing optional fields at their owner, derive consumer types through the supported facade, and delete the copied contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0a0d88df543a. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -28, Other -1. Total -29 across 8 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 17, 2026, 6:31 PM ET / 22:31 UTC. |
|
Merged via squash.
|
What Problem This Solves
The Zalo Personal Markdown renderer maintains a handwritten copy of parser-owned block and list metadata, then asserts that the parser result has that shape. The canonical parser already creates these facts but its return declaration hides part of them.
User Impact
No user-visible change is intended; Zalo Personal Markdown parsing, rendering, and send behavior remain unchanged.
Why This Change Was Made
Describe the existing optional metadata in the parser's existing return type and derive the transport's local types from that supported parser export. Delete the duplicate metadata records and the consumer assertion. No parsing, rendering, serialization, options, SDK export names, runtime imports or send behavior changes.
This is the Zalo transport AREA slice of the Markdown owner family: seven production files, +21/-49, 28 net production lines removed. A generated assertion-baseline row is additionally removed (eight total files,+21/-50); it is not production credit. No tests are deleted or added.
Best-effort tradeoffs accepted
None beyond the existing optional metadata contract. Parser metadata remains non-enumerable and optional. The transport still uses the same parser entry point and preserves the current send-result and error behavior.
Evidence
Exact-head hosted CI39074296295 completed SUCCESS at
a2e063c57bc0c2143a7f4a7735d795db40bd6248, testing synthetic merge747fd6c72f7f2e5192c565b8ac12659ebdb06e41against base1595951a2274857f39f1cd80f945ea6530bb0308. Actual Bun-backed execution passed parser IR43, render-aware chunking14, annotation rendering9, crossing rendering7, and chunk-text2 cases, plus the three Zalo text-style suites25 (9 text-style,11 container,5 block cases). The surrounding Zalo envelope passed137 cases across23 files; that is not137 cases attributed to this change. Production/test types, extension/core lint, architecture/source contracts, and CI gate117519800353 passed. No rerun or follow-up source push was used.Hosted package-boundary job117518406290 selected Zalo plus three representative SDK consumers (Codex,Slack,Telegram). It freshly prepared221 SDK roots and emitted13934 declaration files, then compiled all four packages; Zalo took2399ms. The independent negative-boundary canary also passed. This is actual prepared declaration/consumer proof, not just the planner or blanket all-plugin coverage. Full build-artifacts was skipped; no full runtime artifact build or API-diff report is claimed. API diff is dispatch-only and no named export/callable baseline changes are needed for this truthful existing return contract. The earlier failed local suppression-policy result remains failed; hosted merge-context success does not rewrite it.
The complete exact-head check census contains190 records:69 success,118 skipped,1 neutral and2 cancelled; no failed or pending checks. The cancelled initial PR-context run39074277890 is superseded by successful same-head39074296258. Cancelled auto-response39074325173 is superseded by successful same-head39074328418. These are metadata/automation histories, not cancelled runtime suites or passing results themselves. Current native admission must still refresh effective checks, reviews, security, policy and head identity.
The recovered seven-path source patch is byte-identical to the previously reviewed candidate and applies to pinned main7dcd9a34 without conflict or reverting other work. Existing parser and Zalo block/container tests remain the relevant synthetic boundaries; live credentials or device behavior are outside this type-only change.
Fresh independent direct-route P0–P2 review completed scoped-clean with no findings; the actual report and terminal status were inspected. Canonical one-thread formatting passed on all seven production files without edits. These are source/format results, not test execution.
Canonical complete-source assertion-baseline generation passed,2602→2601files/5956→5955assertions, removing ONLY the text-styles-source allowance. All46371tracked governed-root paths were physically materialized with0skip-worktree before generation. No sparse pruning, handwritten counts or allowance increases. The generator/closure and parser pins match the candidate; tooling was reused only for syntax generation, not borrowed runtime tests or semantic types. Full eight-path patch SHA256 is
1f1e22158d62468547643d1412d729199456db81cf433c4f08834bd3e89c026c; reviewed production source remains4d260d6e879d772df535d637a6d2781dc2ac93c40ffce24cd9fe7ed281e6c3ba.Focused runtime proof at exact signed
a2e063c57bc0c2143a7f4a7735d795db40bd6248passed68 assertions across four files: parser IR43 (Vitest5.14s) and Zalo text-style/block/container25 (27.98s), two serial single-worker shards/wrapper105.55s. The qualified full proof checkout was clean/detached at this exact candidate; all workspace manifests, lockfile, workspace configuration and .npmrc match its retained install qualification. No install/reconciliation or borrowed cross-checkout semantic result. Every runtime command isolated HOME/OpenClaw/XDG/TMP. No assertion, timeout, retry or skip changed.A targeted actual-source typecheck also passed using the real Zalo text-style pipeline as its only root and the public text-chunking facade; its imports cover all five changed consumers and both changed Markdown owners. This proves source return-contract assignment, not packaged SDK declaration emission/API budgets. Targeted two-file core lint passed. Mandatory suppression policy completed naturally with exit1/fourpass-onefail (Vitest144.05s/wrapper188.66s): the same existing95vs94 explicit inventory mismatch already diagnosed in binding/FIFO, concerning backup-restore's existing second preserve-caught-error directive and native-bridge's postMessage directive. All three causal files are unchanged by this candidate; current main owns their expectation repair. No assertion, allowance, suppression, timeout, retry or skip changed. Broad declaration preparation and extension lint were reserved for CI rather than using a skip-prepare flag or the wrong core config; the completed hosted results are recorded above. Current exact-head review, security, policy and native admission remain required before landing.
The hosted execution and package-boundary receipts above cover the three Zalo text-style suites, the shared parser's explicit IR/rendering/chunking consumers, production types, and the touched Zalouser package against freshly prepared host SDK declarations. This is representative facade/declaration proof, not proof of every transitive plugin. Callable/export inventory tests do not prove return shape; the actual source-facade typecheck and hosted consumer compilation supply that contract proof. API-diff reporting is dispatch-only and was not run; the full artifact job was skipped. No generated name baseline needs changing merely to describe existing optional return fields accurately.
Signed candidate:
a2e063c57bc0c2143a7f4a7735d795db40bd6248. The normal guarded commit hook passed after its tracked files were materialized, with no hook or signing bypass; its seven-file formatting pass left the reviewed patch unchanged. The owned worktree is clean. The completed exact-head hosted results are recorded above; current native admission and verified landing remain required before completion.