From a009bacef9725bc197206d466e72f6dfda901aa7 Mon Sep 17 00:00:00 2001 From: Scott Scoble Date: Sat, 2 May 2026 20:08:08 -0700 Subject: [PATCH] =?UTF-8?q?Add=20Speckl=20demo=20page=20=E2=80=94=20live?= =?UTF-8?q?=20pipeline=20showcase=20(RetryHandler=20end-to-end)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo/index.html | 379 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 379 insertions(+) create mode 100644 demo/index.html diff --git a/demo/index.html b/demo/index.html new file mode 100644 index 0000000..d1aac8d --- /dev/null +++ b/demo/index.html @@ -0,0 +1,379 @@ + + + + + +Speckl Demo โ€” Judgement Transport for AI-Generated Code + + + + +
+

๐Ÿงฌ Speckl

+
Judgement Transport for AI-Generated Code
+
Specify โ†’ Verify โ†’ Generate โ†’ Prove. Every artifact traceable to its origin.
+
+ +
+ + +
+

๐Ÿ“‹ The Problem

+

+ AI code generators produce outputs at machine speed โ€” but they can't explain why they made a decision. + For regulated industries (medical devices, aerospace, critical infrastructure), that's disqualifying. + NIST SA-11 and the EU Cyber Resilience Act both require human-in-the-loop + oversight for automated outputs. +

+

+ Speckl is judgement transport: it bridges the gap between "the AI says X is correct" and + "here is a verifiable chain of evidence proving X is correct." It's the compliance layer for AI-generated code. +

+
+ + +
+

โš™๏ธ The Pipeline

+
+
+
๐Ÿ“
+
SpeckDL
+
Human-authored spec with constraints
+
+
โ†’
+
+
๐Ÿ”
+
Z3 Verify
+
SMT solver checks invariants
+
+
โ†’
+
+
โšก
+
Codegen
+
TypeScript / Rust from verified spec
+
+
โ†’
+
+
๐Ÿ”—
+
Provenance
+
Immutable trace from spec to code
+
+
+
+ + +
+

๐ŸŸข Live Demo: RetryHandler

+

Here's a real Speck for an exponential-backoff retry handler, running through the reference agent.

+ +

Step 1 โ€” SpeckDL Specification

+
// RetryHandler.speck โ€” Exponential backoff with constraint verification +speck RetryHandler { + input: { operation: Operation, maxRetries: Nat, initialDelay: Real } + output: { success: Bool, attemptCount: Nat, totalDelay: Real } + + // Invariants โ€” must always hold + constraint: maxRetries <= 10 + constraint: initialDelay > 0 + constraint: totalDelay == sum(delays) + constraint: totalDelay <= 30s + constraint: backoff(delay(n)) == delay(n-1) * 2 + + // Verification conditions + verify: always(implies(attempt > 1, delay > 0)) + verify: always(implies(attemptCount == maxRetries + 1, not success)) + + // Design provenance + traceability + derives from FaultHandler + satisfies RESILIENCE-REQ-01 + author: Scott Scoble + review: manual +}
+ +

Step 2 โ€” Agent Output (Run Live)

+
$ speckl run RetryHandler.speck + +๐Ÿงฌ Processing Speck: RetryHandler + Constraints: 8 + Verify conditions: 2 + +โ”Œโ”€ Verification Phase โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” +โ”‚ Task task-1: success โ”‚ +โ”‚ Z3 result: sat โ”‚ +โ”‚ All constraints verified โ”‚ +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ + +โ”Œโ”€ Codegen Phase โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” +โ”‚ Task task-2: success โ”‚ +โ”‚ Generated typescript code (27 lines) โ”‚ +โ”‚ Interface + constraint guards emitted โ”‚ +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ + +โœ… Result: success | Duration: 1ms
+ +

Step 3 โ€” Generated TypeScript

+
/** Generated from Speck: RetryHandler */ +export interface RetryHandlerInput { + operation: Operation; + maxRetries: number; + initialDelay: number; + maxDelay: number; +} + +export type RetryHandlerOutput = { + success: boolean; + finalResult: string; + attemptCount: number; + totalDelay: number; +}; + +export function retryhandler(input: RetryHandlerInput): RetryHandlerOutput { + // Constraint checks (runtime guards) + // constraint: maxRetries <= 10 + // assert(maxRetries <= 10, "c1"); + // constraint: maxRetries >= 0 + // assert(maxRetries >= 0, "c2"); + // constraint: initialDelay > 0 + // assert(initialDelay > 0, "c3"); + // constraint: maxDelay >= initialDelay + // assert(maxDelay >= initialDelay, "c4"); + // constraint: totalDelay == sum(delays) + // assert(totalDelay == sum(delays), "c5"); + // constraint: totalDelay <= 30s + // assert(totalDelay <= 30s, "c6"); + // constraint: backoff(delay(n)) == delay(n-1) * 2 + // assert(backoff(delay(n)) == delay(n-1) * 2, "c7"); + // constraint: delay(n) <= maxDelay + // assert(delay(n) <= maxDelay, "c8"); + // Implementation โ€” compiled from verified DST + throw new Error("RetryHandler: implementation pending DST compilation"); +}
+ +

Step 4 โ€” Provenance Graph (Dark Provenance)

+
+
speck:RetryHandler โ†’ z3:task-1 verified_by Z3 4.12.5
+
speck:RetryHandler โ†’ code:task-2 generated_from speckl-codegen
+
+ Every derivation is recorded. Every artifact is traceable. This is your compliance audit trail. +
+
+
+ + +
+

๐Ÿค– Agent Architecture

+
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” +โ”‚ Orchestrator โ”‚ +โ”‚ Accepts Specks, decomposes tasks โ”‚ +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ + โ”‚ โ”‚ +โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” +โ”‚ Team Lead โ”‚ โ”‚ Team Lead โ”‚ +โ”‚ Verification โ”‚ โ”‚ Codegen โ”‚ +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ + โ”‚ โ”‚ +โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” +โ”‚ Z3 SME โ”‚ โ”‚ TypeScript SME โ”‚ +โ”‚ (verify) โ”‚ โ”‚ (emit) โ”‚ +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ + +// Tiered agents with TillDone condition-based task tracking +// Every SME records provenance edges for full traceability
+
+ + +
+

๐Ÿ“œ Compliance Mapping

+
+

NIST SA-11: Developer Testing and Evaluation โ€” requires human review of automated outputs

+

EU Cyber Resilience Act: Reporting obligations from Sept 11, 2026 โ€” requires SBOM + compliance evidence

+

FDA Software as Medical Device (SaMD): IEC 62304 โ€” requires traceability from requirements to code

+
+
+

Speckl maps directly to these requirements:

+ + + + + + +
RequirementSpeckl Feature
Human-in-the-loop reviewmanual review flag + sign-off provenance
SBOM generationBOM block โ†’ CycloneDX / SPDX export
TraceabilityDark Provenance graph โ€” every derivation recorded
Constraint verificationZ3 SMT solver โ€” mathematical proof of correctness
+
+
+ + +
+

๐Ÿ“Š Current Status

+
+
5
Example Specks
+
3
Compilation Targets (PROV-O, CycloneDX, SPDX)
+
9
Validation Checks
+
v0.3
Validator CLI
+
MIT
License
+
$0
Cost to Run
+
+
+ + +
+

๐Ÿš€ Ready to bring compliance to your AI-generated code?

+

+ Open standard โ€” github | + codeberg mirror | + speckl.scoble.me +

+

+ Consulting, pilots, and speaking: scott@scoble.me +

+
+ +
+ + + + +