fix: export extraction misses/phantoms for TS unicode escapes, Erlang arity, GFM tables, NFC/NFD (closes #437, partial)#457
Open
0xLeif wants to merge 1 commit into
Open
Conversation
…entity (closes #437, partial) TS/JS: identifiers containing �/u{...} escapes are decoded instead of truncated at the backslash. Erlang: -export identity is name/arity (area/1 and area/2 are different exports); (?m) comment stripping; -compile(export_all) support.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
❌ Corvin says...
_
<(;\ .oO(oh no...)
|/(\
\(\\
" "\\
"I'm pecking through the errors..."
CI Summary
| Check | Status |
|---|---|
| Validate action.yml | ✅ Passed |
| Packaged Action Consumer | ✅ Passed |
| Dependency Audit | ✅ Passed |
| Code Coverage | ✅ Passed |
| Format Check | ❌ failure |
| Docs Site | ✅ Passed |
| Spec Validation | ❌ failure |
| Tests (build, test, clippy) | ✅ Passed |
| VS Code Extension | ✅ Passed |
📋 Spec Validation Details
❌ SpecSync: Failed
| Metric | Value |
|---|---|
| Specs checked | 62 |
| Passed | 62 |
| Errors | 1 |
| Warnings | 0 |
| File coverage | 100% (105/105) |
| LOC coverage | 100% (86936/86936) |
Errors
- meaningful changed paths are not covered by an active change: src/exports/erlang.rs, src/exports/typescript.rs
Action Items
- Review and fix -- meaningful changed paths are not covered by an active change: src/exports/erlang.rs, src/exports/typescript.rs
Generated by specsync · Run specsync check --format github to reproduce
Powered by corvid-pet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem (partial fix — see Deferred below)
Export-extraction mismatches that produce phantom "no matching export" errors or silently hidden exports:
\uescapes:export const caf\u0061 = 4(the legal identifiercafa) was truncated at the backslash to a boguscafexport — an unfixable phantom.name/arity—area/1andarea/2are different exports; one was always unmatchable and arity mismatches were invisible. Also%comments were only stripped on the file's last line ((?m)missing), so commented-out-exportattributes on earlier lines leaked in.naïve(NFC) against source exportingnai\u{0308}ve(NFD) — glyph-identical — produced phantom errors.Repro (fixture:
/var/tmp/scratch/w2/437/)src/geo.erl(-export([area/2]).),src/u.ts(export const caf\u00e9 = 1;), spec with an indented GFM table documentingarea/2andcafé.caf\u00e9truncates tocaf; Erlang export is barearea; indented table rows ignored.cafédecodes correctly; Erlang export isarea/2(bareareain a spec still matches for back-compat, butarea/1is correctly a phantom); indented tables parse; duplicate rows warn; NFC spec matches NFD source.Root cause / Fix
exports/typescript.rs:JS_IDENTaccepts\uXXXX/\u{...}sequences;decode_js_identifier_escapesdecodes them (malformed input passes through untouched).exports/erlang.rs: emitname/arity;(?m)comment stripping;-compile(export_all)support (both atom and list forms).parser.rs(ships in PR fix: frontmatter parsing leniency enables validation bypass (closes #436) #453):TABLE_ROW_REtolerates 0–3 leading spaces;get_duplicate_spec_symbolswarns on duplicate rows.validator.rs(ships in PR fix: frontmatter parsing leniency enables validation bypass (closes #436) #453):symbol_keyfolds combining diacritics on both sides (with a dependency-free Latin decomposition table);symbols_matchlets a bare spec name match an arity-qualified export (area⇔area/2) whilearea/1≠area/2.Tests (all in-file, all passing)
test_unicode_escape_identifiers_not_truncated(typescript.rs);test_erlang_commented_out_export_on_non_last_line_not_leaked,test_erlang_comment_with_dollar_dot_and_quotes_on_non_final_line,test_erlang_compile_export_all[_list_form],test_erlang_export_list_and_callback_in_behaviour_module,test_erlang_inline_trailing_comment_inside_multiline_export_list(erlang.rs);test_get_spec_symbols_indented_table,test_get_duplicate_spec_symbols(parser.rs, PR #453);test_unicode_nfc_nfd_export_matching,test_erlang_arity_export_matching(validator.rs, PR #453).Deferred (remaining #437 bullets, NOT in this PR)
defpackage/defgeneric/defclassextractioninline/givenextractiontypedefs/externs@EXPORT_OK/ case-insensitive matchingFile overlap note
src/parser.rsandsrc/validator.rsship in PR #453 (fix/436-frontmatter-validation); the whole current files there include the #437 table/NFC-NFD/arity-matching changes above. This PR shipssrc/exports/typescript.rsandsrc/exports/erlang.rsin full.Full suite: 1743 passed, 1 pre-existing root-only failure (unrelated).
clippy --all-targets -- -D warningsclean.Closes #437 (partial — deferred bullets listed above)