Five specs, one ledger, proven to the cent
A real-time position, portfolio-weight, and FIFO/LIFO/HIFO tax-lot engine — the kind of thing a trading desk runs — built in Java 21 + Quarkus. It's too big for one spec, so spectastic decomposes it: an umbrella and four child slices, driven all the way from principles to a verified terminal state. The proof isn't a toy you poke — it's a passing test suite you can re-run.
One append-only trade ledger is the single source of truth; every analytic — net position, portfolio weight, tax lots — is a deterministic pure fold over it, in exact integer money. That one architectural choice is why the live fast-path and a from-zero replay are the same function, and reconcile to the cent. Where the other examples run in your browser, this one is a real backend: the proof is mvn verify — 22 tests, green.
Five specs, one ledger
The other examples are single specs. This one is the first that shows spectastic slicing a problem too big to hold in one artifact — an umbrella that owns the shared model and the reliability envelope, and four children that each own one hard thing. The links are reciprocal and validated: a child names its <spec-parent>, and the umbrella carves it out with a matching defer-to — or validate fails.
The lifecycle, to verified
Same eight-verb lifecycle as the rate-limiter build — but this one runs it to the terminal state: every slice ends accepted with a verify.html that ties each success criterion to the test that closes it.
Principles → spec
init --profile enterprise seeds 20 principles; then the problem is sliced. The umbrella owns the shared TradeEvent model and a latency ladder that rungs up to tick-to-analytic p99 < 1 ms; each child owns one hard problem. Every NFR across the five specs carries a <spec-slo> — the enterprise gate refuses a "fast".
Design → tasks
The umbrella design carries the load-bearing, grounded decisions the whole build inherits: event-sourced folds (D-001), exact integer money at scale 1e-4 (D-002), and the Java 21 + Quarkus stack (D-003) — chosen against a scored matrix, grounded in a real toolchain probe. Then tests-first tasks per slice.
Implement
~1,300 lines of framework-free Java for the domain, with Quarkus touching only the REST edge and the wiring bean (library-first, P-12). The read surface ships dark behind a config flag (P-8); Micrometer times every fold — the SLO instrument, made real (P-15). Read the code below.
Verify — the terminal step
Each slice moves to accepted and grows a verify.html — a derived view tracing every success criterion to its closing test and every NFR to its SLO. Authoring it wasn't ceremony: the cross-file rules caught a real traceability bug (a task over-citing a criterion it didn't close) that a hand-wave would have shipped. "Done means verified" (P-7), enforced. See it below.
Understand it with the coach
Five specs and a Java service is a lot to land on a new teammate. This is exactly what the extended verb spectastic.explain is for — a grounded coach that explains a real spec, requirement, or decision on demand, from the source. It writes nothing, and it refuses to invent: ask for something that isn't there and it reports the miss instead of hallucinating an answer.
explain is read-only and ephemeral — it teaches an artifact that already exists, authors nothing, and (with --course) can leave behind a git-ignored study guide. More in the extended commands.
Play · read · trust
The payoff, three ways. Play the tax-lot rule in your browser; read the Java that implements it; trust the passing suite that proves it.
You hold three lots — 100 @ $10, then 100 @ $14, then 100 @ $12 (deliberately out of order, so all three policies differ). Sell some shares and choose which lots to relieve. Same trades, different policy, different realized gain — that's the whole point of tax-lot tracking, and why HIFO harvests the most.
A browser re-creation of the Java fold, for illustration. The real thing is TaxLotBook — proven by the tests below, not by this widget.
And that suite is wired back to the specs. Each verify.html is a derived trace — a few rows:
The artifacts
Twenty artifacts — the five slices, each a full spec · design · tasks · verify bundle — plus the applied HIFO change and the Java project. Every one is live and clickable below, and every one passes spectastic validate on the enterprise gate.
These are the real, rendered artifacts — the same files spectastic validate checks; the excerpts above are drawn from them verbatim.