The four design docs from the GP architecture research thread. These define Speckl's
general-purpose architecture: conversation → SIR → deterministic compile, with domain
plugins for state machines, data schemas, and workflows.
- sir-schema.md (48KB): Central IR data structure with ~20 interfaces, 8 domain element tables
- extraction-protocol.md (47KB): How conversation populates the SIR
- validation-engine.md (39KB): SIR validation before compilation
- compilation-layer.md (43KB): How validated SIRs compile to deterministic artifacts
Phase strategy: build GP core now, ship state machines first, layer data schemas
and workflows on the same architecture (no rewrites).
- Declare speckl_len_Int helper for list/sequence lengths
- Fix infix = inside => bodies (final pass regex)
- Handle prime notation: currentTerm' → currentTerm_post
- Handle length() calls: length(log) → (speckl_len_Int log)
- Handle min(): (ite (<= a b) a b) instead of unsupported 'min'
- Handle subtraction: i-1 → (- i 1)
- Declare _post state vars when invariants compare pre/post
- Added 3 BMC verify blocks to KRaft spec (TermMonotonicity, CommitSafety, LeaderCompleteness)
- Z3 returns clean sat with zero errors for all specs
- All 37 tests pass
- Sanitize sort names: Option(NodeId) → Option_NodeId
- Emit action transition predicates only for verify/BMC mode
- Handle -> implication operator in translateExpr
- Fleshed out KRaft invariant bodies (4/6 now have real expressions)
- ToggleSwitch: clean sat with model
- TigerBeetleLedger: sat with model
- KafkaKRaft: sat with model
- All 37 tests pass
- x in someSet → someSet.has(x)
- x in someMap.keys → someMap.has(x)
- x notIn someMap.keys → !someMap.has(x)
- m[k] → m.get(k) for Map state variables
- s.size() → s.size (property, not method)
- Track Map-typed state variables via mapVarNames for accurate .get() translation
- Thread mapVarNames through emitAction and rewriteExpr
All 41 tests passing. TigerBeetleLedger now generates correct TypeScript
with .get() for Map access and .has() for Set membership.
Part of M0.1: Fix TS generator bugs (speckl#18)
- Deleted compiler/src/generators/wasm.ts (472 lines)
- Deleted compiler/src/runtime/wasm-host.ts (165 lines)
- Deleted compiler/__tests__/e2e-wasm.test.ts (203 lines)
- Removed WASM import and generation call from compiler/src/index.ts
- Removed WASMGenerated from TS generator state enum literals
- Removed WASM codegen tests from parser.test.ts
- All 37 tests passing
The WASM generator was architecturally wrong: every Map/Set operation
crossed the WASM→JS boundary, creating 45-55% overhead for a module
that doesn't compute anything. WASM will be a byproduct of the Rust
backend via wasm-pack instead (M2.1).
Closes#19
- Add 'precondition' and 'postcondition' ActionStatement types
- Parse precondition: expr and postcondition: expr in action bodies
- Support 'or' continuation lines for multi-clause pre/postconditions
- TigerBeetleLedger now parses 21 preconditions + 24 postconditions
(previously all dropped, resulting in empty action bodies)
- All 41 existing tests pass
Addresses marcus/engineering#9 (parser gap)
Does NOT wire into generators yet — TypeScript/WASM output
will be empty for pre/postconditions. Generator wiring
is follow-up work.
blog-01: Spec-Code Drift Is a Provenance Problem (~1,500 words)
blog-02: Designing SpeckDL (~1,800 words)
blog-03: How Speckl's Compiler Works (~1,900 words)
blog-04: Embedded Provenance (~1,200 words)
blog-05: Consensus Protocols in SpeckDL (~1,300 words)
publishing-toolkit: Dev.to/Medium/Reddit/HN formatting + objection prep (~3,500 words)
Total Phase 2 pipeline: ~11,200 words across 6 files.
Previously existed only in workspace copy (posts 1/3/toolkit) or
as untracked files (posts 2/4/5). All now committed to Forgejo.
Runs full pipeline (parse → generate → TS check) on all 11 examples.
Produces structured pass/fail report with artifact counts.
Supports --quick (skip WAT) and --verbose (show errors).
Current state: 5/11 clean (AccessControl, DrugDosageCalculator,
PaymentService, RetryHandler, TemperatureMonitor). 6/11 have TS errors
from known issues (engineering#9: precondition drops, record type refs,
spurious this.state prefix).
Replace 'dark provenance' / constraint-based / Z3 messaging with what Speckl
actually does: state machine compilation to 5 auditable artifacts (PROV-O,
CycloneDX, SPDX, TypeScript, WASM). Update code example from old 'speck' syntax
to current 'spec' / state / init / action keywords. Add pipeline grid, real
examples (TwoPhaseCommit, Paxos, Raft, Forgejo workflow), strategy ladder with
completion status, quickstart section with real CLI commands.
The old landing page described a completely different product — one that didn't
exist. This version accurately reflects the compiler, examples, and whitepaper
v2 that are actually built and working.
Comprehensive comparison of SpeckDL against:
- TLA+/PlusCal (model checking vs. runtime compilation)
- Alloy (structural vs. behavioral modeling)
- Coq/Rocq (static proofs vs. dynamic enforcement)
- Dafny (verified code vs. spec-as-code)
- Event-B, UML/SysML, P (Microsoft), OpenAPI/gRPC
- SBOM tools: Syft/Grype, SLSA, in-toto
Includes positioning table across 7 tools on 6 dimensions.
Defines niche: specification language with compiler-level provenance,
designed for teams that need evidence of correctness more than proof.
Covers: regulatory landscape (EO 14028, CRA, DORA, FedRAMP), NIST SA-11 control
mapping (sub-controls 2/4/6/7), the evidence problem, compliance automation workflow,
judgement transport model, 4 real-world use cases (FDA, CISA, DORA, SLSA), clear
boundaries on what Speckl does not do, and cost equation with before/after comparison.
Completes the bridge between provenance (S4) and practical regulatory value.
Rewrites the whitepaper from the old 'Dark Provenance' concept to reflect
what Speckl actually is now: specifications that compile to software.
Section 1 covers:
- The Archaeology Problem (specs that rot in docs)
- The Formal Methods Gap (verified spec ≠ running system)
- The SpeckDL Approach (compile spec directly to code + provenance)
- Concrete ToggleSwitch example (14 lines → 5 artifacts)
Whitepaper outline restructured around current compiler capabilities
(TypeScript, WASM, PROV-O, CycloneDX, SPDX generators).
Undcompiled map/record/unrecognized assignments emitted (i32.const 1)
placeholders that left values on the WASM stack. Combined with
the default return i32.const 1 at end of function, this caused
type mismatch errors (expected [], got [i32, i32] or [i32]).
Fix: make uncompiled assignments emit comment-only output with
no stack effect. Scalar assignments already work correctly since
emitExpr feeds into global.set which consumes the value.
Closes#9 WASM E2E portion — parser fix for precondition:/postcondition:
keyword handling still needed.
- 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)