feat: add deterministic preview rendering
This commit is contained in:
parent
8c75f4f44d
commit
411f417670
23 changed files with 1413 additions and 142 deletions
|
|
@ -128,3 +128,51 @@ DFG-3: add isolated, hash-bound proposal changesets without canonical write auth
|
|||
### Next gate
|
||||
|
||||
DFG-4: add deterministic previews and confined renderer orchestration without canonical application.
|
||||
|
||||
## DFG-4 deterministic previews and renderer orchestration
|
||||
|
||||
### Changed
|
||||
|
||||
- Added optional project-declared template, preview, view, and derived-output configuration with
|
||||
strict root confinement, overlap rejection, stable view IDs, and configured size limits.
|
||||
- Added an explicit renderer protocol backed by a closed built-in registry. Configuration cannot
|
||||
name commands, modules, executable paths, or undeclared renderers.
|
||||
- Added the `generic_html` renderer with pinned `markdown-it-py` CommonMark parsing, disabled raw
|
||||
HTML, fixed safe template tokens, deterministic node ordering, navigation, metadata, content, and
|
||||
relationship output.
|
||||
- Added render identities covering canonical and proposal inputs, node and edge identities, view
|
||||
configuration, template hash, renderer contract, and exact Markdown parser version.
|
||||
- Added atomic per-view CLI rendering, non-writing render status, and isolated changeset previews.
|
||||
Input changes detected before replacement preserve prior output.
|
||||
- Added `docforge_preview_changeset` to MCP and made `docforge_render_status` report configured view
|
||||
hashes and state. MCP cannot render declared project output or select a renderer or command.
|
||||
- Split shared configuration validation, render configuration, renderer contract, and orchestration
|
||||
into focused modules instead of expanding the project loader or MCP translation layer.
|
||||
|
||||
### Verification
|
||||
|
||||
- Renderer tests prove repeatable identities and bytes, current and stale status, isolated previews,
|
||||
escaped raw HTML, CommonMark conversion, unchanged canonical and declared output, configured
|
||||
limits, symbolic-link rejection, and preservation of prior output after invalid or changing input.
|
||||
- Configuration tests reject command-like fields, unsupported renderer IDs, protected output paths,
|
||||
undeclared views, oversized templates and output, and unsafe symbolic links.
|
||||
- CLI tests cover declared render, render status, isolated preview, and structured unknown-view
|
||||
failure. Protocol tests exercise preview through the official in-memory MCP transport and prove
|
||||
declared output remains absent.
|
||||
- Ruff formatting and lint checks, Python compilation, all five JSON schema parses, and the locked
|
||||
dependency check passed.
|
||||
- All 35 core, CLI, changeset, concurrency, renderer, in-memory MCP, and real stdio tests passed with
|
||||
`ResourceWarning` treated as an error.
|
||||
|
||||
### Limits
|
||||
|
||||
- The first built-in renderer emits one self-contained HTML file per view. Multi-file asset bundles
|
||||
and project-specific view models remain future adapter work.
|
||||
- Preview generation validates proposals but does not apply them to canonical documentation.
|
||||
- Declared project-output rendering is an explicit local CLI integration action, not an MCP tool.
|
||||
- Worldforge and unrelated-project adapters remain unopened.
|
||||
|
||||
### Next gate
|
||||
|
||||
DFG-5: reproduce Worldforge semantics and generated output through a shadow-only adapter without
|
||||
changing the live workflow.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue