statelyai 0.15.1 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -21
- package/dist/bin.mjs +1 -1
- package/dist/{cli-CE7KhcOJ.mjs → cli-BBG--n3O.mjs} +10556 -10334
- package/dist/coverageWorker.d.mts +1 -0
- package/dist/coverageWorker.mjs +178 -0
- package/dist/index.d.mts +65 -17
- package/dist/index.mjs +2 -2
- package/dist/skills/setup-behavior-ci/SKILL.md +25 -0
- package/dist/skills/setup-behavior-ci/agents/openai.yaml +3 -0
- package/dist/skills/setup-behavior-ci/assets/campaign-adapter.mjs +203 -0
- package/dist/skills/setup-behavior-ci/assets/campaign-producer.mjs +63 -0
- package/dist/skills/setup-behavior-ci/assets/config.json +39 -0
- package/dist/skills/setup-behavior-ci/assets/estimated-model.json +12 -0
- package/dist/skills/setup-behavior-ci/assets/executable-config.json +42 -0
- package/dist/skills/setup-behavior-ci/assets/minimal.campaign.mjs +50 -0
- package/dist/skills/setup-behavior-ci/assets/plan.json +86 -0
- package/dist/skills/setup-behavior-ci/assets/vitest-adapter.mjs +47 -0
- package/dist/skills/setup-behavior-ci/assets/workflow.yml +28 -0
- package/dist/skills/setup-behavior-ci/references/contract.md +31 -0
- package/dist/skills/setup-behavior-ci/references/executable.md +41 -0
- package/dist/testing.d.mts +1 -0
- package/dist/testing.mjs +3 -0
- package/package.json +13 -8
package/README.md
CHANGED
|
@@ -24,33 +24,34 @@ npm install --global statelyai
|
|
|
24
24
|
|
|
25
25
|
<!-- command capabilities and side effects from src/cli.ts#COMMANDS -->
|
|
26
26
|
|
|
27
|
-
| Goal
|
|
28
|
-
|
|
|
29
|
-
| Calibrate reviewed behavior
|
|
30
|
-
| Run deterministic behavior evidence
|
|
31
|
-
| Adopt inspected red or green evidence | `statelyai behavior adopt .scratch/run --config config.json`
|
|
32
|
-
|
|
|
33
|
-
|
|
|
34
|
-
|
|
|
35
|
-
|
|
|
36
|
-
|
|
|
37
|
-
| Set up
|
|
38
|
-
|
|
|
39
|
-
|
|
|
40
|
-
|
|
|
41
|
-
|
|
|
42
|
-
|
|
|
43
|
-
|
|
|
44
|
-
|
|
|
45
|
-
|
|
|
27
|
+
| Goal | Command | Writes |
|
|
28
|
+
| ------------------------------------- | --------------------------------------------------------------------------------- | -------------------------------------------------------- |
|
|
29
|
+
| Calibrate reviewed behavior | `statelyai behavior calibrate --config config.json --output .scratch/calibration` | Native setup receipt awaiting inspected adoption |
|
|
30
|
+
| Run deterministic behavior evidence | `statelyai behavior check --config config.json --output .scratch/run` | Fresh local run artifact; checked baseline unchanged |
|
|
31
|
+
| Adopt inspected red or green evidence | `statelyai behavior adopt .scratch/run --config config.json` | Immutable checked state and exact config baseline |
|
|
32
|
+
| Measure source transition outcomes | `statelyai coverage model.ts --execute --cases cases.json` | Coverage report and optional Viz graph |
|
|
33
|
+
| Test an application against a model | `statelyai test ./feature.campaign.mjs` | Local code execution, report and optional replay fixture |
|
|
34
|
+
| Process a saved verification report | `statelyai verify --from-report report.json` | Local report file |
|
|
35
|
+
| List local machines | `statelyai scan` | Nothing |
|
|
36
|
+
| Edit local machines visually | `statelyai open [file]` | Local source, when you save in the editor |
|
|
37
|
+
| Set up local discovery | `statelyai init --local --scan` | Local `statelyai.json` |
|
|
38
|
+
| Set up project sync | `statelyai init --scan` | Remote project and local `statelyai.json` |
|
|
39
|
+
| Inspect project machines | `statelyai status` | Nothing |
|
|
40
|
+
| Connect to a Studio project | `statelyai link --project <id>` | Project association in `statelyai.json` |
|
|
41
|
+
| Associate an existing machine | `statelyai link <file> --machine <id>` | Selected source machine ID comment |
|
|
42
|
+
| Preview project uploads | `statelyai push --dry-run` | Nothing |
|
|
43
|
+
| Upload local machines | `statelyai push [file]` | Remote machines and local `@statelyai` IDs |
|
|
44
|
+
| Download project machines | `statelyai pull` | Linked local files and new files under `newMachinesDir` |
|
|
45
|
+
| Compare two machines | `statelyai diff <source> <target>` | Nothing |
|
|
46
|
+
| Fail on differences in CI | `statelyai diff <source> <target> --fail-on-changes` | Nothing |
|
|
46
47
|
|
|
47
48
|
## Test application behavior
|
|
48
49
|
|
|
49
50
|
<!-- trusted local campaign command from src/testCommand.ts -->
|
|
50
51
|
|
|
51
|
-
`statelyai test ./feature.campaign.mjs` runs graph paths and property testing through
|
|
52
|
+
`statelyai test ./feature.campaign.mjs` runs graph paths and property testing through the shared internal testing runtime. Install `statelyai` in the campaign project and import authoring helpers from `statelyai/testing`. The campaign is trusted JavaScript with ordinary local permissions. The child process is not a sandbox.
|
|
52
53
|
|
|
53
|
-
Use `--report report.json --fixture regression.json` to save results and a concrete counterexample, then `--replay regression.json` after fixing the app. Exit codes are 0 for passed, 1 for a model/app discrepancy, and 2 for inconclusive execution. See [Test application behavior](../../docs/cli/test.md) for budgets and replay, or the [runnable browser example](../
|
|
54
|
+
Use `--report report.json --fixture regression.json` to save results and a concrete counterexample, then `--replay regression.json` after fixing the app. Exit codes are 0 for passed, 1 for a model/app discrepancy, and 2 for inconclusive execution. See [Test application behavior](../../docs/cli/test.md) for budgets and replay, or the [runnable browser example](../mcp/testing/README.md#verify-the-browser-example).
|
|
54
55
|
|
|
55
56
|
## Quick start
|
|
56
57
|
|
|
@@ -301,6 +302,12 @@ writes an evidence artifact. `adopt <artifact-directory> --config <path>`
|
|
|
301
302
|
validates inspected red/green evidence and advances the exact checked baseline.
|
|
302
303
|
See [Behavior evidence in CI](#behavior-evidence-in-ci) for setup and exit codes.
|
|
303
304
|
|
|
305
|
+
### `coverage`
|
|
306
|
+
|
|
307
|
+
Extract source outcomes without executing the model, or add `--execute --cases
|
|
308
|
+
cases.json` to search and replay witnesses. See [Source transition
|
|
309
|
+
coverage](#source-transition-coverage) for dependency requirements and outputs.
|
|
310
|
+
|
|
304
311
|
### `login`
|
|
305
312
|
|
|
306
313
|
Store an OAuth credential or API key.
|
|
@@ -649,6 +656,25 @@ dependency scope, not complete transitive coverage. Core execution remains
|
|
|
649
656
|
reported; review identity is unavailable. CI requires clean bound inputs and
|
|
650
657
|
actual HEAD equal to `GITHUB_SHA`; environment metadata alone is not remote proof.
|
|
651
658
|
|
|
659
|
+
## Source transition coverage
|
|
660
|
+
|
|
661
|
+
<!-- coverage execution, dependencies, deadlines, and output ownership from src/sourceCoverageCommand.ts and src/sourceCoverageRunner.ts -->
|
|
662
|
+
|
|
663
|
+
`statelyai coverage model.ts` extracts a JSON obligation manifest without
|
|
664
|
+
executing application code. Add `--execute --cases cases.json` to search for
|
|
665
|
+
witnesses using the model project's v6 runtime, source-coverage graph planner and
|
|
666
|
+
`@xstate/test` adapter. `--replay report.json` rechecks retained witnesses;
|
|
667
|
+
`--graph coverage.graph.json` writes a source-linked Viz coverage graph.
|
|
668
|
+
Execution runs trusted local code with ordinary permissions in a worker with a
|
|
669
|
+
deadline. It requires project releases containing the new graph and test APIs.
|
|
670
|
+
Execution supports ESM imports, top-level await and the source project's
|
|
671
|
+
TypeScript path aliases. Both extraction and execution use `--timeout`, which
|
|
672
|
+
defaults to 120 seconds. After output paths pass alias checks, a failed run
|
|
673
|
+
replaces the report with an error and removes any previous coverage graph.
|
|
674
|
+
|
|
675
|
+
See [source transition coverage](../../docs/sdk/source-coverage.md) for examples,
|
|
676
|
+
exit codes, supported source forms and coverage criteria.
|
|
677
|
+
|
|
652
678
|
## Self-hosting
|
|
653
679
|
|
|
654
680
|
<!-- self-host auth and URL behavior from LoginCommand, baseUrlFlags, OpenCommand, credential resolution, and projectConfig.ts -->
|
package/dist/bin.mjs
CHANGED