Skip to content

Add model alias format specification#29984

Merged
pelikhan merged 2 commits intomainfrom
copilot/add-model-alias-format-specification
May 3, 2026
Merged

Add model alias format specification#29984
pelikhan merged 2 commits intomainfrom
copilot/add-model-alias-format-specification

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 3, 2026

Summary

Introduces a new W3C-style specification for the Model Alias Format (MAF) in GitHub Agentic Workflows (v1.1.0).

What's included

A single new file: docs/src/content/docs/reference/model-alias-specification.md

Key sections

Section Content
§4 Model Identifier Syntax ABNF grammar covering bare names, provider/model, glob patterns, and ?key=value query strings; explicit allowed-character table and prohibited-character list per segment
§5 URL-Style Parameter Encoding How parameters attach to identifiers, inheritance and caller-wins merge semantics
§6 Defined Parameters effort (low|medium|high) for reasoning models; temperature (0.0–2.0); reserved names for future params
§7 Alias Map Format YAML schema for the models: frontmatter key, constraints on circular references
§8 Fallback Resolution Algorithm Pseudocode for recursive alias + semver-aware glob resolution with parameter forwarding; compile-time DFS cycle detection and runtime per-call cycle guard
§9 Builtin Aliases Documents the shipped builtins (sonnet, haiku, opus, gpt-5, etc. and meta-aliases mini, large, auto)
§10 Merge Precedence Three-layer merge with explicit MergeAliasMap pseudocode: builtins → imported workflows (first-wins) → main workflow (always wins)
§11 Validation Rules Normative compile-time checks (V-MAF-xxx) and runtime cycle guard (V-MAF-013)
§12 Compliance Testing Test IDs (T-MAF-xxx) and compliance checklist table
Appendices Resolution walkthrough example, schema reference, extension guide, security considerations

Notable normative requirements

  • Semver-aware glob matching (§8.4): when multiple catalog entries match a glob, the entry with the highest semantic version wins; date suffix used as tiebreaker.
  • Strict character restrictions (§4.1 + V-MAF-006): each identifier segment has an explicit allowed-character set; prohibited characters (whitespace, :, @, etc.) must be rejected with a message naming the offending character and segment.
  • Cycle detection at compile time (§8.6.1 + V-MAF-010): full DFS over the merged alias map; compilation aborted on any cycle.
  • Cycle detection at runtime (§8.6.2 + V-MAF-013): per-call visited-set guard that falls back to the next alias entry if available.
  • Merge pseudocode (§10.2): MergeAliasMap algorithm explicitly documents the three-step merge with first-wins import semantics.

Related

  • Existing Go implementation: pkg/workflow/model_aliases.go
  • AWF Schema: pkg/parser/schemas/main_workflow_schema.json (models: and engine.model fields)
  • Effective Tokens Specification (cross-referenced)

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/61c14f96-26f7-494c-9f25-6913b59d5e29

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Collaborator

@pelikhan pelikhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot

  • glob matching must be semver aware (favor latest)
  • strict restriction on allowed characters in model identifiers
  • cycle in model name resolution are not allowed. Detection at compile and runtime needed.
  • document models payload merge strategy.

…ntime cycles, merge pseudocode

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/f391ad2d-af81-47e7-aaeb-0e0c01fff0df

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 3, 2026

@copilot

  • glob matching must be semver aware (favor latest)
  • strict restriction on allowed characters in model identifiers...

All four points addressed in commit 5b919f8:

  1. Semver-aware glob matching — §8.4 now defines SelectLatestMatch: when multiple catalog entries match a glob, the implementation MUST sort by descending semver tuple (e.g. 4.5 > 4.0) with date suffix as tiebreaker. Tests T-MAF-026/027/028 cover the cases.

  2. Strict character restrictions — §4.1 ABNF was tightened with a complete allowed-character table and an explicit prohibited-character list (whitespace, :, @, !, etc. are all called out). New validation rule V-MAF-006 requires the error message to name the offending character and segment type. Tests T-MAF-008/009 cover whitespace and colon rejection.

  3. Cycle detection at compile and runtime — §8.6 is now split into §8.6.1 (compile-time DFS over the full merged map; compilation aborted on any cycle) and §8.6.2 (runtime per-call visited-set guard that treats a re-entrant alias as an unavailable model and falls back). V-MAF-010 covers compile-time, V-MAF-013 covers runtime.

  4. Models payload merge strategy — §10.2 now contains explicit pseudocode (MergeAliasMap) showing the three steps: copy builtins, first-wins import loop, unconditional frontmatter overwrite.

Copilot AI requested a review from pelikhan May 3, 2026 18:37
@pelikhan pelikhan marked this pull request as ready for review May 3, 2026 18:37
Copilot AI review requested due to automatic review settings May 3, 2026 18:37
@pelikhan pelikhan merged commit 3cad106 into main May 3, 2026
3 checks passed
@pelikhan pelikhan deleted the copilot/add-model-alias-format-specification branch May 3, 2026 18:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new formal reference specification document for the Model Alias Format (MAF) used by GitHub Agentic Workflows, including syntax, parameter semantics, alias-map YAML format, resolution/merge algorithms, validation rules, and compliance tests.

Changes:

  • Introduces a W3C-style MAF specification document (v1.1.0 draft) covering ABNF grammar, parameter encoding, alias maps, and fallback resolution.
  • Defines normative validation rules (V-MAF-xxx) and a compliance test matrix (T-MAF-xxx).
  • Documents builtin aliases and a three-layer merge precedence algorithm (builtins → imports → main).
Show a summary per file
File Description
docs/src/content/docs/reference/model-alias-specification.md New normative spec for model identifier syntax, alias YAML format, resolution/merge semantics, validation rules, and compliance tests

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 5

Comment on lines +430 to +435
To rank matches, an implementation MUST extract the version string from a catalog entry using the following procedure:

1. Take the model-token portion (after the first `/`).
2. Scan right-to-left for the last occurrence of a version segment matching the pattern `\d+(\.\d+)*` (one or more dot-separated integers).
3. The extracted version string is used for comparison as a semver tuple.
4. If no version segment is found, the entry is treated as version `0.0.0` for ranking purposes.
Comment on lines +408 to +412
i. Strip parameters from E → (eBase, eParams)
ii. Merge params ← MergeParams(params, eParams) // caller wins
iii.If eBase is a key in aliasMap → recurse: Resolve(eBase+MarshalParams(eParams), ...)
iv. If eBase is a glob pattern → match against catalog; if any match, return first match + params
v. If eBase is a provider-scoped name (no wildcards) → if present in catalog, return eBase + params
Comment on lines +475 to +479
MergeParams(callerParams, aliasParams):
result = aliasParams
for each (key, value) in callerParams:
result[key] = value // caller overwrites alias
return result
| Parameter key | `[A-Za-z0-9-]` | MUST start with a letter |
| Parameter value | `[A-Za-z0-9-_.]` | |

Characters explicitly PROHIBITED in all segments: whitespace, `@`, `!`, `#`, `$`, `%`, `^`, `&` (except as separator), `(`, `)`, `+`, `=`, `[`, `]`, `{`, `}`, `|`, `\`, `:`, `;`, `,`, `<`, `>`, `/` (except as provider/model separator), `?` (except as parameter separator), `"`, `'`.
Comment on lines +155 to +163
model-token = model-char 0*( model-char / "." model-char )
; segments separated by "."; each segment starts with ALPHA or DIGIT

model-char = ALPHA / DIGIT / "-" / "_"
; the underscore is permitted inside model tokens only

glob-pattern = provider-token "/" model-glob-token

model-glob-token = 1*( model-char / "." / "*" )
@github-actions github-actions Bot mentioned this pull request May 3, 2026
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.

3 participants