Skip to content

feat: implement decision 0022 text escapes (WO27 Part 1b) - #15

Merged
undergroundrap merged 4 commits into
mainfrom
wip/part1b-text-escapes
Sep 23, 2026
Merged

undergroundrap merged 4 commits into
mainfrom
wip/part1b-text-escapes

Conversation

@undergroundrap

@undergroundrap undergroundrap commented Sep 23, 2026

Copy link
Copy Markdown
Owner

Implements accepted decision 0022 (text escape sequences) as WO27 Part 1b.

Decoding: Exactly once: \n, \t, \\, \". Double-decoding is a bug.

Errors:

  • Unknown escapes and trailing backslash: H0638 (checker error, fails hum full-type-check with exit 1)
  • Stray empty text_split arguments: H0636 (checker error)

Honesty pass (2026-09-23): Three fail-open defects found and fixed:

  1. H0638 did not block: rejected_invalid_text_escape_v0 was missing from the blocking/counting inventories in full_type_check.rs, so hum full-type-check exited 0 on unknown escapes. Added to all three lists.
  2. Trailing backslash silently accepted: delimiter completion claimed the case before the escape check could report it. Moved escape check before delimiter completion in projected/retained paths.
  3. Diagnostic catalog count pin: H0638 addition (92→93) was not reflected in the check_all.ps1 pin. Also updated the Invoke-HumCompilerFrontChecks digest pin.

Evidence:

  • 499 unit tests pass (497 + 2 new H0638 span regression tests)
  • Local Fast profile: PASSED (EXIT:0)
  • Local Exhaustive: PASSED (14,226 canonical-seal pairs, 28.4s, EXIT:0)
  • CI: pending

New evidence:

  • fixtures/diagnostics/text_trailing_backslash_fail.hum: trailing backslash misuse fixture
  • H0638 exact-span regression tests: span marks the bad escape itself (backslash at column 16 for \q, column 15 for trailing)
  • Session AB Part 1b coverage: H0638 unknown/trailing, H0636 stray empty, newline round-trip through graph JSON

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.
@undergroundrap
undergroundrap marked this pull request as ready for review September 23, 2026 10:34
@undergroundrap
undergroundrap merged commit 7b29f40 into main Sep 23, 2026
4 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