Skip to content

Schema Changes for 0.3.0#5

Merged
gruenwaldlk merged 20 commits into
mainfrom
features/gruenwaldlk/release_0_3_0
Jul 22, 2026
Merged

Schema Changes for 0.3.0#5
gruenwaldlk merged 20 commits into
mainfrom
features/gruenwaldlk/release_0_3_0

Conversation

@gruenwaldlk

Copy link
Copy Markdown
Member

No description provided.

gruenwaldlk and others added 14 commits July 11, 2026 16:12
Implement the previously skipped MetafileType.Special chain so plot
manifests and story thread files are discovered, typed, and validated.

- New projects PG.StarWarsGame.LSP.Story (+ .Tests): StoryChainScanner
  walks campaignfiles.xml -> campaigns (*_Story_Name) -> plot manifests
  -> threads, recursing into tactical refs (STORY_LAND/SPACE_TACTICAL
  Event_Param1, LINK_TACTICAL Reward_Param7), behind a resolver shared
  by WorkspaceIndexer and BaselineBuilder
- Type manifests as new StoryPlotManifest, threads as StoryParser,
  activating the dormant story param validation/completion; new
  tags/StoryPlotManifest.yaml provides manifest tag validation
- Strict chain diagnostics on the referencing line (code "story-chain"):
  unresolved story names/plot entries/tactical refs, malformed
  manifests; warning for vanilla-shipped sources, error otherwise
- Feature flag features.story.discovery (server default on, client
  setting default off, restart-based) with flag-off regression test
- BaselineBuilder scans the game repository (MEG-aware) into FileTypeMap

BREAKING CHANGE: SerializedBaseline.SchemaVersion is bumped 1 -> 2.
Existing v1 baselines (downloaded or locally cached .aet files) no
longer load and are discarded cleanly; baseline-backed validation is
degraded until a regenerated v2 baseline is published. Regenerate with
the BaselineBuilder against a game install.

Closes #82
Dialog .txt scripts become a third language, scoped by the new pgproj
directories.storyDialog node.

- pgproj: directories.storyDialog in the canonical schema, loader,
  resolver, WorkspaceConfiguration/ProjectLayer StoryDialogRoots
- schema: enums/StoryDialogCommand.yaml (17 commands, typed args,
  references); new machine-readable "untested" flag on enum values
- Story project: line-based StoryDialogParser ([CHAPTER n], # comments,
  WAIT SPEECH normalization), schema-driven fact producer + dispatcher
  handlers (unknown command, arity, arg types, untested warning,
  localisation/speech/movie/SFX references), .txt diagnostics publisher
  (code "story-dialog"), scope-gated document sync for **/*.txt
- XML cross-checks: Story_Dialog outside the storyDialog scope warns on
  the event; Story_Chapter pointing at an undefined chapter errors
- Feature flag features.dialog.diagnostics (server default on, client
  setting default off, restart-based) gating everything through
  IStoryDialogScope.Enabled, with flag-off regression tests
- 3289 unit tests green; 2 new E2E smoke tests (one catches the real
  vanilla typo "TEXTCOLOR255" in Dialog_tutorial_07.txt)

Closes #89
…nostics (#83)

  From-scratch story model with the campaign-wide graph and executable
  evaluator that validation, filtering, and the future simulator share.

  - StoryThreadParser: single StoryEvent class (prereq OR-of-AND groups,
    positional params, column-accurate ranges incl. prereq tokens,
    document-order tag list for the future canonical writer)
  - StoryGraphBuilder: schema-driven typed edges (prereq/control/tactical/
    flag) via the new ParamDefinition.ReferenceTypeName, AND/OR junctions
    and portals with deterministic ids, campaign-global TRIGGER_EVENT
    resolution with ambiguity tracking
  - StoryEvaluator + immutable StoryRuntimeState: lifecycle, OR-of-ANDs
    truth semantics, fixpoint reachability with control-edge rescue,
    Tarjan prereq-cycle detection
  - StoryModelService: lazy per-campaign models (chain associations from
    the discovery scanner), validate-on-access invalidation by GameIndex
    document versions, open-buffer-first reads, layer-aware resolution
  - Graph diagnostics (code "story-graph", opt-in via
    features.story.graphDiagnostics): dangling/cyclic prereqs, duplicate
    and ambiguous event names, unreachable events, suspended plots nothing
    activates, documented tag order, 31-char flag limit
  - YAML: referenceType StoryEventName/StoryFlag/StoryPlotFile/StoryBranch
    on StoryEventType/StoryRewardType params

  Closes #83
Story event names, flags, and AI-notification ids become indexed
symbols across XML story threads and Lua scripts.

- XML (StoryDocumentSymbolCollector, schema-driven): <Event Name>
  defines StoryEvent, SET_FLAG param 1 defines StoryFlag; prereq tokens
  and reference-typed params emit column-accurate references
- Lua (LuaStorySymbolCollector): StoryModeEvents keys reference their
  XML events; Story_Event("X") defines the StoryNotification id;
  Check_Story_Flag references flags via the @xmlref schema data
- Hover/definition/references ride the existing generic handlers:
  go-to-definition works from a Prereq token to its event and from a
  STORY_AI_NOTIFICATION id to the Lua call that fires it
- Story references are campaign-scoped: index-wide duplicate and
  unresolved-reference checks exempt them (the story graph diagnostics
  own that); StoryParamReferenceHandler falls back to the raw
  referenceType, activating the previously inert planet/unit/faction
  existence checks in story params
- features.story.symbols (server default on, client setting default
  off); flag state folds into the snapshot fingerprint so cached
  parses invalidate on a flip

3382 unit tests green; E2E 71/74 (known pre-existing failure only)
incl. two new cross-language go-to-definition smoke tests.

Requires the eaw-schema counterpart (StoryEventType.yaml
StoryNotification + lua/api.d.lua typed @xmlref annotations).

Closes #84
…ions

Adds the executable story (gated by features.tools.storySimulator):
StorySimulator runs deterministic simulation over the campaign graph —
virtual clock for STORY_ELAPSED, control-edge trigger cascades
(TRIGGER_EVENT and friends; DISABLE_* rewards disable), flag table
feeding STORY_FLAGS, STORY_ELEMENT thread activation — with manual
intervention points for everything the model cannot decide: trigger
satisfaction, Lua Story_Event notifications (catalogue collected from
the campaign's indexed scripts), and tactical outcomes via the armed
victory/defeat events. Sessions live per campaign behind
aet/storySim{Start,Stop,GetState,SatisfyTrigger,SetFlag,AdvanceClock,
LuaNotify} plus an aet/storySimChanged push; the graph panel gains a
Simulate toolbar, live lifecycle colouring without re-layout, a flag
inspector, an intervention queue, and a step log. No game process, no
DAP, no file writes.

Closes #90
Adds tags that were added by recent patch
@gruenwaldlk gruenwaldlk mentioned this pull request Jul 19, 2026
@gruenwaldlk
gruenwaldlk merged commit 9b0bbe6 into main Jul 22, 2026
1 check passed
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.

2 participants