feat(twin): optional spec-to-twin station (spec-independent behavioural oracle)#1
Merged
Merged
Conversation
…al oracle)
Adds a pluggable sibling to spec-to-tests that authors a digital twin — a
deliberately-trivial reference model + REQ-tagged invariants + adapter +
fast-check model-based harness — derived from domain truths, NOT the EARS
spec (anti-re-anchor). Proves correctness (agreement of two independent
derivations), not just fidelity-to-spec. Framework Säule 4.
- driver: conditional spec-to-twin phase
(tests-written -> spec-to-twin -> twin-written -> OPEN_SPEC_PR) gated on
DriverState.twinEnabled; default off keeps the core chain unchanged. Pure,
unit-tested (TDD: red -> green).
- init: scaffold .devloop config twin:{enabled:false} (discoverable, off).
- station: agents/devloop-spec-to-twin.md + skills/spec-to-twin/ (own isolated
subagent, fresh context, does NOT read spec-to-tests' output — oracle
independence one level up, §11).
- loop: source twinEnabled from .devloop/config.json.
- docs: docs/2026-06-23-spec-to-twin-station-design.md + README/USAGE.
The oracle stays project-local & protected; only the runner is later reusable
(@devloop/twin, by rule-of-three — not extracted from a single use).
173 tests green, tsc clean, dist rebuilt in sync.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011LHUMhzeqYkB5i6JiPfaBt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Was
Optionale
spec-to-twin-Station: eine zuschaltbare Schwester vonspec-to-tests, die ein spec-unabhängiges Verhaltens-Orakel (Digital Twin) erzeugt — triviales Referenzmodell + REQ-getaggte Invarianten + Adapter + fast-check model-based Harness, aus Domänen-Wahrheiten abgeleitet (nicht aus den EARS-Kriterien). Prüft Korrektheit, nicht nur Spec-Treue.Warum
spec-to-testsleitet Erwartungswerte aus derselben Spec ab → ein falscher Intent wird von Test-Autor und Implementierer identisch kodiert (gemeinsame Wurzel). Der Twin entfernt die geteilte Spec als Wahrheitsquelle: berechneter statt geschriebener Erwartungswert, generierte statt hand-gewählte Eingaben. Unabhängigkeit eine Ebene über der Producer/Critic-Trennung (§11).Änderungen
src/core/driver.ts): bedingte Phasetests-written → spec-to-twin → twin-written → OPEN_SPEC_PR, gated aufDriverState.twinEnabled. Default off → bestehende Kette unverändert. Reine Zustandsmaschine, unit-getestet.agents/devloop-spec-to-twin.md+skills/spec-to-twin/(eigener isolierter Subagent, frischer Kontext, liestspec-to-tests' Tests nicht — Orakel-Unabhängigkeit).src/core/init.ts):.devlooptwin:{enabled:false}(discoverable, aus).twinEnabledaus.devloop/config.json; Doku.docs/2026-06-23-spec-to-twin-station-design.md.Verifikation
tscclean ·distneu gebaut & in sync (check:dist).Hinweis
Das Orakel (Modell/Invarianten/Adapter) bleibt projekt-lokal & im geschützten Satz — nur der Runner wird später wiederverwendbar (
@devloop/twin, by rule-of-three, nicht aus einem Beispiel abstrahiert). Erster Consumer: Obol (Greenfield-Twin).🤖 Generated with Claude Code
https://claude.ai/code/session_011LHUMhzeqYkB5i6JiPfaBt