SpecDeltas (DLT-*)¶
When architecture needs to change, how do you track the change without creating dead ADRs? Eidos uses SpecDeltas.
A SpecDelta is a semantic mutation artifact describing an architectural change, why it was made, which living specifications were updated, and which tests verify it.
Dual Workflows: Direct Mode vs. Planned Mode¶
Eidos recognizes that software development cannot be burdened by ceremony for every localized fix. It enforces Dual Workflows (POL-CONTINUOUS-DOCUMENTATION-SYNC):
| Mode | When to Use | How It Works |
|---|---|---|
| Direct Mode (Default for localized changes) | Bug fixes, single-container refactors, adding an internal helper or non-breaking CLI flag, test/doc updates | Co-evolve code in src/, tests in tests/, and living specs in eidos/ directly in the same commit. eidos drift verifies that touched components or their 1-hop knowledge graph neighborhood have substantive spec updates. |
| Planned Mode (SpecDelta Lifecycle) | New C4 containers (CNT-*), breaking contract (CTR-*) changes, cross-domain features, new policies (POL-*), deprecations/removals |
Author a formal SpecDelta (DLT-*) declaring intent and mutations (with expect.body / expect.frontmatter post-conditions; scope and downstream blast radius are derived automatically from the knowledge graph). Implement code and spec changes, verify with eidos delta verify, audit removals with eidos delta audit, and reconcile via eidos delta apply. |
The SpecDelta Mutation Lifecycle (Planned Mode)¶
stateDiagram-v2
[*] --> proposed: eidos delta create
proposed --> in_review: Code, specs & tests implemented
in_review --> approved: eidos delta verify & audit pass
approved --> applied: eidos delta apply
proposed --> rejected: Superseded or cancelled
applied --> [*]
All SpecDeltas reside in flat storage under eidos/deltas/dlt-yyyy-nnn.adoc (with older reconciled items partitioned into eidos/deltas/archive/ via eidos delta archive --keep-recent 15), and can be filtered by lifecycle state (proposed, in_review, approved, applied, rejected) via eidos delta list --status <state> [--include-archived] or eidos delta status.
Anatomy of a SpecDelta (delta.schema.yaml)¶
A SpecDelta document (eidos/deltas/dlt-2026-051.adoc) combines strongly-typed YAML frontmatter with human-readable architectural rationale:
---
type: delta/mutation
id: DLT-2026-051
title: "Close Spec-to-Code Drift Detection Bypasses for Unowned Code and 1-Hop Neighborhoods"
status: applied # proposed | in_review | approved | applied | rejected
intent:
kind: bug # feature | enabler | bug
bug_classification: spec_violation # spec_violation | spec_gap (for kind: bug)
severity: high # low | medium | high | critical
motivation: "Eliminate spec-to-code drift bypasses where unowned source files pass or trivial whitespace spec edits satisfy coverage."
mutations:
- operation: modify
target: "CNT-EIDOS-VCS"
details: "Harden CMP-DRIFT-DETECTOR in src/eidos/vcs/drift.py to flag unowned structural code files and enforce substantive spec diffs."
expect:
body:
contains:
- "CMP-DRIFT-DETECTOR"
- operation: add
target: "INV-VCS-UNOWNED-CODE-DRIFT"
details: "Require unowned structural code files to trigger drift unless claimed by a container/component."
tombstone:
search_tokens:
- "legacy_drift_fallback"
allowed_reasons:
- path: "tests/test_drift.py"
reason: "Negative regression test verifying legacy fallback is rejected."
vcs:
base_commit: "a1b2c3d"
branch: "fix/drift-unowned-code"
---
= SpecDelta: Close Spec-to-Code Drift Detection Bypasses
== Rationale & Context
Previously, modifying an unowned source file could pass drift checks if an unrelated specification was edited in the same commit.
== Verification Checklist
* [x] `eidos delta verify DLT-2026-051` passes.
* [x] `eidos validate eidos && eidos drift --uncommitted` exits `0`.
How the SpecDelta Engine Works Under the Hood¶
- Composable
operation+targetMutations & Graph-Derived Scope (DLT-2026-085,DLT-2026-087,DLT-2026-090,DLT-2026-112): Every mutation targets a specific entity in the living architecture viaoperation: add | modify | remove | deprecateandx-eidos-refvalidatedtarget(inferring the entity type from its canonical prefix:SYS-*,DOM-*,CAP-*,PER-*,POL-*,INV-*,ARCH-*,CNT-*,CMP-*,CTR-*,DS-*,UIC-*,SCR-*,CLT-*,FLOW-*), whileaffectsandblast_radiusare derived automatically from the SQLite knowledge graph: - Product & Governance:
DOM-*,CAP-*,PER-*,POL-*,INV-*. - Technical Architecture:
ARCH-*,CNT-*,CMP-*,CTR-*. - Design & Experience:
DS-*,UIC-*,SCR-*,CLT-*,FLOW-*. - Closed-Schema Declarative Post-Conditions (
expect:) & Nested Dot-Path Verification (eidos delta verify,DLT-2026-079,DLT-2026-103): Each mutation item can include a strictly schema-validated (additionalProperties: false)expect:block containingfrontmatter:assertions (source_path,rule,test_binding,status,version,category, plus nested dot-path keys such ascontracts.provides,technical.containers, ordecisions.idwith list-subset and leaf-key prose substring matching) and/orbody:assertions (contains/not_contains, evaluated after stripping YAML and AsciiDoc comments).eidos delta verify <ID>deterministically verifies thatadd/modifytargets exist and were substantively updated relative tovcs.base_commit(resolved from Git via_resolve_git_baseline_sha),removetargets are deleted, and allexpect:assertions pass—reporting specificfailure_reasondiagnostics on any mismatch. - Cross-Ref Collision-Safe IDs & Verified In-Place Application (
eidos delta create,eidos delta apply [--verify/--no-verify],DLT-2026-080,DLT-2026-088,DLT-2026-095):eidos delta createscans all local and remote Git refs (refs/heads/*,refs/remotes/*) pluseidos/deltas/archive/to generate collision-freeDLT-YYYY-NNNIDs (with optional--slugsuffixes) and recordsvcs.base_commitin frontmatter.eidos delta applyverifies all declared mutations against the living specification catalog by default (--verify, or bypass via--no-verify), validates the updated SpecDelta viaSpecValidator, and transitionsstatus: appliedin place. - Index-Driven Spec-Scoped Deletion Auditing (
eidos delta audit,DLT-2026-107): When a SpecDelta removes or deprecates an entity,AuditEnginequeries the syncedArchitecturalIndex(file_tokens_ftsandindexed_files) across governed specification, source, and test files for lingering references—separating approved references (historical deltas/explorations resolved in \(O(1)\) fromentities, negative tests, cleanup routines, ortombstone.allowed_reasons/ inline# eidos:tombstoneexemptions) from unacknowledged active leaks (active_spec_leakandactive_code_leak). - Two-Tier Archive Lifecycle & Automated Changelog Compilation (
eidos delta archive&eidos delta changelog,DLT-2026-106):eidos delta archive [--keep-recent 15]keeps all active SpecDeltas/Explorations plus the 15 most recent terminal items ineidos/deltas/andeidos/explorations/, moving older terminal items intoeidos/deltas/archive/andeidos/explorations/archive/as slimmed, schema-valid.adocfiles (~88%byte reduction).ChangelogGeneratorcombines Git release tags (v*.*.*) with applied and archived SpecDeltas (classified viaintent.kindandmutations[].operation) to generate a Keep a Changelog compliantCHANGELOG.mdanddocs/changelog.md.
CLI Commands for SpecDeltas¶
# 1. Scaffold a new SpecDelta (ID defaults to collision-free 'auto'; optional --slug appends title slug)
eidos delta create \
--title "Add Rate Limiting Contract" \
--kind feature \
--slug
# Or specify an explicit SpecDelta ID:
eidos delta create DLT-2026-055 \
--title "Add Rate Limiting Contract" \
--kind feature
# 2. List all SpecDeltas (including archived) or view/transition the lifecycle status
eidos delta list
eidos delta list --include-archived
eidos delta status
eidos delta status DLT-2026-055 in_review
# 3. Verify all declared mutations and expect: post-conditions
eidos delta verify DLT-2026-055 --json
# 4. Audit removed/deprecated entities for dangling references
eidos delta audit DLT-2026-055 --strict
# 5. Reconcile and apply the SpecDelta in-place (verifies mutations by default; optional --no-verify)
eidos delta apply DLT-2026-055
# 6. Archive and slim older terminal SpecDeltas and Explorations beyond the 15 most recent
eidos delta archive --keep-recent 15
# 7. Compile CHANGELOG.md and docs/changelog.md from applied SpecDeltas
eidos delta changelog