Commit graph

7 commits

Author SHA1 Message Date
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
7230650628 feat(compiler): self-hosting spec + generator multi-enum support
Some checks failed
Deploy Landing Page to Storj / deploy (push) Failing after 2s
- Add speckl-compile.speckdl — compiler formally specified in SpeckDL
- Generator: multi-enum detection, value→enum mapping, trailing comma cleanup
- Emit blocks collapsed to single-line (parser limitation)
- Generated artifacts: provenance, BOMs, WAT, TypeScript (2 known bugs → engineering#8)
2026-05-03 14:42:03 -07:00
Scott Scoble
39436b4382 WASM E2E test: Speckl specs compile to runnable WebAssembly
Some checks failed
Deploy Landing Page to Storj / deploy (push) Failing after 3s
- Add __tests__/e2e-wasm.test.ts: full pipeline test
  - Parse Counter speck → generate WAT → assemble with wabt → instantiate → run
  - Verify init, action calls, guard pass/fail, state mutations
  - TigerBeetle WAT validation test (wabt parse + validate + toBinary)
- Fix wasm.ts bugs found by E2E:
  - Guard condition inverted: added i32.eqz to negate comparison
  - Missing local declarations: locals now inserted before body
  - Uncompiled guards left stack values: now emit comments only (no i32.const 1)
- Install wabt npm package for WAT→WASM assembly in tests
- 41/41 tests passing (39 original + 2 E2E)

Milestone: Speckl produces runnable WebAssembly from specs.
2026-05-03 13:13:55 -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
cbee677a11 fix: support hyphenated speck names + provenance block parsing (v0.3.1)
Some checks failed
Deploy Landing Page to Storj / deploy (push) Failing after 2s
- Fixed speck name regex to allow hyphens (\w → [\w-])
- Added provenance { } block handling in parseMember()
- Updated hyphenated name test from 'My' to 'My-Service-Handler'
- All 48 tests passing (27 parser + 21 validator)
2026-05-02 23:12:27 -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