How Eidos Works: Architecture & Engine Internals¶
Eidos is not a passive documentation generator or an LLM wrapper—it is a 100% deterministic, Git-native software architecture and lifecycle engine (POL-ZERO-AI-CALL-DEPENDENCY). Every query, schema validation, context slice, and drift check runs locally in milliseconds with zero external AI calls and zero background daemons.
This guide explains how Eidos works under the hood across its end-to-end execution loop and six core engine subsystems.
1. The End-to-End Eidos Execution Loop¶
When a human engineer or an autonomous AI coding agent works in an Eidos-governed repository, every change flows through a deterministic 4-stage feedback loop:
sequenceDiagram
autonumber
actor Dev as Engineer / AI Agent
participant CLI as Eidos CLI (CNT-EIDOS-CLI)
participant Index as SQLite Knowledge Graph (CNT-EIDOS-INDEX)
participant Core as Spec & Delta Engine (CNT-EIDOS-CORE)
participant VCS as Git Drift Engine (CNT-EIDOS-VCS)
participant Git as Git Repo (src/, eidos/, tests/)
Dev->>CLI: 1. eidos context -f src/... (or -t "task prompt")
CLI->>Index: Lazy dirty check (mtime_ns + SHA-256 in <5ms)
Index->>Git: Incrementally re-index modified specs, AST symbols & tests
Index-->>CLI: Sub-millisecond rank-ordered context slice (anchor / guardrails / deep)
CLI-->>Dev: Owning CNT-*/CMP-*, contracts (CTR-*), capabilities (CAP-*), invariants (INV-*), decisions (DEC-*)
Note over Dev,Git: 2. Select Workflow Mode: Direct Mode (localized) vs. Planned Mode (SpecDelta DLT-*)
Dev->>Git: 3. Co-evolve code (src/), living specs (eidos/*.adoc), and bound tests (tests/)
Dev->>CLI: 4. eidos validate eidos && eidos drift --uncommitted
CLI->>Core: Validate 16 v1 JSON Schemas, x-eidos-ref graph links & DEC-* uniqueness
CLI->>VCS: Inspect Git diff, AST public symbols, 1-hop spec coverage & polyglot INV-* test bindings
VCS-->>Dev: Exit 0 (Clean) or Exit 1 (Structured remediation suggestions)
Why This Loop Eliminates Architectural Drift¶
- Before Writing Code (Token-Budgeted Context Slicing): Instead of stuffing thousands of lines of raw markdown into an LLM context window,
eidos contextqueries the embedded SQLite knowledge graph (eidos/.cache/index.db) in<5msand extracts the exact containers, components, contracts, capabilities, active invariants, and embeddedDEC-*architectural decisions governing the target files or task. - During Implementation (Dual Workflow Co-Evolution):
- Direct Mode: For bug fixes and single-container refactors, engineers and agents update code, tests, and the owning
.adocspecification in the same commit. - Planned Mode: For cross-container features, new containers, or breaking contract changes, changes are declared upfront in a SpecDelta (
DLT-*) with verifiablemutations:andexpect:post-conditions.
- Direct Mode: For bug fixes and single-container refactors, engineers and agents update code, tests, and the owning
- Before Completion (Deterministic Drift Gate):
eidos validateandeidos driftverify that every schema is valid, every cross-reference resolves, every modified code package is backed by a substantive specification update, and every capability invariant (INV-*) is bound to a real test function.
2. System Container Topology (Dogfooded C4 Level 2)¶
Eidos uses its own specification standard to govern itself. The engine is organized as a modular monorepo with 7 C4 Level 2 Containers across 4 architectural tiers:
flowchart TD
subgraph Tier1["Tier 1: Presentation & Interface"]
CLI["CNT-EIDOS-CLI<br/>Typer CLI & Rich UI<br/>(src/eidos/cli)"]
PORTAL["CNT-EIDOS-PORTAL<br/>Living Web Portal & Static Builder<br/>(src/eidos/portal)"]
DOCS["CNT-EIDOS-DOCS<br/>Zensical User Documentation<br/>(docs/)"]
end
subgraph Tier2["Tier 2: Extensibility & Agent Harness"]
PLUGIN["CNT-EIDOS-PLUGIN<br/>TargetAdapters & Agent Skills<br/>(src/eidos/plugin)"]
end
subgraph Tier3["Tier 3: Core Domain & Verification Engines"]
CORE["CNT-EIDOS-CORE<br/>Parser, Validator, Scaffolder & DeltaEngine<br/>(src/eidos/core)"]
VCS["CNT-EIDOS-VCS<br/>Git Diff, AST Structural & Drift Engine<br/>(src/eidos/vcs)"]
end
subgraph Tier4["Tier 4: Knowledge Graph & Persistence"]
INDEX["CNT-EIDOS-INDEX<br/>SQLite WAL + FTS5 + AST Graph<br/>(src/eidos/core/index)"]
end
CLI --> CORE
CLI --> VCS
CLI --> INDEX
CLI --> PLUGIN
CLI --> PORTAL
VCS --> CORE
VCS --> INDEX
PORTAL --> CORE
PORTAL --> INDEX
PLUGIN --> CORE
INDEX --> CORE
DOCS --> PORTAL
3. Subsystem Deep Dive¶
3.1 Specification Parser & Schema Validator (CNT-EIDOS-CORE)¶
Every living specification in eidos/ is an AsciiDoc (.adoc) file headed by a YAML frontmatter block (--- ... ---). When eidos validate runs, SpecParser and SpecValidator execute a three-pass validation pipeline:
Pass 1: Schema Validation with Shared $defs & SQLite Caching¶
- Frontmatter Extraction:
SpecParsersplits the.adocfile into structured YAML frontmatter metadata (parsed via Rust-backedfastyaml-rs), raw YAML line offsets, and AsciiDoc prose body. - Shared Definition Injection:
SpecValidatorloads the canonical JSON/YAML schema derived fromtype:underassets/schemas/v1/(16 document types acrossproduct/*,tech/*,design/*, anddelta/*, introspectable viaeidos spec schema [type]) and merges reusable definitions fromassets/schemas/v1/common/defs.yaml:#/$defs/decision: Enforces structure on in-place architectural decisions (DEC-*,title,decision,rationale,rejected_alternatives,graduated_from).#/$defs/invariant: Enforces RFC 2119 rules andtest_bindingpaths on invariants (INV-*).
- Content-Hashed Validation Cache (
spec_validation_cache): Validation results and parsedSpecDocumentpayloads are serialized withorjsonand keyed by repo-relative path,mtime_ns, file SHA-256, and schema SHA-256 insideeidos/.cache/index.db. Unchanged specifications skip JSON Schema re-evaluation on subsequent runs.
Pass 2: Cross-Document Graph Integrity (x-eidos-ref) & Architectural Laws¶
After individual documents validate against their JSON Schema, SpecValidator verifies global graph invariants across the entire catalog:
- Entity ID & Decision Uniqueness: Ensures zero duplicate document IDs (
CNT-*,CMP-*,CAP-*, etc.) and zero duplicateDEC-*decision IDs across the repository. - Schema-Driven Reference Resolution (
x-eidos-ref): Schemas annotate reference fields withx-eidos-ref: {prefixes: [...], target_types: [...]}. The validator checks that every referenced ID or file path resolves to an existing catalog entity of the exact expected type (for example, preventing aCNT-*container field from pointing to aCMP-*component). - Centralized Component Governance:
INV-COMPONENT-CENTRALIZATION-MANDATE: Everytech/componentspecification (CMP-*) must reside centrally undereidos/architecture/components/and never inline in container manifests or inside implementation directories (src/,packages/).INV-COMPONENT-CONTAINER-AFFINITY: EveryCMP-*component must bind to an existing parentCNT-*container viacontainer:.INV-INTERFACE-BOUNDARY-GOVERNANCE: Containers (CNT-*) own cross-process boundary contracts (CTR-*), whereas components (CMP-*) represent internal building blocks whose intra-containerconsumes_apiand inter-containerdepends_onrelationships are derived automatically via AST import analysis.
Pass 3: Physical Binding Verification & Bidirectional Multi-Protocol Contract Parity¶
When executed within a repository containing a source tree (src/), SpecValidator verifies that declared living specification bindings exist in the filesystem:
- Container Source Path & Public Surface Verification (
DLT-2026-113): Verifies that every directory or file declared insource_pathon active C4 containers (CNT-*) and components (CMP-*) exists on disk, and statically verifies via AST that every backticked code symbol declared under== Public Surfaceresolves in the entity's mapped Python source files (INV-SPEC-GRAPH-INTEGRITY). - Contract Specification File Resolution: Verifies that external specifications (e.g., OpenAPI schemas, protobufs, or CLI entrypoint files) referenced in
specification_fileon active contracts (CTR-*) exist on disk. - Bidirectional Multi-Protocol Contract Parity (
DLT-2026-082,DLT-2026-114,DLT-2026-142,DLT-2026-147,DLT-2026-151,DLT-2026-166): Across all 16 verifiable protocols of the canonical 17-valuetech/contractprotocol enum (cli_argssupporting Python Typer/Click/argparseplus polyglot Gocobra, Rustclap, Node/TScommander/yargs, and C#System.CommandLineacross single-file, directory, or glob targets;openapicovering bothpathsand OpenAPI 3.1webhooks; modernrest_httpverifying normalized(METHOD, path)routes across single-file, directory, or globspecification_filetargets for ASP.NET Core controllers/Minimal APIs, Spring, NestJS, FastAPI, and other modern REST frameworks plus opt-in polyglot authorization contradiction checks while excluding legacy code-first.asmx/WebForms and .NET Framework Web API 2;protobuf;graphql;json_schemawith bidirectional$defs/definitionsand recursive bare-identifier reverse phantom parity;python_protocol;asyncapi2.x/3.x channels and operations;json_rpc_stdioOpenRPC/JSON-RPC/MCP stdio manifests and handler files;code_interfaceacross TypeScript, C#, Go, Rust, Java, and Kotlin; stdlib XMLwsdl1.½.0;avro.avsc/.avdl;sql_ddl.sql/.prisma;trpcTypeScript routers;websocketSignalR/NestJS/Socket.IO hubs and events; and transport-agnosticmcptools, resources, and prompts; plusotherwith conditionally requiredcustom_protocol), Eidos verifies parity in both directions—flagging both undocumented operations added inspecification_fileand stale/phantom operations left inCTR-*specifications after removal from code. - Applied SpecDelta Fast-Path (
DLT-2026-080): Historicalstatus: appliedSpecDeltas are cached against both their file SHA-256 and thedelta.schema.yamlSHA-256 digest so validation remains O(1) for unchanged historical deltas.
Note
If eidos validate runs in a repository without a source tree (e.g. a standalone specification repository or documentation deployment), Pass 3 physical disk checks are automatically skipped.
3.2 Embedded SQLite Knowledge Graph & Context Slicer (CNT-EIDOS-INDEX)¶
To provide sub-millisecond retrieval without external databases or remote embedding APIs, CNT-EIDOS-INDEX maintains an embedded SQLite 3 database in WAL (Write-Ahead Logging) mode at eidos/.cache/index.db.
The index engine is decomposed into 6 focused modules under src/eidos/core/index/:
| Module | Component ID | Responsibility |
|---|---|---|
storage.py |
CMP-GRAPH-STORAGE |
Canonical authority for SCHEMA_VERSION (2.24.0), independent EMBEDDING_SCHEMA_VERSION ("1"), atomic BEGIN IMMEDIATE DDL initialization and migration (preserving compatible spec_embeddings and semantic_sync_complete across sync --force and unrelated SCHEMA_VERSION upgrades), WAL pragmas, corruption recovery, and unified orjson-backed SpecDocument / test-binding / public-surface / Mermaid / memory-freshness cache helpers. |
sync.py |
CMP-INCREMENTAL-SYNC-ENGINE |
Two-tier mtime_ns + SHA-256 dirty detection across _GOVERNED_TEXT_EXTS, path-keyed entity eviction on ID rename, canonical unidirectional edge reconstruction (including C4 Level 1 ARCH-*/SYS-*, exploration graduated_to, team memory anchors_entity/promoted_to, and AST-derived consumes_api/depends_on edges), active-only agent/memory specs_fts projection, file_tokens_fts inverted token indexing, AST symbol FTS projection, and source ownership reconciliation. |
fts_query.py / traversal.py |
CMP-FTS-QUERY-ENGINE & CMP-GRAPH-TRAVERSAL-ENGINE |
Two-tier (AND conjunction before OR fallback) positional column-weighted FTS5 BM25 search with deterministic architectural synonym expansion and opt-in Hybrid RRF fusion, identifier de-compounding, symbol lookup via unified all_mappings CTE, indexed catalog reconstruction (query_spec_catalog_in_db), and hub-scoped recursive CTE k-hop blast-radius (resolve_blast_radius_targets) and SpecDelta impact (compute_delta_impact_in_db) traversal. |
context.py / context_memories.py |
CMP-TIERED-CONTEXT-COMPRESSOR |
Rank-ordered, token-budgeted context slicing across anchor (<=300 tokens), guardrails (<=1000 tokens), and deep (<=2500 tokens) tiers, {a,b} brace-glob matching, secondary budgeted agent/memory (MEM-*) attachment backed by HEAD-keyed memory_freshness_cache, and Stage 0 memory-first pruning. |
semantic.py |
CMP-SEMANTIC-EMBEDDING-ENGINE |
Opt-in local CPU ONNX embedding engine (microsoft/harrier-oss-v1-0.6b INT8 quantized ONNX, 1024-dim L2-normalized Float32 vectors using the sts_query prompt prefix), content-addressed spec_embeddings caching, and Gated Weighted Reciprocal Rank Fusion (fuse_hybrid_rrf). |
ast_indexer.py |
CMP-AST-SYMBOL-INDEXER |
Unified polyglot AST symbol, import, and test-binding extraction via AstGrepIndexer (ast-grep-py SgRoot) across all 17 supported languages (Python, TS, TSX, JS, JSX, Go, Rust, Java, Kotlin, C, C++, C#, Ruby, PHP, Swift, Vue, and Svelte). |
Relational, Lexical & Semantic Schema (eidos/.cache/index.db)¶
The SQLite database is a 100% stateless, derived cache (DEC-INDEX-STATELESS-DERIVED-CACHE) managing 15 coordinated tables (14 domain/FTS/semantic/cache tables plus schema metadata):
entities: All parsed specification nodes (SYS-*,DOM-*,CAP-*,POL-*,PER-*,EXP-*,ARCH-*,CNT-*,CMP-*,CTR-*,DS-*,UIC-*,SCR-*,CLT-*,FLOW-*,DLT-*,MEM-*, plus childINV-*nodes across capabilities, policies, containers, and components) withorjson-serialized metadata and body prose.edges: Canonical unidirectional architectural relationships (realizes,provides,consumes,owned_by,implemented_by,styled_by,extends,governed_by,serves_persona,describes_system,contains_container,graduated_from,graduated_to,delivered_by,has_screen,has_flow,uses_screen,implements,contains_component,part_of,asserts,affects,anchors_entity,promoted_to, plus AST-derivedconsumes_api,depends_on, andast_http) with epistemicprovenanceandfile:lineevidence.code_couplings: Per-call-site cross-boundaryast_importandast_httpcouplings powering declarativeimport_boundariesandratchet_baselineenforcement.indexed_files: Tracksrel_path,mtime,sha256,doc_id, anddoc_typeacross governed specifications, source files, and test suites for incremental synchronization.symbol_mappings: Maps specification-declared file paths, globs, and symbols (source_path,package_path,owned_path,inferred_path,contract_path,specification_file,test_binding) to owningCNT-*,CMP-*,CTR-*, andINV-*entities.code_symbols: Persists AST-extracted classes, functions, methods, structs, enums, interfaces, line coordinates (line_start,line_end), decorator-prefixed signatures, and primary owner flags (is_primary).specs_fts: SQLite FTS5 virtual table indexingentity_id(UNINDEXED),title,jtbd_or_rule,body_text,keywords, and de-compoundedsymbols(including projected primary ASTcode_symbolsand active non-archivedagent/memoryentries, while excluding archived SpecDeltas undereidos/deltas/archive/and inactive/archived memories undereidos/memory/archive/).file_tokens_fts: SQLite FTS5 virtual table (unicode61withtokenchars '-_') indexing unique[A-Za-z0-9_-]{3,}identifier and entity tokens per governed file (rel_path,doc_type) for sub-millisecond SpecDelta deletion auditing (DLT-2026-107).spec_validation_cache: Content-addressed cache of parsedSpecDocumentpayloads and JSON Schema validation verdicts keyed bymtime_ns, file SHA-256, and schema SHA-256.test_binding_cache: Content-addressed cache of AST-extracted test functions (funcandClass::method) and referencedINV-*/POL-*tokens per test file.public_surface_cache: Non-blocking, stat-and-version-keyed (file_path,mtime_ns,st_size,extractor_version) cache ofPublicSurfaceValidatorAST public and component-scoped symbol summaries (DLT-2026-145).mermaid_validation_cache: Non-blocking, content-addressed (diagram_sha256,engine_version) cache ofCMP-MERMAID-VALIDATORQuickJSmermaid.parse()syntax verdicts (DLT-2026-158).memory_freshness_cache: Non-blocking,HEAD-keyed (memory_id,head_sha,mem_sha256,checked_at) cache of deterministicagent/memoryfreshness verdicts (fresh,stale,expired,unverifiable) (DLT-2026-170).spec_embeddings: Content-addressed cache of 1024-dim L2-normalized Float32 Harrier ONNX embeddings keyed byentity_id,content_sha256(computed strictly over specification text), andmodel_id.metadata: CanonicalSCHEMA_VERSION(2.24.0), independentembedding_schema_ver(EMBEDDING_SCHEMA_VERSION = "1"),semantic_sync_completegate state, and cache format versions.
How Lazy Incremental Sync Works (<5ms)¶
Before every CLI query (eidos context, eidos index, eidos spec list), _ensure_synced() runs check_index_dirty():
- Walks
eidos/,tests/, and every container/component's declaredsource_path. - If a file's
mtime_nsmatchesindexed_files, it is skipped immediately without reading bytes from disk. - If
mtime_nschanged, Eidos computes the file'sSHA-256. If the hash matches the stored hash (e.g., aftergit checkoutortouch), Eidos refreshesmtime_nsin-place without re-indexing. - Only genuinely modified, added, or deleted files are re-parsed. If a specification's
id:was renamed in-place,sync.pyevicts the olddoc_idkeyed byfile_pathso ghost entities and orphan edges never linger.
How Lexical Retrieval & Tiered Context Slicing Work¶
When an agent runs eidos context -t "rate limiting and token expiration" --tier guardrails:
- Identifier De-Compounding & AST Symbol Projection: Query tokens like
detect_driftorArchitecturalIndexare split into both exact and sub-word tokens (detect,drift,architectural,index) and matched against both specification prose and projected ASTcode_symbols(DLT-2026-078). - Two-Tier SQL-Scoped FTS5 Ranking:
specs_ftsprioritizes high-precision multi-termANDmatches before falling back toORexpansion (DLT-2026-083), using positional BM25 weightsbm25(specs_fts, 0.0, 4.0, 2.0, 1.0, 2.0, 2.0)(titleweighted 4x,jtbd_or_rule/keywords/symbols2x,body_text1x). Historicaldelta/mutationandproduct/explorationrecords are filtered out inside SQL beforeLIMITso active architecture entities are never crowded out. - Hub-Scoped Graph Expansion: Matched domains (
DOM-*), capabilities (CAP-*), or invariants (INV-*) expand acrossedgesto pull in their realizing containers (CNT-*), components (CMP-*), contracts (CTR-*), and governing policies (POL-*), while scoping hub membership edges (DOM-*,DS-*) at depth >= 2 to prevent sibling fan-out explosion (DLT-2026-083). - Calibrated Rank-Ordered Token Budgeting:
TieredContextCompressorserializes the subgraph into Markdown or JSON while strictly enforcing the tier's token ceiling (anchor <= 300,guardrails <= 1000,deep <= 2500tokens) using structure-calibrated token estimation (~3chars/token for YAML/JSON/code/paths vs~4chars/token for prose), rendering compact 1-lineDEC-*summaries inanchorand full rationale/rejected alternatives inguardrailsanddeep.
3.3 Git-Native Drift Detection Engine (CNT-EIDOS-VCS)¶
eidos drift is the primary verification gate ensuring that code, specifications, and tests never diverge. Located in src/eidos/vcs/ (drift.py, diff.py, structural.py, invariants.py, report.py), it executes an 8-step deterministic verification pipeline:
flowchart LR
A["1. Git Diff &<br/>Merge-Base SHA"] --> B["2. Batched .gitattributes<br/>Generated Filter"]
B --> C["3. Move/Rename Pairing &<br/>AST Symbol Diffing"]
C --> D["4. Path-Boundary<br/>Ownership Mapping"]
D --> E["5. Substantive Spec<br/>Diff Verification"]
E --> F["6. Mode Evaluation<br/>(Direct vs. Planned)"]
F --> G["7. SpecValidator<br/>Catalog Verification"]
G --> H["8. Polyglot Static<br/>INV-* Test Verification"]
- Fail-Closed Base Ref & Merge-Base Resolution (
diff.py):- In branch mode (
--base origin/main), Eidos resolves the exact merge-base SHA (git merge-base) for 3-dot diffs (base...HEAD) and reads baseline file contents directly from that commit SHA. If an explicit--baseref does not exist, Eidos fails closed with an error instead of silently falling back to--uncommitted. - In working-tree mode (
--uncommitted), Eidos inspects both staged and unstaged changes plus untracked files againstHEAD.
- In branch mode (
- Batched Generated/Vendored Filtering (
project.py):- Candidate code paths are passed in a single batched
git check-attr linguist-generated linguist-vendoredcall. Generated bundles (such asassets/portal/bundle.html.gz) are automatically excluded from code drift.
- Candidate code paths are passed in a single batched
- Content-Based Move Pairing & Polyglot Structural AST Diffing (
structural.py,DLT-2026-083):- Deleted and added files are paired by content and public symbol overlap to recognize file moves/renames without relying on Git rename heuristics.
- For modified code files across Python, TS/JS, Go, Rust, Java, Kotlin, C/C++, C#, Ruby, PHP, Swift, Vue, and Svelte,
AstSymbolIndexercompares public AST declarations and signatures between the baseline version and current working tree. - If a code change only touches internal implementation comments, docstrings, or function-body-local logic without adding/modifying/removing public symbols or files, Eidos classifies it as a non-structural (
body_only_code_files) edit by default—while still mapping all modifiedcode_filesintotouched_componentsand supporting--strict(detect_drift(..., strict=True)) to enforce 1-hop spec or bound test co-evolution on body-only edits (DLT-2026-113).
- Strict Path-Boundary Ownership Mapping & Monorepo Sub-Project Isolation (
DLT-2026-123):- Every modified source file is mapped to its owning C4 component (
CMP-*viasource_path) and C4 container (CNT-*viasource_path). - Monorepo Sub-Project Scoping: In monorepos with independent sub-project
eidos/directories (e.g.packages/api/eidos/),discover_nested_subproject_rootsisolates each sub-project'ssource_path,test_binding, knowledge graph index, and Git diff evaluation strictly to its own sub-project boundary without cross-project bleed. - Unowned Code Detection: If a structural code file is added or modified outside any declared
source_path,eidos driftflags it as unowned code drift unless claimed by a container/component or covered by a substantive rootsystem.adoc/system-architecture.adocupdate.
- Every modified source file is mapped to its owning C4 component (
- Substantive Spec Diff & Boundary-Aware Anchoring (
DLT-2026-081,DLT-2026-113):- To prevent agents or developers from bypassing drift checks by adding a blank line or comment to a
.adocfile,StructuralChangeInspector.is_substantive()normalizes specification diffs by stripping AsciiDoc comments (//), YAML comments (#), and whitespace. - Structural code changes whose only accompanying spec edit is whitespace or comments are flagged under
trivially_covered_files(rule: trivial_spec_diff) and fail the drift check. - Stale Removed-Symbol Rejection (
rule: stale_removed_symbol,DLT-2026-113): When a public symbol is removed or renamed in code,evaluate_spec_diff_coveragerejects owning-spec coverage if the removed symbol identifier remains referenced in the owning specification body. - Boundary-Aware Symbol Anchoring (
DLT-2026-081): New unclaimed files and package/contract boundary exports (__init__.py,index.ts,mod.rs,lib.rs,__all__, or contractspecification_file) require explicit file or symbol anchoring when covered via a 1-hop neighbor spec (rule: missing_anchor), whereas intra-package helper functions are covered by substantive updates to their owningCNT-*/CMP-*specification without polluting C4 prose with low-level helper identifiers.
- To prevent agents or developers from bypassing drift checks by adding a blank line or comment to a
- Workflow Mode & 1-Hop Neighborhood Evaluation (
DLT-2026-085,DLT-2026-090):- Planned Mode (when an active
DLT-*SpecDelta is modified in the diff): Verifies that all touched containers and components are authorized strictly by the active SpecDelta's composablemutations[].target(and its 1-hop graph ownership neighborhood). - Direct Mode (no active
DLT-*in diff): Verifies that for every touched container/component with structural changes, either its own.adocspecification or a specification within its component-scoped 1-hop knowledge graph neighborhood (CAP-*,CTR-*,CNT-*,CMP-*—explicitly excluding globalPOL-*andPER-*edges so editing one policy never rubber-stamps the whole repo) was substantively updated.
- Planned Mode (when an active
- Specification Schema & Referential Integrity Gate (
validator.py):- Runs the full 3-pass
SpecValidatorsuite overeidos/. Before code changes can merge, Eidos guarantees that all specification documents conform to JSON schemas, cross-references resolve, declared containersource_pathand contractspecification_filetargets exist on disk, and contracts maintain bidirectional parity.
- Runs the full 3-pass
- Polyglot Static Invariant Test Verification (
invariants.py,DLT-2026-078,DLT-2026-134):- Scans every
INV-*invariant across capabilities (CAP-*), policies (POL-*), containers (CNT-*), standalone components (CMP-*), and UI components (UIC-*undereidos/design/). - Uses Git-tracked file enumeration (
get_tracked_files),test_binding_cache, andast-grepacross Python (.py), TypeScript/JavaScript (.ts,.tsx,.js,.jsx), Go (_test.go), Rust (.rs), Java (.java), and Kotlin (.kt,.kts) to verify that:- The file in
test_binding: path/to/test_file::test_func(orpath/to/test_file::TestClass::test_method) exists. - The target test function or method is defined in the AST.
- The test body, docstring, decorator, or comment explicitly references the
INV-*ID.
- The file in
- Orphan Invariant Detection: Scans the test suite to detect tests referencing
INV-*IDs that do not exist in any living specification.
- Scans every
3.4 SpecDelta Engine, Declarative Verification, Tombstone Auditor & Archive Ledger (CNT-EIDOS-CORE)¶
In Planned Mode, architectural changes are governed by SpecDeltas (eidos/deltas/dlt-yyyy-nnn.adoc) managed by DeltaEngine (delta_engine.py), AuditEngine (audit.py), and ChangelogGenerator (changelog.py):
- Composable
operation+targetMutations & Graph-Derived Scope (DLT-2026-085,DLT-2026-087,DLT-2026-090,DLT-2026-104,DLT-2026-112): Each SpecDelta declares an orderedmutations:array using the orthogonal composable contract (operation: add | modify | remove | deprecateandx-eidos-refvalidatedtarget)—while 0-hop affected entities (affects) andk-hop downstream impact (blast_radius) are computed dynamically viaArchitecturalIndex.compute_delta_impact. - Closed-Schema Declarative Post-Conditions & Dot-Path Key Resolution (
expect:,DLT-2026-079,DLT-2026-103): Mutations specify strictly schema-validated (additionalProperties: false) post-conditions underexpect.body(contains,not_contains, evaluated against comment-stripped AsciiDoc body text) andexpect.frontmatter(source_path,rule,test_binding,status,version,category, plus nested dot-path keys such ascontracts.provides,technical.containers, ordecisions.idacross nested dicts and lists of dicts). Runningeidos delta verify <ID>checks that target entities exist (or are absent forremovemutations), were substantively changed relative to the Git baseline (vcs.base_commit/_resolve_git_baseline_sha), and that allexpect:assertions hold—emitting granularfailure_reasondiagnostics on mismatch. - Cross-Ref Collision-Safe IDs & Verified In-Place Application (
DLT-2026-080,DLT-2026-088,DLT-2026-095):eidos delta create [ID] --slugscans all local and remote Git refs (refs/heads/*,refs/remotes/*) pluseidos/deltas/archive/to guarantee collision-freeDLT-YYYY-NNNidentifiers across parallel branches and recordsvcs.base_commit. Wheneidos delta apply <ID>runs,DeltaEngineverifies all declared mutations by default (verify=True), validates the updated SpecDelta withSpecValidator, and transitionsstatus: appliedin place while preserving YAML comments. - Index-Driven Spec-Scoped Deletion Auditing (
eidos delta audit <ID>,DLT-2026-107): When a SpecDelta removes or deprecates an entity,AuditEnginequeries the syncedArchitecturalIndex(file_tokens_ftsandindexed_files) in sub-millisecond time—with zerogit ls-filessubprocesses or full-repositoryos.walkscans—and classifies every occurrence across governed files bydoc_type:- Approved References: Current or historical
DLT-*/EXP-*records (self_delta,historical_ledgerresolved in O(1) fromentities), negative assertions or docstrings incode/test, cleanup routines, or matches fortombstone.allowed_reasonsand inline# eidos:tombstone/# eidos:allow-retiredannotations. - Active Leaks: Unacknowledged live references in active specifications (
active_spec_leak,critical) or governed source/test files (active_code_leak,high;--strictexits with code1).
- Approved References: Current or historical
- Two-Tier
--keep-recent 15Archive & Slimming Lifecycle (eidos delta archive,DLT-2026-106): To prevent top-level directory clutter, FTS5 search noise, and portal payload bloat as projects mature,eidos delta archive [--keep-recent 15]retains all active SpecDeltas/Explorations plus the 15 most recent terminal items (applied/rejectedandadopted/discarded) ineidos/deltas/andeidos/explorations/, moving older terminal records intoeidos/deltas/archive/andeidos/explorations/archive/as slimmed, schema-valid.adocfiles (~88%byte reduction).eidos delta changelogcombines Git release tags with applied and archived SpecDeltas to compile a Keep a Changelog compliantCHANGELOG.mdanddocs/changelog.md.
3.5 Agent Harnesses & Agent Skills (CNT-EIDOS-PLUGIN)¶
Eidos integrates with AI coding assistants through a declarative TargetAdapter pipeline (src/eidos/plugin/installer.py) harmonized with npx-skills / npx skills and root skills-lock.json:
skills-lock.json-Tracked Multi-Harness Skill Projection (eidos plugin install [TARGETS]... [--copy]):- Projects the unified Discovery-First Agent Skill (
eidos/SKILL.md+eidos/references/{setup,spec,plan,ops,memory}.mdfromassets/plugin_reference/skills/) into canonical.agents/skills/eidos/(delegating tonpx-skills/npx --yes skillswhen available with an offline pure-Python fallback across all 24 natively supported coding assistants, and linking client-specific skill directories such as.claude/skills/eidos,.kilocode/skills/eidos,.aider/skills/eidos,.windsurf/skills/eidos,.roo/skills/eidos,.goose/skills/eidos,.kiro/skills/eidos, etc. via internal relative symlinks unless--copyis passed; other externalskills.shslugs delegate tonpx-skills/npxfor install and uninstall) alongside the canonical rootAGENTS.mdmanaged block (withCLAUDE.md@AGENTS.mdimport for Claude Code and comment-preserving.aider.conf.ymlread:for Aider). - Writes
vercel-labs/skills-compatible SHA-256computedHashentries into rootskills-lock.json(preserving all third-party skills), reads installed versions fromeidos/SKILL.mdmetadata.version, and detects on-disk skill divergence ("modified") soeidos doctorverifies skill andAGENTS.mdhealth without proprietary manifest files.
- Projects the unified Discovery-First Agent Skill (
3.6 Scalable Air-Gapped Living Web Portal (CNT-EIDOS-PORTAL)¶
The interactive Living Web Portal (eidos portal serve and eidos portal build) compiles all 16 specification types and the SQLite knowledge graph into a single-page visual architecture explorer:
- Zero Node.js Runtime Dependency (
INV-PORTAL-ZERO-NODE-DEP): The frontend (React 19, Tailwind CSS v4, Material Design 3, Mermaid.js v11, and@asciidoctor/core) is pre-compiled at package build time into a deterministic gzip-compressed asset (assets/portal/bundle.html.gz,<5 MiBuncompressed budget). - 100% Air-Gapped Bundle (
INV-PORTAL-AIR-GAPPED-BUNDLE): All scripts, stylesheets, and Geist/Geist Monowoff2fonts are packaged locally with zero requests to external CDNs, working offline in air-gapped corporate networks (eidos portal buildemits local./assets/*+./specs/<id>.jsonchunks by default, or a single self-containedindex.htmlforfile://viewing with--single-file). - Static-First Scalability, XSS Isolation & Deep Linking (
INV-PORTAL-STATIC-SCALABILITY,INV-PORTAL-XSS-AND-SERVER-ISOLATION):StaticSiteBuilderlazy-loads per-entityspecs/<id>.jsonAsciiDoc chunks on demand (or deduplicates inline bodies with--single-file) and exports pre-computed graphedgesandvalidationdiagnostics. Every view, C4 container whitebox, contract, SpecDelta, and SpecReader drawer is synchronized withwindow.location.hash(#/<view>/<entity-id>) for zero-config deep linking on static hosts, whileeidos portal servestreams real-time workspace updates over Server-Sent Events (GET /api/events) alongsideGET /api/versionand fail-closedGET /api/drift. - Hierarchical C4 Drill-Down, Blast Radius Simulator & Contract Explorer (
INV-PORTAL-INTERACTIVE-C4):PortalGeneratorsynthesizes C4 Level 1 System Context, tiered Level 2 Container diagrams with explicit and AST-derived dependency edges, clickable Level 3 Component Whitebox views, an interactive client-side 1–2 hop Blast Radius Simulator, a first-class Boundary Interface Contracts (CTR-*) explorer, and a Multi-Design System & Recursive W3C Token Tree browser.