Commit graph

6 commits

Author SHA1 Message Date
Scott Scoble
c5ca757e80 Merge branch 'feature/z3-backend' (Z3 backend + KRaft spec) 2026-05-09 22:34:40 -07:00
6c6daaf90f feat(compiler): Z3 SMT-LIB2 verification backend (speckl#21)
- New generator: compiler/src/generators/z3.ts (1,034 lines)
- Translates SpeckDL state → Z3 sort declarations
- Translates invariants → Z3 define-fun returning Bool
- Translates actions → Z3 transition predicates (enabled + step)
- BMC unrolling with --verify-depth=N (default: 10)
- CLI: --target=z3 or --target=all
- ToggleSwitch and TigerBeetleLedger generate valid SMT-LIB2
- KafkaKRaft spec generates valid SMT-LIB2 structure
- Complex forall/set expressions emit 'true' as placeholders (to be improved)
- All 41 existing tests still pass

This unblocks M1.2 (KRaft verification), M3.2 (Show HN), and M4.3 (OAuth verification).
2026-05-09 22:28:39 -07:00
Scott Scoble
a2f7b7b2e9 fix: add dist-check guard + List<T> type parsing + state machine examples
Some checks failed
Deploy Landing Page to Storj / deploy (push) Failing after 2s
- check-dist.sh: Prevents DIST DESYNC by verifying all dist/*.js files
  are newer than their src/*.ts sources. Fails build if stale.
- Makefile: Standard build targets (build/check-dist/test/recompile/clean)
- src/index.ts: Integrated dist freshness check before compilation
- src/parser.ts: Added List<T> type parsing alongside existing Set<T>/Map<K,V>
  (e.g., 'log: List<LogEntry>' now parses as { type: 'list', elementType })
- examples/: Restored v0.3 state machine specs (TigerBeetleLedger,
  AccountLedger, ToggleSwitch, TwoPhaseCommit)
- DIST DESYNC is a known recurring anti-pattern — this guard prevents it

Tests: 39/41 pass (2 pre-existing E2E WASM failures due to missing wabt)
2026-05-05 03:11:53 -07:00
Scott Scoble
7ffd65f6b3 speckl: TypeScript state machine generator + Forgejo issue workflow spec
Some checks failed
Deploy Landing Page to Storj / deploy (push) Failing after 2s
Adds a first-class TypeScript code generator to speckl-compile that emits:
- Const enum for workflow states (IssueWorkflowState)
- Strongly-typed class with guards, state transitions, decision log
- Proper this. prefixing (state vars only, not local params)
- Enum references instead of string literals for state comparisons
- Clean tsc --noEmit compilation

Also includes:
- specs/forgejo-issue-workflow.speckdl — full workflow with 9 actions,
  8 constraints, 5 temporal verifications
- Generator deduplication of duplicate AST nodes
- Support for init block initialization of state variables

The generator was validated against the Forgejo issue workflow spec,
producing IssueWorkflow.ts that compiles with zero errors.

Refs: heartbeat conversation re: speckl-compile extensibility
2026-05-03 12:23:33 -07:00
Scott Scoble
8facd5c6c7 Wire up compiler generators + fix parser for SpeckDL edge cases
Some checks failed
Deploy Landing Page to Storj / deploy (push) Failing after 3s
- Connected PROV-O, CycloneDX, and SPDX generators to CLI entry point
- Fixed parseAuthor regex to handle angle-bracket email format
- Fixed parseDerives to handle hyphenated names and quoted rationale
- Fixed parseSatisfies to handle hyphenated requirement IDs
- Fixed parseSource to handle ref keyword with quoted value
- Added graceful fallbacks (warn instead of throw) for parse errors
- All 5 example .speck files compile and validate successfully
2026-05-02 15:14:31 -07:00
Scott Scoble
f19a43fd5f Add SpeckDL compiler scaffold
- CLI entry point with yargs parsing for speckl-compile <file> --output-dir --bom-format
- TypeScript parser with AST types for all SpeckDL primitives
- Generator for PROV-O JSON-LD provenance graphs
- Generator for CycloneDX v1.6 BOMs
- Generator for SPDX 3.0.1 BOMs
- E2E test verifying RetryHandler.speck parsing and all output formats

All tests pass.
2026-04-29 15:12:08 -07:00