Skip to content

Add data-aware Declare constraints to path search - #15

Merged
dbera merged 23 commits into
mainfrom
feature/declare-constraints
Aug 7, 2026
Merged

Add data-aware Declare constraints to path search#15
dbera merged 23 commits into
mainfrom
feature/declare-constraints

Conversation

@dbera

@dbera dbera commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Summary

This change introduces data-aware Declare constraints for constrained path
discovery in LTSVisualizer.

The implementation covers the full workflow:

  • define Declare constraints and transition-data predicates;
  • build executable monitors for supported Declare templates;
  • evaluate constraints during path search;
  • select transitions and their available input/output data from the loaded graph;
  • configure typed conditions, including nested and multidimensional arrays;
  • run constrained path discovery with either a required target or an optional
    target;
  • inspect and edit constraints through a graph-aware user interface.

The side panel and condition editor were also improved to make the larger
constraint workflow easier to use.

Main changes

Declare constraint model

  • Added the core Declare constraint representation.
  • Added transition-data predicates and correlation support.
  • Added a monitor abstraction and monitor factory.
  • Added executable monitor implementations for:
    • basic Declare constraints;
    • response constraints;
    • precedence constraints;
    • existence constraints;
    • succession constraints.
  • Added validation and tests for the supported monitor configurations.

Constrained path search

  • Integrated Declare monitors into path search.
  • Passed transition input and output data into constraint evaluation.
  • Added constrained path discovery using the configured Declare constraints.
  • Added optional-target search semantics, allowing a valid constrained path to
    be discovered without requiring a fixed destination state.
  • Preserved the existing unconstrained path-search workflow.

Graph-aware constraint builder

  • Added a Declare constraint builder.
  • Added graph-aware transition selection.
  • Added a transition-data catalogue derived from the loaded graph.
  • Added searchable input/output field selection.
  • Added a data-aware condition editor with typed comparison values.
  • Added support for multiple conditions combined within a constraint.

Nested and multidimensional data

  • Added conditions over nested transition input and output data.
  • Added support for arrays of objects and arrays of primitive values.
  • Added arbitrary multidimensional-array traversal.
  • Added per-level array access modes:
    • existential item matching;
    • fixed zero-based indexing.
  • Added mixed traversal, so indexed and existential access can be combined at
    different levels of the same path.
  • Added regression coverage for path normalization, reconstruction, formatting,
    typed values, existence operators, mixed sources, and repeated fields.

User-interface improvements

  • Added a resizable side panel.
  • Added panel collapse and expansion.
  • Persisted panel width and collapsed state.
  • Added keyboard-accessible panel resizing.
  • Extracted panel sizing and persistence rules into a tested utility.
  • Redesigned the transition-condition editor with clearer sections for:
    • data-field selection;
    • array traversal;
    • comparison operator;
    • value type and value.
  • Improved behavior at narrow panel widths.
  • Preserved condition-editor state while collapsing and reopening the panel.

Supported condition capabilities

Conditions can be configured against transition inputs and outputs using:

  • string values;
  • numeric values;
  • boolean values;
  • null;
  • comparison operators;
  • exists;
  • does-not-exist;
  • nested object paths;
  • fixed array indices;
  • existential array-item matching;
  • arbitrary multidimensional combinations of indexed and existential access.

Multiple configured conditions are combined as an AND group.

Compatibility

The change preserves:

  • ordinary graph loading and visualization;
  • Inspector and Analysis functionality;
  • manual path selection;
  • unconstrained path search;
  • graph JSON handling;
  • standard web builds;
  • single-file offline builds.

No graph JSON or condition serialization migration is required.

Validation

The following validation was completed:

  • npm test
  • npm run build
  • npm run build:offline
  • manual testing with npm run dev

Manual regression testing covered:

  • graph loading;
  • Inspector, Analysis, and Paths tabs;
  • ordinary path search;
  • constrained path search;
  • Declare constraint creation and removal;
  • transition input/output field selection;
  • typed comparisons;
  • exists and does-not-exist;
  • nested and multidimensional arrays;
  • mixed indexed and existential array traversal;
  • optional-target path discovery;
  • panel resizing, keyboard resizing, collapsing, and persistence;
  • offline-build operation.

Scope

This PR combines the complete Declare-constraint feature because the model,
monitor framework, path-search integration, graph-derived data catalogue, and
constraint editor depend on one another as a single end-to-end workflow.

@dbera
dbera merged commit 181aab2 into main Aug 7, 2026
2 checks 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.

1 participant