test: add workbench tests and MVP documentation
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
# Architecture
|
||||
|
||||
`DocxWorkbench.App` and `StandardsWorkbench.App` are separate WinForms applications. They share only DTOs in `DocumentAutomation.Shared`.
|
||||
|
||||
DOCX flow: GUI -> `DocxWorkbench.Core` contracts -> `DocxWorkbench.OpenXml` read-only inspection or `DocxWorkbench.WordInterop` sequential Word COM queue -> DOCX/PDF and technical JSON log.
|
||||
|
||||
Standards flow: GUI -> `StandardsWorkbench.Pdf` page/clause extraction and `StandardsWorkbench.Ollama` candidate-only suggestions -> manually approved portable profile -> `StandardsWorkbench.Core.RulesEngine`.
|
||||
|
||||
COM is isolated from Core and UI. Standards rules are not hardcoded into document generation.
|
||||
@@ -0,0 +1,9 @@
|
||||
# Development
|
||||
|
||||
```powershell
|
||||
dotnet restore .\DocumentAutomation\DocumentAutomation.sln
|
||||
dotnet build .\DocumentAutomation\DocumentAutomation.sln --configuration Release
|
||||
dotnet test .\DocumentAutomation\DocumentAutomation.sln --configuration Release
|
||||
```
|
||||
|
||||
Run `DocxWorkbench.App` or `StandardsWorkbench.App` from Visual Studio/VS Code. Microsoft Word is required only for DOCX generation and PDF export. Ollama is configured at `http://192.168.200.112:11434`; the model must be selected from `/api/tags`.
|
||||
@@ -0,0 +1,5 @@
|
||||
# DOCX template contract
|
||||
|
||||
The preferred insertion point is a Content Control with tag or title `DOC_BODY`, then a bookmark named `DOC_BODY`, then the exact marker `{{DOC_BODY}}`. If none is present, generation fails explicitly; the body is never silently appended.
|
||||
|
||||
The template is copied to a temporary working file. Body headers/footers are not imported. Template sections and headers/footers are retained, fields are updated, and Word repaginates before saving.
|
||||
@@ -0,0 +1,5 @@
|
||||
# Standards rule model
|
||||
|
||||
PDF metadata includes SHA-256, page count, text-layer status and import time. Pages without text are marked `OCR_REQUIRED`; no text is invented. Clause extraction preserves clause number, text, page and confidence.
|
||||
|
||||
Ollama receives only a small clause context and may return a candidate JSON rule. Candidates remain `New` until human approval. Only `Approved`, `Implemented` or `Tested` rules are evaluated. Profiles contain manifest, approved rules, references and a signature hash.
|
||||
@@ -0,0 +1,5 @@
|
||||
# Word COM lifecycle
|
||||
|
||||
Word is started in a dedicated task with `Visible=false` and alerts disabled. The service opens a working copy, performs one operation, updates fields, repaginates, saves, closes the Document, quits the Application, and releases owned COM objects in `finally`.
|
||||
|
||||
The prototype does not run as a Windows Service, does not kill unrelated `WINWORD.EXE` processes, and does not execute macros. Production hardening should add an explicit serial queue and PID-scoped orphan check.
|
||||
Reference in New Issue
Block a user