Skip to content

fix(skill): make interface-body parsing comment- and string-aware#135

Merged
bug-ops merged 1 commit into
masterfrom
124-125-skill-parser
Jul 9, 2026
Merged

fix(skill): make interface-body parsing comment- and string-aware#135
bug-ops merged 1 commit into
masterfrom
124-125-skill-parser

Conversation

@bug-ops

@bug-ops bug-ops commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replaces the [^}]*-bounded INTERFACE_REGEX with a balanced-brace, comment- and string-literal-aware scan (extract_interface_body) so a nested object-type property no longer truncates the rest of the interface body (mcp-skill parser: INTERFACE_REGEX truncates interface bodies with nested-type braces #124).
  • Replaces line-by-line property matching with split_top_level_properties, which splits on top-level ; instead of newlines, so a property declaration whose type wraps onto a second line is captured and parsed correctly (mcp-skill parser: parse_parameters does not support multi-line property declarations #125).
  • Also fixes two gaps found during review of the above: a multi-member nested object type (e.g. filter: { foo: string; bar: number; }) being dropped because the property regex couldn't span an internal ;, and a brace inside a ////* */ comment corrupting brace-depth tracking and dropping every parameter for the tool.
  • Adds 6 regression tests covering the original repro cases plus the two follow-on gaps.
  • Adds a CHANGELOG.md entry under [Unreleased] > Fixed.

Closes #124, closes #125.

Test plan

  • cargo +nightly fmt --check
  • cargo +stable clippy --all-targets --all-features --workspace -- -D warnings
  • cargo nextest run --all-features --workspace --no-fail-fast (693/693 passed)
  • cargo test --doc --all-features --workspace
  • RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --workspace
  • Independent adversarial review by testing and critic agents against realistic generated-TS shapes (nested multi-field object types, comment-embedded braces, string-literal-embedded delimiters) — confirmed no silent data loss/corruption remains

@github-actions github-actions Bot added type: documentation Documentation changes (*.md, docs/, comments) breaking change Contains breaking API changes (requires major version bump) release Release preparation (changelog, version bumps) labels Jul 9, 2026
@bug-ops
bug-ops enabled auto-merge (squash) July 9, 2026 15:32
INTERFACE_REGEX used a [^}]*-bounded match, so a nested object-type
property truncated the interface body at the first closing brace
(#124). parse_parameters processed the body line by line, so a
property declaration wrapping onto a second line was silently
dropped (#125).

Replace both with a single comment- and string-literal-aware scan:
extract_interface_body tracks brace depth only in Code state, and
split_top_level_properties splits on top-level semicolons, both
skipping over comment and string-literal content. This also fixes
two gaps found in review: a multi-member nested object type being
dropped because the property regex could not span an internal `;`,
and a brace inside a comment corrupting brace-depth tracking for the
whole interface.

Closes #124, #125
@bug-ops
bug-ops force-pushed the 124-125-skill-parser branch from fe1c2d0 to ca56fc5 Compare July 9, 2026 15:34
@bug-ops
bug-ops merged commit 4f71b6e into master Jul 9, 2026
17 checks passed
@bug-ops
bug-ops deleted the 124-125-skill-parser branch July 9, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Contains breaking API changes (requires major version bump) release Release preparation (changelog, version bumps) type: documentation Documentation changes (*.md, docs/, comments)

Projects

None yet

1 participant