Skip to content

Parser errors: only flag real contraction leftovers as unescaped apostrophes - #31

Merged
ako merged 1 commit into
mainfrom
fix/apostrophe-false-positive
Jul 25, 2026
Merged

Parser errors: only flag real contraction leftovers as unescaped apostrophes#31
ako merged 1 commit into
mainfrom
fix/apostrophe-false-positive

Conversation

@ako

@ako ako commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Sudoku-app finding #4: a false-positive in the parse-error enhancer.

looksLikeUnescapedApostrophe matched any 1–4 char lowercase token as a contraction leftover. So a genuine parse error on a short lowercase MDL keyword/identifier — mismatched input 'on', 'in', 'as', 'to', 'by' — drew the "looks like an unescaped apostrophe" hint and sent the user hunting for a quote that isn't there.

Fix

Match only the fixed contraction-suffix set — s / t / d / m / re / ve / ll — the actual leftovers ANTLR is holding after an apostrophe splits it's, don't, he'd, I'm, you're, we've, you'll. Real apostrophe errors still get the hint; short real keywords no longer do.

  • Replaced the "any short lowercase word" heuristic with a contractionSuffixes set membership test.
  • Dropped the now-unused isLowerAlpha helper.
  • Added negative test cases (on/in/as/to/by) alongside the existing positive contraction cases.
  • Symptom-table row in fix-issue.md.

🤖 Generated with Claude Code


Generated by Claude Code

…trophes

looksLikeUnescapedApostrophe matched any 1-4 char lowercase token as a
contraction leftover, so a genuine parse error on a short lowercase MDL
keyword/identifier (mismatched input 'on'/'in'/'as'/'to'/'by') drew the
"unescaped apostrophe" hint and sent the user hunting for a quote that
isn't there (findings #4).

Restrict the match to the fixed contraction-suffix set (s/t/d/m/re/ve/ll —
the leftovers from it's, don't, he'd, I'm, you're, we've, you'll). Real
apostrophe errors still hint; short real keywords no longer do. Drop the
now-unused isLowerAlpha helper; add negative test cases for the keywords.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JXnEgoc2NQP1Y2TWMCMXC4
@ako
ako merged commit 076bb23 into main Jul 25, 2026
3 checks passed
ako pushed a commit that referenced this pull request Jul 28, 2026
Three fixes surfaced by testing the deployed authenticated hub:

- #31C (reliability): a failed hub registration no longer aborts the
  whole `run --hub`. An unreachable hub or stale/rejected key now warns
  and degrades to a normal local run (app boots on localhost; only the
  public preview URL is lost), instead of killing the process before the
  runtime starts. The downstream tunnel/heartbeat already guards on a nil
  registration.

- #31B (compat): with auth enabled, the shared X-Hub-Secret is honored
  again as a fallback registration credential — a valid X-Hub-Key stamps
  the owner, a valid X-Hub-Secret registers owner-less, neither is
  refused. A configured secret now actually gates soft mode too (a
  keyless, secretless register is denied rather than silently allowed).

- #31A (usability): `mxcli auth hub login --token <pat>` mints the hub
  key directly from a GitHub token, skipping the device flow — for
  environments whose egress proxy blocks GitHub's device endpoints (e.g.
  Claude Code web containers, which only permit repo-scoped paths).

Tests: secret-fallback (auth-on valid/invalid secret; soft-mode-with-
secret gating) and LoginWithToken mint+store. run-local skill documents
the --token escape hatch, non-fatal registration, and the secret
fallback.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JXnEgoc2NQP1Y2TWMCMXC4
ako pushed a commit that referenced this pull request Jul 29, 2026
- #37: write-oql-queries.md RULE 2 said "NEVER use ORDER BY or LIMIT in a view",
  but mxcli's MDL030 *requires* ORDER BY to be paired with a LIMIT (ORDER BY alone
  → CE0174; ORDER BY + LIMIT builds clean). Reworded RULE 2 + the Mistake 8,
  Step 9, and checklist entries to match the tool, and documented UNION/UNION ALL
  as a supported construct (it worked end-to-end but was undocumented).
- #32: MDL001 (nested-loop) reworded — it now distinguishes a key LOOKUP (use
  FIND) from intentional aggregation that must visit every element (correct as
  written), so it stops reading as "your loop is wrong" on report pivots.
- #31: documented that a variable first created inside an if/else arm (including
  by `$Var = call ...`) is scoped to that arm — declare before, assign in each.
- #34: run-local.md notes the Dart Sass `rgba()` comma-list trap (a theme compile
  error fails the build step pre-runtime).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JXnEgoc2NQP1Y2TWMCMXC4
ako pushed a commit that referenced this pull request Jul 31, 2026
"Read-only" conflated three things and only two are true. Document the accurate
model: a view entity has no storage (not a table, and not a database view
either — the runtime issues the OQL per query); `commit` does not write it back;
but a view row IS editable in memory (it behaves like a non-persistent object),
so it can back an editable screen that writes changes through the source entity.
Also record the CE6770 gotcha: each declared attribute type must match its
source column exactly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JXnEgoc2NQP1Y2TWMCMXC4
ako added a commit that referenced this pull request Aug 1, 2026
…-spike-emta6h

TraceOps #31#36: oql reaches run --local, lint widget flow refs, view-entity docs
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.

2 participants