Skip to content

core: call the word after as an alias, in messages, the spec and the docs - #246

Merged
jbpros merged 1 commit into
mainfrom
core/alias-words
Oct 17, 2026
Merged

jbpros merged 1 commit into
mainfrom
core/alias-words

Conversation

@jbpros

@jbpros jbpros commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Second step of #244. ergo called the word that stands for something longer a "name", the same word it uses for requirements, checks and subjects. It's now an alias everywhere a reader meets it. That covers the word after as on a for line, the old syntax's each_as and as names and the $name that refers to one, and a bare word after named by. REFERENCE.md defines it once: "An alias is a short word that stands for something longer: as pr makes pr an alias for each pull request in turn."

Before After
name given twice alias given twice
invalid name invalid alias
unknown name <word> unknown alias <word>
<word> can't be a name <word> can't be an alias
<name given twice>, <invalid name> in expressions <alias given twice>, <invalid alias>

What stays "name":

  • A sentence path starting with $ that isn't $params or $input still says unknown name $foo: in a sentence, an alias is a bare word, so $foo isn't one. A test says so.
  • <unknown name $input> and <unknown name $params> in old-syntax expressions stay too, since those aren't aliases.

The old syntax's $artifact, a chained subject's parent, now says unknown alias too, since a chain's parent is an alias by #244's decisions.

The ABNF rule name is now alias, and the rule id sentence.for.name is now sentence.for.alias, with its 17 cites updated. Internal Rego rule names are unchanged.

Changes the report: the messages above, in $well_formed inputs and in expressions.

Checks

  • Every check in AGENTS.md passes: 1258 tests, no uncovered lines, 1110 spec cases. spec/check_grammar.py finds 0 disagreements.
  • The JS Wasm runtime passes within its budgets.
  • On every spec case from main and every corpus line on two inputs (1740 reports), main and this branch differ in 6 reports, and only by these messages.

🤖 Generated with Claude Code

…docs

An alias is a word that stands for something longer: the word after `as`
on a `for` line, the `each_as` or `as` name in the old syntax and the
`$name` that reads it, and a bare word after `named by`. Requirement,
check and subject names stay names.

The messages, the spec rule `sentence.for.alias`, the ABNF rule `alias`
and the docs now use the word. A `$word` in a sentence isn't an alias, so
`unknown name $foo` stays as it was.

Changes the report: `invalid name` is now `invalid alias`, `name given
twice` is `alias given twice`, `unknown name <word>` is `unknown alias
<word>` for an old-syntax `$name` or a bare word after `named by`, `<x can't
be a name>` is `x can't be an alias`, and the expression text
`<invalid name>` and `<name given twice>` are `<invalid alias>` and
`<alias given twice>`.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@jbpros jbpros added core Relates to the ergo library or format themselves. impacts-ergo-reports Impacts ergo report schema. Careful design attention needed. labels Oct 17, 2026
@jbpros
jbpros marked this pull request as ready for review October 17, 2026 21:56
@jbpros
jbpros merged commit 4a6df52 into main Oct 17, 2026
6 checks passed
@jbpros
jbpros deleted the core/alias-words branch October 17, 2026 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Relates to the ergo library or format themselves. impacts-ergo-reports Impacts ergo report schema. Careful design attention needed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant