Skip to content

Fail closed on malformed Ruby with structured parse diagnostics - #68

Merged
TristanKruse merged 2 commits into
mainfrom
fix/parse-diagnostics-63
Oct 26, 2026
Merged

TristanKruse merged 2 commits into
mainfrom
fix/parse-diagnostics-63

Conversation

@TristanKruse

@TristanKruse TristanKruse commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Fixes #63.

  • Fail closed by default on included malformed Ruby in both dependency modes and AST metrics. Raise SourceParseError < TechnicalError, with immutable ParseDiagnostic data (path, one-based line/column, parser message), instead of returning partial graphs or zero AST counts.
  • Count malformed files in extraction profiles, propagate technical failures through RSpec/Minitest and graph reports, and never cache failed graph builds. Project exclusions and explicit cache-clearing behavior are unchanged.
  • Document this intentional pre-1.0 change from the prototype's permissive parsing. There is no silently permissive mode.
  • Add regressions for the original reproducer, structured error immutability, adapters, logging, target-file errors, exclusions, metrics, and cache recovery. Extend the installed-gem regression script.

Validation

  • Before fix: 8 of the 9 new integration examples failed, confirming false-clean behavior.
  • After fix: 604 examples, 0 failures (8 Windows native-symlink skips); 264 files lint-clean.
  • 179 documentation pages validated without generator errors; installed-analysis smoke passes.
  • All six pinned Rack/Rake/RSpec canary modes pass with unchanged reviewed graph fingerprints.
  • Version stays 0.0.2 development. No merge or release is part of this PR.

Combined validation

Locally combined #68, #69, and #70 on an unpushed verification branch without conflicts. Passed: 614 examples with zero failures (8 Windows native-symlink skips); runtime-library-only coverage 98.48% line / 91.51% branch at unchanged 98% / 90% thresholds; 267 files lint-clean; 179 documentation pages validated; both public/installed-API smoke scripts; fresh scan of 1,269 advisories with zero findings and successful health detection; all six pinned Rack/Rake/RSpec canary modes with reviewed fingerprints unchanged. All GitHub checks on each PR are green. No PR was merged and no release/version bump was performed.

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.

Extraction: surface parse failures instead of silently passing malformed source

1 participant