Skip to content

feat(twin): optional spec-to-twin station (spec-independent behavioural oracle)#1

Merged
TMogdans merged 1 commit into
mainfrom
twin/spec-to-twin-station
Jun 23, 2026
Merged

feat(twin): optional spec-to-twin station (spec-independent behavioural oracle)#1
TMogdans merged 1 commit into
mainfrom
twin/spec-to-twin-station

Conversation

@TMogdans

Copy link
Copy Markdown
Collaborator

Was

Optionale spec-to-twin-Station: eine zuschaltbare Schwester von spec-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-tests leitet 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

  • Kern (src/core/driver.ts): bedingte Phase tests-written → spec-to-twin → twin-written → OPEN_SPEC_PR, gated auf DriverState.twinEnabled. Default off → bestehende Kette unverändert. Reine Zustandsmaschine, unit-getestet.
  • Station: agents/devloop-spec-to-twin.md + skills/spec-to-twin/ (eigener isolierter Subagent, frischer Kontext, liest spec-to-tests' Tests nicht — Orakel-Unabhängigkeit).
  • Config (src/core/init.ts): .devloop twin:{enabled:false} (discoverable, aus).
  • Loop/README/USAGE: twinEnabled aus .devloop/config.json; Doku.
  • Design: docs/2026-06-23-spec-to-twin-station-design.md.

Verifikation

  • 173 Tests grün · tsc clean · dist neu gebaut & in sync (check:dist).
  • TDD: rot → grün (Driver + init).

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

…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
@TMogdans TMogdans merged commit 219da65 into main Jun 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant