Add posture-expansion templates and pre-bind expansion stage with derived-graph provenance#12
Open
danielbdyer wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Description
scenarios/templates/(example:policy-search.posture-expansion.yaml) that encodesid,scenarioAdoIds, andruleswithscreen,baseline,overrides,include/exclude, andmaxExpansions.ScenarioTemplateArtifact,ExpandedScenarioSet,ExpandedScenarioVariant,PostureExpansionRule) and extendedGraphNodeKind/GraphEdgeKindto includetemplateandderived-from-templatekinds.lib/domain/posture-expansion.tscontainingexpandScenarioPostureswhich consumesScenario,ScreenElements, andScreenPosturesand emits deterministic expanded variants with stable ordering (by element id) and stable variant ids (fingerprinted viasha256(stableStringify(...))).lib/application/expand.tsto run expansion as a pre-bind stage, validate templates viavalidateScenarioTemplateArtifactandvalidateTemplateExpansionContext, and persist derived expansions under.tesseract/bound/expanded/*.expanded.json(derived space; not canonical).expandScenarioTemplatesin the compile workflow (lib/application/compile.ts) prior to binding, and exposed theexpandedresult in compile outputs.lib/domain/validation.tsto parse/validate template artifacts and to produce semantic diagnostics for expansion context issues (missing posture partitions, unknown elements, non-input actions).lib/domain/derived-graph.ts,lib/domain/ids.ts,lib/application/graph.ts) to include template nodes and scenario-variant nodes and to emitderived-from-templateedges so provenance from template -> generated variant is represented in the graph; template and expanded scenarios are included in graph input fingerprints for deterministic caching.tests/domain.spec.ts) and refresh-level deterministic expanded-output test (tests/compiler.spec.ts).Testing
npm run build(TypeScript compilation) and then ran the test suites:node ./node_modules/@playwright/test/cli.js test tests/domain.spec.ts tests/compiler.spec.tsCodex Task