Skip to content

feat(ctx-symbol): Anchor compact folds at AST body nodes and drive corpus regressions to zero - #24

Merged
Xuepoo merged 4 commits into
mainfrom
carryctx/ctx-0042
Aug 24, 2026
Merged

feat(ctx-symbol): Anchor compact folds at AST body nodes and drive corpus regressions to zero#24
Xuepoo merged 4 commits into
mainfrom
carryctx/ctx-0042

Conversation

@Xuepoo

@Xuepoo Xuepoo commented Aug 24, 2026

Copy link
Copy Markdown
Owner

Verdict: found already landed + one gap fixed

The M1 plan's core (Language::body_node_kinds(), find_body_node, fold_at_body_node) was already merged via earlier PRs (#13 et seq.) — not re-implemented. This delta re-measured the corpus, found and fixed the single remaining failure class, and closed out docs.

Baseline (branch @ 6cd7836)

files: 55498  raw-parse-ok slices: 1879020  regressions: 458
  css: 458

All h/hpp/go/py classes from the original ~5.3k baseline were already at zero.

Fix

  • css rule sets: the brace-path fold emitted /* ... [N lines omitted] without the closing */; the unterminated comment swallowed the kept } and every folded rule set failed to re-parse. Fix appends Language::comment_close() in fold_at_body_node (no-op for line-comment backends). Commit: fix(ctx-symbol): fold css rule sets at their AST body (css).
  • TDD: css_rule_set_fold_keeps_block_comment_closed.
  • Also: two mechanical pre-existing clippy lint fixes in test files; added compact_output_is_byte_stable_across_invocations pinning byte-identical output across two invocations over all fold paths.
  • Harness strictly decreased 458 → 0 in one iteration; final: files: 55498 raw-parse-ok slices: 1879020 regressions: 0.

Gates

cargo fmt --check / clippy --all-features --all-targets -D warnings / cargo test — all green (13 suites).

Report: https://github.com/Xuepoo/ctxctl-docs/pull/2

@Xuepoo
Xuepoo merged commit 6992cc6 into main Aug 24, 2026
12 checks passed
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.

1 participant