refactor: extract markdown core package#88265
Conversation
Dependency GuardThis PR changes dependency-related files. Maintainers should confirm these changes are intentional. Changed files:
Maintainer follow-up:
|
Dependency graph change authorizedThis PR includes dependency graph changes. A member of
A later push changes the PR head SHA and requires a fresh security approval. |
|
Codex review: found issues before merge. Reviewed May 30, 2026, 3:23 AM ET / 07:23 UTC. Summary PR surface: Source +186, Tests +47, Config +105, Other +77. Total +415 across 58 files. Reproducibility: yes. for the PR finding: current main trims chunks through Review metrics: 2 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Land the extraction only after restoring the existing chunk trimming contract with regression coverage and getting explicit maintainer/security approval for the dependency graph and plugin SDK package-boundary changes. Do we have a high-confidence way to reproduce the issue? Yes for the PR finding: current main trims chunks through Is this the best way to solve the issue? No, not yet. Extracting markdown into a package is a plausible maintainable direction, but this implementation should preserve the old chunk boundary behavior and clear the dependency/package-boundary approval gates first. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 5f4fc7512e33. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +186, Tests +47, Config +105, Other +77. Total +415 across 58 files. View PR surface stats
Security concerns:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 06ffb4297b
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const { lastNewline, lastWhitespace } = scanParenAwareBreakpoints(window); | ||
| const breakOffset = lastNewline > 0 ? lastNewline : lastWhitespace; | ||
| const end = breakOffset > 0 ? cursor + breakOffset : windowEnd; | ||
| chunks.push(text.slice(cursor, end)); |
There was a problem hiding this comment.
Preserve trimming at soft chunk boundaries
When the best break is in a whitespace run, such as abc def with a limit of 5, lastWhitespace points at the second space and this slice keeps the first trailing space in the emitted chunk. The previous chunkTextByBreakResolver path trimmed the chunk end and trimmed/skipped the separator before continuing, so chunkMarkdownIR now produces/render-delivers chunks with stray trailing whitespace in these inputs instead of preserving the prior markdown chunking behavior.
Useful? React with 👍 / 👎.
|
/allow-dependencies-change private markdown package importer; dependency report shows 0 added/removed/changed resolved packages for 084d761 |
|
/allow-dependencies-change private markdown package importer and root markdown-it ownership cleanup; dependency report shows no resolved package version changes for dde5656 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dde5656981
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "dependencies": { | ||
| "markdown-it": "14.2.0", | ||
| "yaml": "2.9.0" |
There was a problem hiding this comment.
Regenerate the npm shrinkwrap for the moved dependency
Moving markdown-it into this new package leaves the published npm shrinkwrap stale: npm-shrinkwrap.json still lists markdown-it under the root package dependencies and has no packages/markdown-core package entry. Because the root package ships that shrinkwrap, npm-based installs and lockfile checks continue to consume the old root-owned dependency graph instead of the package-owned one, defeating the extraction and risking package/lock mismatches. Please regenerate/update the shrinkwrap alongside this dependency move.
Useful? React with 👍 / 👎.
|
/allow-dependencies-change private markdown package importer, root markdown-it ownership cleanup, and regenerated root shrinkwrap; dependency report shows no resolved package version changes for 6f69c72 |
* refactor: extract markdown core package * refactor: remove old markdown sources * fix: use source paths for markdown core imports * fix: clean markdown package dependency ownership * fix: refresh root shrinkwrap for markdown dependency move
* refactor: extract markdown core package * refactor: remove old markdown sources * fix: use source paths for markdown core imports * fix: clean markdown package dependency ownership * fix: refresh root shrinkwrap for markdown dependency move
* refactor: extract markdown core package * refactor: remove old markdown sources * fix: use source paths for markdown core imports * fix: clean markdown package dependency ownership * fix: refresh root shrinkwrap for markdown dependency move
* refactor: extract markdown core package * refactor: remove old markdown sources * fix: use source paths for markdown core imports * fix: clean markdown package dependency ownership * fix: refresh root shrinkwrap for markdown dependency move
Summary
src/markdowninto private workspace package@openclaw/markdown-corewith explicit build exports.Verification
node scripts/run-vitest.mjs run packages/markdown-core/src/*.test.ts src/plugins/sdk-alias.test.ts src/infra/watch-node.test.ts src/plugins/contracts/extension-package-project-boundaries.test.ts test/vitest-unit-config.test.tspnpm check:changed.agents/skills/autoreview/scripts/autoreview --mode localpnpm buildBehavior addressed: internal markdown helpers now live under a package boundary without changing markdown parsing/rendering behavior.
Real environment tested: local macOS checkout, Node/pnpm repo toolchain.
Exact steps or command run after this patch: focused Vitest shard list above,
pnpm check:changed, autoreview local,pnpm build.Evidence after fix: focused tests passed;
check:changedpassed; autoreview clean; build passed.Observed result after fix: package-boundary dts includes markdown-core outputs and public SDK dts no longer references
@openclaw/markdown-core.What was not tested: live channel delivery; this is an internal package-boundary refactor covered by existing markdown/runtime tests.