Repository navigation
Releases
@anteriorai/srg-types@0.7.0
Minor Changes
- ffa81a0: Export
AGGREGATOR_ID_PATTERNandNODE_ID_PATTERN, the aggregator and node id formats from the
SRG schema. - ffa81a0: Predicates, outcomes, aggregators and citations hold author metadata in a
metadatafield instead of as extra top-level keys, and graph objects no longer
accept fields outside the schema.
Patch Changes
- ffa81a0: License the packages under Apache-2.0: each package declares
"license": "Apache-2.0"
and ships theLICENSEfile. - ffa81a0: Support Node.js 22 and later, and ship tree-sitter's license with the
tree-sitter.wasmin@anteriorai/srg-parser. - ffa81a0: The graph schema's
item_iddescription says only theRootnode wrapsRoot.
@anteriorai/srg-parser@0.7.0
Minor Changes
-
ffa81a0: Add
!=>for false path edges, with parser support. The optional AST
Path.conditionsarray records one outgoing boolean per step; omission means all true.The compiler shares identical path prefixes and named aggregators. Existing source
and AST inputs remain supported, but generated IDs and node/aggregator counts may change. -
ffa81a0: Add an optional top-level
policy_context: "..."declaration to SRG source, with
regular and triple-quoted strings. Preserve each declaration as a
PolicyContextDefinition in SourceFile.definitions, including its source location.
Compile its value into the graph, including through the CLI. Reject duplicate
declarations during compilation, preserve explicit empty strings, and emit null
when omitted.Remove CompilerOptions and the options parameter from compile, compileFile, and
compileAST. Declare policy context in the SRG source or AST instead.
Patch Changes
- ffa81a0: Require nonempty aggregators and integer counts, validate citation regions and
page numbers, and reject nested syntax
errors or missing tokens instead of compiling Tree-sitter's recovered input. - ffa81a0: License the packages under Apache-2.0: each package declares
"license": "Apache-2.0"
and ships theLICENSEfile. - ffa81a0: Allow comments between a declaration and its properties, and between successive properties, without ending the declaration.
- ffa81a0: End a
#comment at a carriage return as well as a newline, so a policy saved with
carriage-return line endings no longer loses every declaration after its first comment. - ffa81a0: Support Node.js 22 and later, and ship tree-sitter's license with the
tree-sitter.wasmin@anteriorai/srg-parser. - ffa81a0: Undefined reference and undefined outcome errors are now
CompilerErrors carrying the
location of the misspelled identifier, and duplicate property errors areStructuralErrors
at the repeated property, matching the Python compiler. - ffa81a0: Generate the exported AST types from a shared JSON Schema, alongside Python
models for the same AST. Existing TypeScript imports remain unchanged. - Updated dependencies [ffa81a0]
- Updated dependencies [ffa81a0]
- Updated dependencies [ffa81a0]
- Updated dependencies [ffa81a0]
- Updated dependencies [ffa81a0]
- Updated dependencies [ffa81a0]
- Updated dependencies [ffa81a0]
- @anteriorai/srg-grammar@0.7.0
@anteriorai/srg-grammar@0.7.0
Minor Changes
-
ffa81a0: Add
!=>for false path edges, with parser support. The optional AST
Path.conditionsarray records one outgoing boolean per step; omission means all true.The compiler shares identical path prefixes and named aggregators. Existing source
and AST inputs remain supported, but generated IDs and node/aggregator counts may change. -
ffa81a0: Add an optional top-level
policy_context: "..."declaration to SRG source, with
regular and triple-quoted strings. Preserve each declaration as a
PolicyContextDefinition in SourceFile.definitions, including its source location.
Compile its value into the graph, including through the CLI. Reject duplicate
declarations during compilation, preserve explicit empty strings, and emit null
when omitted.Remove CompilerOptions and the options parameter from compile, compileFile, and
compileAST. Declare policy context in the SRG source or AST instead.
Patch Changes
- ffa81a0: Require nonempty aggregators and integer counts, validate citation regions and
page numbers, and reject nested syntax
errors or missing tokens instead of compiling Tree-sitter's recovered input. - ffa81a0: License the packages under Apache-2.0: each package declares
"license": "Apache-2.0"
and ships theLICENSEfile. - ffa81a0: Allow comments between a declaration and its properties, and between successive properties, without ending the declaration.
- ffa81a0: End a
#comment at a carriage return as well as a newline, so a policy saved with
carriage-return line endings no longer loses every declaration after its first comment. - ffa81a0: Support Node.js 22 and later, and ship tree-sitter's license with the
tree-sitter.wasmin@anteriorai/srg-parser.
@anteriorai/srg-compiler@0.7.0
Minor Changes
-
ffa81a0: Add
!=>for false path edges, with parser support. The optional AST
Path.conditionsarray records one outgoing boolean per step; omission means all true.The compiler shares identical path prefixes and named aggregators. Existing source
and AST inputs remain supported, but generated IDs and node/aggregator counts may change. -
ffa81a0:
metadatacompiles to the symbol'smetadatafield, so it can no longer replace
fields such asquestionorname. Adefinewhose body is a single reference
compiles to its own aggregator, keeping its name, label, doc, citations and
metadata. -
ffa81a0: Add an optional top-level
policy_context: "..."declaration to SRG source, with
regular and triple-quoted strings. Preserve each declaration as a
PolicyContextDefinition in SourceFile.definitions, including its source location.
Compile its value into the graph, including through the CLI. Reject duplicate
declarations during compilation, preserve explicit empty strings, and emit null
when omitted.Remove CompilerOptions and the options parameter from compile, compileFile, and
compileAST. Declare policy context in the SRG source or AST instead.
Patch Changes
- ffa81a0: License the packages under Apache-2.0: each package declares
"license": "Apache-2.0"
and ships theLICENSEfile. - ffa81a0:
compileASTrejects a definition or expression with an unknowntype, any key the AST schema does not define (for exampleconditionforconditions), and alocthat is not a location, with a locatedCompilerError, instead of silently dropping or ignoring them. - ffa81a0:
srg-compilenow defaults to<input>.jsonfor any input name and refuses to write over
the input file, so compilingpolicy.txtorpolicy.SRGno longer replaces the source. - ffa81a0: Export the parser's error classes,
ParseError,SyntaxError,StructuralErrorand
InternalParserError, so a project that depends on@anteriorai/srg-compileralone, as pnpm
installs it, can catch the errorscompileandcompileFilethrow for an invalid policy. - ffa81a0: A
definethat refers to itself, directly or through other defines, is now aCompilerError
naming the cycle ('d' refers to itself: d -> e -> d) at the reference that closes it, instead of
overflowing the stack. - ffa81a0: The compiler rejects a second definition of a predicate, outcome or
definename (they share one
namespace), a duplicate citation, and definitions namedroot. Names in the schema's
aggregator and node id formats (Root,A<digits>,SN<digits>andSN_<digits>) are
reserved for graph ids, so a predicate, outcome ordefinecan no longer be namedA1orSN_2. - ffa81a0: Support Node.js 22 and later, and ship tree-sitter's license with the
tree-sitter.wasmin@anteriorai/srg-parser. - ffa81a0: Undefined reference and undefined outcome errors are now
CompilerErrors carrying the
location of the misspelled identifier, and duplicate property errors areStructuralErrors
at the repeated property, matching the Python compiler. - ffa81a0:
rootis accepted only as the first step of a path. Anywhere else, including inside an
aggregator or adefine, or followed by!=>, it is aCompilerErrorat the reference instead
of a graph with a cycle back to the root or an edge that can never fire. - ffa81a0: Create a separate graph node for each path-step occurrence while retaining shared
predicate symbols. This prevents paths that reuse predicates from reaching each
other's outcomes or forming cycles when steps repeat or appear in opposite orders. - ffa81a0:
compileFileandsrg-compilereject a policy file that is not valid UTF-8 instead of
replacing its bytes with U+FFFD, matching the Python compiler. - ffa81a0: Reject a
cite:that names a citation the policy does not declare, or names the same citation twice, with aCompilerErrorat the reference, instead of compiling a dangling or repeatedcitation_idsentry. - ffa81a0:
compileASTrejects a path with no steps, an aggregator with no arguments, anotwith no expression, and a count that is not a whole number from the strategy's minimum to 2^53 - 1, with a locatedCompilerError, instead of crashing or returning a graph the runtime cannot load. - Updated dependencies [ffa81a0]
- Updated dependencies [ffa81a0]
- Updated dependencies [ffa81a0]
- Updated dependencies [ffa81a0]
- Updated dependencies [ffa81a0]
- Updated dependencies [ffa81a0]
- Updated dependencies [ffa81a0]
- Updated dependencies [ffa81a0]
- Updated dependencies [ffa81a0]
- Updated dependencies [ffa81a0]
- Updated dependencies [ffa81a0]
- Updated dependencies [ffa81a0]
- @anteriorai/srg-parser@0.7.0
- @anteriorai/srg-types@0.7.0