GeezerVison is showing github.com — refactor(id): split web/markdown.rs into four submodules (#4704) by dezren39 · Pull Request #8404 · developing-today/code
Conversation
dezren39
commented
Nov 11, 2026
•
edited by blacksmith-sh
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
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_markdown and its rendering helpers, including hard-break placement normalization.
web/markdown.rs keeps 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 gained pub(crate) visibility; the root re-exports them).
Also in this PR, as a separate first commit: the one-character serve.rs typo 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
Task 6691, lane code-g.
![Autofix with [code]smith](/api/image?u=https%3A%2F%2Fcamo.githubusercontent.com%2F33b6f70f3541c4e93f4503d29cbfec051fa1b040d8e0ae9313a51c4ece44a627%2F68747470733a2f2f70722d636f6d6d656e74732d6173736574732e626c61636b736d6974682e73682f636f6465736d6974682f6175746f6669782d776974682d636f6465736d6974682d6461726b2d33782e706e67)
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
chatgpt-codex-connector[bot] reacted with thumbs up emoji
…-guard grandfather entry (#4704)
coderabbitai
Bot
commented
Nov 11, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Warning
Review limit reached
You'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.
Check out review usage here.
View limit details
-
Limit details: You’ve used the included review currently available.
Learn how review limits work.
Review configuration:
Run configuration
-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
bff83a89-d72b-4123-a210-2b432c0e53de
Commits
-
Reviewing files that changed from the base of the PR and between 11a754e and 87a1ffb.
Files selected for processing: 8
-
.github/scripts/check-production-line-limit.sh
.github/scripts/check-production-line-limit.test.sh
doc/2026-11-11T03-19-54Z_refactor_markdown_module_split/2026-11-11T03-19-54Z_refactor_markdown_module_split.md
pkgs/id/src/web/markdown.rs
pkgs/id/src/web/markdown/markdown_scan.rs
pkgs/id/src/web/markdown/markdown_serialization.rs
pkgs/id/src/web/markdown/parse_helpers.rs
pkgs/id/src/web/markdown/prosemirror_json.rs
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Share
-
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
| Review |
Status |
Commit |
Review trigger |
| 📝 Code Review |
✅ Completed 2026-11-11T04:46:54.231073Z |
87a1ffb |
New commits |
ℹ️ 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.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 11, 2026
|
state: parked
task: 6691
lane: code-g
pr: 8404
outcome: pr_opened_ci_wait
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.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 11, 2026
…own-split
# Conflicts:
# .github/scripts/check-production-line-limit.sh
# pkgs/id/src/web/markdown.rs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 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".
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Comment on lines
+250
to
+253
|
|
mod markdown_scan;
|
|
|
mod markdown_serialization;
|
|
|
mod parse_helpers;
|
|
|
mod prosemirror_json;
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 👍 / 👎.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…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
- Agent: repo queue worker, lane tmp-code-e (repo-worker-code), task 6691 (issue id: split pkgs/id/src/web/markdown.rs (5,284 production lines) — remove the F11.10 line-guard grandfather entry #4704).
- State on claim: PR refactor(id): split web/markdown.rs into four submodules (#4704) #8404 was
mergeable: false / dirty against current main — the split was verified, but main had moved. This session merged origin/main (11a754e) into the branch (merge commit 545eb4a).
- Sole conflict:
.github/scripts/check-production-line-limit.sh grandfather list. Resolution: the list is now EMPTY — main had removed the world_session/mod.rs entry when its id: split pkgs/id/src/world_session/mod.rs (2,821 production lines) — remove the F11.10 line-guard grandfather entry #4717 split landed, and this PR removes the web/markdown.rs entry; the merged file keeps neither, with a comment recording both removals.
- Contract-test fallout, fixed in 87a1ffb: the guard contract test fixtures named a grandfathered path (world_session on this branch, markdown on main). With the list empty, the compliant-tree case now asserts a plain pass and records how to restore the fixture if an entry returns. All 9 contract cases pass.
- Guard on the merged tree: exactly the 4 pre-existing main failures (fleet-queue client.rs 3117, turso_queue.rs 6887, serve.rs 2696, directory.rs 2610) — no markdown, no world_session, no new violations. (Local runs also list generated files under pkgs/id/target/; those are build artifacts, absent in CI.)
- Codex: the one P1 finding (dated refactor design record) was fixed in 4bab9f9 and dispositioned on its thread; no other findings.
- Infra note: the first test run died with ENOSPC — the laptop /home was at 100% (197M free; tracked on issue infra: laptop /home at 100% — fleet worktree cargo targets fill the disk, builds die with ENOSPC #6797). A
cargo clean of this task's own worktree target freed 10 GiB and the re-run proceeded.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 11, 2026
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|