Repository navigation
Testing
Full automated suite green in CI, coverage gate 85% on the deterministic core, a committed Playwright E2E suite, and a golden-file corpus that compares structure rather than bytes.
make test # pytest
make test-cov # coverage gate: --cov-fail-under=85
make lint # ruff check + ruff format --check
make typecheck # mypy over packages/ and services/Or directly:
pytest -q
pytest tests/unit -q
pytest tests/integration -q
pytest -k golden -q| Area | Coverage |
|---|---|
| Parser | valid, malformed, empty, oversized, encrypted, nested, zip-bomb, XXE, depth/node limits |
| Schema | XSD typing, inference from sample data, attributes, recursion, collections, diagnostics |
| Resolver | absolute/alias paths, unknown paths, context violations, ambiguity detection |
| IR | model validation, expression rules, table shape, migration errors, canonical digest |
| Planner | baseline composition, mapping report, repair pass, revisions, budget propagation |
| Validator | every level, not_tested semantics, package checks (macros, missing entries) |
| Compiler | byte-identical output, content assertions, placeholders, images, conditionals, gated target |
| Preview | escaping, repeats, conditionals, placeholders, sandboxed HTML |
| LLM gateway | adapters via mocked transports, retries, error normalization, budget pre-flight |
| API | upload → plan → validate → compile → download, error envelopes, artifact lifecycle |
| CLI | every command, JSON output, exit codes |
Eight fixtures (simple-fields, sales-quotation, purchase-order, nested-list, conditional-vat,
image-binding, missing-data, multilingual) each store:
| File | Content |
|---|---|
schema.json |
normalized schema |
ir.json |
canonical Template IR produced by the baseline planner |
mapping.json |
requirement-to-field report |
validation.json |
level statuses, findings, package statuses |
docx.json |
normalized document structure (paragraphs, tables, header/footer, media, properties) |
DOCX comparison is structural: ZIP order, identifiers and metadata legitimately vary, so the test
compares a normalized projection instead of bytes. Compiler determinism is asserted separately by
byte equality in test_validator_and_compiler.py.
Regenerate deliberately:
python -m tests.golden_files.update_golden # write
python -m tests.golden_files.update_golden --check # CI guard| Guard | Command |
|---|---|
| Examples are reproducible | python scripts/build_examples.py --check |
| Golden files are current | python -m tests.golden_files.update_golden --check |
| OpenAPI is current | export + git diff --exit-code
|
| Coverage gate | pytest --cov-fail-under=85 |
| Gap | Status |
|---|---|
| Real DDSP packages | No permitted sample available |
| Live LLM provider calls | Adapters tested against mocked HTTP transports |
| Word rendering / pagination | Out of scope for the MVP |
| Docentric AX execution | Blocked by the compatibility gate |
| Browser E2E in CI | Manual Playwright smoke run only |
| UI layouts below 1024 px | Not verified |
Performed against a production build with a real API:
- upload the quotation DDSP → tree, diagnostics and counts render;
- keyboard navigation and path insertion in the schema tree;
- plan → mapping rows, validation badges, sandboxed preview;
- compile → automatic DOCX download (39,749 bytes);
- revision → version 2, diff summary, load version 1;
- error path: unsupported file → message, code and details.
Zero console errors; no horizontal overflow at 1024 px.
Docentric Copilot · Apache-2.0 · independent open-source project, not affiliated with Docentric.
Docentric AX compatibility is unverified — output is a generic DOCX; every validation report records not_tested.
Docentric Copilot
Understand the product
Use it
How it works
- Architecture
- Template IR
- Validation Model
- DDSP Compatibility
- Reference Templates, Diff & Eval
- Safe IR Import & Visual Diff
- Docentric AX Compatibility
Quality
Project