Skip to content

compiler: structured list data (frames, source labels, enumitem keys, description, verse) - #147

Merged
jay3332 merged 2 commits into
mainfrom
agent/kabir-claude/list-structure-compiler
Sep 13, 2026
Merged

jay3332 merged 2 commits into
mainfrom
agent/kabir-claude/list-structure-compiler

Conversation

@GoKubar

@GoKubar GoKubar commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Compiler side of the list corpus (render-pipeline tests/list_corpus, PR #143): the compiler now reports list structure instead of only •/N. marker text, so the pipeline no longer has to rebuild labels and enumitem keys from the source.

Structures (all in crate::parser, new src/parser/lists.rs)

  • Block::ListItem gains lists: Vec<ListFrame> and item: Option<ItemLabel>.
  • Block::Styled gains lists: Vec<ListFrame> and line_break_before: Option<LineBreakBefore>. Breaking for struct-literal constructors: the render pipeline's adapter.rs builds Styled in two places, so a vendor re-pin has to land together with the pipeline PR.
  • ListFrame { environment, kind_depth, options, begin_span }: covers itemize, enumerate, description, thebibliography, quote, quotation and verse, outermost first. lists.len() is \@listdepth; kind_depth is \@itemdepth/\@enumdepth.
  • ListOption: enumitem keys parsed as keys, in the order enumitem applies them (matching \setlist[env,level] calls first, then resume*'s saved keys, then the \begin options). Covers label, label*, shortlabels, start, resume, resume*, series, leftmargin/labelsep/labelwidth/labelindent/itemindent/listparindent/rightmargin (*, ! or pt), topsep/partopsep/itemsep/parsep (glue), nosep, noitemsep, align, widest, and Other for everything else.
  • ItemLabel: Explicit { content, text, span } for \item[...] (bold in description, and it does not step the counter), Symbol for \labelitemi..iv, Counter { value, style, prefix, suffix } for \labelenumi..iv or a single-counter template (after start/resume), Template, and Empty.
  • description and verse environments are new. In verse, each \\ is \@centercr: it ends the paragraph, and the next paragraph records the break along with its [dimen] and *. A quote inside an item becomes Styled carrying both frames.
  • Fixed: \begin{enumerate}[noitemsep] was read as a shortlabels template (so it showed roman numerals).
  • label text in the existing field is now the article label for the nesting depth (–, (a), i., ...), not always •/N..

Sources are cited in the module doc: latex.ltx 15848-16073, article.cls 344-410, enumitem.sty 244-1157 and 1787.

Gates

  • The branch includes current main (354ed74, the expansion pass); parser.rs conflicts were resolved against the Rc token stream (token_mut).
  • cargo test --release --no-fail-fast (crates/compiler): 404 passed, 0 failed. That includes the new tests/list_structure.rs (9 tests) and the lists unit tests.
  • The supported inventory was regenerated (scripts/render_supported_latex.sh) and the drift gate is green.
  • Needs an apps/mac sync at integration: CI's apps/mac/scripts/sync-supported-latex.sh --check requires the bundled Resources/supported-latex.json to match. This PR changes the inventory (adds description and verse, updates the item/setlist/enumitem text), and this lane does not touch apps/.

The pipeline PR that consumes this (and needs vendor/compiler re-pinned to this PR's SHA) follows separately.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu

GoKubar and others added 2 commits September 13, 2026 08:23
… description, verse)

Block::ListItem gains `lists` (every enclosing \list environment, outermost
first: environment, kind depth, enumitem keys in application order, \begin
span) and `item` (ItemLabel: explicit \item[...] content/text/span, article
\labelitem symbol, single-counter label with value/style/prefix/suffix after
start=/resume, template, empty). Block::Styled gains `lists` and
`line_break_before` (verse's \\ = \@centercr ends the paragraph; its [dimen]
and star are kept).

New: description (bold \descriptionlabel terms), verse, \item[label] (does
not step the counter), enumitem options parsed as keys ([noitemsep] is no
longer label text), start/resume/resume*/series, label*, \setlist[env,level]
targets, nested article labels per \@itemdepth/\@enumdepth, quote inside an
item reported as Styled with both frames.

Provenance: latex.ltx 15848-16073, article.cls 344-410, enumitem.sty
244-1157 and 1787 (cited in src/parser/lists.rs). Supported inventory
regenerated; cargo test --release green (tests/list_structure.rs: 9 new).

Implementation-Agent: Claude Opus 5 (subagent kabir-claude list structure, mac-m5pro-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
Resolves parser.rs against the expansion pass (Rc token stream: token_mut); supported inventory regenerated; cargo test --release: 404 passed, 0 failed.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude list structure, mac-m5pro-kabir)

Commit-Executor: Claude Code direct Git

Co-Authored-By: Claude Opus 5 <[email protected]>
GoKubar added a commit that referenced this pull request Sep 13, 2026
Conflicts: parser.rs modules (+ algorithmic), initialisers/fields (main's subequations + #159's algorithm_counter; equation/figure counters stay in xref::Counters per #155), preamble dispatch (hyperref/boxes/counter commands + algnewcommand/algrenewcommand/algsetup/floatname), \caption (algorithm branch before main's figure/table check), float \begin/\end (figure, table, algorithm, algorithm*; #159's stale theorem clause dropped), package matches (listings + algorithm packages); supported.rs TEXT_EXTRA_ARMS and caption/item descriptions (main's item [label]). Integration fix: parser/algorithmic.rs Block::Styled gains #147's lists/line_break_before. Generated docs took main.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude integration, mac-m5pro-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
GoKubar added a commit that referenced this pull request Sep 13, 2026
…ession handoff)

Stage 1 partly done: #131, #137, #153 (incl. #142), #144, #147, #149, #150,
#155, #159, #163, #164 merged with conflicts and post-expansion fixes recorded
in docs/evidence/integration-2026-09-13b/merge-log.md. Remaining: #166, #169,
#148, #161, then the inventory regeneration and stages 2-4. The helper scripts
under tools/ hard-code the original worktree path.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude integration, mac-m5pro-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
GoKubar added a commit that referenced this pull request Sep 13, 2026
Conflicts: bib.rs BibItem accessor; parser.rs Parsed fields/initialisers,
preamble dispatch and \usepackage (two braces git had shared were restored),
\bibliographystyle vs main's now-dead inline \cite body, and the \bibitem
label. Re-added #131's hyperref cite.<key> links inside citation() and #147's
pending_item template for bibliography markers.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude integration, nixos-pc-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
GoKubar added a commit that referenced this pull request Sep 13, 2026
…merges

Every stage 1 merge took main's side of the generated inventory and deferred
the regeneration to the end of the stage. Running
crates/compiler/scripts/render_supported_latex.sh picks up #131, #137, #144,
#147, #149, #150, #153, #155, #159, #163, #164, #166 and #169, so
supported_latex::generated_artifacts_are_current passes again.

The TeX Live-derived canonical denominator is deliberately untouched: this
machine has TeX Live 2025, not the MacTeX the committed file was pinned from.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude integration, nixos-pc-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
@jay3332
jay3332 merged commit cf4b36c into main Sep 13, 2026
11 of 18 checks passed
@GoKubar
GoKubar deleted the agent/kabir-claude/list-structure-compiler branch September 13, 2026 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants