-
Notifications
You must be signed in to change notification settings - Fork 31
08 MG Grammar
Varietyz edited this page Apr 2, 2026
·
1 revision
Annotation-based DSL for structured memory files.
Every annotation starts with @. Every operator has exactly one meaning.
See also: Memory Schema
| Operator | Name | Meaning | Arity |
|---|---|---|---|
:= |
Bind | Assigns value to name | Binary |
-> |
Relate | Directed relationship | Binary |
=> |
Transition | State change (from => to) | Binary |
>> |
Sequence | Ordered steps (A then B) | Binary |
| |
Union | List of alternatives | Binary |
|> |
Pipe | Scoped continuation | Unary |
| Annotation | Values | Example |
|---|---|---|
@type |
project user feedback reference
|
@type project |
@domain |
Registered values from grammar/registries/domains.md
|
@domain ai-governance | governance |
@owner |
Registered values from grammar/registries/owners.md
|
@owner jay-baleine |
| Annotation | Purpose | Example |
|---|---|---|
@tag |
Searchable terms | @tag schema | validation | frontmatter |
@scope |
Visibility scope | @scope session |
| Annotation | Purpose | Example |
|---|---|---|
@state |
Current state or transition |
@state active or @state draft => active
|
@verified |
Last verification date | @verified 2026-04-02 |
@version |
Content version | @version 3 |
@stale |
Days until stale (-1 = never) |
@stale 14 or @stale never
|
| Annotation | Purpose | Example |
|---|---|---|
@context |
Situation or transition | @context "migration in progress" |
@decided |
Named decision | @decided architecture := "event-driven" |
@rule |
Behavioral rule | @rule "always validate before write" |
@note |
Free-form note | @note "revisit after Phase 2" |
| Annotation | Purpose | Example |
|---|---|---|
@depends |
File dependencies | @depends schema -> grammar |
@supersedes |
File this replaced | @supersedes old-file |
@next |
Ordered sequence | @next phase-1 >> phase-2 >> phase-3 |
@blocks |
Blocking dependency | @blocks deployment -> testing |
| Annotation | Purpose | Example |
|---|---|---|
@created |
File created | @created src/new-module.js |
@modified |
File modified | @modified src/config.js |
@removed |
File removed | @removed src/deprecated.js |
| Annotation | Purpose | Example |
|---|---|---|
@notify |
Alert owner with pipeline | @notify jay-baleine |> @load schema.md |> @rule "validate" |
| Annotation | Purpose | Example |
|---|---|---|
@max |
Line budget | @max 150 |
@require |
Required dependency | @require auth-module |
@forbid |
Prohibited content | @forbid "hardcoded credentials" |
Each @type constrains which annotations are valid.
| Type | Required | Optional | Enforced |
|---|---|---|---|
project |
@domain, @owner, @state, @verified, @version, @stale | @tag, @context, @decided, @next, @depends, @supersedes, @created, @modified, @removed, @notify, @max, @note | — |
feedback |
@domain, @owner, @verified, @version | @tag, @rule, @context, @depends, @note | @stale never |
user |
@domain, @owner, @verified, @version | @tag, @scope, @context, @note | @stale >= 90 |
reference |
@domain, @owner, @verified, @version | @tag, @context, @depends, @note, @max | @state, @next, @notify, @created, @modified, @removed FORBIDDEN |
- Every line starts with
@or|>. No other line start is valid. -
->is always a directed relationship. Never a transition. -
=>is always a state transition. Only after@state. -
>>is always an ordered sequence. Only after@next. -
|is always union. Only in@domainand@taglists. -
|>is always pipe-forward. Only in@notifychains. -
:=is always value binding. Only in@decidedand named@rule. - Quoted strings are free text. Bare words are identifiers or paths.
node grammar/compiler/mg-compile.js --validate
node grammar/compiler/mg-compile.js --validate --compiled-index
node grammar/compiler/mg-compile.js --validate --jsonDisciplined AI Software Development © 2025 by Jay Baleine
Licensed under CC BY-SA 4.0 · banes-lab.com
Navigation
🏠 Home
Quick Reference
- 📖 Glossary
- 🔑 PAG Keywords
- 📜 PAG Grammar
- 🧩 PAG Guide
- 📐 MG Grammar
- 📋 Memory Schema
- 🏗️ Architectural Principles
- ✍️ Terminology Rules
- 🔄 Algorithm Classes
Getting Started
- 🏁 Reading Path
- ❓ FAQ
Links