Skip to content

add structured LangError feature ids - #789

Merged
ewhauser merged 1 commit into
mainfrom
ewhauser/langerror-feature-ids
Mar 30, 2026
Merged

ewhauser merged 1 commit into
mainfrom
ewhauser/langerror-feature-ids

Conversation

@ewhauser

Copy link
Copy Markdown
Owner

Summary

  • add typed shell/syntax feature categories and feature IDs for variant-gated syntax rejections
  • extend syntax.LangError with structured FeatureID and FeatureDetail metadata while preserving the legacy Feature text and rendered error strings
  • migrate parser checkLang call sites and add regression coverage for both the new metadata and the unchanged compatibility surface
  • document the public parse-diagnostic contract in SPEC.md

Why

Language-variant rejections were only exposed as free-form strings, which forced downstream tooling to match human-facing message text. This change gives analyzers a stable machine-readable surface without changing parser behavior or existing diagnostics.

Impact

External consumers of shell/syntax can key on LangError.FeatureID, FeatureDetail, and FeatureID.Category() instead of matching Feature strings. Existing callers that only read Feature or Error() keep the previous output.

Validation

  • make lint
  • go test ./shell/syntax
  • go test ./internal/shell/...

@ewhauser
ewhauser marked this pull request as ready for review March 30, 2026 02:36
@ewhauser ewhauser changed the title [codex] add structured LangError feature ids add structured LangError feature ids Mar 30, 2026
@ewhauser
ewhauser merged commit 0fb2993 into main Mar 30, 2026
16 checks passed
@ewhauser
ewhauser deleted the ewhauser/langerror-feature-ids branch March 30, 2026 02:50
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