Gravity.Dsl.Ast
0.7.0
dotnet add package Gravity.Dsl.Ast --version 0.7.0
NuGet\Install-Package Gravity.Dsl.Ast -Version 0.7.0
<PackageReference Include="Gravity.Dsl.Ast" Version="0.7.0" />
<PackageVersion Include="Gravity.Dsl.Ast" Version="0.7.0" />
<PackageReference Include="Gravity.Dsl.Ast" />
paket add Gravity.Dsl.Ast --version 0.7.0
#r "nuget: Gravity.Dsl.Ast, 0.7.0"
#:package Gravity.Dsl.Ast@0.7.0
#addin nuget:?package=Gravity.Dsl.Ast&version=0.7.0
#tool nuget:?package=Gravity.Dsl.Ast&version=0.7.0
Gravity.Dsl.Ast
Public, versioned AST records for the Gravity DSL — a textual definition language for AI-constrained enterprise software development.
This is the read-only contract emitters consume. The Gravity compiler parses,
resolves, and validates .gravity source, then publishes an instance of these
records to any registered emitter through the Gravity.Dsl.Emitter host. Emitters
do not depend on the compiler; they depend on this package and on Gravity.Dsl.Emitter.
AST version contract
The package exposes a single constant:
public static class AstVersion
{
public const string Value = "1.1.0";
}
AstVersion is independent of the DSL grammar version. The grammar can grow
additively without changing the AST version; only a breaking change to a public
record on this package bumps the major.
1.1.0 (Phase 8)
Single additive change: NamedTypeRef gains an optional int? Version slot,
appended as the last positional parameter with a default of null. The
4-argument constructor signature from 1.0.0 is preserved — source compiled
against 1.0.0 that constructed new NamedTypeRef(name, isOpt, isArr, span)
continues to compile and run identically against 1.1.0 (the default kicks in,
Version = null). Pattern matching using named properties (is NamedTypeRef n
then reading n.Name, n.IsOptional, etc.) is unaffected. Per the FR-111
compatibility promise, no other AST record changes shape. See specs/002-phase-8-versioning/
(FR-110, FR-111, FR-112, FR-113) for the versioning surface.
Emitters declare the AST version range they support (see
Gravity.Dsl.Emitter.IEmitter.SupportedAstVersions). The emitter host refuses
incompatible emitters with a clear error at startup. This is how the Gravity
project keeps third-party emitters working across grammar revisions.
Additive-only versioning policy (AST level)
- A new optional field on an existing record is non-breaking if it has a default
that preserves the prior semantics. Such a change is shipped in a minor version
of this package and does not bump
AstVersion's major. - A new record type is non-breaking and ships in a minor version.
- Removing a field, narrowing a field's type, or changing a record's shape in a
way that existing emitters cannot tolerate is breaking and requires:
- A major bump of
AstVersion.Value. - A documented migration path for third-party emitters.
- A deprecation window in which both AST versions are published in parallel.
- A major bump of
This policy mirrors the DSL's own additive-only-by-default principle (constitution Principle IV) at the AST contract level.
Read-only contract (Principle III, VI)
Every record is a C# record with init-only properties; every collection is an
ImmutableArray<T> or ImmutableSortedDictionary<TKey, TValue>. There is no API
on this package that lets downstream code redefine domain meaning at build time —
that is the central governance mechanism of the Gravity DSL.
In particular, AnnotationDecl.Arguments uses ImmutableSortedDictionary (not
ImmutableDictionary) so iteration order is byte-stable across runs and platforms.
This is required for deterministic emitter output and is part of the contract.
Compatibility
- Target framework:
net9.0. - No external dependencies beyond
System.Collections.Immutable(BCL).
License
Apache-2.0. See LICENSE in the repository root.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- No dependencies.
NuGet packages (5)
Showing the top 5 NuGet packages that depend on Gravity.Dsl.Ast:
| Package | Downloads |
|---|---|
|
Gravity.Dsl.Compiler
Gravity DSL compiler core — lexing, parsing, resolution, validation, and AST construction over the Pidgin parser combinator stack. |
|
|
Gravity.Dsl.Emitter
IEmitter contract and emitter host for the Gravity DSL. |
|
|
Gravity.Dsl.Emitter.CSharp
C# reference emitter for the Gravity DSL. |
|
|
Gravity.Dsl.Emitter.JsonSchema
JSON Schema (Draft-07) reference emitter for the Gravity DSL — emits per-entity bundles, per-value-type, and per-enum schemas. |
|
|
Gravity.Dsl.Emitter.PostgresDdl
PostgreSQL DDL reference emitter for the Gravity DSL — emits idempotent table creation SQL plus per-version migration ledgers; target schema configurable. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.7.0 | 379 | 6/26/2026 |
| 0.6.0 | 218 | 6/26/2026 |
| 0.5.0 | 194 | 6/26/2026 |
| 0.4.0 | 195 | 6/26/2026 |
| 0.3.0 | 184 | 6/16/2026 |
| 0.2.0 | 228 | 6/16/2026 |
| 0.1.0-alpha4 | 175 | 5/19/2026 |
| 0.1.0-alpha2 | 140 | 5/19/2026 |