feat: implement decision 0022 text escapes (WO27 Part 1b) - #15
Merged
Merged
Conversation
undergroundrap
force-pushed
the
wip/part1b-text-escapes
branch
from
September 23, 2026 09:50
01e4c26 to
3498867
Compare
Decode exactly once while building canonical AST: \n, \t, \, " become newline, tab, backslash, quote. Unknown escapes and trailing backslash are H0638 checker errors spanning the escape. All quote-aware scanners agree escaped quotes do not terminate literals. Reject stray empty arguments in text_split calls (H0636). Remove temporary split_call_arguments wrappers from full_type_check and run; migrate callers to typed_failure::split_call_arguments. Fix non-Hum semicolon in LANGUAGE_REFERENCE.md. Add escape table, H0638 documentation, and fixtures for escapes, invalid escapes, and stray-empty misuse.
Three fail-open defects in the decision-0022 implementation: 1. H0638 did not block: rejected_invalid_text_escape_v0 was missing from rejected_statements(), is_blocking_statement(), and checked_statements(), so hum full-type-check exited 0 on unknown escapes. Added to all three gate lists. 2. Trailing backslash silently accepted: projected_delimiter_completion claimed "ab\" as UnterminatedTextLiteral before projected_bad_text_escape could report InvalidTextEscape, and the unterminated completion never surfaced as a blocking error. Moved the escape check before the delimiter check in projected and retained completion events; H0638 covers trailing backslash per the diagnostic catalog. 3. Added missing evidence: trailing-backslash misuse fixture, H0638 exact-span regression tests (span marks the bad escape), and Part 1b Session AB coverage (H0638 unknown/trailing, H0636 stray empty, newline round-trip through graph JSON). Also updated the Invoke-HumCompilerCorpusChecks digest pin and improved its failure message to print expected vs found digests.
The original Part 1b commit added H0638 to the diagnostic catalog without updating the hardcoded 92-code pin in check_all.ps1. The Fast profile failed at the catalog assertion. Updated to 93.
The 92->93 diagnostic catalog count fix modified the Invoke-HumCompilerFrontChecks function body. Updated its SHA-256 pin.
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.
Implements accepted decision 0022 (text escape sequences) as WO27 Part 1b.
Decoding: Exactly once:
\n,\t,\\,\". Double-decoding is a bug.Errors:
hum full-type-checkwith exit 1)Honesty pass (2026-09-23): Three fail-open defects found and fixed:
rejected_invalid_text_escape_v0was missing from the blocking/counting inventories infull_type_check.rs, sohum full-type-checkexited 0 on unknown escapes. Added to all three lists.Evidence:
New evidence:
fixtures/diagnostics/text_trailing_backslash_fail.hum: trailing backslash misuse fixture\q, column 15 for trailing)