Workflows
Workflow A: start from tests/logs
- Add test and log traces:
speclogician ch trace test-add --art-id T1 --name "test positive" --given "{ x = 1 }" --when "{ amount = 2 }" --then "{ x = 3 }" speclogician ch trace log-add --art-id L1 --filename "prod.log" --given "{ x = 0 }" --contents "OrderAccepted" - Add a minimal domain model (state/action types)
- Add predicates to describe observed properties
- Add scenarios that match observed behavior
- Use diffs to measure progress: check
scenarios_valid_pctandcomponents_valid_pct
Workflow B: start from requirements/docs
- Add doc artifacts:
speclogician ch data doc-add --art-id D1 --text "Orders must be rejected if qty > 10000" - Add predicates and transitions that encode key rules
- Add scenarios to cover each requirement clause
- Link artifacts to the formal components they support:
speclogician ch data link --art-id D1 --comp-name qty_too_big - Track
linked_artifacts_pctin the diff to measure coverage
Workflow C: start from code (agentic)
- Use CodeLogician/ImandraX to extract formal structure from code
- Add source code references:
speclogician ch data src-add --art-id S1 --src-code "def check(order): ..." --language python - Use batch operations for efficiency:
speclogician ch batch --json < changes.json - Validate batches cheaply before committing:
speclogician ch batch --dry-run --json < changes.json - Iterate: inspect with
view state --compact, diagnose withreach properties, refine
The refinement loop
In all workflows, after every batch of changes:
speclogician view state --compact # current state overview
speclogician view diff --json # what changed + progress metrics
speclogician reach properties # safety + liveness check (SAFE? LIVE?)
speclogician reach unreachable # dead scenarios
speclogician reach frontier # scenarios with no successorsIf a change made things worse, undo it:
speclogician undo --jsonUse safety and liveness to drive refinement:
| Verdict | Meaning | Action |
|---|---|---|
| UNSAFE | A --bad scenario is reachable | Add guard predicates or fix transitions to block the violation path |
| NOT LIVE | A --goal scenario is unreachable | Add missing transitions or relax over-constrained predicates |
| SAFE + LIVE | All properties hold | Add more goals/bads to increase coverage, or work on complement |
The backbone is always the same: incremental typed changes + global verification after every step + measurable progress metrics