feat: WP-0003 complete — LEVEL3 advanced features + error framework

Implements full LEVEL3 feature set: cross-references (xref.py), numbered
figures (figures.py), auto-diagrams (diagrams.py), bibliography/citations
(bibliography.py), LEVEL3 capability detection (level3.py), and structured
error/warning records (errors.py). Builder, importer, and differ updated for
LEVEL3 round-trip support. REST and MCP interfaces updated with structured
warning records. 259 tests passing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-16 10:51:38 +00:00
parent 760047b82b
commit ac442ea41f
26 changed files with 3713 additions and 74 deletions

View File

View File

@@ -0,0 +1,35 @@
# Research Document with Citations
## Introduction
Prior work by [@smith2020] established the foundation. The approach was later
refined by [@jones2021], building on the original insights of [@smith2020].
## Related Work
Several key contributions inform this work. The landmark paper [@brown2019]
introduced the core technique. Further development appeared in [@davis2022]
and [@wilson2023].
## Methodology
Based on [@smith2020] and the refinements of [@jones2021], our methodology
proceeds as follows.
## Results
Our results confirm the predictions of [@brown2019] and extend the findings
of [@davis2022].
## Conclusion
This work synthesises [@smith2020], [@jones2021], [@brown2019], [@davis2022],
and [@wilson2023].
## References
- [@smith2020]: Smith, J. *Foundational Work*. Journal of Research, 2020.
- [@jones2021]: Jones, B. *Refinements and Extensions*. Proceedings, 2021.
- [@brown2019]: Brown, C. *The Core Technique*. Nature, 2019.
- [@davis2022]: Davis, A. *Further Development*. Science, 2022.
- [@wilson2023]: Wilson, E. *Recent Advances*. Review, 2023.

View File

@@ -0,0 +1,63 @@
# Combined LEVEL3 Feature Document {#combined}
This document exercises all LEVEL3 constructs in a single file.
## Introduction {#intro}
This document demonstrates the full LEVEL3 feature set as described by [@smith2020].
See [Background][bg] for context.
## Background {#bg}
Context and prerequisites are discussed here. Refer to [Introduction][intro]
for the problem statement.
## Architecture {#arch-section}
The system architecture is shown below.
![System Architecture](arch.png){#fig:arch}
The architecture overview in [Architecture][arch-section] establishes the
baseline from which the data flow is derived.
## Data Flow
The data flow diagram illustrates message routing.
```mermaid
graph LR
A[Input] --> B[Processor]
B --> C[Output]
```
## Algorithm {#algo}
The algorithm formalises the approach described in [@jones2021].
```graphviz
digraph algorithm {
start -> step1 -> step2 -> end;
}
```
## Results {#results}
Experimental results confirm the algorithm in [Algorithm][algo].
![Experimental Results](results.png){#fig:results}
The results align with predictions from [@brown2019] and the architectural
choices described in [Architecture][arch-section].
## Conclusion {#conclusion}
All LEVEL3 constructs — cross-references, figures, diagrams, and citations —
have been demonstrated. See [Introduction][intro] through [Results][results]
for the complete narrative.
## References
- [@smith2020]: Smith, J. *LEVEL3 Design Principles*. 2020.
- [@jones2021]: Jones, B. *Algorithm Formalisation*. 2021.
- [@brown2019]: Brown, C. *Experimental Validation*. 2019.

View File

@@ -0,0 +1,44 @@
# Document with Diagram Sources
## State Machine
The following Mermaid diagram describes the state machine:
```mermaid
stateDiagram-v2
[*] --> Idle
Idle --> Processing: start
Processing --> Done: complete
Processing --> Error: fail
Done --> [*]
Error --> Idle: reset
```
## Dependency Graph
The Graphviz diagram shows dependencies:
```graphviz
digraph G {
A -> B;
A -> C;
B -> D;
C -> D;
}
```
## Sequence
The PlantUML sequence diagram:
```plantuml
@startuml
Alice -> Bob: Request
Bob --> Alice: Response
Alice -> Carol: Forward
@enduml
```
## Summary
All three diagram types are supported in LEVEL3 source-only mode.

View File

@@ -0,0 +1,29 @@
# Technical Report with Figures
## Overview
This document contains multiple numbered figures for LEVEL3 round-trip testing.
## System Architecture
The overall architecture is illustrated below.
![System Architecture Overview](figures/architecture.png){#fig:arch}
The architecture shows the main components and their interactions.
## Data Flow
The data flow is shown in the following figure.
![Data Flow Diagram](figures/dataflow.png){#fig:dataflow}
Compare the architecture in [fig:arch] with the data flow above.
## Results
Final results are captured in this chart.
![Results Summary Chart](figures/results.png){#fig:results}
The chart confirms the findings from the data flow in Figure 2.

View File

@@ -0,0 +1,21 @@
# Introduction {#intro}
This document demonstrates cross-reference support for LEVEL3 processing.
## Background {#bg}
The background section provides context. See [Introduction][intro] for the overview.
## Methodology {#method}
This section describes the approach. Refer to [Background][bg] for prerequisites,
and see [Introduction][intro] for the original problem statement.
## Results {#results}
Results are discussed here. The methodology in [Methodology][method] led to these findings.
## Conclusion
This concludes the document. All sections from [Introduction][intro] through
[Results][results] have been covered.