Skip to content

refactor(markdown): derive Zalo parser metadata from its owner - #175880

Merged
steipete merged 1 commit into
mainfrom
deslop/r01-17-zalouser-markdown-recovered-20261015
Oct 18, 2026
Merged

steipete merged 1 commit into
mainfrom
deslop/r01-17-zalouser-markdown-recovered-20261015

Conversation

@steipete

@steipete steipete commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

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 merge 747fd6c72f7f2e5192c565b8ac12659ebdb06e41 against base 1595951a2274857f39f1cd80f945ea6530bb0308. 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 remains 4d260d6e879d772df535d637a6d2781dc2ac93c40ffce24cd9fe7ed281e6c3ba.

Focused runtime proof at exact signed a2e063c57bc0c2143a7f4a7735d795db40bd6248 passed68 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.

@clawsweeper

clawsweeper Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review October 17, 2026 22:15
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-17T22:17:35.178677Z a2e063c Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added channel: zalouser Channel integration: zalouser size: S labels Oct 17, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 17, 2026
@clawsweeper

clawsweeper Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Derive Zalo Personal’s Markdown metadata types from the existing parser export and remove the duplicated declarations and assertion.

Example: Render “# Title” in Zalo Personal.

  • Before: Displays “Title” with Bold and Big styles using handwritten metadata types.
  • After: Displays the same text and styles using parser-derived metadata types.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is focused and source-supported, with passing exact-head CI; retained execution evidence is compiler and in-process test coverage rather than a shipped-entry-point demonstration.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored type-only refactor changes no executable parser or transport behavior; the body reports focused parser/Zalo tests and source typechecking, and exact-head hosted validation passes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes
Reason: The maintainer-authored change removes a handwritten contract and assertion while preserving existing rendering, serialization, options, and transport behavior.

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
Reviewed head: a2e063c57bc0c2143a7f4a7735d795db40bd6248

Before merge

None.

Findings

None.

Agent review details

How this fits together

The 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]
Loading

Technical review

Best 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

  • Zalo metadata declarations and consumer assertion keeps the original intent (589ac03: Move Zalo block parsing onto shared CommonMark metadata while keeping transport formatting local and serialized IR unchanged.)
  • Shared metadata view keeps the original intent (f79678c: Use structural typed assignments for private metadata while preserving descriptors and avoiding repeated chunk metadata scans.)
  • Parser return declaration changes intended behavior with a stated reason (54f7221: Expose collected table metadata for Slack block-mode extraction; later Zalo metadata work intentionally kept the public IR declaration narrow.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 589ac03 adds extensions/zalouser/src/text-styles-shared.ts:49 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 589ac0372ec0; files: extensions/zalouser/src/text-styles-shared.ts)

PR surface

Source -28, Other -1. Total -29 across 8 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 7 21 49 -28
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 0 1 -1
Total 8 21 50 -29

Review metrics

Metric Value Why it matters
Production versus test changes Production +21/-49; tests +0/-0 Removes duplicated type ownership without adding runtime machinery or test scaffolding; the separate generated baseline loses one assertion allowance.

Labels

Label changes:

No label changes.

Label justifications:

  • P3: Maintenance cleanup with no intended change to user-visible rendering or delivery.
  • merge-risk: 🚨 compatibility: An SDK-visible return declaration now exposes existing optional metadata; maintainer-authored direction accepts that additive contract change, with unchanged runtime behavior and passing declaration-boundary checks.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 17, 2026, 6:31 PM ET / 22:31 UTC.

@steipete
steipete merged commit f749481 into main Oct 18, 2026
208 of 210 checks passed
@steipete
steipete deleted the deslop/r01-17-zalouser-markdown-recovered-20261015 branch October 18, 2026 01:26
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: zalouser Channel integration: zalouser merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant