Repository navigation
refactor(id): split web/markdown.rs into four submodules (#4704) - #8404
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 seconds. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ✅ CompletedThis 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. |
|
state: parked Task 6691 (issue #4704): the markdown.rs split is implemented fresh from current main and opened as PR #8404 (branch queue/6691-4704-markdown-split): markdown_scan (1,282), parse_helpers (1,281), prosemirror_json (1,479), markdown_serialization (1,072), root markdown.rs ~1,176 production lines — all under the 2,500 limit, grandfather entry removed from .github/scripts/check-production-line-limit.sh, guard self-test example moved to cli.rs (#4715 entry untouched, as is #4717's). Verification on the laptop: cargo check --lib --features web,sandbox,ssh,world clean; cargo test --lib --features web web::markdown — 266 passed, 0 failed; line guard over the tree flags no markdown file; guard contract tests pass. PR #7256 (the stale earlier split) is closed as superseded with a salvage note — its layout was adopted, its flake-check part was already superseded by main's prod-lines-check. The branch also carries, as a separate first commit, the one-character serve.rs typo fix for #8355 (it broke every web+world build on main, so nothing here could compile without it). Parking as a CI wait: merge PR #8404 when checks complete and any Codex findings are dispositioned (the diff is move-only apart from visibility prefixes, but Codex review on a 5k-line move deserves a real read). Merging closes #4704 and #8355. |
…own-split # Conflicts: # .github/scripts/check-production-line-limit.sh # pkgs/id/src/web/markdown.rs
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: afb8c9800e
ℹ️ 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".
| mod markdown_scan; | ||
| mod markdown_serialization; | ||
| mod parse_helpers; | ||
| mod prosemirror_json; |
There was a problem hiding this comment.
Add the required dated refactor design record
This split moves over 5,000 lines into four new modules, qualifying as the major refactor covered by pkgs/id/AGENTS.md's document-first requirement. The commit contains no dated refactor record, and repository-wide searches for the issue number, new module names, and markdown-split descriptions found no corresponding design document. Add the required dated document explaining the module boundaries and shared-helper visibility decisions so the architectural rationale is preserved.
AGENTS.md reference: pkgs/id/AGENTS.md:L159-L168
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 4bab9f9: added the dated refactor record at doc/2026-11-11T03-19-54Z_refactor_markdown_module_split/2026-11-11T03-19-54Z_refactor_markdown_module_split.md (pkgs/id/docs/ is a symlink to the repo-root doc/ tree where dated records live). It documents the request and scope from #4704, the four module boundaries (markdown_scan, parse_helpers, prosemirror_json, markdown_serialization, plus what the root keeps), the visibility rule the split applied (pub(crate) at most for moved items, root re-exports, no crate-boundary widening), the guard-entry removal, the split-time verification, and a dated update section covering the merge with main (the #1002 port into markdown_serialization.rs / parse_helpers.rs / root tests and the combined grandfather-list resolution). The record notes it was written at review time in response to this finding.
…own-split # Conflicts: # .github/scripts/check-production-line-limit.sh
…4704) The merged grandfather list is empty: main removed the world_session entry when its #4717 split landed, and this branch removes the markdown.rs entry. The contract test fixture named a grandfathered path (world_session on this branch, markdown on main); with no entry left, the compliant-tree case now asserts a plain pass and records how to restore the fixture if an entry returns.
|
🤖 Agent note · main merged, guard conflict resolved, tests re-verified — task 6691 resumed
|
Summary
Fixes #4704. Splits
pkgs/id/src/web/markdown.rs(6,273 production lines at the base) into cohesive submodules and removes its F11.10 line-guard grandfather entry in the same PR, per the issue's acceptance:web/markdown/markdown_scan.rs(1,282 lines) — source scans: fence/HTML-block tracking, container prefixes, footnote/link-reference source scans.web/markdown/parse_helpers.rs(1,281 lines) — link reference definitions, footnote synthesis, destination protection, table code-span escapes.web/markdown/prosemirror_json.rs(1,479 lines) — ProseMirror JSON construction from the CommonMark AST (convert_node, inline/list conversion, placement validation).web/markdown/markdown_serialization.rs(1,072 lines) —prosemirror_to_markdownand its rendering helpers, including hard-break placement normalization.web/markdown.rskeeps the public API,json_to_ast, and the test module: ~1,176 production lines. Every resulting production file is at or below the 2,500-line limit; no behavior change (moved items only gainedpub(crate)visibility; the root re-exports them).Also in this PR, as a separate first commit: the one-character
serve.rstypo fix for #8355 (_started_server_config), which broke every web+world build on current main — the split's verification could not compile without it. It is an independent commit and can be cherry-picked on its own.The guard script's self-test example for a grandfathered path now uses
pkgs/id/src/cli.rs(still grandfathered under #4715); the #4715 and #4717 grandfather entries are untouched.This supersedes PR #7256, the earlier split attempt preserved from task 6599: that branch's split was built on a much older main (21 changed + 18 new items on main inside the moved region, including the link/image sanitization work, per the task 13547 analysis), and its flake-check part was already superseded by main's
prod-lines-check. This PR re-derives the same four-module layout from current main instead of porting the stale branch.Verification
cargo check --lib --features web,sandbox,ssh,worldinpkgs/id— clean (after the id: serve.rs does not compile with the web feature (_started_server_config typo on main) #8355 commit).cargo test --lib --features web web::markdownon the laptop — 266 passed, 0 failed (the full existing markdown suite, unchanged)..github/scripts/check-production-line-limit.shover the tree: no markdown file flagged;check-production-line-limit.test.sh— all contract tests pass.Task 6691, lane code-g.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.