SpecCompiler Core Design

1 Scope

This document describes the software architecture and design of SpecCompiler Core.

1.1 Pipeline Architecture

1.1.1 Overview

SpecCompiler uses a layered architecture with the engine orchestrating a five-phase <Pipeline> that processes documents through registered <Handler>.

1.1.2 Component Summary

The architecture comprises 30 CSCs organized in four source layers and two model packages. For the complete decomposition with all 162 CSUs, see the Software Decomposition chapter.

Layer CSC CSUs Responsibility
Core Runtime CSC-001 Core Runtime CSU-001 Pandoc Filter Entry Point, CSU-002 Configuration Parser, CSU-003 Data Loader, CSU-004 Diagnostics Collector, CSU-005 Build Engine, CSU-006 Pipeline Orchestrator, CSU-007 Analyze Query Loader, CSU-008 Type Loader, CSU-009 Validation Policy Pipeline orchestration, metadata/config extraction, model loading, analyze query loading, validation policy, and runtime control.
Database Persistence CSC-002 Database Persistence CSU-010 Build Cache, CSU-011 Database Handler, CSU-012 Data Manager, CSU-013 Output Cache, CSU-014 Analyze Query Definitions Canonical insert/query API for SpecIR, transaction handling, build cache, output cache, and analyze query definitions.
CSC-005 DB Queries CSU-015 Build Queries, CSU-016 Content Queries, CSU-017 Query Aggregator, CSU-018 Resolution Queries, CSU-019 Search Queries, CSU-020 Type Queries SQL query string modules for all database operations across content, types, build, search, and resolution domains.
CSC-006 DB Schema CSU-021 Build Schema, CSU-022 Content Schema, CSU-023 Schema Aggregator, CSU-024 Search Schema, CSU-025 Type System Schema DDL table creation statements for content, types, build infrastructure, and search tables.
CSC-007 DB Views CSU-026 EAV Pivot Views, CSU-027 Views Aggregator, CSU-028 Public API Views, CSU-029 Resolution Views SQL view definitions for EAV pivots, public API, and resolution helpers.
Pipeline Handlers CSC-003 Pipeline Handlers CSU-030 Include Expansion Filter, CSU-031 Analyze Handler Phase handlers implementing initialize, resolve, transform, analyze, and emit behavior across five pipeline phases.
CSC-008 Analyze Handlers CSU-032 Attribute Caster, CSU-033 Relation Resolver, CSU-161 Relation Type Inferrer RESOLVE phase handlers for relation resolution, relation type inference, and attribute casting.
CSC-009 Emit Handlers CSU-034 Document Assembler, CSU-035 Float Emitter, CSU-036 View Emitter, CSU-037 Emitter Orchestrator, CSU-038 Float Handler Dispatcher, CSU-039 Float Numbering, CSU-040 Float Resolver, CSU-041 FTS Indexer, CSU-042 Inline Handler Dispatcher, CSU-043 View Handler Dispatcher EMIT phase handlers for document assembly, float resolution, view rendering, FTS indexing, and output generation.
CSC-010 Initialize Handlers CSU-044 Attribute Parser, CSU-046 Float Parser, CSU-047 Object Parser, CSU-048 Relation Parser, CSU-049 View Parser, CSU-050 Specification Parser INITIALIZE phase handlers that parse document AST and populate all SpecIR container tables.
CSC-011 Shared Pipeline Utilities CSU-045 Include Handler, CSU-051 Attribute Paragraph Utilities, CSU-052 Float Base, CSU-053 Include Utilities, CSU-054 Math Render Utilities, CSU-055 Render Utilities, CSU-056 Source Position Compatibility, CSU-057 Specification Base, CSU-058 Spec Object Base, CSU-059 View Utilities Shared infrastructure modules providing base handlers, rendering utilities, and view helpers used across pipeline phases.
CSC-012 Transform Handlers CSU-060 External Render Handler, CSU-061 Float Transformer, CSU-062 Object Render Handler, CSU-063 Specification Render Handler, CSU-162 Relation Link Rewriter TRANSFORM phase handlers for external rendering and spec object/specification rendering.
Infrastructure CSC-004 Infrastructure CSU-065 Hash Utilities, CSU-066 JSON Utilities, CSU-067 Logger, CSU-068 Reference Cache, CSU-069 MathML to OMML Converter Output toolchain integration, hashing, logging, JSON utilities, reference cache management, and external tool wrappers.
CSC-013 Format Utilities CSU-070 Format Writer, CSU-071 XML Utilities, CSU-072 ZIP Utilities Writer adapters, XML utilities, and ZIP archive operations for format-specific output generation.
CSC-014 DOCX Generation CSU-073 OOXML Builder, CSU-074 Preset Loader, CSU-075 Reference Generator, CSU-076 Style Builder OOXML builder, preset loader, reference generator, and style builder for Word document output.
CSC-015 I/O Utilities CSU-077 Document Walker, CSU-078 File Walker AST traversal with source position tracking and basic file I/O operations.
CSC-016 Process Management CSU-079 Pandoc CLI Builder, CSU-080 Task Runner External process spawning via luv and Pandoc command-line argument building.
Default Model CSC-017 Default Model CSU-081 SECTION Object Type, CSU-082 SPEC Specification Type Foundational type model providing base object, float, relation, and view types that all other models extend.
CSC-018 Default Filters CSU-083 DOCX Filter, CSU-084 HTML Filter, CSU-085 Markdown Filter Format-specific Pandoc Lua filters that convert speccompiler markers to native output elements.
CSC-019 Default Postprocessors CSU-086 DOCX Postprocessor, CSU-087 LaTeX Postprocessor Format-specific post-processing applied after Pandoc output generation.
CSC-020 Default Analyze Queries CSU-089 Spec Missing Required, CSU-090 Spec Invalid Type, CSU-091 Object Missing Required, CSU-092 Object Cardinality Over, CSU-093 Object Cast Failures, CSU-094 Object Invalid Enum, CSU-095 Object Invalid Date, CSU-096 Object Bounds Violation, CSU-097 Float Orphan, CSU-098 Float Duplicate Label, CSU-099 Float Render Failure, CSU-100 Float Invalid Type, CSU-101 Relation Unresolved, CSU-102 Relation Dangling, CSU-103 Relation Ambiguous SQL analyze query queries for detecting constraint violations across specifications, objects, floats, relations, and views.
CSC-021 Default Styles CSU-106 DOCX Style Preset, CSU-107 HTML Style Preset Style presets defining page layout, typography, and formatting for DOCX and HTML output.
CSC-022 Default Float Types CSU-108 CHART Float Type, CSU-109 FIGURE Float Type, CSU-110 LISTING Float Type, CSU-111 MATH Float Type, CSU-112 PLANTUML Float Type, CSU-113 TABLE Float Type Float type definitions for numbered content blocks including images, tables, code listings, diagrams, charts, and equations.
CSC-023 Default Relation Types CSU-114 XREF_CITATION Relation Type, CSU-115 XREF_FIGURE Relation Type, CSU-116 XREF_LISTING Relation Type, CSU-117 XREF_MATH Relation Type, CSU-118 XREF_TABLE Relation Type Cross-reference relation type definitions mapping PID and label selectors to typed object and float targets.
CSC-024 Default View Types CSU-119 ABBREV View Type, CSU-120 ABBREV_LIST View Type, CSU-121 GAUSS View Type, CSU-122 LOF View Type, CSU-123 MATH_INLINE View Type, CSU-124 TOC View Type View type definitions for inline and block-level data-driven content rendering.
SW Docs Model CSC-025 SW Docs Model CSU-125 HTML5 Postprocessor Domain model for software documentation providing traceable object types, domain-specific analyze queries, specification types, relation types, and views.
CSC-026 SW Docs Analyze Queries CSU-126 VC Missing HLR Traceability, CSU-127 TR Missing VC Traceability, CSU-128 HLR Missing VC Coverage, CSU-131 FD Missing CSC Traceability, CSU-132 FD Missing CSU Traceability, CSU-163 CSC Missing FD Allocation, CSU-164 CSU Missing FD Allocation Domain-specific analyze query queries for software documentation traceability and naming convention enforcement.
CSC-027 SW Docs Object Types CSU-133 CSC Object Type, CSU-134 CSU Object Type, CSU-135 DD Object Type, CSU-136 DIC Object Type, CSU-137 FD Object Type, CSU-138 HLR Object Type, CSU-139 LLR Object Type, CSU-140 NFR Object Type, CSU-141 SF Object Type, CSU-142 SYMBOL Object Type, CSU-143 TR Object Type, CSU-144 TRACEABLE Base Object Type, CSU-145 VC Object Type Domain object type definitions for traceable specification items including requirements, design decisions, verification cases, and MIL-STD-498 architectural elements.
CSC-028 SW Docs Relation Types CSU-146 BELONGS Relation Type, CSU-147 REALIZES Relation Type, CSU-148 TRACES_TO Relation Type, CSU-149 XREF_DIC Relation Type Domain relation type definitions for traceability links between software documentation elements.
CSC-029 SW Docs Specification Types CSU-150 SDD Specification Type, CSU-151 SRS Specification Type, CSU-152 SUM Specification Type, CSU-153 SVC Specification Type, CSU-154 TRR Specification Type Specification type definitions for SDN document types (SRS, SDD, SVC, SUM, TRR).
CSC-030 SW Docs View Types CSU-155 Coverage Summary View, CSU-156 Requirements Summary View, CSU-157 Test Execution Matrix View, CSU-158 Test Results Matrix View, CSU-159 Traceability Matrix View Domain view type definitions for traceability matrices, test results, and coverage summaries.

1.2 Type System Architecture

1.2.1 Overview

SpecCompiler uses a dynamic type system where models define available types for objects, <Float>, relations, and views.

Figure Type System Architecture (COMP-002)

1.2.2 Type Module Structure

Each extension module returns one descriptor table. The host reads the declared descriptor fields.

-- Example: models/default/types/objects/hlr.lua
return {
    kind = "object",            -- object | float | view | relation | specification | analyze
    schema = {                  -- SpecIR fields for this kind. schema.id is authoritative.
        id = "HLR",
        long_name = "High-Level Requirement",
        extends = "TRACEABLE",  -- attribute + hook inheritance via the extends chain
        attributes = {
            { name = "status", type = "ENUM", values = { "Draft", "Review", "Approved", "Implemented" } },
        },
    },
    hooks = {                   -- Optional custom behavior.
        render = function(ctx) ... end,
    },
}

Custom behavior belongs in hooks. The host validates each hook name against the descriptor kind. It rejects functions on other top-level keys. A data-only type can omit hooks. An on_<phase> function in hooks registers phase participation.

1.2.3 Type Categories

Table Type categories and database tables
Category Database Table Key Fields
Specifications spec_specification_types id, long_name, extends, is_default
Objects spec_object_types id, long_name, extends, is_default (HLR, FD, CSC, CSU, VC, etc.)
Floats spec_float_types id, long_name, counter_group, needs_external_render
Relations spec_relation_types id, source_type_ref, target_type_ref, link_selector
Views spec_view_types id, inline_prefix, aliases

1.2.4 Hook Contract

Each hook accepts one frozen context table. The polymorphic subject field contains the hook input. The capability field identifies the hook. The hook name selects one of two context tiers:

Table The two hook tiers: the hook name selects the context and the return type
Hook(s) Tier / context Returns
render, render_block, render_link, message render context with Pandoc and output-format fields Pandoc AST / string
dataset data context with subject.params { source / data / links } dataset
build_block data context with subject.params pandoc.Block
transform data context with subject.raw_content and subject.float resolved-AST string
resolve data context with target text and source identifier { target, ambiguous }
prepare_task, handle_result data context with task or result fields task table / DB write

A render hook receives the render core and its subject. A data hook receives data, spec_id, log, and its subject. The host checks required context fields. It prevents assignment to top-level context fields. Each hook must return its documented type.

1.2.5 Loading Process

  1. The host engine (contract.registry) loads default then each overlay model (later-wins-by-id), scanning models/{model}/types/{category}/.
  2. Each file returns one descriptor; the host validates it (kind, schema.id, each hook valid for the kind, no behaviour on top-level keys) and emits the type row into the corresponding SpecIR table.
  3. Each declared hook is eager-indexed into the (kind, id) -> hook map that every consumer reads via get_hook / get_hook_inherited (which walks the extends chain). An on_<phase> hook in hooks is synthesized into pipeline:register_handler.
  4. host:finalize() propagates inherited attributes, creates the analyze-query SQL views, and asserts required hooks (e.g. a TABLE_VIEW subtype must resolve a build_block).

1.3 SpecIR Database Schema

1.3.1 Overview

The Specification <Intermediate Representation> (SpecIR) is implemented as a <SQLite Database> schema composed from:

The schema has four domains:

Table Schema domains
Domain Tables
Type system spec_specification_types, spec_object_types, spec_float_types, spec_relation_types, spec_view_types, datatype_definitions, spec_attribute_types, enum_values
Content specifications, spec_objects, spec_floats, spec_relations, spec_views, spec_attribute_values
Build cache build_graph, output_cache
Search (FTS5) fts_objects, fts_attributes, fts_floats

1.3.2 Type + Content (SpecIR)

SpecIR is a ReqIF inspired relational metamodel that lowers textual specifications into a typed intermediate representation against which structural validity is evaluated.

Where Pandoc provides the syntactic bridge from Markdown to a structured AST, SpecIR provides the semantic layer by separating: a type layer (Γ), which defines what may exist and a content layer, which records what does exist.

Validation reduces to relational set operations: constraints are expressed as queries over finite sets of entities and relations, and violations emerge as counterexamples (e.g., anti-joins between expected and actual structures).

1.4 Pipeline Design

FD-001: Pipeline Execution Orchestration

Allocation: Realized by Core Runtime (Core Runtime) through Build Engine (Build Engine) and Pipeline Orchestrator (Pipeline Orchestrator), with handlers registered via Pipeline Handlers (Pipeline Handlers). Phase-specific handlers are organized in Analyze Handlers (Analyze Handlers), Initialize Handlers (Initialize Handlers), and Transform Handlers (Transform Handlers), with shared utilities in Shared Pipeline Utilities (Shared Pipeline Utilities).

The <Pipeline> execution orchestration function manages the five-phase document processing lifecycle from initial Pandoc hook entry through final output generation. It encompasses <Handler> registration, dependency-based execution ordering, context propagation, and phase abort logic.

Entry Point: The Pandoc filter (Build Engine) hooks into the Pandoc Meta callback, extracts project metadata via Validation Policy, and invokes the build engine. The engine creates the database, initializes the data manager, loads the model via Type Loader, processes document files (with <Build Cache> checks), and delegates to the pipeline orchestrator.

Handler Registration: During model loading, Type Loader registers each handler with the Pipeline Orchestrator Pipeline Orchestrator, which enforces the registration contract by validating that every handler declares both a name and a [dic:prerequisites](#) field before accepting registration. The orchestrator rejects duplicate handler names — attempting to register a handler whose name already exists raises an immediate error. Accepted handlers are stored in a lookup table keyed by name for O(1) retrieval during phase execution. Each handler implements phase hooks using the naming convention on_{phase} (e.g., on_initialize, on_analyze, on_transform, on_verify, on_emit). All hooks receive the full contexts array: on_{phase}(data, contexts, diagnostics).

<Topological Sort>: Before executing each phase, the Pipeline Orchestrator Pipeline Orchestrator applies Kahn’s algorithm to produce a deterministic handler execution order. Only handlers that implement an on_{phase} hook for the current phase participate in the sort; handlers without a relevant hook are skipped entirely. The algorithm begins by building a dependency graph restricted to participants and initializing an in-degree count for each node. Nodes with zero in-degree — handlers whose prerequisites are already satisfied — seed a processing queue. At each step the algorithm dequeues the first node, appends it to the sorted output, and decrements the in-degree of all its dependents; any dependent whose in-degree reaches zero is enqueued. Alphabetical tie-breaking is applied at every dequeue step so that handlers at the same dependency depth are always emitted in the same order, guaranteeing deterministic output across runs. After the queue is exhausted, if the sorted list length is less than the participant count a dependency cycle exists and is reported as an error.

For example, if INITIALIZE has three handlers — specifications (no prerequisites), spec_objects (prerequisite: specifications), and spec_floats (prerequisite: specifications) — the sort produces [specifications, spec_floats, spec_objects], with spec_floats and spec_objects ordered alphabetically since both depend only on specifications.

Phase Execution: The pipeline executes five phases in order:

  1. <INITIALIZE Phase> — Parse Pandoc <Abstract Syntax Tree> into <Intermediate Representation> database tables (specifications, spec_objects, attributes, spec_floats, spec_views, spec_relations)
  2. <RESOLVE Phase> — Resolve cross-references and infer relation types
  3. <TRANSFORM Phase> — Render content, materialize views, execute external renderers
  4. <ANALYZE Phase> — Run analyze queries and collect diagnostics
  5. <EMIT Phase> — Assemble documents and generate output files

All phases use the same dispatch model: for each handler in sorted order, the Pipeline Orchestrator Pipeline Orchestrator calls the handler’s on_{phase}(data, contexts, diagnostics) hook once with the full set of contexts. Handlers are responsible for iterating over contexts internally. Each handler invocation is bracketed by uv.hrtime() calls at nanosecond precision to record its duration, and the orchestrator also records the aggregate duration of each phase, providing two-level performance visibility (handler-level and phase-level).

Phase Abort: After ANALYZE, the Pipeline Orchestrator Pipeline Orchestrator inspects the diagnostics collector for any error-level entries. If errors exist, the pipeline aborts before EMIT — only output generation is skipped, since TRANSFORM has already completed. This design allows analyze queries to validate transform results before committing to output.

Context Propagation: Each document file produces a context containing the parsed AST, file path, specification ID, and walker state. Contexts are passed through all phases, accumulating state. The diagnostics collector aggregates errors and warnings across all handlers and contexts.

Component Interaction

The pipeline is realized through the core runtime and four handler packages that correspond to pipeline phases.

CSC Core Runtime (Core Runtime) provides the entry point and orchestration layer. CSU Pandoc Filter Entry Point (Pandoc Filter Entry Point) hooks into the Pandoc callback to launch the build. CSU Configuration Parser (Configuration Parser) reads project.yaml and resolves model, output, and logging settings. CSU Data Loader (Data Loader) loads external data files referenced by specifications. CSU Build Engine (Build Engine) coordinates the full build lifecycle — creating the database, loading the model, processing document files with cache checks, and delegating to CSU Pipeline Orchestrator (Pipeline Orchestrator) for phase execution. The orchestrator drives topological sort, handler dispatch, timing, and abort logic across all five phases.

CSC Pipeline Handlers (Pipeline Handlers) registers cross-cutting handlers. CSU Include Expansion Filter (Include Expansion Filter) resolves include directives during INITIALIZE, expanding referenced files into the document AST before entity parsing begins.

CSC Initialize Handlers (Initialize Handlers) parses the Pandoc AST into SpecIR entities. CSU Specification Parser (Specification Parser) extracts document-level metadata, CSU Object Parser (Object Parser) identifies typed content blocks, CSU Attribute Parser (Attribute Parser) extracts key-value attributes from object paragraphs, CSU Float Parser (Float Parser) detects embedded figures, tables, and listings, CSU Relation Parser (Relation Parser) captures cross-reference links, and CSU View Parser (View Parser) identifies view directives.

CSC Analyze Handlers (Analyze Handlers) resolves cross-references and infers types. CSU Relation Resolver (Relation Resolver) matches link targets to spec objects using selector-based resolution. CSU Relation Type Inferrer (Relation Type Inferrer) assigns relation type_refs based on source and target object types. CSU Attribute Caster (Attribute Caster) validates and casts attribute values against their declared datatypes.

CSC Shared Pipeline Utilities (Shared Pipeline Utilities) provides reusable base modules consumed by handlers across phases. CSU Spec Object Base (Spec Object Base) and CSU Specification Base (Specification Base) provide shared parsing logic for objects and specifications. CSU Float Base (Float Base) provides float detection and extraction. CSU Attribute Paragraph Utilities (Attribute Paragraph Utilities) parses attribute blocks from definition-list paragraphs. CSU Include Handler (Include Handler) and CSU Include Utilities (Include Utilities) manage file inclusion and path resolution. CSU Render Utilities (Render Utilities) and CSU Math Render Utilities (Math Render Utilities) provide AST-to-output conversion helpers. CSU View Utilities (View Utilities) supports view parsing and rendering. CSU Source Position Compatibility (Source Position Compatibility) normalizes Pandoc source position data across API versions.

Figure Pipeline Execution Orchestration

TRACEABILITY:
srs: SF-001

LLR-PIPE-002-01: Handler Registration Requires Name

Pipeline handler registration shall reject handlers that do not provide a non-empty name field.

TRACEABILITY:
srs: HLR-PIPE-002
VERIFICATION METHOD:
Test

LLR-PIPE-002-02: Handler Registration Requires Prerequisites

Pipeline handler registration shall reject handlers that do not provide a prerequisites array.

TRACEABILITY:
srs: HLR-PIPE-002
VERIFICATION METHOD:
Test

LLR-PIPE-002-03: Duplicate Handler Names Are Rejected

Pipeline handler registration shall reject duplicate handler names within the same pipeline instance.

TRACEABILITY:
srs: HLR-PIPE-002
VERIFICATION METHOD:
Test

LLR-PIPE-006-01: Base Context Fields Are Propagated

Pipeline execution shall propagate the base context fields (validation, build_dir, log, output_format, template, reference_doc, docx, project_root, outputs, html5, bibliography, csl) to handlers.

TRACEABILITY:
srs: HLR-PIPE-006
VERIFICATION METHOD:
Test

LLR-PIPE-006-02: Document Context Is Attached Per Document

Pipeline execution shall attach doc and spec_id for each processed document context passed to handlers.

TRACEABILITY:
srs: HLR-PIPE-006
VERIFICATION METHOD:
Test

LLR-PIPE-006-03: Project Context Exists Without Documents

Pipeline execution shall create a fallback project context when the document list is empty, with doc=nil and a derived spec_id.

TRACEABILITY:
srs: HLR-PIPE-006
VERIFICATION METHOD:
Test

LLR-020: Phase Execution Order

Given registered <Handler>s, CSU Pipeline Orchestrator shall execute phases in fixed order: <INITIALIZE Phase><RESOLVE Phase><TRANSFORM Phase><ANALYZE Phase><EMIT Phase>.

TRACEABILITY:
srs: HLR-PIPE-001
VERIFICATION METHOD:
Test

LLR-021: Phase Hook Filtering

Given the <Handler> set for a <Phase>, CSU Pipeline Orchestrator shall invoke only those declaring an on_{phase} hook for that phase.

TRACEABILITY:
srs: HLR-PIPE-001
VERIFICATION METHOD:
Test

LLR-022: No EMIT After Abort

When diagnostics:has_errors() returns true after <ANALYZE Phase>, CSU Pipeline Orchestrator shall not execute <EMIT Phase> phase handlers.

TRACEABILITY:
srs: HLR-PIPE-001
VERIFICATION METHOD:
Test

LLR-023: Topological Sort Phase Filtering

Given a <Phase> name and the <Handler> registry, CSU Pipeline Orchestrator shall build the <Topological Sort> dependency graph from only those handlers declaring an on_{phase} hook, producing an ordered execution list.

TRACEABILITY:
srs: HLR-PIPE-003
VERIFICATION METHOD:
Test

LLR-024: Alphabetic Tie-Breaking

When multiple <Handler>s have no dependency ordering between them, CSU Pipeline Orchestrator shall sort them alphabetically by name, producing deterministic output.

TRACEABILITY:
srs: HLR-PIPE-003
VERIFICATION METHOD:
Test

LLR-025: Circular Dependency Reporting

When a cyclic <Prerequisites> graph is detected, CSU Pipeline Orchestrator shall report an error listing the remaining unordered handler names.

TRACEABILITY:
srs: HLR-PIPE-003
VERIFICATION METHOD:
Test

LLR-026: TRANSFORM Completes Before Abort Check

CSU Build Engine shall complete all <TRANSFORM Phase> phase handlers before checking has_errors() for abort, ensuring transforms are applied before validation results are inspected.

TRACEABILITY:
srs: HLR-PIPE-004
VERIFICATION METHOD:
Test

LLR-027: Abort Logs Error Count

When aborting execution before <EMIT Phase>, CSU Build Engine shall log the error count via CSU Logger.

TRACEABILITY:
srs: HLR-PIPE-004
VERIFICATION METHOD:
Test

LLR-028: Full Contexts Array Dispatch

Given a document context array, CSU Pipeline Orchestrator shall pass the full array to each <Handler>’s on_{phase} hook in a single call.

TRACEABILITY:
srs: HLR-PIPE-005
VERIFICATION METHOD:
Test

LLR-029: Handler Hook Signature

CSU Pipeline Orchestrator shall invoke phase hooks with signature on_{phase}(data, contexts, diagnostics) where data is a CSU Data Manager instance, contexts is the array, and diagnostics is a CSU Diagnostics Collector instance.

TRACEABILITY:
srs: HLR-PIPE-005
VERIFICATION METHOD:
Test

LLR-030: L1 Headers Register as Specifications

Given a Pandoc Header at level 1 in the <Abstract Syntax Tree>, CSU Specification Parser shall parse the optional TYPE: prefix and @<Project Identifier> suffix and insert one <Specification> record into the specifications table with identifier derived from filename, type_ref validated against the <Type Registry>, and header_ast storing the serialized <Abstract Syntax Tree>.

TRACEABILITY:
srs: HLR-PIPE-007
VERIFICATION METHOD:
Test

LLR-031: L2-H6 Headers Register as Spec Objects

Given a Pandoc Header at level 2–6, CSU Object Parser shall insert one <Spec Object> record with type resolved via explicit TYPE: prefix → <Type Alias> lookup → default fallback.

TRACEABILITY:
srs: HLR-PIPE-007
VERIFICATION METHOD:
Test

LLR-032: Blockquotes Register as Attributes

Given Pandoc BlockQuote lines matching > key: value, CSU Attribute Parser shall insert <Attribute> records in spec_attribute_values linked to the enclosing <Spec Object> via owner_object_id.

TRACEABILITY:
srs: HLR-PIPE-007
VERIFICATION METHOD:
Test

LLR-033: Code Blocks Register as Floats

Given a Pandoc CodeBlock with syntax:label class, CSU Float Parser shall insert one <Spec Float> record with type_ref resolved from <Type Alias>, label, and raw_content.

TRACEABILITY:
srs: HLR-PIPE-007
VERIFICATION METHOD:
Test

LLR-034: Links Register as Relations

Given a Pandoc Link with (@) or (#) target, CSU Relation Parser shall insert one <Spec Relation> record with target_text and <Relation Selector> preserved for downstream resolution.

TRACEABILITY:
srs: HLR-PIPE-007
VERIFICATION METHOD:
Test

LLR-035: Content-Addressable Identifiers and Document Order

For any <Intermediate Representation> record, CSU Object Parser and CSU Hash Utilities shall compute identifier as SHA1 hash of source context and assign file_seq preserving document order.

TRACEABILITY:
srs: HLR-PIPE-007
VERIFICATION METHOD:
Test

LLR-036: Include Path Resolution

Given .include CodeBlock paths, CSU Include Expansion Filter shall resolve each path relative to the including file’s directory.

TRACEABILITY:
srs: HLR-PIPE-008
VERIFICATION METHOD:
Test

LLR-037: Circular Include Detection

When recursive include traversal detects a cycle, CSU Include Expansion Filter shall raise an error with the include chain path before performing any expansion.

TRACEABILITY:
srs: HLR-PIPE-008
VERIFICATION METHOD:
Test

LLR-038: Source Position Injection

After expanding included content, CSU Include Expansion Filter shall inject data-source-file and data-pos attributes into expanded blocks for diagnostic tracing.

TRACEABILITY:
srs: HLR-PIPE-008
VERIFICATION METHOD:
Test

LLR-039: Non-Composite PID Format

Given a non-<Composite Object Type> <Spec Object> without explicit @<Project Identifier>, the pid_generator shall produce a <Project Identifier> using pid_prefix + pid_format from the <Type> definition (e.g., HLR-%03dHLR-001).

TRACEABILITY:
srs: HLR-PIPE-009
VERIFICATION METHOD:
Test

LLR-040: Composite Hierarchical PID

Given a <Composite Object Type> <Spec Object> without explicit @<Project Identifier>, the pid_generator shall produce a hierarchical <Project Identifier> qualified by the <Specification> PID (e.g., SRS-sec1.2.3).

TRACEABILITY:
srs: HLR-PIPE-009
VERIFICATION METHOD:
Test

LLR-041: Explicit PID Preservation

Given a <Spec Object> with explicit @<Project Identifier> annotation, the pid_generator shall preserve the PID unchanged.

TRACEABILITY:
srs: HLR-PIPE-009
VERIFICATION METHOD:
Test

LLR-042: PID Collision Detection

After generating a <Project Identifier>, the pid_generator shall check for collisions across all <Specification>s, raising an error if a duplicate is found.

TRACEABILITY:
srs: HLR-PIPE-009
VERIFICATION METHOD:
Test

LLR-043: Relation Type Constraint Filtering

Given an unresolved <Spec Relation> and the <Type Registry>, CSU Relation Type Inferrer shall filter candidate relation types by <Relation Selector>, source_attribute, source type_ref, and target type_ref constraints.

TRACEABILITY:
srs: HLR-PIPE-010
VERIFICATION METHOD:
Test

LLR-044: NULL Constraints Are Wildcards

When a candidate relation type has a NULL constraint, CSU Relation Type Inferrer shall treat it as a wildcard matching any value, adding 0 to the <Specificity Scoring> score.

TRACEABILITY:
srs: HLR-PIPE-010
VERIFICATION METHOD:
Test

LLR-045: Specificity Tie Marks Ambiguity

When multiple candidates achieve equal highest <Specificity Scoring>, CSU Relation Type Inferrer shall mark the <Spec Relation> as ambiguous.

TRACEABILITY:
srs: HLR-PIPE-010
VERIFICATION METHOD:
Test

LLR-046: Same-Specification Target Preference

When resolving target candidates, CSU Resolution Queries shall prefer targets in the same <Specification> over cross-specification targets.

TRACEABILITY:
srs: HLR-PIPE-010
VERIFICATION METHOD:
Test

DD-CORE-001: SQLite as SpecIR Persistence Engine

Selected SQLite as the persistence engine for the Specification Intermediate Representation.

RATIONALE:

SQLite provides:

  • Zero-configuration embedded database requiring no server process
  • Single-file database portable across platforms (specir.db)
  • SQL-based query interface enabling declarative analyze queries and resolution logic
  • ACID transactions for reliable incremental builds with cache coherency
  • Built-in FTS5 for full-text search in the web application output
  • Mature Lua binding (lsqlite3) available in the Pandoc ecosystem

DD-CORE-002: EAV Attribute Storage Model

Selected Entity-Attribute-Value storage for dynamic object and float attributes.

RATIONALE:

The EAV model enables runtime schema extension through model definitions:

  • Object types declare custom attributes in Lua modules without DDL changes
  • New models can add attributes by declaring them in type definitions
  • Typed columns provide SQL-level type safety while preserving EAV flexibility
  • Per-type pivot views (view_{type}_objects) generated dynamically from spec_attribute_types restore columnar access for queries
  • Alternative of wide tables rejected: column set unknown at schema creation time since models load after initialization

DD-CORE-003: Five-Phase Pipeline Architecture

Selected a five-phase sequential pipeline (INITIALIZE, RESOLVE, TRANSFORM, ANALYZE, EMIT) for document processing.

RATIONALE:

Five phases separate concerns and enable verification before output:

  • INITIALIZE parses AST into normalized relational IR before any resolution
  • RESOLVE resolves cross-references and infers types on the complete IR, not partial state
  • TRANSFORM renders content with all references resolved (views render live at EMIT)
  • ANALYZE runs analyze queries after TRANSFORM so it can check transform results (e.g., float render failures)
  • EMIT generates output only after verification passes, preventing invalid documents
  • ANALYZE-before-EMIT enables abort on error without wasting output generation time
  • Phase ordering is fixed; handler ordering within each phase is controlled by topological sort

DD-CORE-004: Topological Sort for Handler Ordering

Selected Kahn’s algorithm with declarative prerequisite arrays for handler execution ordering within each pipeline phase.

RATIONALE:

Declarative prerequisites with topological sort enable:

  • Handlers declare prerequisites = {"handler_a", "handler_b"} rather than manual sequence numbers
  • Only handlers implementing the current phase’s hook participate in the sort
  • Alphabetical tie-breaking at equal dependency depth guarantees deterministic execution across runs
  • Cycle detection with error reporting prevents invalid configurations
  • New handlers (including model-provided handlers) integrate by declaring their prerequisites without modifying existing handlers
  • Alternative of priority numbers rejected: fragile when inserting new handlers between existing priorities

1.5 Type Discovery Design

FD-002: Type Model Discovery and Registration

The host loads model descriptors from the filesystem. It registers schema data, behavior hooks, phase hooks, and analyze queries.

Model order: The engine loads default before the selected model. It loads manifest dependencies before the model that requires them. A descriptor with the same kind and identifier replaces the earlier descriptor.

Model paths: The host searches $SPECCOMPILER_HOME/models/{model} first. It then searches {cwd}/models/{model}. A missing selected or required model stops the build.

Type discovery: The host scans five directories under models/{model}/types/.

Table Type category directory mapping
Category Directory Descriptor kind Database table
Specifications specifications/ specification spec_specification_types
Objects objects/ object spec_object_types
Floats floats/ float spec_float_types
Relations relations/ relation spec_relation_types
Views views/ view spec_view_types

The host loads Lua files in sorted order. A type can use one file or a directory with init.lua. The declared kind must match the directory category.

Descriptor contract: Each module returns { kind, schema, hooks }. The hooks field is optional. The host requires a known kind and a non-empty schema.id. It rejects invalid hooks and functions outside hooks.

return {
    kind = "object",
    schema = {
        id = "HLR",
        extends = "TRACEABLE",
        attributes = {
            { name = "status", type = "ENUM",
              values = { "Draft", "Approved" } },
        },
    },
    hooks = {
        render = function(ctx)
            return ctx.subject.element
        end,
    },
}

Registration: The host writes schema data to the applicable SpecIR table. It registers declared attributes and records the extends relationship. It indexes each behavior hook by kind, identifier, and hook name.

Hook inheritance: get_hook_inherited searches the descriptor and then its ancestors. This lookup applies to all descriptor kinds that support extends.

Phase hooks: An on_<phase> hook creates a pipeline handler named <lowercase schema.id>_handler. The schema.phase_prerequisites field defines its ordering constraints. Phase hooks do not enter the behavior-hook index.

Analyze queries: The host scans models/{model}/analyze_queries/. Each descriptor uses kind = "analyze". Repeated policy keys use later-model precedence. A descriptor with disabled = true removes the policy key.

Finalization: After model loading, the host propagates inherited attributes. It creates analyze-query SQL views and checks required hooks. A TABLE_VIEW subtype without build_block stops the build.

Figure Model descriptor loading

TRACEABILITY:
srs: SF-005 , CSC-001 , CSU-008

LLR-EXT-020-01: Known Type Categories Are Scanned

The host shall scan the five known type-category directories in deterministic order.

TRACEABILITY:
srs: HLR-EXT-002
VERIFICATION METHOD:
Test

LLR-EXT-021-01: Declared Hooks Are Indexed

The host shall index each valid behavior hook by kind, schema.id, and hook name.

TRACEABILITY:
srs: HLR-EXT-003
VERIFICATION METHOD:
Test

LLR-EXT-021-02: Attribute Display Order

The standard object renderer shall render attributes listed in schema.attr_order first. It shall append other attributes in alphabetical order.

TRACEABILITY:
srs: HLR-EXT-003
VERIFICATION METHOD:
Test

LLR-EXT-022-01: Schema Identifier Validation

The host shall stop model loading when a descriptor has no non-empty schema.id. It shall apply category defaults to valid schemas and register enum values.

TRACEABILITY:
srs: HLR-EXT-004
VERIFICATION METHOD:
Test

LLR-EXT-023-01: Model Path Resolution Order

Model resolution shall check SPECCOMPILER_HOME/models/{model} before {cwd}/models/{model}.

TRACEABILITY:
srs: HLR-EXT-005
VERIFICATION METHOD:
Test

LLR-EXT-023-02: Missing Model Paths Fail Fast

Model loading shall stop when neither model path contains the selected or required model.

TRACEABILITY:
srs: HLR-EXT-005
VERIFICATION METHOD:
Test

LLR-EXT-024-01: Data View Resolution

Chart data loading shall use the inherited dataset hook for the requested view. Fixture modules outside the host index can use the loose-module loader.

TRACEABILITY:
srs: HLR-EXT-006
VERIFICATION METHOD:
Test

LLR-EXT-024-02: Sankey Data Injection

For a Sankey series, chart injection shall copy returned data and links to the first series. It shall remove the conflicting dataset.

TRACEABILITY:
srs: HLR-EXT-006
VERIFICATION METHOD:
Test

LLR-EXT-024-03: Unsupported View Data

Chart injection shall preserve the chart configuration when no view is specified or the view returns an unsupported shape.

TRACEABILITY:
srs: HLR-EXT-006
VERIFICATION METHOD:
Test

LLR-094: Phase Hook Registration

The host shall register descriptor on_<phase> hooks with the pipeline.

TRACEABILITY:
srs: HLR-EXT-001
VERIFICATION METHOD:
Test

LLR-095: Data View Discovery

The host shall register view descriptors from models/{model}/types/views/.

TRACEABILITY:
srs: HLR-EXT-007
VERIFICATION METHOD:
Test

LLR-096: Hook Index Lookup

The host shall return direct hooks from its index and inherited hooks from the extends chain. An absent hook shall return nil.

TRACEABILITY:
srs: HLR-EXT-008
VERIFICATION METHOD:
Test

DD-CORE-006: Lua Type System with Inheritance

SpecCompiler shall use Lua descriptor modules for model types.

RATIONALE:
Lua supports computed schema data and co-locates behavior with its type. The extends field supports attribute and hook inheritance. Ordered model loading supports replacement without changes to the default model.

1.6 Storage Design

FD-003: SpecIR Persistence and Cache Coherency

Allocation: Realized by Database Persistence (Database Persistence) through Data Manager (Data Manager) and Build Cache (Build Cache). The database schema is defined in DB Schema (DB Schema), queries in DB Queries (DB Queries), and materialized views in DB Views (DB Views).

The <Intermediate Representation> persistence function manages the <SQLite Database> database that stores all parsed specification content and provides cache coherency for incremental builds. It encompasses schema management, the <EAV Model> storage model, build caching, and output caching.

SQLite Persistence: The data manager (Data Manager) wraps all database operations, providing a query API over the SpecIR schema. The database file is created in the project’s output directory and persists across builds. Schema creation is executed inside DataManager.new(), establishing all content and type tables.

SpecIR Schema: The content schema (Output Cache) defines the core entity tables:

  • specifications — Document-level containers with header AST and metadata
  • spec_objects — Typed content blocks with AST, file position, and specification scope
  • spec_floats — Embedded figures, listings, tables with render state
  • spec_views — Materialized data views (TOC, LOF, traceability matrices)
  • spec_relations — Links between objects with type inference results
  • spec_attribute_values — EAV-model attribute storage for object and float properties

The type schema (Analyze Query Definitions) defines the metamodel tables that describe valid types, attribute definitions, and datatype constraints.

EAV Attribute Model: Attributes are stored as individual rows in spec_attribute_values rather than as columns, enabling dynamic schema extension through model definitions. Each attribute row references its parent entity (object or float), attribute definition, and stores the value as text with type casting at query time.

<Build Cache>: The build cache (Build Cache) records, per document, the full file set the last successful build read — the root document itself plus every included file — as nodes of the build_graph table, each with the SHA1 it had at build time (the root is its own node). Before parsing, the Build Engine (Build Engine) hashes the root and the build cache walks the recorded nodes, hashing include files via the Hash Utilities (Hash Utilities). The document is dirty — reparsed from source — when any node’s current hash differs, a node file is missing (hash returns nil, forcing the parse to fail fast with a clear include-not-found error), or no root node is recorded (first build, or the previous build failed before the deferred cache update). Unchanged documents skip parsing entirely and reuse their cached SpecIR state.

<Output Cache>: The output cache stores, per generated output file, the SHA1 of the exact serialized document that was fed to Pandoc — assembled from the database, views rendered, and the format filter applied. Before invoking Pandoc, the emitter serializes the assembled document, hashes it, and skips the invocation when the stored hash matches and no file dependency (bibliography, LaTeX class archive, reference.docx for DOCX) is newer than the output. Because the hash covers the render input itself rather than a model of its dependencies, any change that affects the rendered document — including cross-document view data such as traceability matrices, and template filter changes — invalidates the cache by construction.

Component Interaction

The storage subsystem is realized through four packages that separate runtime operations from static definitions.

CSC Database Persistence (Database Persistence) provides the runtime database layer. CSU Database Handler (Database Handler) wraps raw SQLite operations and connection management with DELETE journal mode for single-file reliability. CSU Data Manager (Data Manager) builds on the handler to provide the high-level query API used by all pipeline phases — inserting spec entities during INITIALIZE, updating references during RESOLVE, and reading assembled content during EMIT. CSU Build Cache (Build Cache) queries build_graph to detect changed documents via SHA1 comparison of every recorded node (root and includes). CSU Output Cache (Output Cache) tracks generated output files and the hash of their serialized render input to skip redundant generation. CSU Analyze Query Loader (Analyze Query Loader) materializes SQL analyze query views at build time for the ANALYZE phase.

CSC DB Schema (DB Schema) defines the database structure through composable modules. CSU Schema Aggregator (Schema Aggregator) is the entry point, composing: CSU Content Schema (Content Schema) for the core SpecIR tables, CSU Type System Schema (Type System Schema) for attribute and datatype definitions, CSU Build Schema (Build Schema) for source file and dependency tracking, and CSU Search Schema (Search Schema) for FTS5 virtual tables.

CSC DB Queries (DB Queries) mirrors the schema structure with composable query modules. CSU Query Aggregator (Query Aggregator) combines: CSU Content Queries (Content Queries) for spec entity CRUD, CSU Resolution Queries (Resolution Queries) for cross-reference and relation resolution, CSU Build Queries (Build Queries) for cache and dependency lookups, CSU Type Queries (Type Queries) for type definitions and attribute constraints, and CSU Search Queries (Search Queries) for FTS5 population and search.

CSC DB Views (DB Views) provides materialized SQL views over the SpecIR data. CSU Views Aggregator (Views Aggregator) composes: CSU EAV Pivot Views (EAV Pivot Views) for pivoting attribute values into typed columns, CSU Resolution Views (Resolution Views) for joining relations with resolved targets, and CSU Public API Views (Public API Views) for stable query interfaces used by pipeline handlers and external tools.

Figure SpecIR Persistence and Cache Coherency

TRACEABILITY:
srs: SF-002

LLR-DB-007-01: DataManager Rollback Cancels Staged Inserts

DataManager.begin_transaction() followed by facade insert calls and DataManager.rollback() shall leave no persisted staged rows.

TRACEABILITY:
srs: HLR-STOR-001
VERIFICATION METHOD:
Test

LLR-DB-007-02: DataManager CRUD Facade Persists Canonical IR Rows

DataManager facade methods (insert_specification, insert_object, insert_float, insert_relation, insert_view, insert_attribute_value, query_all, query_one, execute) shall persist and retrieve canonical IR rows in content tables.

TRACEABILITY:
srs: HLR-STOR-001
VERIFICATION METHOD:
Test

LLR-DB-008-01: Attribute Casting Persists Typed Columns For Valid Pending Rows

Attribute casting shall map raw attribute values to the correct typed columns (string_value, int_value, real_value, bool_value, date_value, enum_ref) and skip updates for invalid casts.

TRACEABILITY:
srs: HLR-STOR-002
VERIFICATION METHOD:
Test

LLR-047: Build Cache Clean on Hash Match

Given a document path and its current SHA1 hash, CSU Build Cache is_document_dirty() shall walk the document’s <Build Graph> nodes and return false when the root node is recorded and every node’s stored node_sha1 matches its current file hash.

TRACEABILITY:
srs: HLR-STOR-003
VERIFICATION METHOD:
Test

LLR-048: Build Cache Dirty on Missing Entry

Given a document path with no root node recorded in the <Build Graph> (first build, or a previous build that failed before the deferred cache update), CSU Build Cache is_document_dirty() shall return true.

TRACEABILITY:
srs: HLR-STOR-003
VERIFICATION METHOD:
Test

LLR-049: Output Cache Stale on Hash Mismatch

Given a spec_id, output_path, and the SHA1 of the serialized document to be rendered (the exact Pandoc input, after assembly, view rendering, and format filtering), CSU Output Cache is_output_current() shall return false when the stored hash in the <Output Cache> differs.

TRACEABILITY:
srs: HLR-STOR-004
VERIFICATION METHOD:
Test

LLR-050: Output Cache Stale on Missing File

When the output file does not exist on disk, CSU Output Cache is_output_current() shall return false regardless of hash match.

TRACEABILITY:
srs: HLR-STOR-004
VERIFICATION METHOD:
Test

LLR-051: Include-Aware Dirty Check

Given a root document path, CSU Build Cache is_document_dirty() shall compare every <Build Graph> node — the root itself and all includes — against current file hashes, returning true if any differs or a node file is missing.

TRACEABILITY:
srs: HLR-STOR-005
VERIFICATION METHOD:
Test

LLR-052: Build Graph Refresh After Build

After a successful build, CSU Build Cache and CSU Build Queries update_build_graph() shall delete old <Build Graph> rows for root_path and insert the current file set: the root document as its own node plus the include tree.

TRACEABILITY:
srs: HLR-STOR-005
VERIFICATION METHOD:
Test

LLR-053: EAV Pivot View Naming

Given <Type Registry> spec_object_types entries, CSU EAV Pivot Views shall generate <EAV Model> pivot views named view_{type_lower}_objects with one column per registered attribute.

TRACEABILITY:
srs: HLR-STOR-006
VERIFICATION METHOD:
Test

LLR-054: No Pivot View for Composites

Given a <Composite Object Type> spec_object_types entry, CSU EAV Pivot Views shall not generate a pivot view.

TRACEABILITY:
srs: HLR-STOR-006
VERIFICATION METHOD:
Test

DD-CORE-007: Content-Addressed Build Caching

Selected SHA1 content hashing for incremental build detection.

RATIONALE:

Content-addressed hashing provides deterministic cache invalidation:

  • SHA1 of document content detects actual changes, ignoring timestamp-only modifications
  • One build_graph table records the whole file set of a build (root as its own node plus includes), so a single node walk answers the dirty check
  • Missing include files force cache miss (hash returns nil), preventing stale IR state
  • Deferred cache updates (after successful pipeline execution) prevent stale entries on error
  • The output cache keys on the hash of the serialized render input (the exact Pandoc input), not on a model of its dependencies — cross-document view data and template filter changes invalidate by construction
  • Uses Pandoc’s built-in pandoc.sha1() when available, falling back to vendor/sha2.lua in standalone mode
  • Alternative of file timestamps rejected: unreliable across platforms (git checkout, copy, WSL2 clock skew)
  • Alternative of per-spec dependency-model hashing (the previous “P-IR hash”) rejected: it missed inbound relations and live view queries, serving stale outputs after cross-document edits

DD-DB-002: Dynamic SQL View Generation for EAV Pivots

Selected runtime-generated CREATE VIEW statements per object type to pivot EAV attributes into typed columns.

RATIONALE:

Dynamic view generation bridges EAV flexibility with query usability:

  • Views generated after type loading, when attribute definitions are known
  • One view per non-composite object type (view_{type}_objects) with type-appropriate MAX(CASE) pivot expressions
  • Datatype-aware column selection (string_value for STRING, int_value for INTEGER, etc.)
  • External tools query familiar columnar views instead of raw EAV tables
  • Three-stage view initialization: resolution views first, public API views second, EAV pivots last
  • Alternative of application-layer pivoting rejected: pushes N+1 query patterns to every consumer

1.7 Output Design

FD-004: Multi-Format Publication

Allocation: Realized by Transform Handlers (Transform Handlers) and Emit Handlers (Emit Handlers) through External Render Handler (External Render Handler) and Emitter Orchestrator (Emitter Orchestrator). Output infrastructure is provided by Infrastructure (Infrastructure), with format-specific utilities in Format Utilities (Format Utilities), DOCX generation in DOCX Generation (DOCX Generation), I/O operations in I/O Utilities (I/O Utilities), and external process management in Process Management (Process Management).

The multi-format publication function encompasses the TRANSFORM and EMIT pipeline phases, covering content rendering, external subprocess rendering, document assembly from the <Intermediate Representation> database, <Float> numbering and resolution, and parallel output generation via Pandoc. Views (table of contents, list of figures/tables, abbreviation lists, matrices) are rendered live at EMIT time by their view-type render hooks querying the database, so their content always reflects current database state — a requirement of the output cache, which keys on the serialized render input.

TRANSFORM Phase: Prepares content for output through the handler stages:

  • Float Transformer: Resolves float content that does not require external rendering (e.g., CSV parsing, text processing) and updates spec_floats.resolved_ast.

  • External Render Handler: Coordinates parallel subprocess rendering for float types requiring external tools (PlantUML, ECharts, Math). Prepares tasks via renderer callbacks, checks output cache for hits, and spawns remaining tasks in parallel via luv spawn_batch(). Results update resolved_ast with output paths.

  • Object Render Handler: Invokes type-specific handlers for each spec_object (ordered by file_seq). Type handlers provide header() and body() functions dispatched through the base handler wrapper. Rendered AST is merged back to spec_objects.ast.

  • Specification Render Handler: Renders document title headers via specification type handlers, storing result in specifications.header_ast.

EMIT Phase: Assembles and generates output documents in multiple formats, fulfilling multi-format output requirements:

  • Float Numbering: Assigns sequential numbers to floats by counter_group (e.g., FIGURE, TABLE, LISTING, EQUATION) across all documents. Shared counter groups enable natural numbering where related visual content types form a single sequence.

  • Document Assembler: Reconstructs a complete Pandoc AST from the SpecIR database Queries spec_objects ordered by file_seq, decodes JSON AST fragments, normalizes header levels, and assembles floats and views into the document structure. Metadata is built from specification attributes and the assembler returns a complete pandoc.Pandoc document.

  • Float Resolver: Builds a lookup map of rendered float results (ast, number, caption, type_ref) from spec_floats with resolved_ast. The resolver queries the database for all floats belonging to the current specification and indexes them for efficient lookup during document traversal.

  • Float Emitter: Walks assembled document blocks and replaces float placeholder CodeBlocks with rendered Div elements containing captions and semantic CSS classes for format-specific styling.

  • FTS Indexer: Replaces view placeholder blocks with materialized content from the TRANSFORM phase. Views are expanded inline as formatted tables, lists, or custom structures depending on view type. Additionally, populates FTS5 virtual tables (fts_objects, fts_attributes, fts_floats) for <Full-Text Search> in the web application, converting AST to plain text and indexing searchable fields with Porter stemming.

  • Inline Handler Dispatcher: Processes inline elements during emit - resolves (@) links to #anchor references, processes citations, and renders inline math expressions.

  • Emitter Orchestrator: Format-agnostic orchestration for batch mode execution: (1) assigns float numbers globally, (2) assembles documents per specification, (3) resolves and transforms floats, (4) applies format-specific filters (docx, html), (5) serializes assembled documents to intermediate JSON via pandoc.write(doc, "json") to temporary files, (6) checks output_cache for staleness and skips generation when outputs are current, (7) spawns parallel Pandoc processes via luv for concurrent format conversion (docx, html5), and (8) cleans up intermediate JSON files after generation completes. Format-specific postprocessors run after Pandoc generation: DOCX postprocessing applies style fixups via OOXML manipulation, and HTML5 postprocessing bundles assets for web application deployment.

Infrastructure Support: The Pandoc CLI wrapper (Pandoc CLI Builder) builds command arguments for multiple output formats (docx, html5, markdown, json) with reference document, bibliography, and filter support. The reference generator (Reference Generator) creates reference.docx from style presets for DOCX output styling.

Component Interaction

The output subsystem spans the TRANSFORM and EMIT pipeline phases, realized through handler packages and infrastructure components.

CSC Transform Handlers (Transform Handlers) prepares content for output. CSU Float Transformer (Float Transformer) resolves float content not requiring external tools. CSU External Render Handler (External Render Handler) coordinates parallel subprocess rendering via luv. CSU Object Render Handler (Object Render Handler) invokes type-specific header/body renderers. CSU Specification Render Handler (Specification Render Handler) renders document title headers. CSU Relation Link Rewriter (Relation Link Rewriter) rewrites (@) link targets to resolved anchors in the final AST.

CSC Emit Handlers (Emit Handlers) assembles and generates output documents. CSU FTS Indexer (FTS Indexer) populates full-text search tables. CSU Float Numbering (Float Numbering) assigns sequential numbers by counter group. CSU Document Assembler (Document Assembler) reconstructs complete Pandoc AST from SpecIR. CSU Float Resolver (Float Resolver) builds the rendered float lookup map. CSU Float Emitter (Float Emitter) replaces float placeholders with rendered Divs. CSU View Emitter (View Emitter) expands view placeholders with materialized content. CSU Inline Handler Dispatcher (Inline Handler Dispatcher) processes inline elements — links, citations, math. CSU Float Handler Dispatcher (Float Handler Dispatcher) routes float rendering to type-specific handlers. CSU View Handler Dispatcher (View Handler Dispatcher) routes view expansion to type-specific materializers. CSU Emitter Orchestrator (Emitter Orchestrator) coordinates the full emit sequence: numbering, assembly, resolution, filtering, and parallel Pandoc output.

CSC Infrastructure (Infrastructure) provides cross-cutting utilities. CSU Hash Utilities (Hash Utilities) computes SHA1 hashes for cache coherency. CSU Logger (Logger) implements NDJSON structured logging. CSU JSON Utilities (JSON Utilities) handles JSON serialization for AST interchange. CSU Reference Cache (Reference Cache) caches resolved cross-references for O(1) lookup during emit. CSU MathML to OMML Converter (MathML to OMML Converter) translates MathML equations to Office Math Markup for DOCX output.

CSC Format Utilities (Format Utilities) provides format-specific helpers. CSU Format Writer (Format Writer) serializes AST to intermediate JSON for Pandoc consumption. CSU XML Utilities (XML Utilities) generates and manipulates XML for OOXML postprocessing. CSU ZIP Utilities (ZIP Utilities) handles DOCX archive creation and modification.

CSC DOCX Generation (DOCX Generation) produces Word documents. CSU Preset Loader (Preset Loader) reads style preset definitions from Lua files. CSU Style Builder (Style Builder) generates OOXML style elements from preset values. CSU OOXML Builder (OOXML Builder) assembles the final DOCX package with styles, numbering, and content parts. CSU Reference Generator (Reference Generator) creates reference.docx for Pandoc’s --reference-doc option.

CSC I/O Utilities (I/O Utilities) provides file-system operations. CSU Document Walker (Document Walker) traverses specification documents and their includes to build processing contexts. CSU File Walker (File Walker) scans directories for files matching glob patterns during model discovery.

CSC Process Management (Process Management) manages external subprocesses. CSU Pandoc CLI Builder (Pandoc CLI Builder) constructs Pandoc command-line arguments for each output format. CSU Task Runner (Task Runner) provides the luv-based parallel task executor used by both external float rendering and batch Pandoc output generation.

Figure Transform and Emit Pipeline

TRACEABILITY:
srs: SF-004

LLR-OUT-029-01: DOCX Preset Loader Resolves, Merges, And Validates Preset Chains

DOCX preset loading shall resolve preset paths, merge extends chains deterministically, and reject malformed or cyclic preset definitions.

TRACEABILITY:
srs: HLR-OUT-005
VERIFICATION METHOD:
Test

LLR-070: Assembler Queries by File Sequence

Given a <Specification> identifier, CSU Document Assembler shall query spec_objects ordered by file_seq, producing a Pandoc Block list in document order.

TRACEABILITY:
srs: HLR-OUT-001
VERIFICATION METHOD:
Test

LLR-071: Include Header Level Adjustment

Given an included file under an active heading, CSU Include Handler shall shift all Pandoc Header levels by the same amount. The shallowest included heading shall be one level below the active heading. The handler shall preserve relative depths and combine shifts across nested includes. A ---- section close shall reduce the active level by one. Without an active heading, the handler shall preserve source levels. The source file can start at any heading level. The handler shall preserve computed levels greater than 6.

TRACEABILITY:
srs: HLR-OUT-001
VERIFICATION METHOD:
Test

LLR-072: Float and View Placeholder Insertion

Given <Spec Float> and <Spec View> positions, CSU Document Assembler shall insert <Placeholder Block>s at correct file_seq positions for downstream resolution.

TRACEABILITY:
srs: HLR-OUT-001
VERIFICATION METHOD:
Test

LLR-073: Float Placeholder Label Matching

Given a <Placeholder Block> in the assembled document, CSU Float Emitter shall match its label against spec_floats records to retrieve the resolved_ast.

TRACEABILITY:
srs: HLR-OUT-002
VERIFICATION METHOD:
Test

LLR-074: Float Semantic Div Wrapping

Given a resolved <Spec Float>, CSU Float Emitter shall wrap it in a Pandoc Div with semantic classes (speccompiler-float, <Counter Group>-specific class) and a bookmark anchor identifier.

TRACEABILITY:
srs: HLR-OUT-002
VERIFICATION METHOD:
Test

LLR-075: Failed Float Error Placeholder

Given a <Spec Float> with NULL resolved_ast (failed <External Renderer>), CSU Float Emitter shall preserve an error placeholder block with <Diagnostic Record> message.

TRACEABILITY:
srs: HLR-OUT-002
VERIFICATION METHOD:
Test

LLR-076: Monotonic Float Numbering

Given all <Spec Float>s across all <Specification>s ordered by file_seq, CSU Float Numbering shall assign monotonically increasing number within each <Counter Group>, starting at 1.

TRACEABILITY:
srs: HLR-OUT-003
VERIFICATION METHOD:
Test

LLR-077: Shared Counter Group Numbering

When float types share a <Counter Group> (e.g., FIGURE, CHART, PLANTUML share “FIGURE”), CSU Float Numbering shall use a single numbering sequence.

TRACEABILITY:
srs: HLR-OUT-003
VERIFICATION METHOD:
Test

LLR-078: Output Cache Skip

Given an assembled Pandoc document and output config, CSU Emitter Orchestrator shall call CSU Output Cache is_output_current() and skip format generation when it returns true.

TRACEABILITY:
srs: HLR-OUT-004
VERIFICATION METHOD:
Test

LLR-079: Intermediate JSON Cleanup

After Pandoc format conversion completes, CSU Emitter Orchestrator shall remove the intermediate JSON file from the build directory.

TRACEABILITY:
srs: HLR-OUT-004
VERIFICATION METHOD:
Test

LLR-080: HTML5 Resource Embedding

When embed_resources: true is set in project.yaml html5: config, CSU Pandoc CLI Builder shall add --embed-resources to Pandoc CLI args, producing single-file HTML5 output.

TRACEABILITY:
srs: HLR-OUT-006
VERIFICATION METHOD:
Test

LLR-081: HTML5 Search Index Bundling

When <Full-Text Search> tables are populated, CSU HTML5 Postprocessor HTML5 postprocessor shall bundle the search index JSON into the output.

TRACEABILITY:
srs: HLR-OUT-006
VERIFICATION METHOD:
Test

LLR-082: FTS5 Table Creation with Porter Stemming

During <EMIT Phase> phase, CSU FTS Indexer shall create FTS5 virtual tables (fts_objects, fts_attributes, fts_floats) with tokenize='porter'.

TRACEABILITY:
srs: HLR-OUT-007
VERIFICATION METHOD:
Test

LLR-083: AST to Plain Text for FTS Indexing

Given <Spec Object> body <Abstract Syntax Tree>, CSU FTS Indexer shall convert to plain text via Pandoc utils.stringify() before inserting into the <Full-Text Search> index.

TRACEABILITY:
srs: HLR-OUT-007
VERIFICATION METHOD:
Test

DD-INFRA-001: NDJSON Logging

Selected Newline-Delimited JSON format for structured logging.

RATIONALE:

NDJSON enables:

  • Machine-parseable log output for CI/CD integration
  • Structured data (level, message, timestamp, context)
  • Easy filtering and analysis with standard tools (jq)
  • Human-readable when formatted

Configuration via config.logging.level with env override SPECCOMPILER_LOG_LEVEL.

DD-INFRA-002: Parallel Task Execution

Selected luv (libuv) for parallel subprocess execution.

RATIONALE:

Document processing benefits from parallel execution:

  • External renderers (PlantUML, ECharts) run concurrently
  • Pandoc output generation runs in parallel for multiple formats
  • luv provides cross-platform async I/O without external dependencies

DD-INFRA-003: Preset-Based DOCX Styles

Selected preset system for DOCX style customization.

RATIONALE:

Corporate documents require consistent styling. The preset system:

  • Loads style definitions from Lua files
  • Generates reference.docx with custom styles
  • Caches generated reference based on preset hash
  • Enables style changes without modifying source documents

DD-TOOLS-001: Deno Runtime for External Tools

Selected Deno as the runtime for TypeScript-based external tools.

RATIONALE:

Deno provides:

  • Single-file TypeScript execution without build step
  • Built-in npm module support via npm: specifiers
  • Permission-based security model
  • Cross-platform compatibility

Tools are spawned via task_runner.spawn_sync() with timeout handling.

DD-CORE-005: Pandoc as Document Processing Engine

Selected Pandoc as the document parsing and output generation engine.

RATIONALE:

Pandoc serves as both input parser and output generator:

  • CommonMark+extensions parsing via pandoc.read() provides a well-defined AST
  • Lua filter API enables in-process AST manipulation without subprocess overhead for parsing
  • Multi-format output (DOCX, HTML5, Markdown, LaTeX/PDF, JSON) from a single intermediate representation
  • --reference-doc support enables DOCX style customization via generated reference.docx
  • --lua-filter support enables format-specific transformations (docx.lua, html.lua)
  • Native bibliography support (–bibliography, –csl) for citation processing
  • Broad ecosystem adoption provides stability and community support

1.8 Model Design

FD-005: Type System and Domain Model Definition

The type system and domain model definition function encompasses the default model components that provide base type definitions, format-specific processing, and style configuration. These components are overlaid by the host engine (<Type Loader>, Type Loader) during the model discovery phase described in Type Model Discovery and Registration and collectively define the foundational capabilities that all domain models inherit and extend.

Model Directory Structure: Each model provides a standard directory layout with types/ (objects, floats, relations, views, specifications), filters/, postprocessors/, and styles/ subdirectories. Each .lua file under types/ returns one descriptor table { kind, schema, [hooks] }. The host reads the descriptor fields. The default model (models/default/) establishes baseline definitions for all five type categories.

Type Definitions: CSC-017 defines the foundational document object and specification types (SECTION, SPEC) that every overlay reuses. CSC-022 defines float types (FIGURE, TABLE, LISTING, PLANTUML, CHART, MATH) with counter groups for shared numbering. CSC-023 defines the reusable base relation types (PID_REF, LABEL_REF) plus built-in cross-reference relations (XREF_SEC, XREF_FIGURE, XREF_TABLE, XREF_LISTING, XREF_MATH, XREF_CITATION) that map @ and # selectors to typed targets without reimplementing resolution. CSC-024 defines view types (TOC, LOF, ABBREV, ABBREV_LIST, GAUSS, MATH_INLINE) with inline prefix syntax and materializer strategies.

Format Processing: CSC-018 provides Pandoc Lua filters for DOCX, HTML, and Markdown output that convert speccompiler-format markers (page breaks, bookmarks, captions, equations) into native output elements. CSC-019 applies format-specific post-processing after Pandoc output generation, loading template-specific fixup modules for DOCX and LaTeX. CSC-021 defines style presets with page layout, typography, and formatting configuration for DOCX (Letter-sized, standard margins) and HTML (Inter/JetBrains Mono fonts, color palette) output.

Component Interaction

The default model is realized through six packages that define the baseline type system, format processing, and style configuration inherited by all domain models.

CSC Default Float Types (Default Float Types) defines the visual content types. CSU FIGURE Float Type (FIGURE) handles image-based floats. CSU TABLE Float Type (TABLE) handles tabular data with CSV parsing. CSU LISTING Float Type (LISTING) handles code blocks with syntax highlighting. CSU PLANTUML Float Type (PLANTUML) renders UML diagrams via external subprocess. CSU CHART Float Type (CHART) renders ECharts visualizations. CSU MATH Float Type (MATH) renders LaTeX equations via KaTeX. Each type declares a counter group for cross-specification numbering.

CSC Default Relation Types (Default Relation Types) defines reusable cross-reference relations. The base types PID_REF and LABEL_REF centralize @ and # resolution. XREF_SEC targets sections by PID. CSU XREF_FIGURE Relation Type (XREF_FIGURE) targets FIGURE floats. CSU XREF_TABLE Relation Type (XREF_TABLE) targets TABLE floats. CSU XREF_LISTING Relation Type (XREF_LISTING) targets LISTING floats. CSU XREF_MATH Relation Type (XREF_MATH) targets MATH floats. CSU XREF_CITATION Relation Type (XREF_CITATION) resolves bibliography citations via BibTeX keys.

CSC Default View Types (Default View Types) defines data views with inline prefix syntax. CSU TOC View Type (TOC) generates tables of contents from spec objects. CSU LOF View Type (LOF) generates lists of figures, tables, or listings by counter group. CSU ABBREV View Type (ABBREV) renders inline abbreviation expansions. CSU ABBREV_LIST View Type (ABBREV_LIST) generates abbreviation glossaries. CSU GAUSS View Type (GAUSS) renders Gaussian distribution charts. CSU MATH_INLINE View Type (MATH_INLINE) renders inline LaTeX math expressions.

CSC Default Filters (Default Filters) provides format-specific Pandoc Lua filters applied during EMIT. CSU DOCX Filter (DOCX Filter) converts markers to OOXML-compatible elements — page breaks, bookmarks, and custom styles. CSU HTML Filter (HTML Filter) converts markers to semantic HTML5 elements with CSS classes. CSU Markdown Filter (Markdown Filter) normalizes markers for clean Markdown output.

CSC Default Postprocessors (Default Postprocessors) applies fixups after Pandoc generation. CSU DOCX Postprocessor (DOCX Postprocessor) manipulates the OOXML package — injecting custom styles, fixing table widths, and applying numbering overrides. CSU LaTeX Postprocessor (LaTeX Postprocessor) applies template-specific LaTeX fixups for PDF output.

CSC Default Styles (Default Styles) provides output styling presets. CSU DOCX Style Preset (DOCX Style Preset) defines page layout (Letter, standard margins), heading styles, table formatting, and font selections for Word output. CSU HTML Style Preset (HTML Style Preset) defines the web typography (Inter/JetBrains Mono), color palette, and responsive layout for HTML output.

Figure Type System and Domain Model Definition

TRACEABILITY:
srs: SF-003 , CSC-017 , CSC-018 , CSC-019 , CSC-021 , CSC-022 , CSC-023 , CSC-024 , CSU-081 , CSU-082

LLR-055: Specification Identifier from Filename

Given a source file path, CSU Specification Parser shall derive the <Specification> identifier from the filename without extension.

TRACEABILITY:
srs: HLR-TYPE-001
VERIFICATION METHOD:
Test

LLR-056: Unknown Specification Type Fallback

When a L1 header declares an unknown type_ref, CSU Specification Parser shall fall back to the default <Type> or emit a <Diagnostic Record> warning via CSU Diagnostics Collector.

TRACEABILITY:
srs: HLR-TYPE-001
VERIFICATION METHOD:
Test

LLR-057: Spec Object Content-Addressable ID

Given source path, start_line, and title_text, CSU Object Parser and CSU Hash Utilities shall compute the <Spec Object> identifier as SHA1 hash of the concatenation.

TRACEABILITY:
srs: HLR-TYPE-002
VERIFICATION METHOD:
Test

LLR-058: Spec Object Type Resolution Order

Given L2-H6 header text, CSU Object Parser shall resolve the <Type> in order: explicit TYPE: prefix → <Type Alias> lookup in <Type Registry> → default type.

TRACEABILITY:
srs: HLR-TYPE-002
VERIFICATION METHOD:
Test

LLR-059: Spec Object Label Format

Given a resolved <Spec Object>, CSU Object Parser shall format the label field as {type_lower}:{title_slug} for (#) cross-referencing.

TRACEABILITY:
srs: HLR-TYPE-002
VERIFICATION METHOD:
Test

LLR-060: Float Short Identifier Format

Given a float source context, CSU Float Parser and CSU Hash Utilities shall compute the <Spec Float> identifier in short format float-{8-char-sha1} for DOCX bookmark compatibility.

TRACEABILITY:
srs: HLR-TYPE-003
VERIFICATION METHOD:
Test

LLR-061: Float Type Alias Resolution

Given a CodeBlock class string, CSU Float Parser shall resolve the <Spec Float> type_ref from <Type Alias> entries in spec_float_types (e.g., “csv” → “TABLE”).

TRACEABILITY:
srs: HLR-TYPE-003
VERIFICATION METHOD:
Test

LLR-062: External Render Delegation

When a <Spec View> has needs_external_render = 1 in spec_view_types, CSU External Render Handler shall delegate it to the registered <External Renderer>.

TRACEABILITY:
srs: HLR-TYPE-004
VERIFICATION METHOD:
Test

LLR-063: Inline View Syntax

Given Inline Code with type: content format, CSU View Parser shall insert a <Spec View> record with view_type_ref and raw_ast.

TRACEABILITY:
srs: HLR-TYPE-004
VERIFICATION METHOD:
Test

LLR-064: PID and Label Selector Resolution

Given a (@) <Relation Selector>, CSU Resolution Queries shall resolve via spec_objects.pid; given (#) <Relation Selector>, CSU Resolution Queries shall resolve via spec_objects.label or spec_floats.label.

TRACEABILITY:
srs: HLR-TYPE-005
VERIFICATION METHOD:
Test

LLR-065: Default Relation Type Selection

When no explicit relation type is provided, CSU Relation Type Inferrer shall select the default <Spec Relation> type where is_default = 1 AND link_selector matches in spec_relation_types.

TRACEABILITY:
srs: HLR-TYPE-005
VERIFICATION METHOD:
Test

LLR-066: ENUM Attribute Resolution

Given an ENUM <Attribute> raw_value, CSU Attribute Caster shall resolve it against the enum_values table and populate the enum_ref foreign key.

TRACEABILITY:
srs: HLR-TYPE-006
VERIFICATION METHOD:
Test

LLR-067: XHTML AST Preservation

Given an XHTML <Attribute> raw_value, CSU Attribute Parser shall preserve the Pandoc <Abstract Syntax Tree> serialization in the ast column as JSON.

TRACEABILITY:
srs: HLR-TYPE-006
VERIFICATION METHOD:
Test

LLR-068: Analyze Query Registration

Given a <Analyze Query> SQL string, CSU Analyze Query Loader shall register it as a CREATE VIEW in the <SpecIR> database during the <ANALYZE Phase> phase.

TRACEABILITY:
srs: HLR-TYPE-007
VERIFICATION METHOD:
Test

LLR-069: Validation Policy Severity Resolution

Given a <Validation Policy> policy_key and project.yaml configuration, CSU Validation Policy shall return severity (error, warn, ignore) controlling <Diagnostic Record> emission.

TRACEABILITY:
srs: HLR-TYPE-007
VERIFICATION METHOD:
Test

DD-MODEL-001: Layered Model Extension with Override Semantics

Selected layered model loading where domain models extend and override the default model by type identifier.

RATIONALE:

ID-based override enables clean domain specialization:

  • Default model loads first, establishing baseline types (SECTION, SPEC, float types, relations, views)
  • Domain model loads second; types with matching IDs replace defaults, new IDs add to the registry
  • Verification views follow the same pattern: domain analyze queries override defaults by policy_key
  • Attribute inheritance propagated iteratively after all types are loaded, enabling parent attributes to flow to child types across model boundaries
  • Filter, postprocessor, and style directories follow conventional naming for predictable discovery
  • Alternative of mixin composition rejected: ordering ambiguity when multiple mixins define the same attribute

1.9 Audit & Integrity Design

FD-006: Audit and Integrity

Allocation: Realized by Core Runtime (Core Runtime) and Default Analyze Queries (Default Analyze Queries) through Analyze Handler (Analyze Handler) and Hash Utilities (Hash Utilities).

The audit and integrity function ensures deterministic compilation, reproducible builds, and audit trail integrity. It encompasses content-addressed hashing for incremental build detection, structured logging for audit trails, and include dependency tracking for proper cache invalidation.

Include Hash Computation: The engine (Build Engine) queries the build_graph table for known includes from the previous build, then computes SHA1 hashes for each include file. Missing files cause a cache miss (triggering a full rebuild). The resulting map of path-to-hash is compared against stored values to detect changes. SHA1 hashing uses Pandoc’s built-in pandoc.sha1() when available, falling back to vendor/sha2.lua in standalone worker mode.

Document Change Detection: Each document’s content is hashed and compared against the hashes recorded as build_graph nodes (the root document is its own node, alongside its includes). Unchanged documents (every node hash matching) skip parsing and reuse cached <Intermediate Representation> state, providing significant performance improvement for large projects.

Structured Logging: NDJSON (Newline-Delimited JSON) logging provides machine-parseable audit trails with structured data (level, message, timestamp, context). Log level is configurable via config.logging.level with environment override via SPECCOMPILER_LOG_LEVEL. Levels: DEBUG, INFO, WARN, ERROR.

Build Reproducibility: Given identical source files (by content hash), project configuration, and tool versions, the system produces identical outputs. Content-addressed hashing of documents, includes, and the P-IR state ensures deterministic compilation.

Verification Execution: The Analyze Handler Analyze Handler executes in batch mode during the ANALYZE phase. It iterates over all registered analyze queries, querying each via the Data Manager Data Manager. For each violation row returned, the handler consults the Validation Policy Validation Policy to determine the configured severity level. Error-level violations are emitted as structured diagnostics via the Diagnostics Collector Diagnostics Collector. Violations at the ignore level are suppressed entirely. Each analyze query enforces constraints declared by the type metamodel, ensuring that registered types satisfy their validation rules.

After verification completes, the handler stores the verification result (error and warning counts) in all pipeline contexts. The Pipeline Orchestrator Pipeline Orchestrator checks for errors after ANALYZE and aborts before EMIT if any exist.

Analyze Queries — Entity-Based Taxonomy

Verification views follow the SpecIR 5-tuple: S (Specification), O (Object), F (<Float>), R (Relation), V (View). Each analyze query is identified by its policy_key.

Specification Verification views (S)

Table Specification analyze queries
Policy Key View Name Validates
spec_missing_required view_spec_missing_required Required spec attributes present
spec_invalid_type view_spec_invalid_type Specification type is valid

Spec Object Verification views (O)

Table Spec object analyze queries
Policy Key View Name Validates
missing_required view_object_missing_required Required object attributes present
cardinality_over view_object_cardinality_over Attribute count <= max_occurs
invalid_cast view_object_cast_failures Attribute value casts to declared type
invalid_enum view_object_invalid_enum Enum value exists in enum_values
invalid_date view_object_invalid_date Date format is YYYY-MM-DD
bounds_violation view_object_bounds_violation Numeric values within min/max bounds
object_duplicate_pid view_object_duplicate_pid PID is globally unique

Spec Float Verification views (F)

Table Spec float analyze queries
Policy Key View Name Validates
float_orphan view_float_orphan Float has a parent object
float_duplicate_label view_float_duplicate_label Float labels unique per specification
float_render_failure view_float_render_failure External render succeeded
float_invalid_type view_float_invalid_type Float type is registered

Spec Relation Verification views (R)

Table Spec relation analyze queries
Policy Key View Name Validates
unresolved_relation view_relation_unresolved Link target resolves
dangling_relation view_relation_dangling Target ref points to existing object
ambiguous_relation view_relation_ambiguous Float reference is unambiguous

Component Interaction

The audit subsystem is realized through core runtime components and the default verification view package.

CSC Core Runtime (Core Runtime) provides the verification infrastructure. CSU Build Engine (Build Engine) drives the build lifecycle and content-addressed hash computation. CSU Analyze Query Loader (Analyze Query Loader) discovers and loads analyze query modules from model directories, registering them with the data manager for ANALYZE phase execution. CSU Validation Policy (Validation Policy) maps analyze query policy_key values to configured severity levels (error, warn, ignore) from project.yaml. CSU Analyze Handler (Analyze Handler) iterates over registered analyze queries during ANALYZE, querying each via CSU Data Manager (Data Manager) and emitting violations through CSU Diagnostics Collector (Diagnostics Collector). CSU Pipeline Orchestrator (Pipeline Orchestrator) inspects diagnostics after ANALYZE and aborts before EMIT if errors exist.

CSC Default Analyze Queries (Default Analyze Queries) provides the baseline verification rules organized by the SpecIR 5-tuple. Specification analyze queries: CSU Spec Missing Required (Spec Missing Required) validates that required specification attributes are present, and CSU Spec Invalid Type (Spec Invalid Type) validates that specification types are registered. Object analyze queries: CSU Object Missing Required (Object Missing Required) checks required object attributes, CSU Object Cardinality Over (Object Cardinality Over) enforces max_occurs limits, CSU Object Cast Failures (Object Cast Failures) validates attribute type casts, CSU Object Invalid Enum (Object Invalid Enum) checks enum values against allowed sets, CSU Object Invalid Date (Object Invalid Date) validates YYYY-MM-DD date format, and CSU Object Bounds Violation (Object Bounds Violation) checks numeric bounds. Float analyze queries: CSU Float Orphan (Float Orphan) detects floats without parent objects, CSU Float Duplicate Label (Float Duplicate Label) enforces label uniqueness per specification, CSU Float Render Failure (Float Render Failure) flags failed external renders, and CSU Float Invalid Type (Float Invalid Type) validates float type registration. Relation analyze queries: CSU Relation Unresolved (Relation Unresolved) detects links whose targets cannot be resolved, CSU Relation Dangling (Relation Dangling) detects resolved references pointing to nonexistent objects, and CSU Relation Ambiguous (Relation Ambiguous) flags ambiguous float references.

Figure Audit and Integrity: Build Caching and Verification

TRACEABILITY:
srs: SF-006

LLR-084: Deferred Hash Update on Success

When build completes with no <ANALYZE Phase> errors, CSU Build Engine shall rewrite the <Build Graph> node hashes via CSU Build Cache; when errors are present, hashes shall not be updated.

TRACEABILITY:
srs: HLR-AUDIT-001
VERIFICATION METHOD:
Test

LLR-085: Cache Hit Skips Pipeline

When all <Build Graph> node hashes (root and includes) match current content, CSU Build Engine shall skip <Pipeline> processing and reuse cached <Intermediate Representation> state.

TRACEABILITY:
srs: HLR-AUDIT-001
VERIFICATION METHOD:
Test

LLR-086: Include Dependencies Recorded in Build Graph

During include expansion, CSU Include Expansion Filter shall record root_path, node_path, and node_sha1 for each included file into the <Build Graph> table via CSU Build Cache.

TRACEABILITY:
srs: HLR-AUDIT-002
VERIFICATION METHOD:
Test

LLR-087: Circular Include Error Before Expansion

When an include path is already in the processed-file set, CSU Include Expansion Filter shall raise an error with the circular include chain path before performing any expansion.

TRACEABILITY:
srs: HLR-AUDIT-002
VERIFICATION METHOD:
Test

LLR-088: Diagnostic Record Structure

Given a diagnostics:error(file, line, code, msg) or diagnostics:warn(...) call from any <Handler>, CSU Diagnostics Collector shall store a <Diagnostic Record> record with file (path), line (int), code (string), and msg (string).

TRACEABILITY:
srs: HLR-AUDIT-003
VERIFICATION METHOD:
Test

LLR-089: Diagnostic Code Domain Prefix Format

<Diagnostic Record> codes shall follow domain prefix + number format (e.g., invalid_enum, dangling_relation) enabling machine-parseable classification via CSU Diagnostics Collector.

TRACEABILITY:
srs: HLR-AUDIT-003
VERIFICATION METHOD:
Test

LLR-090: NDJSON Log Output Format

Given non-TTY output, CSU Logger shall emit one <Newline-Delimited JSON> object per line with fields level, message, timestamp, and optional context.

TRACEABILITY:
srs: HLR-AUDIT-004
VERIFICATION METHOD:
Test

LLR-091: NO_COLOR Compliance

Given TTY output with NO_COLOR environment variable set, CSU Logger shall suppress ANSI color codes in console mode.

TRACEABILITY:
srs: HLR-AUDIT-004
VERIFICATION METHOD:
Test

LLR-092: Deterministic Float Numbering by File Sequence

CSU Float Numbering shall determine <Spec Float> numbering solely by file_seq ordering, which is stable across builds for identical input.

TRACEABILITY:
srs: HLR-AUDIT-005
VERIFICATION METHOD:
Test

LLR-093: Hash-Only Cache Invalidation

CSU Build Cache shall base <Build Cache> dirty checks solely on SHA1 content hashes, never on filesystem timestamps or mtime.

TRACEABILITY:
srs: HLR-AUDIT-005
VERIFICATION METHOD:
Test

1.10 SW Docs Model Design

FD-007: Software Documentation Domain Model

Allocation: Realized by SW Docs Model (SW Docs Model), with domain analyze queries in SW Docs Analyze Queries (SW Docs Analyze Queries), object types in SW Docs Object Types (SW Docs Object Types), relation types in SW Docs Relation Types (SW Docs Relation Types), specification types in SW Docs Specification Types (SW Docs Specification Types), and view types in SW Docs View Types (SW Docs View Types).

The software documentation domain model extends the default model with traceable object types, domain-specific relation semantics, specification document types, and verification views for MIL-STD-498 and DO-178C compliant software documentation workflows.

Object Type Taxonomy: SW Docs Object Types defines the TRACEABLE abstract base type providing an inherited status enum (Draft, Review, Approved, Implemented) that all domain objects extend. The taxonomy includes requirements (HLR, LLR, NFR), design elements (FD, SF, DD), architectural decomposition (CSC, CSU), verification artifacts (VC, TR), and reference types (DIC, SYMBOL). Each SW Docs type declares its own attributes, PID prefix, and inheritance chain through the extends field.

Relation Types: SW Docs Relation Types defines domain-specific traceability relations: REALIZES (FD traces to SF via the traceability source attribute), BELONGS (HLR membership in SF via belongs_to), TRACES_TO (general-purpose @ link traceability), XREF_DIC (dictionary cross-references), and XREF_DECOMPOSITION (references targeting CSC/CSU elements). These relations enable automated traceability matrix generation and coverage analysis.

Specification Types: SW Docs Specification Types defines document types for the software documentation lifecycle: SRS (Software Requirements Specification), SDD (Software Design Description), SVC (Software Verification Cases), SUM (Software User Manual), and TRR (Test Results Report). Each type declares version, status, and date attributes.

View Types: SW Docs View Types defines domain-specific views for generating traceability matrices (TRACEABILITY_MATRIX, TEST_EXECUTION_MATRIX, TEST_RESULTS_MATRIX) and coverage summaries (COVERAGE_SUMMARY, REQUIREMENTS_SUMMARY).

Analyze Queries: SW Docs Analyze Queries provides domain-specific analyze query queries that enforce traceability constraints: VC must trace to HLR, TR must trace to VC, every HLR must be covered by at least one VC, every FD must trace to at least one CSC and CSU, and every CSC and CSU must have at least one FD allocated. SW Docs Model provides the HTML5 postprocessor that generates a single-file documentation web app with embedded CSS, JS, and SQLite-WASM full-text search.

Component Interaction

The software documentation domain model is realized through six packages that extend the default model with traceable types, domain relations, document types, analyze queries, and verification constraints.

CSC SW Docs Object Types (SW Docs Object Types) defines the domain object taxonomy. CSU TRACEABLE Base Object Type (TRACEABLE Base Object Type) provides the abstract base with an inherited status enum (Draft, Review, Approved, Implemented) that all domain objects extend. Requirements: CSU HLR Object Type (HLR) for high-level requirements, CSU LLR Object Type (LLR) for low-level requirements, and CSU NFR Object Type (NFR) for non-functional requirements. Design elements: CSU FD Object Type (FD) for functional descriptions and CSU SF Object Type (SF) for software functions. Architecture: CSU CSC Object Type (CSC) for computer software components and CSU CSU Object Type (CSU) for computer software units. Verification: CSU VC Object Type (VC) for verification cases and CSU TR Object Type (TR) for test results. Design decisions: CSU DD Object Type (DD) for design decision records. Reference types: CSU DIC Object Type (DIC) for dictionary entries and CSU SYMBOL Object Type (SYMBOL) for symbol definitions.

CSC SW Docs Relation Types (SW Docs Relation Types) defines domain-specific traceability relations. CSU REALIZES Relation Type (REALIZES) traces FD to SF via the traceability source attribute. CSU BELONGS Relation Type (BELONGS) establishes HLR membership in SF via belongs_to. CSU TRACES_TO Relation Type (TRACES_TO) provides general-purpose @ link traceability between any traceable objects. CSU XREF_DIC Relation Type (XREF_DIC) resolves dictionary cross-references targeting DIC entries.

CSC SW Docs Specification Types (SW Docs Specification Types) defines document types for the software documentation lifecycle. CSU SRS Specification Type (SRS) for Software Requirements Specifications. CSU SDD Specification Type (SDD) for Software Design Descriptions. CSU SVC Specification Type (SVC) for Software Verification Cases. CSU SUM Specification Type (SUM) for Software User Manuals. CSU TRR Specification Type (TRR) for Test Results Reports. Each type declares version, status, and date attributes.

CSC SW Docs View Types (SW Docs View Types) defines domain-specific views for documentation output. CSU Traceability Matrix View (Traceability Matrix) generates requirement-to-design traceability matrices. CSU Test Execution Matrix View (Test Execution Matrix) generates verification case execution status tables. CSU Test Results Matrix View (Test Results Matrix) generates test result summary tables. CSU Coverage Summary View (Coverage Summary) computes requirement coverage statistics. CSU Requirements Summary View (Requirements Summary) generates requirement status dashboards.

CSC SW Docs Analyze Queries (SW Docs Analyze Queries) provides domain-specific traceability verification rules. CSU VC Missing HLR Traceability (VC Missing HLR Traceability) ensures every verification case traces to at least one HLR. CSU TR Missing VC Traceability (TR Missing VC Traceability) ensures every test result traces to a verification case. CSU HLR Missing VC Coverage (HLR Missing VC Coverage) ensures every HLR is covered by at least one VC. CSU FD Missing CSC Traceability (FD Missing CSC Traceability) ensures every FD references at least one CSC. CSU FD Missing CSU Traceability (FD Missing CSU Traceability) ensures every FD references at least one CSU. CSU CSC Missing FD Allocation (CSC Missing FD Allocation) ensures every CSC is allocated to at least one FD. CSU CSU Missing FD Allocation (CSU Missing FD Allocation) ensures every CSU is allocated to at least one FD.

CSC SW Docs Model (SW Docs Model) provides the domain postprocessor. CSU HTML5 Postprocessor (HTML5 Postprocessor) generates a single-file documentation web application with embedded CSS, JS, navigation, and SQLite-WASM full-text search from the SpecIR database.

Figure Software Documentation Domain Model

1.11 Software Decomposition

This chapter defines decomposition and design allocation using MIL-STD-498 nomenclature:

Note: Software Functions (SF) are defined in the SRS alongside their constituent HLRs. Functional Descriptions (FD) trace to SFs via the REALIZES relation and are documented in the SDD design files.

1.11.1 Core Software Components

1.11.1.1 Core Runtime Layer

CSC-001: Core Runtime

COMPONENT TYPE:
Layer
DESCRIPTION:
Pipeline orchestration, metadata/config extraction, model loading, analyze query loading, validation policy, and runtime control.
PATH:
src/core/
CSU-001: Pandoc Filter Entry Point
DESCRIPTION:
Pandoc filter entry point that hooks into Meta(meta) to extract project configuration and invoke engine.run_project(), serving as the bridge between Pandoc and the SpecCompiler build system.
FILE PATH:
src/filter.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-001
CSU-002: Configuration Parser
DESCRIPTION:
Parses and validates project.yaml metadata via Pandoc, extracting project configuration into plain Lua tables for consumption by the engine.
FILE PATH:
src/core/config.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-001
CSU-003: Data Loader
DESCRIPTION:
Loads view modules from models/{model}/types/views/ and invokes their dataset hook to produce data for charts and other data-driven consumers.
FILE PATH:
src/core/data_loader.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-001
CSU-004: Diagnostics Collector
DESCRIPTION:
Collects and emits structured errors and warnings (with file, line, column, and diagnostic code) via the logger diagnostic API.
FILE PATH:
src/core/diagnostics.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-001
CSU-005: Build Engine
DESCRIPTION:
Main orchestrator that wires together the pipeline, database, <Type Loader> , file walker, <Build Cache> , and output emission to run a full SpecCompiler project build across all documents.
FILE PATH:
src/core/engine.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-001
CSU-006: Pipeline Orchestrator
DESCRIPTION:
Pipeline lifecycle orchestrator that manages a 5-phase (INITIALIZE, RESOLVE, TRANSFORM, ANALYZE, EMIT) execution model with declarative handler prerequisites and topological sorting.
FILE PATH:
src/core/pipeline.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-001
CSU-007: Analyze Query Loader
DESCRIPTION:
Discovers, loads, and registers analyze query modules from models/{model}/analyze_queries/, maintaining an in-memory registry of analyze query definitions used for verification policies.
FILE PATH:
src/core/analyze_query_loader.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-001
CSU-008: Type Loader
DESCRIPTION:
Host engine (registry) that overlays the default model then each requested model (later-wins-by-id, repo-bundled), reads each extension point’s single descriptor table {kind, schema, [hooks]}, validates it, emits the type row into the corresponding SpecIR type table, and eager-indexes every hook into a (kind, id) -> hook map read via get_hook / get_hook_inherited; host:finalize() propagates inherited attributes, creates the verification SQL views, and asserts required hooks.
FILE PATH:
src/contract/registry.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-001
CSU-009: Validation Policy
DESCRIPTION:
Manages configurable validation severity levels (error/warn/ignore) for policy keys, building default policies from loaded analyze query definitions and allowing project-level overrides.
FILE PATH:
src/core/validation_policy.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-001

1.11.1.2 Database Persistence Layer

CSC-002: Database Persistence

COMPONENT TYPE:
Layer
DESCRIPTION:
Canonical insert/query API for SpecIR, transaction handling, build cache, output cache, and analyze query definitions.
PATH:
src/db/
CSU-010: Build Cache
DESCRIPTION:
Provides incremental build support by comparing SHA1 hashes of source documents against cached values to determine which files need rebuilding.
FILE PATH:
src/db/build_cache.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-002
CSU-011: Database Handler
DESCRIPTION:
Low-level SQLite database handler that wraps lsqlite3, providing execute, query_all, and prepared statement operations for all database access.
FILE PATH:
src/db/handler.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-002
CSU-012: Data Manager
DESCRIPTION:
High-level data manager that initializes the database schema and provides domain-specific insert/update operations for spec objects, floats, relations, and attributes.
FILE PATH:
src/db/manager.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-002
CSU-013: Output Cache
DESCRIPTION:
Checks whether generated output files are up-to-date by comparing the current SpecIR state hash against the cached hash, enabling skipping of unchanged output regeneration.
FILE PATH:
src/db/output_cache.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-002
CSU-014: Analyze Query Definitions
DESCRIPTION:
Defines SQL CREATE VIEW statements for all analyze queries used in the ANALYZE phase, organized by entity type (specifications, objects, floats, relations, views).
FILE PATH:
src/db/proof_views.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-002
1.11.1.2.1 DB Queries Package

CSC-005: DB Queries

COMPONENT TYPE:
Package
DESCRIPTION:
SQL query string modules for all database operations across content, types, build, search, and resolution domains.
PATH:
src/db/queries/
CSU-015: Build Queries
DESCRIPTION:
SQL query strings for build infrastructure operations: source file hash lookups, build graph (include dependency) management, and output cache entries.
FILE PATH:
src/db/queries/build.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-005
CSU-016: Content Queries
DESCRIPTION:
SQL query strings for content-layer CRUD operations on spec_objects, spec_floats, spec_relations, spec_views, and spec_attribute_values tables.
FILE PATH:
src/db/queries/content.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-005
CSU-017: Query Aggregator
DESCRIPTION:
Aggregation module that re-exports all domain-specific query sub-modules (types, content, search, build, resolution) under a single Queries namespace.
FILE PATH:
src/db/queries/init.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-005
CSU-018: Resolution Queries
DESCRIPTION:
SQL query strings for resolving relations, float types, cross-references, and relation type inference rules using the weighted quadruple scoring system.
FILE PATH:
src/db/queries/resolution.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-005
CSU-019: Search Queries
DESCRIPTION:
SQL query strings for managing FTS5 full-text search tables, including clearing, indexing, and populating fts_objects, fts_attributes, and fts_floats.
FILE PATH:
src/db/queries/search.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-005
CSU-020: Type Queries
DESCRIPTION:
SQL query strings for inserting and querying type system metadata: float types, relation types, object types, view types, specification types, attribute types, datatype definitions, and enum values.
FILE PATH:
src/db/queries/types.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-005
1.11.1.2.2 DB Schema Package

CSC-006: DB Schema

COMPONENT TYPE:
Package
DESCRIPTION:
DDL table creation statements for content, types, build infrastructure, and search tables.
PATH:
src/db/schema/
CSU-021: Build Schema
DESCRIPTION:
DDL for build infrastructure tables (build_graph, output_cache) that enable incremental builds through file dependency tracking and content hashing.
FILE PATH:
src/db/schema/build.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-006
CSU-022: Content Schema
DESCRIPTION:
DDL for content-layer tables (specifications, spec_objects, spec_floats, spec_relations, spec_views, spec_attribute_values) that store parsed specification data.
FILE PATH:
src/db/schema/content.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-006
CSU-023: Schema Aggregator
DESCRIPTION:
Aggregation module that combines all domain-specific schema SQL in dependency order and provides an initialize_views() entry point for post-load view creation.
FILE PATH:
src/db/schema/init.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-006
CSU-024: Search Schema
DESCRIPTION:
DDL for FTS5 virtual tables (fts_objects, fts_attributes, fts_floats) that enable full-text search across specification content with porter stemming.
FILE PATH:
src/db/schema/search.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-006
CSU-025: Type System Schema
DESCRIPTION:
DDL for type system (metamodel) tables (spec_object_types, spec_float_types, spec_relation_types, spec_view_types, spec_specification_types, datatype_definitions, spec_attribute_types, enum_values, implicit_type_aliases).
FILE PATH:
src/db/schema/types.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-006
1.11.1.2.3 DB Views Package

CSC-007: DB Views

COMPONENT TYPE:
Package
DESCRIPTION:
SQL view definitions for EAV pivots, public API, and resolution helpers.
PATH:
src/db/views/
CSU-026: EAV Pivot Views
DESCRIPTION:
Dynamically generates per-object-type SQL views that pivot the <EAV Model> into typed columns for external BI queries (e.g., SELECT * FROM view_hlr_objects WHERE status = ‘approved’ ). These views are not used by internal pipeline code, which queries the raw EAV tables directly. See HLR-STOR-006.
FILE PATH:
src/db/views/eav_pivot.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-007
CSU-027: Views Aggregator
DESCRIPTION:
Aggregation module that initializes all database view categories (resolution, public API, and EAV pivot) in the correct dependency order.
FILE PATH:
src/db/views/init.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-007
CSU-028: Public API Views
DESCRIPTION:
Stable BI-friendly SQL views (e.g., public_traceability_matrix) intended as the public interface for external dashboards and query tools.
FILE PATH:
src/db/views/public_api.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-007
CSU-029: Resolution Views
DESCRIPTION:
Internal SQL views for resolving float type aliases, relation types, and cross-references, moving resolution logic from Lua handler code into queryable SQL.
FILE PATH:
src/db/views/resolution.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-007

1.11.1.3 Pipeline Handlers Layer

CSC-003: Pipeline Handlers

COMPONENT TYPE:
Layer
DESCRIPTION:
Phase handlers implementing initialize, resolve, transform, analyze, and emit behavior across five pipeline phases.
PATH:
src/pipeline/
CSU-030: Include Expansion Filter
DESCRIPTION:
Standalone Pandoc Lua filter that recursively expands include code blocks in a subprocess, outputting include dependencies to a JSON metadata file for build graph tracking.
FILE PATH:
src/filters/expand_includes.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-003
CSU-031: Analyze Handler
DESCRIPTION:
ANALYZE phase handler that iterates over all registered analyze queries, queries each for violations, and emits structured diagnostics based on validation policy.
FILE PATH:
src/pipeline/analyze/analyze_handler.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-003
1.11.1.3.1 Resolve Handlers Package

CSC-008: Analyze Handlers

COMPONENT TYPE:
Package
DESCRIPTION:
RESOLVE phase handlers for relation resolution, relation type inference, and attribute casting.
PATH:
src/pipeline/resolve/
CSU-032: Attribute Caster
DESCRIPTION:
Casts raw attribute values to their typed columns (string, integer, real, boolean, enum, date) based on the datatype definition, returning the appropriate typed field for database storage.
FILE PATH:
src/pipeline/resolve/attribute_caster.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-008
CSU-033: Relation Resolver
DESCRIPTION:
RESOLVE phase handler that resolves spec_relation targets by matching PIDs and header IDs across specifications, populating target_object_id and target_float_id foreign keys.
FILE PATH:
src/pipeline/resolve/relation_resolver.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-008
CSU-161: Relation Type Inferrer
DESCRIPTION:
RESOLVE phase handler that infers relation types using 4-dimension unweighted specificity scoring (selector, source_attribute, source_type, target_type) after relation_resolver has populated targets.
FILE PATH:
src/pipeline/resolve/relation_type_inferrer.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-008
1.11.1.3.2 Emit Handlers Package

CSC-009: Emit Handlers

COMPONENT TYPE:
Package
DESCRIPTION:
EMIT phase handlers for document assembly, float resolution, view rendering, FTS indexing, and output generation.
PATH:
src/pipeline/emit/
CSU-034: Document Assembler
DESCRIPTION:
Reconstructs a complete Pandoc document from the SpecIR database by querying spec_objects, spec_floats, and spec_views, decoding their stored AST JSON back into Pandoc blocks.
FILE PATH:
src/pipeline/emit/assembler.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-009
CSU-035: Float Emitter
DESCRIPTION:
Transforms Pandoc documents during EMIT by replacing float CodeBlock elements with their rendered content (images, tables, charts) and adding captions and bookmarks.
FILE PATH:
src/pipeline/emit/emit_float.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-009
CSU-036: View Emitter
DESCRIPTION:
Transforms inline Code elements and standalone Code-in-Para patterns during EMIT phase, resolving each view type’s render (inline) or render_block (block) hook from the host hook index via get_hook_inherited to produce rendered inline or block output.
FILE PATH:
src/pipeline/emit/emit_view.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-009
CSU-037: Emitter Orchestrator
DESCRIPTION:
Format-agnostic EMIT phase orchestrator that assembles the Pandoc document from IR, resolves floats, applies numbering, runs format filters and postprocessors, and writes output via Pandoc CLI.
FILE PATH:
src/pipeline/emit/emitter.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-009
CSU-038: Float Handler Dispatcher
DESCRIPTION:
Model-agnostic dispatch layer that resolves each float type’s render hook from the host’s (kind, id) -> hook index via get_hook_inherited (walking the extends chain), then invokes it to replace float CodeBlock elements with rendered content.
FILE PATH:
src/pipeline/emit/float_handlers.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-009
CSU-039: Float Numbering
DESCRIPTION:
Assigns sequential numbers to captioned floats per specification and per counter_group, so that related types (e.g., FIGURE, CHART, PLANTUML) share a single numbering sequence within each spec.
FILE PATH:
src/pipeline/emit/float_numbering.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-009
CSU-040: Float Resolver
DESCRIPTION:
Collects floats with their resolved_ast and categorizes them for EMIT phase processing, distinguishing between image-producing floats and handler-dispatched floats.
FILE PATH:
src/pipeline/emit/float_resolver.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-009
CSU-041: FTS Indexer
DESCRIPTION:
EMIT phase handler that populates FTS5 virtual tables by converting stored Pandoc AST JSON to plain text and indexing spec objects, attributes, and floats for full-text search.
FILE PATH:
src/pipeline/emit/fts_indexer.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-009
CSU-042: Inline Handler Dispatcher
DESCRIPTION:
Model-agnostic dispatch layer that matches an inline Code prefix to a view id via the host’s prefix index, then resolves and invokes that view’s render hook from the host’s (kind, id) -> hook index via get_hook_inherited to produce inline output.
FILE PATH:
src/pipeline/emit/inline_handlers.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-009
CSU-043: View Handler Dispatcher
DESCRIPTION:
Model-agnostic dispatch layer that resolves each block-level view type’s render_block hook from the host’s (kind, id) -> hook index via get_hook_inherited (walking the extends chain), then invokes it to produce block-level view output.
FILE PATH:
src/pipeline/emit/view_handlers.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-009
1.11.1.3.3 Initialize Handlers Package

CSC-010: Initialize Handlers

COMPONENT TYPE:
Package
DESCRIPTION:
INITIALIZE phase handlers that parse document AST and populate all SpecIR container tables.
PATH:
src/pipeline/initialize/
CSU-044: Attribute Parser
DESCRIPTION:
INITIALIZE phase handler that extracts attributes from BlockQuote elements following headers, parses name: value syntax, casts values via datatype definitions, and stores them in spec_attribute_values.
FILE PATH:
src/pipeline/initialize/attributes.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-010
CSU-045: Include Handler
DESCRIPTION:
Pre-pipeline utility that recursively expands include code blocks by reading referenced files and parsing them through Pandoc, with cycle detection and depth limiting. Called directly by the engine before pipeline execution; not a pipeline handler.
FILE PATH:
src/pipeline/shared/include_handler.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-011
CSU-046: Float Parser
DESCRIPTION:
INITIALIZE phase handler that parses float CodeBlock syntax (type.lang:label), resolves type aliases, and stores float instances in spec_floats.
FILE PATH:
src/pipeline/initialize/spec_floats.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-010
CSU-047: Object Parser
DESCRIPTION:
INITIALIZE phase handler that creates spec_objects rows from L2+ headers parsed by the specifications handler, inferring object types from header prefixes.
FILE PATH:
src/pipeline/initialize/spec_objects.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-010
CSU-048: Relation Parser
DESCRIPTION:
INITIALIZE phase handler that extracts link-based relations ([PID](@) and [PID](#)) from object ASTs and stores them in spec_relations. Type inference and link rewriting are delegated to relation_type_inferrer (RESOLVE) and relation_link_rewriter (TRANSFORM).
FILE PATH:
src/pipeline/initialize/spec_relations.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-010
CSU-049: View Parser
DESCRIPTION:
INITIALIZE phase handler that registers view instances from CodeBlock and inline Code syntax, resolving view type prefixes and storing entries in spec_views.
FILE PATH:
src/pipeline/initialize/spec_views.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-010
CSU-050: Specification Parser
DESCRIPTION:
INITIALIZE phase handler that runs first to parse document headers, register the root specification from the L1 header, and store parsed header data in the pipeline context.
FILE PATH:
src/pipeline/initialize/specifications.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-010
1.11.1.3.4 Shared Pipeline Utilities Package

CSC-011: Shared Pipeline Utilities

COMPONENT TYPE:
Package
DESCRIPTION:
Shared infrastructure modules providing base handlers, rendering utilities, and view helpers used across pipeline phases.
PATH:
src/pipeline/shared/
CSU-051: Attribute Paragraph Utilities
DESCRIPTION:
Shared utility functions for parsing attribute paragraphs from Pandoc inline nodes, handling Span unwrapping, text extraction, and inline content normalization.
FILE PATH:
src/pipeline/shared/attribute_para_utils.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-011
CSU-052: Float Base
DESCRIPTION:
Shared infrastructure for float type handlers, providing helper functions to update resolved_ast in the database and query floats by type and specification.
FILE PATH:
src/pipeline/shared/float_base.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-011
CSU-053: Include Utilities
DESCRIPTION:
Shared utility functions for identifying include directive CodeBlocks and parsing include file paths, used by both include_handler and expand_includes.
FILE PATH:
src/pipeline/shared/include_utils.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-011
CSU-054: Math Render Utilities
DESCRIPTION:
Shared helpers for AsciiMath and MathML/OMML rendering, providing content hashing, script path resolution, and external process invocation for math conversion.
FILE PATH:
src/pipeline/shared/math_render_utils.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-011
CSU-055: Render Utilities
DESCRIPTION:
Shared rendering utilities for spec object handlers, providing functions to add CSS classes, insert page breaks, create bookmarks, and build styled header elements.
FILE PATH:
src/pipeline/shared/render_utils.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-011
CSU-056: Source Position Compatibility
DESCRIPTION:
Pandoc version compatibility layer that strips inline sourcepos tracking Spans from the AST while preserving line/column data on Link elements for diagnostics.
FILE PATH:
src/pipeline/shared/sourcepos_compat.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-011
CSU-057: Specification Base
DESCRIPTION:
Shared infrastructure for specification type handlers, providing default header rendering and configurable title formatting with optional PID display.
FILE PATH:
src/pipeline/shared/specification_base.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-011
CSU-058: Spec Object Base
DESCRIPTION:
Shared infrastructure for spec object types (HLR, FD, VC, etc.), providing styled headers with PID prefixes, attribute display, and the host-owned standard object-card renderer registered as the render hook of the base requirement type, which leaf types inherit via the extends chain.
FILE PATH:
src/pipeline/shared/spec_object_base.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-011
CSU-059: View Utilities
DESCRIPTION:
Shared utility functions for view handlers, providing MathML-to-HTML wrapping, Pandoc element JSON serialization, and other common view rendering operations.
FILE PATH:
src/pipeline/shared/view_utils.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-011
1.11.1.3.5 Transform Handlers Package

CSC-012: Transform Handlers

COMPONENT TYPE:
Package
DESCRIPTION:
TRANSFORM phase handlers for external rendering and spec object/specification rendering.
PATH:
src/pipeline/transform/
CSU-060: External Render Handler
DESCRIPTION:
TRANSFORM phase handler that orchestrates parallel rendering of external float and view types (PlantUML, charts, math) by batching tasks and dispatching to registered renderer callbacks.
FILE PATH:
src/pipeline/transform/external_render_handler.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-012
CSU-061: Float Transformer
DESCRIPTION:
TRANSFORM phase handler that resolves internal float types (TABLE, CSV, etc.) by reading each type’s transform data hook from the host hook index (get_hook) and invoking it with a frozen data context to produce the resolved AST; external floats are delegated to external_render_handler.
FILE PATH:
src/pipeline/transform/spec_floats.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-012
CSU-162: Relation Link Rewriter
DESCRIPTION:
TRANSFORM phase handler that rewrites @ and # links in stored spec_object AST JSON, replacing them with resolved anchor targets using the relation lookup built from spec_relations.
FILE PATH:
src/pipeline/transform/relation_link_rewriter.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-012
CSU-062: Object Render Handler
DESCRIPTION:
TRANSFORM phase handler that resolves each object type’s render hook from the host via get_hook_inherited (walking the extends chain) and invokes it with a frozen render context to transform stored AST into styled output with headers, attributes, and bookmarks.
FILE PATH:
src/pipeline/transform/spec_object_render_handler.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-012
CSU-063: Specification Render Handler
DESCRIPTION:
TRANSFORM phase handler that resolves each specification type’s render hook from the host via get_hook_inherited (walking the extends chain) and invokes it with a frozen render context to generate the document title header.
FILE PATH:
src/pipeline/transform/specification_render_handler.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-012

1.11.1.4 Infrastructure Layer

CSC-004: Infrastructure

COMPONENT TYPE:
Layer
DESCRIPTION:
Output toolchain integration, hashing, logging, JSON utilities, reference cache management, and external tool wrappers.
PATH:
src/infra/
CSU-065: Hash Utilities
DESCRIPTION:
Provides SHA1 hashing for content and files, using Pandoc’s built-in sha1 when running inside Pandoc or falling back to a pure-Lua SHA1 implementation for standalone workers.
FILE PATH:
src/infra/hash_utils.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-004
CSU-066: JSON Utilities
DESCRIPTION:
Unified JSON encode/decode wrapper using the dkjson pure-Lua library, providing a consistent JSON interface independent of Pandoc’s JSON functions.
FILE PATH:
src/infra/json.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-004
CSU-067: Logger
DESCRIPTION:
TTY-aware logging system that outputs human-readable colored console messages when connected to a terminal, or structured NDJSON when piped, with configurable severity levels.
FILE PATH:
src/infra/logger.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-004
CSU-068: Reference Cache
DESCRIPTION:
Tracks whether reference.docx needs rebuilding by comparing the SHA1 hash of the preset file against a cached hash in the build_meta database table.
FILE PATH:
src/infra/reference_cache.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-004
CSU-069: MathML to OMML Converter
DESCRIPTION:
Converts MathML to Office MathML (OMML) by invoking an external Deno process running the mathml2omml npm library.
FILE PATH:
src/tools/mathml2omml_external.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-004
1.11.1.4.1 Format Utilities Package

CSC-013: Format Utilities

COMPONENT TYPE:
Package
DESCRIPTION:
Writer adapters, XML utilities, and ZIP archive operations for format-specific output generation.
PATH:
src/infra/format/
CSU-070: Format Writer
DESCRIPTION:
Provides postprocessor and filter loading utilities for template-specific output modifications, discovering format-specific Lua modules from models/{template}/ directories.
FILE PATH:
src/infra/format/writer.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-013
CSU-071: XML Utilities
DESCRIPTION:
XML utility module providing escaping, DOM construction, parsing, and manipulation via the SLAXML library for generating and transforming XML content.
FILE PATH:
src/infra/format/xml.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-013
CSU-072: ZIP Utilities
DESCRIPTION:
Cross-platform ZIP archive utilities using the lua-zip library, providing extract and create operations for DOCX archive manipulation.
FILE PATH:
src/infra/format/zip_utils.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-013
1.11.1.4.2 DOCX Generation Package

CSC-014: DOCX Generation

COMPONENT TYPE:
Package
DESCRIPTION:
OOXML builder, preset loader, reference generator, and style builder for Word document output.
PATH:
src/infra/format/docx/
CSU-073: OOXML Builder
DESCRIPTION:
Unified OOXML builder for generating Word Open XML, offering both a stateful Builder API (method chaining) and a stateless Static API (inline OOXML generation).
FILE PATH:
src/infra/format/docx/ooxml_builder.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-014
CSU-074: Preset Loader
DESCRIPTION:
Loads Lua preset files that define DOCX styles, executing the preset script and returning the resulting configuration table for use by the reference generator.
FILE PATH:
src/infra/format/docx/preset_loader.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-014
CSU-075: Reference Generator
DESCRIPTION:
Generates reference.docx by merging custom styles from preset definitions into Pandoc’s default DOCX template via ZIP manipulation of the word/styles.xml file.
FILE PATH:
src/infra/format/docx/reference_generator.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-014
CSU-076: Style Builder
DESCRIPTION:
Provides unit conversion (cm/pt/in to twips) and OOXML style-building functions for generating Word paragraph and character style definitions.
FILE PATH:
src/infra/format/docx/style_builder.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-014
1.11.1.4.3 I/O Utilities Package

CSC-015: I/O Utilities

COMPONENT TYPE:
Package
DESCRIPTION:
AST traversal with source position tracking and basic file I/O operations.
PATH:
src/infra/io/
CSU-077: Document Walker
DESCRIPTION:
Provides AST traversal methods for pipeline handlers, extracting source position (line numbers) from Pandoc data-pos attributes and tracking source file provenance through include expansion.
FILE PATH:
src/infra/io/document_walker.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-015
CSU-078: File Walker
DESCRIPTION:
Provides basic file I/O operations (read file, resolve relative paths, check existence, list directory) using luv for filesystem access.
FILE PATH:
src/infra/io/file_walker.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-015
1.11.1.4.4 Process Management Package

CSC-016: Process Management

COMPONENT TYPE:
Package
DESCRIPTION:
External process spawning via luv and Pandoc command-line argument building.
PATH:
src/infra/process/
CSU-079: Pandoc CLI Builder
DESCRIPTION:
Builds Pandoc command-line argument arrays from configuration, resolving filter paths and speccompiler home directory for external pandoc process invocation.
FILE PATH:
src/infra/process/pandoc_cli.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-016
CSU-080: Task Runner
DESCRIPTION:
Unified interface for spawning and managing external processes using luv (libuv), providing async I/O, timeouts, CPU count detection, and command existence checking.
FILE PATH:
src/infra/process/task_runner.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-016

1.11.2 Default Model Components

1.11.2.1 Default Model

CSC-017: Default Model

COMPONENT TYPE:
Model
DESCRIPTION:
Foundational type model providing base object, float, relation, and view types that all other models extend.
PATH:
models/default/
CSU-081: SECTION Object Type
DESCRIPTION:
Defines the SECTION object type (id=“SECTION”), the default type for headers without explicit TYPE: prefix; numbered, with optional XHTML description attribute.
FILE PATH:
models/default/types/objects/section.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-017
CSU-082: SPEC Specification Type
DESCRIPTION:
Defines the SPEC specification type (id=“SPEC”), the default type for H1 headers without explicit TYPE: prefix; title is unnumbered and does not display a PID.
FILE PATH:
models/default/types/specifications/spec.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-017
1.11.2.1.1 Default Filters Package

CSC-018: Default Filters

COMPONENT TYPE:
Package
DESCRIPTION:
Format-specific Pandoc Lua filters that convert speccompiler markers to native output elements.
PATH:
models/default/filters/
CSU-083: DOCX Filter
DESCRIPTION:
Pandoc Lua filter for DOCX output that converts speccompiler-format markers (page-break, bookmarks, math-omml, captions, equations) into native OOXML elements.
FILE PATH:
models/default/filters/docx.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-018
CSU-084: HTML Filter
DESCRIPTION:
Pandoc Lua filter for HTML5 output that converts speccompiler-format markers into semantic HTML elements with Bootstrap-compatible styling.
FILE PATH:
models/default/filters/html.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-018
CSU-085: Markdown Filter
DESCRIPTION:
Pandoc Lua filter for Markdown output that converts speccompiler page-break markers to horizontal rules and removes markers with no Markdown equivalent.
FILE PATH:
models/default/filters/markdown.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-018
1.11.2.1.2 Default Postprocessors Package

CSC-019: Default Postprocessors

COMPONENT TYPE:
Package
DESCRIPTION:
Format-specific post-processing applied after Pandoc output generation.
PATH:
models/default/postprocessors/
CSU-086: DOCX Postprocessor
DESCRIPTION:
DOCX post-processor that loads and applies template-specific OOXML post-processing to fix styles regenerated by Pandoc’s DOCX writer.
FILE PATH:
models/default/postprocessors/docx.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-019
CSU-087: LaTeX Postprocessor
DESCRIPTION:
LaTeX post-processor that loads and applies template-specific LaTeX post-processing to transform Pandoc’s standard LaTeX output.
FILE PATH:
models/default/postprocessors/latex.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-019
1.11.2.1.3 Default Analyze Queries Package

CSC-020: Default Analyze Queries

COMPONENT TYPE:
Package
DESCRIPTION:
SQL analyze query queries for detecting constraint violations across specifications, objects, floats, relations, and views.
PATH:
models/default/analyze_queries/
CSU-089: Spec Missing Required
DESCRIPTION:
Verification view detecting specifications missing required attributes.
FILE PATH:
models/default/analyze_queries/sd_101_spec_missing_required.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-020
CSU-090: Spec Invalid Type
DESCRIPTION:
Verification view detecting specifications whose type_ref does not match any registered specification type.
FILE PATH:
models/default/analyze_queries/sd_102_spec_invalid_type.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-020
CSU-091: Object Missing Required
DESCRIPTION:
Verification view detecting spec objects missing required attributes.
FILE PATH:
models/default/analyze_queries/sd_201_object_missing_required.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-020
CSU-092: Object Cardinality Over
DESCRIPTION:
Verification view detecting spec object attributes exceeding their declared max_occurs cardinality.
FILE PATH:
models/default/analyze_queries/sd_202_object_cardinality_over.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-020
CSU-093: Object Cast Failures
DESCRIPTION:
Verification view detecting spec object attributes whose raw values failed to cast to their declared datatype.
FILE PATH:
models/default/analyze_queries/sd_203_object_cast_failures.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-020
CSU-094: Object Invalid Enum
DESCRIPTION:
Verification view detecting spec object ENUM attributes with values not matching any entry in enum_values.
FILE PATH:
models/default/analyze_queries/sd_204_object_invalid_enum.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-020
CSU-095: Object Invalid Date
DESCRIPTION:
Verification view detecting spec object DATE attributes not matching the YYYY-MM-DD format.
FILE PATH:
models/default/analyze_queries/sd_205_object_invalid_date.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-020
CSU-096: Object Bounds Violation
DESCRIPTION:
Verification view detecting numeric attributes falling outside declared min_value/max_value bounds.
FILE PATH:
models/default/analyze_queries/sd_206_object_bounds_violation.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-020
CSU-097: Float Orphan
DESCRIPTION:
Verification view detecting floats with no parent object despite objects existing in the same specification.
FILE PATH:
models/default/analyze_queries/sd_301_float_orphan.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-020
CSU-098: Float Duplicate Label
DESCRIPTION:
Verification view detecting floats sharing the same label within a specification.
FILE PATH:
models/default/analyze_queries/sd_302_float_duplicate_label.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-020
CSU-099: Float Render Failure
DESCRIPTION:
Verification view detecting floats requiring external rendering but with NULL resolved_ast.
FILE PATH:
models/default/analyze_queries/sd_303_float_render_failure.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-020
CSU-100: Float Invalid Type
DESCRIPTION:
Verification view detecting floats whose type_ref does not match any registered float type.
FILE PATH:
models/default/analyze_queries/sd_304_float_invalid_type.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-020
CSU-101: Relation Unresolved
DESCRIPTION:
Verification view detecting relations with target_text but no resolved target_ref.
FILE PATH:
models/default/analyze_queries/sd_401_relation_unresolved.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-020
CSU-102: Relation Dangling
DESCRIPTION:
Verification view detecting relations whose target_ref points to a non-existent identifier.
FILE PATH:
models/default/analyze_queries/sd_402_relation_dangling.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-020
CSU-103: Relation Ambiguous
DESCRIPTION:
Verification view detecting relations flagged as ambiguous where the float reference matched multiple targets.
FILE PATH:
models/default/analyze_queries/sd_407_relation_ambiguous.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-020
1.11.2.1.4 Default Styles Package

CSC-021: Default Styles

COMPONENT TYPE:
Package
DESCRIPTION:
Style presets defining page layout, typography, and formatting for DOCX and HTML output.
PATH:
models/default/styles/default/
CSU-106: DOCX Style Preset
DESCRIPTION:
Defines the default DOCX style preset with Letter-sized page configuration, paragraph styles, and standard margins for Word document output.
FILE PATH:
models/default/styles/default/docx.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-021
CSU-107: HTML Style Preset
DESCRIPTION:
Defines the default HTML style preset with typography (Inter/JetBrains Mono fonts), color palette, and layout configuration for web output.
FILE PATH:
models/default/styles/default/html.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-021
1.11.2.1.5 Default Float Types Package

CSC-022: Default Float Types

COMPONENT TYPE:
Package
DESCRIPTION:
Float type definitions for numbered content blocks including images, tables, code listings, diagrams, charts, and equations.
PATH:
models/default/types/floats/
CSU-108: CHART Float Type
DESCRIPTION:
Defines the CHART float type for ECharts JSON configurations rendered to PNG via Deno; shares FIGURE counter group and requires external rendering.
FILE PATH:
models/default/types/floats/chart.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-022
CSU-109: FIGURE Float Type
DESCRIPTION:
Defines the FIGURE float type for existing image files (PNG, JPG, etc.); does not require external rendering and resolves image paths relative to the source file.
FILE PATH:
models/default/types/floats/figure.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-022
CSU-110: LISTING Float Type
DESCRIPTION:
Defines the LISTING float type for code listings and source code blocks; has its own counter group, supports aliases like src, quadro, and code.
FILE PATH:
models/default/types/floats/listing.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-022
CSU-111: MATH Float Type
DESCRIPTION:
Defines the MATH float type for block-level AsciiMath expressions converted to MathML/OMML; uses the EQUATION counter group and requires external rendering.
FILE PATH:
models/default/types/floats/math.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-022
CSU-112: PLANTUML Float Type
DESCRIPTION:
Defines the PLANTUML float type for PlantUML diagrams rendered to PNG; shares the FIGURE counter group and requires external rendering.
FILE PATH:
models/default/types/floats/plantuml.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-022
CSU-113: TABLE Float Type
DESCRIPTION:
Defines the TABLE float type for tables parsed from CSV, TSV, or list-table syntax using Pandoc’s built-in readers; has its own counter group.
FILE PATH:
models/default/types/floats/table.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-022
1.11.2.1.6 Default Relation Types Package

CSC-023: Default Relation Types

COMPONENT TYPE:
Package
DESCRIPTION:
Cross-reference relation type definitions mapping PID and label selectors to typed object and float targets.
PATH:
models/default/types/relations/
CSU-114: XREF_CITATION Relation Type
DESCRIPTION:
Defines the XREF_CITATION relation type for cross-references to bibliography entries; uses the # link selector with cite/citep prefix aliases.
FILE PATH:
models/default/types/relations/xref_citation.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-023
CSU-115: XREF_FIGURE Relation Type
DESCRIPTION:
Defines the XREF_FIGURE relation type for cross-references to FIGURE, PLANTUML, and CHART floats; default relation type for # references.
FILE PATH:
models/default/types/relations/xref_figure.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-023
CSU-116: XREF_LISTING Relation Type
DESCRIPTION:
Defines the XREF_LISTING relation type for cross-references to LISTING floats; uses the # link selector.
FILE PATH:
models/default/types/relations/xref_listing.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-023
CSU-117: XREF_MATH Relation Type
DESCRIPTION:
Defines the XREF_MATH relation type for cross-references to MATH floats; uses the # link selector.
FILE PATH:
models/default/types/relations/xref_math.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-023
CSU-118: XREF_TABLE Relation Type
DESCRIPTION:
Defines the XREF_TABLE relation type for cross-references to TABLE floats; uses the # link selector.
FILE PATH:
models/default/types/relations/xref_table.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-023
1.11.2.1.7 Default View Types Package

CSC-024: Default View Types

COMPONENT TYPE:
Package
DESCRIPTION:
View type definitions for inline and block-level data-driven content rendering.
PATH:
models/default/types/views/
CSU-119: ABBREV View Type
DESCRIPTION:
Defines the ABBREV view type for inline abbreviation/acronym definitions using abbrev: syntax with first-use expansion support.
FILE PATH:
models/default/types/views/abbrev.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-024
CSU-120: ABBREV_LIST View Type
DESCRIPTION:
Defines the ABBREV_LIST view type for generating a sorted list of all abbreviations defined in the document.
FILE PATH:
models/default/types/views/abbrev_list.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-024
CSU-121: GAUSS View Type
DESCRIPTION:
Defines the GAUSS view type for generating Gaussian distribution data from inline gauss: syntax with configurable parameters; returns ECharts dataset format.
FILE PATH:
models/default/types/views/gauss.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-024
CSU-122: LOF View Type
DESCRIPTION:
Defines the LOF view type for generating lists of floats (figures, tables) from inline lof:/lot: syntax; queries spec_floats by counter_group.
FILE PATH:
models/default/types/views/lof.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-024
CSU-123: MATH_INLINE View Type
DESCRIPTION:
Defines the MATH_INLINE view type for inline AsciiMath expressions using math:/eq:/formula: syntax; requires external rendering for MathML-to-OMML conversion.
FILE PATH:
models/default/types/views/math_inline.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-024
CSU-124: TOC View Type
DESCRIPTION:
Defines the TOC view type for generating a table of contents from inline toc: syntax with optional depth parameter.
FILE PATH:
models/default/types/views/toc.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-024

1.11.3 SW Docs Model Components

1.11.3.1 SW Docs Model

CSC-025: SW Docs Model

COMPONENT TYPE:
Model
DESCRIPTION:
Domain model for software documentation providing traceable object types, domain-specific analyze queries, specification types, relation types, and views.
PATH:
models/sw_docs/
CSU-125: HTML5 Postprocessor
DESCRIPTION:
HTML5 post-processor that generates a single-file documentation web app with embedded CSS, JS, content, and SQLite-WASM full-text search.
FILE PATH:
models/sw_docs/postprocessors/html5.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-025
1.11.3.1.1 SW Docs Analyze Queries Package

CSC-026: SW Docs Analyze Queries

COMPONENT TYPE:
Package
DESCRIPTION:
Domain-specific analyze query queries for software documentation traceability and naming convention enforcement.
PATH:
models/sw_docs/analyze_queries/
CSU-126: VC Missing HLR Traceability
DESCRIPTION:
Verification view detecting verification cases with no traceability link to any high-level requirement.
FILE PATH:
models/sw_docs/analyze_queries/sd_601_vc_missing_hlr_traceability.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-026
CSU-127: TR Missing VC Traceability
DESCRIPTION:
Verification view detecting test results with no traceability link to any verification case.
FILE PATH:
models/sw_docs/analyze_queries/sd_602_tr_missing_vc_traceability.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-026
CSU-128: HLR Missing VC Coverage
DESCRIPTION:
Verification view detecting high-level requirements not covered by any verification case.
FILE PATH:
models/sw_docs/analyze_queries/sd_603_hlr_missing_vc_coverage.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-026
CSU-131: FD Missing CSC Traceability
DESCRIPTION:
Verification view detecting functional descriptions with no traceability link to any Computer Software Component.
FILE PATH:
models/sw_docs/analyze_queries/sd_606_fd_missing_csc_traceability.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-026
CSU-132: FD Missing CSU Traceability
DESCRIPTION:
Verification view detecting functional descriptions with no traceability link to any Computer Software Unit.
FILE PATH:
models/sw_docs/analyze_queries/sd_607_fd_missing_csu_traceability.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-026
CSU-163: CSC Missing FD Allocation
DESCRIPTION:
Verification view detecting Computer Software Components with no functional description (FD) allocated to them.
FILE PATH:
models/sw_docs/analyze_queries/csc_missing_fd_allocation.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-026
CSU-164: CSU Missing FD Allocation
DESCRIPTION:
Verification view detecting Computer Software Units with no functional description (FD) allocated to them.
FILE PATH:
models/sw_docs/analyze_queries/csu_missing_fd_allocation.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-026
1.11.3.1.2 SW Docs Object Types Package

CSC-027: SW Docs Object Types

COMPONENT TYPE:
Package
DESCRIPTION:
Domain object type definitions for traceable specification items including requirements, design decisions, verification cases, and MIL-STD-498 architectural elements.
PATH:
models/sw_docs/types/objects/
CSU-133: CSC Object Type
DESCRIPTION:
Defines the CSC (Computer Software Component) object type for MIL-STD-498 architectural decomposition, with required component_type and path attributes, extending TRACEABLE.
FILE PATH:
models/sw_docs/types/objects/csc.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-027
CSU-134: CSU Object Type
DESCRIPTION:
Defines the CSU (Computer Software Unit) object type for implementation-level source file units, with required file_path and optional language attributes, extending TRACEABLE.
FILE PATH:
models/sw_docs/types/objects/csu.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-027
CSU-135: DD Object Type
DESCRIPTION:
Defines the DD (Design Decision) object type for recording architectural decisions, with a required rationale XHTML attribute, extending TRACEABLE.
FILE PATH:
models/sw_docs/types/objects/dd.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-027
CSU-136: DIC Object Type
DESCRIPTION:
Defines the DIC (Dictionary Entry) object type for project term definitions, with optional term, acronym, and domain attributes, extending TRACEABLE.
FILE PATH:
models/sw_docs/types/objects/dic.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-027
CSU-137: FD Object Type
DESCRIPTION:
Defines the FD (Functional Description) object type for design elements that realize Software Functions, with optional traceability XHTML attribute, extending TRACEABLE.
FILE PATH:
models/sw_docs/types/objects/fd.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-027
CSU-138: HLR Object Type
DESCRIPTION:
Defines the HLR (High-Level Requirement) object type for top-level system requirements, with priority enum (High/Mid/Low), rationale, and belongs_to attributes, extending TRACEABLE.
FILE PATH:
models/sw_docs/types/objects/hlr.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-027
CSU-139: LLR Object Type
DESCRIPTION:
Defines the LLR (Low-Level Requirement) object type for detailed implementation requirements derived from HLRs, with optional rationale, extending TRACEABLE.
FILE PATH:
models/sw_docs/types/objects/llr.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-027
CSU-140: NFR Object Type
DESCRIPTION:
Defines the NFR (Non-Functional Requirement) object type for quality-attribute requirements, with category enum, priority, and metric attributes, extending TRACEABLE.
FILE PATH:
models/sw_docs/types/objects/nfr.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-027
CSU-141: SF Object Type
DESCRIPTION:
Defines the SF (Software Function) object type for grouping related HLRs into functional units, with optional description and rationale attributes, extending TRACEABLE.
FILE PATH:
models/sw_docs/types/objects/sf.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-027
CSU-142: SYMBOL Object Type
DESCRIPTION:
Defines the SYMBOL object type for code symbols (functions, variables, registers) extracted from firmware analysis, with kind, source, complexity, and calls attributes.
FILE PATH:
models/sw_docs/types/objects/symbol.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-027
CSU-143: TR Object Type
DESCRIPTION:
Defines the TR (Test Result) object type for verification-case execution outcomes, with required result enum (Pass/Fail/Blocked/Not Run) and required traceability to a VC, extending TRACEABLE.
FILE PATH:
models/sw_docs/types/objects/tr.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-027
CSU-144: TRACEABLE Base Object Type
DESCRIPTION:
Defines the TRACEABLE abstract base object type that all traceable objects extend; provides the inherited status enum attribute (Draft/Review/Approved/Implemented) and extends SECTION.
FILE PATH:
models/sw_docs/types/objects/traceable.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-027
CSU-145: VC Object Type
DESCRIPTION:
Defines the VC (Verification Case) object type for test specifications, with required objective and verification_method attributes plus optional preconditions, expected results, and pass criteria, extending TRACEABLE.
FILE PATH:
models/sw_docs/types/objects/vc.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-027
1.11.3.1.3 SW Docs Relation Types Package

CSC-028: SW Docs Relation Types

COMPONENT TYPE:
Package
DESCRIPTION:
Domain relation type definitions for traceability links between software documentation elements.
PATH:
models/sw_docs/types/relations/
CSU-146: BELONGS Relation Type
DESCRIPTION:
Defines the BELONGS relation type representing HLR membership in a Software Function (SF), resolved from the belongs_to source attribute using the @ link selector.
FILE PATH:
models/sw_docs/types/relations/belongs.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-028
CSU-147: REALIZES Relation Type
DESCRIPTION:
Defines the REALIZES relation type representing a Functional Description (FD) realizing a Software Function (SF), resolved from the traceability source attribute.
FILE PATH:
models/sw_docs/types/relations/realizes.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-028
CSU-148: TRACES_TO Relation Type
DESCRIPTION:
Defines the TRACES_TO relation type, the default (is_default=true) general-purpose traceability link using the @ link selector with no source/target type constraints.
FILE PATH:
models/sw_docs/types/relations/traces_to.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-028
CSU-149: XREF_DIC Relation Type
DESCRIPTION:
Defines the XREF_DIC relation type for cross-references targeting Dictionary (DIC) entries from any source type, using the @ link selector.
FILE PATH:
models/sw_docs/types/relations/xref_dic.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-028
1.11.3.1.4 SW Docs Specification Types Package

CSC-029: SW Docs Specification Types

COMPONENT TYPE:
Package
DESCRIPTION:
Specification type definitions for SDN document types (SRS, SDD, SVC, SUM, TRR).
PATH:
models/sw_docs/types/specifications/
CSU-150: SDD Specification Type
DESCRIPTION:
Defines the SDD (Software Design Description) specification type with required version, optional status and date attributes.
FILE PATH:
models/sw_docs/types/specifications/sdd.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-029
CSU-151: SRS Specification Type
DESCRIPTION:
Defines the SRS (Software Requirements Specification) specification type with required version, optional status and date attributes.
FILE PATH:
models/sw_docs/types/specifications/srs.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-029
CSU-152: SUM Specification Type
DESCRIPTION:
Defines the SUM (Software User Manual) specification type for user manuals, with required version, optional status and date attributes.
FILE PATH:
models/sw_docs/types/specifications/sum.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-029
CSU-153: SVC Specification Type
DESCRIPTION:
Defines the SVC (Software Verification Cases) specification type with required version, optional status and date attributes.
FILE PATH:
models/sw_docs/types/specifications/svc.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-029
CSU-154: TRR Specification Type
DESCRIPTION:
Defines the TRR (Test Results Report) specification type for aggregating test-execution results, with required version plus optional test_run_id and environment attributes.
FILE PATH:
models/sw_docs/types/specifications/trr.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-029
1.11.3.1.5 SW Docs View Types Package

CSC-030: SW Docs View Types

COMPONENT TYPE:
Package
DESCRIPTION:
Domain view type definitions for traceability matrices, test results, and coverage summaries.
PATH:
models/sw_docs/types/views/
CSU-155: Coverage Summary View
DESCRIPTION:
Defines the COVERAGE_SUMMARY view generating a table of VC counts and pass rates grouped by Software Function (SF).
FILE PATH:
models/sw_docs/types/views/coverage_summary.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-030
CSU-156: Requirements Summary View
DESCRIPTION:
Defines the REQUIREMENTS_SUMMARY view generating a table of HLR counts grouped by Software Function (SF) via the BELONGS relation.
FILE PATH:
models/sw_docs/types/views/requirements_summary.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-030
CSU-157: Test Execution Matrix View
DESCRIPTION:
Defines the TEST_EXECUTION_MATRIX view generating a deterministic VC-to-HLR-to-procedure/oracle matrix from the SpecIR.
FILE PATH:
models/sw_docs/types/views/test_execution_matrix.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-030
CSU-158: Test Results Matrix View
DESCRIPTION:
Defines the TEST_RESULTS_MATRIX view generating a table of VC-to-TR traceability with pass/fail result status.
FILE PATH:
models/sw_docs/types/views/test_results_matrix.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-030
CSU-159: Traceability Matrix View
DESCRIPTION:
Defines the TRACEABILITY_MATRIX view generating a table showing the full HLR-to-VC-to-TR traceability chain with test results.
FILE PATH:
models/sw_docs/types/views/traceability_matrix.lua
LANGUAGE:
Lua
TRACEABILITY:
CSC-030

2 Requirements Allocation Gaps

The matrix below is generated live from SpecIR at build time and lists only HLRs whose allocation chain (SF -> FD -> CSC -> CSU) is incomplete. An empty result means every requirement is fully allocated to the design.

HLR HLR Title SF FD CSC CSU Status
HLR-AUDIT-001 Content-Addressed Hashing SF-006 FD-006 No CSC
HLR-AUDIT-001 Content-Addressed Hashing SF-006 FD-006 CSC-001 No CSU
HLR-AUDIT-002 Include Dependency Tracking SF-006 FD-006 No CSC
HLR-AUDIT-002 Include Dependency Tracking SF-006 FD-006 CSC-001 No CSU
HLR-AUDIT-003 Structured Diagnostic Reporting SF-006 FD-006 No CSC
HLR-AUDIT-003 Structured Diagnostic Reporting SF-006 FD-006 CSC-001 No CSU
HLR-AUDIT-004 Structured Logging SF-006 FD-006 No CSC
HLR-AUDIT-004 Structured Logging SF-006 FD-006 CSC-001 No CSU
HLR-AUDIT-005 Build Reproducibility SF-006 FD-006 No CSC
HLR-AUDIT-005 Build Reproducibility SF-006 FD-006 CSC-001 No CSU
HLR-CFG-001 Manifest Configuration SF-005 FD-002 No CSC
HLR-CFG-001 Manifest Configuration SF-005 FD-002 CSC-001 No CSU
HLR-EXT-001 Type Descriptor Loading SF-005 FD-002 No CSC
HLR-EXT-001 Type Descriptor Loading SF-005 FD-002 CSC-001 No CSU
HLR-EXT-002 Model Directory Structure SF-005 FD-002 No CSC
HLR-EXT-002 Model Directory Structure SF-005 FD-002 CSC-001 No CSU
HLR-EXT-003 Descriptor Registration SF-005 FD-002 No CSC
HLR-EXT-003 Descriptor Registration SF-005 FD-002 CSC-001 No CSU
HLR-EXT-004 Type Schema SF-005 FD-002 No CSC
HLR-EXT-004 Type Schema SF-005 FD-002 CSC-001 No CSU
HLR-EXT-005 Model Resolution and Overlay SF-005 FD-002 No CSC
HLR-EXT-005 Model Resolution and Overlay SF-005 FD-002 CSC-001 No CSU
HLR-EXT-006 External Renderer Hooks SF-005 FD-002 No CSC
HLR-EXT-006 External Renderer Hooks SF-005 FD-002 CSC-001 No CSU
HLR-EXT-007 Data View Hooks SF-005 FD-002 No CSC
HLR-EXT-007 Data View Hooks SF-005 FD-002 CSC-001 No CSU
HLR-EXT-008 Hook Index SF-005 FD-002 No CSC
HLR-EXT-008 Hook Index SF-005 FD-002 CSC-001 No CSU
HLR-EXT-009 Canonical Hook Context SF-005 FD-002 No CSC
HLR-EXT-009 Canonical Hook Context SF-005 FD-002 CSC-001 No CSU
HLR-EXT-010 Model Manifest SF-005 FD-002 No CSC
HLR-EXT-010 Model Manifest SF-005 FD-002 CSC-001 No CSU
HLR-EXT-011 Hook Validation and Phase Registration SF-005 FD-002 No CSC
HLR-EXT-011 Hook Validation and Phase Registration SF-005 FD-002 CSC-001 No CSU
HLR-EXT-012 Analyze Query Descriptor SF-005 FD-002 No CSC
HLR-EXT-012 Analyze Query Descriptor SF-005 FD-002 CSC-001 No CSU
HLR-OUT-001 Document Assembly SF-004 FD-004 No CSC
HLR-OUT-002 Float Resolution SF-004 FD-004 No CSC
HLR-OUT-003 Float Numbering SF-004 FD-004 No CSC
HLR-OUT-004 Multi-Format Output SF-004 FD-004 No CSC
HLR-OUT-005 DOCX Generation SF-004 FD-004 No CSC
HLR-OUT-006 HTML5 Generation SF-004 FD-004 No CSC
HLR-OUT-007 Full-Text Search Indexing SF-004 FD-004 No CSC
HLR-PIPE-001 Five-Phase Lifecycle SF-001 FD-001 No CSC
HLR-PIPE-001 Five-Phase Lifecycle SF-001 FD-001 CSC-001 No CSU
HLR-PIPE-002 Handler Registration and Prerequisites SF-001 FD-001 No CSC
HLR-PIPE-002 Handler Registration and Prerequisites SF-001 FD-001 CSC-001 No CSU
HLR-PIPE-003 Topological Ordering via Kahn’s Algorithm SF-001 FD-001 No CSC
HLR-PIPE-003 Topological Ordering via Kahn’s Algorithm SF-001 FD-001 CSC-001 No CSU
HLR-PIPE-004 Phase Abort on ANALYZE Errors SF-001 FD-001 No CSC
HLR-PIPE-004 Phase Abort on ANALYZE Errors SF-001 FD-001 CSC-001 No CSU
HLR-PIPE-005 Batch Dispatch for All Phases SF-001 FD-001 No CSC
HLR-PIPE-005 Batch Dispatch for All Phases SF-001 FD-001 CSC-001 No CSU
HLR-PIPE-006 Context Creation and Propagation SF-001 FD-001 No CSC
HLR-PIPE-006 Context Creation and Propagation SF-001 FD-001 CSC-001 No CSU
HLR-PIPE-007 CommonSpec Input Parsing SF-001 FD-001 No CSC
HLR-PIPE-007 CommonSpec Input Parsing SF-001 FD-001 CSC-001 No CSU
HLR-PIPE-008 Include File Expansion SF-001 FD-001 No CSC
HLR-PIPE-008 Include File Expansion SF-001 FD-001 CSC-001 No CSU
HLR-PIPE-009 PID Auto-Generation SF-001 FD-001 No CSC
HLR-PIPE-009 PID Auto-Generation SF-001 FD-001 CSC-001 No CSU
HLR-PIPE-010 Relation Type Inference SF-001 FD-001 No CSC
HLR-PIPE-010 Relation Type Inference SF-001 FD-001 CSC-001 No CSU
HLR-PIPE-011 Prerequisite-Not-Found Diagnostic SF-001 FD-001 No CSC
HLR-PIPE-011 Prerequisite-Not-Found Diagnostic SF-001 FD-001 CSC-001 No CSU
HLR-PIPE-012 Section Scope Termination SF-001 FD-001 No CSC
HLR-PIPE-012 Section Scope Termination SF-001 FD-001 CSC-001 No CSU
HLR-STOR-001 SQLite Persistence SF-002 FD-003 No CSC
HLR-STOR-002 EAV Attribute Model SF-002 FD-003 No CSC
HLR-STOR-003 Build Cache SF-002 FD-003 No CSC
HLR-STOR-004 Output Cache SF-002 FD-003 No CSC
HLR-STOR-005 Incremental Rebuild Support SF-002 FD-003 No CSC
HLR-STOR-006 EAV Pivot Views for External Queries SF-002 FD-003 No CSC
HLR-TYPE-001 Specifications Container SF-003 FD-005 No CSC
HLR-TYPE-001 Specifications Container SF-003 FD-005 CSC-017 No CSU
HLR-TYPE-001 Specifications Container SF-003 FD-005 CSC-018 No CSU
HLR-TYPE-001 Specifications Container SF-003 FD-005 CSC-019 No CSU
HLR-TYPE-001 Specifications Container SF-003 FD-005 CSC-021 No CSU
HLR-TYPE-001 Specifications Container SF-003 FD-005 CSC-022 No CSU
HLR-TYPE-001 Specifications Container SF-003 FD-005 CSC-023 No CSU
HLR-TYPE-001 Specifications Container SF-003 FD-005 CSC-024 No CSU
HLR-TYPE-002 Spec Objects Container SF-003 FD-005 No CSC
HLR-TYPE-002 Spec Objects Container SF-003 FD-005 CSC-017 No CSU
HLR-TYPE-002 Spec Objects Container SF-003 FD-005 CSC-018 No CSU
HLR-TYPE-002 Spec Objects Container SF-003 FD-005 CSC-019 No CSU
HLR-TYPE-002 Spec Objects Container SF-003 FD-005 CSC-021 No CSU
HLR-TYPE-002 Spec Objects Container SF-003 FD-005 CSC-022 No CSU
HLR-TYPE-002 Spec Objects Container SF-003 FD-005 CSC-023 No CSU
HLR-TYPE-002 Spec Objects Container SF-003 FD-005 CSC-024 No CSU
HLR-TYPE-003 Spec Floats Container SF-003 FD-005 No CSC
HLR-TYPE-003 Spec Floats Container SF-003 FD-005 CSC-017 No CSU
HLR-TYPE-003 Spec Floats Container SF-003 FD-005 CSC-018 No CSU
HLR-TYPE-003 Spec Floats Container SF-003 FD-005 CSC-019 No CSU
HLR-TYPE-003 Spec Floats Container SF-003 FD-005 CSC-021 No CSU
HLR-TYPE-003 Spec Floats Container SF-003 FD-005 CSC-022 No CSU
HLR-TYPE-003 Spec Floats Container SF-003 FD-005 CSC-023 No CSU
HLR-TYPE-003 Spec Floats Container SF-003 FD-005 CSC-024 No CSU
HLR-TYPE-004 Spec Views Container SF-003 FD-005 No CSC
HLR-TYPE-004 Spec Views Container SF-003 FD-005 CSC-017 No CSU
HLR-TYPE-004 Spec Views Container SF-003 FD-005 CSC-018 No CSU
HLR-TYPE-004 Spec Views Container SF-003 FD-005 CSC-019 No CSU
HLR-TYPE-004 Spec Views Container SF-003 FD-005 CSC-021 No CSU
HLR-TYPE-004 Spec Views Container SF-003 FD-005 CSC-022 No CSU
HLR-TYPE-004 Spec Views Container SF-003 FD-005 CSC-023 No CSU
HLR-TYPE-004 Spec Views Container SF-003 FD-005 CSC-024 No CSU
HLR-TYPE-005 Spec Relations Container SF-003 FD-005 No CSC
HLR-TYPE-005 Spec Relations Container SF-003 FD-005 CSC-017 No CSU
HLR-TYPE-005 Spec Relations Container SF-003 FD-005 CSC-018 No CSU
HLR-TYPE-005 Spec Relations Container SF-003 FD-005 CSC-019 No CSU
HLR-TYPE-005 Spec Relations Container SF-003 FD-005 CSC-021 No CSU
HLR-TYPE-005 Spec Relations Container SF-003 FD-005 CSC-022 No CSU
HLR-TYPE-005 Spec Relations Container SF-003 FD-005 CSC-023 No CSU
HLR-TYPE-005 Spec Relations Container SF-003 FD-005 CSC-024 No CSU
HLR-TYPE-006 Spec Attributes Container SF-003 FD-005 No CSC
HLR-TYPE-006 Spec Attributes Container SF-003 FD-005 CSC-017 No CSU
HLR-TYPE-006 Spec Attributes Container SF-003 FD-005 CSC-018 No CSU
HLR-TYPE-006 Spec Attributes Container SF-003 FD-005 CSC-019 No CSU
HLR-TYPE-006 Spec Attributes Container SF-003 FD-005 CSC-021 No CSU
HLR-TYPE-006 Spec Attributes Container SF-003 FD-005 CSC-022 No CSU
HLR-TYPE-006 Spec Attributes Container SF-003 FD-005 CSC-023 No CSU
HLR-TYPE-006 Spec Attributes Container SF-003 FD-005 CSC-024 No CSU
HLR-TYPE-007 Type Validation SF-003 FD-005 No CSC
HLR-TYPE-007 Type Validation SF-003 FD-005 CSC-017 No CSU
HLR-TYPE-007 Type Validation SF-003 FD-005 CSC-018 No CSU
HLR-TYPE-007 Type Validation SF-003 FD-005 CSC-019 No CSU
HLR-TYPE-007 Type Validation SF-003 FD-005 CSC-021 No CSU
HLR-TYPE-007 Type Validation SF-003 FD-005 CSC-022 No CSU
HLR-TYPE-007 Type Validation SF-003 FD-005 CSC-023 No CSU
HLR-TYPE-007 Type Validation SF-003 FD-005 CSC-024 No CSU