docs: inventory renderer boundaries and preserve synthetic examples
Reportist CI Reportist passed all currently implemented CI checks.
Beffroi/reportist/pipeline/head This commit looks good Details

This commit is contained in:
Dandaedre 2026-09-15 16:09:27 +02:00
parent 2c1c085ca2
commit 3b73d1a03c
5 changed files with 209 additions and 4 deletions

View File

@ -15,7 +15,7 @@ This roadmap must remain usable from a standalone checkout. Legacy repositories
are migration sources, not runtime dependencies. Coordinate public contracts
with consumers; keep implementation and tests in their owning repository.
## Baseline — 2026-09-15
## Initial planning baseline — 2026-09-15
Only instructions, README, license, ignore rules, and Jenkins scaffolding are
tracked. No renderer, report schema, synthetic examples, or rendering tests have
@ -26,9 +26,9 @@ and organisation-specific content, so files must be classified before extraction
- [x] RT0.1 Read repository instructions and inspect tracked files, README, and Jenkins scaffold.
- [x] RT0.2 Create this phased tracker and link it and the instructions from the README.
- [ ] RT0.3 Inventory legacy `report.typ`, rendering wrappers, models, themes, validation, and content blocks; record source revisions, licenses, fonts, Typst requirements, and CLI behavior.
- [ ] RT0.4 Classify reusable layout separately from diagnostics normalization/rules, hard-coded identity/assets, and real report content. Record destinations before copying anything.
- [ ] RT0.5 Create synthetic representative reports and capture legacy visual/behavior baselines, including headings, tables, findings, actions, appendices, and page breaks where supported.
- [x] RT0.3 Inventory legacy `report.typ`, rendering wrappers, models, themes, validation, and content blocks; record source revisions, licenses, fonts, Typst requirements, and CLI behavior.
- [x] RT0.4 Classify reusable layout separately from diagnostics normalization/rules, hard-coded identity/assets, and real report content. Record destinations before copying anything.
- [x] RT0.5 Create synthetic representative reports and capture legacy visual/behavior baselines, including headings, tables, findings, actions, appendices, and page breaks where supported.
Exit: the first extraction slice has a reusable feature inventory and observable
visual baseline without importing private reports into generic fixtures.
@ -93,3 +93,11 @@ contract is sufficient for any report-producing application.
- Validation: documentation links, task IDs, and whitespace checked; renderer tests were not run because no implementation exists yet.
- Open: detailed source classification, synthetic examples, and baseline PDFs.
- Next: RT0.3–RT0.5, then define the first RT1 schema/CLI slice.
### 2026-09-15 — Inventory and executable baseline pass
- Completed RT0.3–RT0.5 for the initial rendering slice: source/function inventory, draft field mapping, and two synthetic legacy report examples with retained MIT notice.
- Evidence: [migration inventory](docs/migration-inventory.md), `tests/fixtures/legacy/`.
- Validation: macro baseline command rendered both report PDFs and rejected missing author/date and unknown theme. Reviewed the technical report first page; later-page/long-content/alternate-branding coverage remains open.
- Existing Beffroi logo coupling remains visible in legacy output. No generic renderer implementation or public schema is claimed yet.
- Next: RT1 schema/validation fixtures, then RT2 generic rendering extraction.

View File

@ -0,0 +1,80 @@
# Renderer inventory and draft contract
## Source and ownership
Inspected legacy typst_reporter commit
`1d381904fff3d378a7c0e04588e75310a9b7ed60` on 2026-09-15.
Software carries an MIT notice, copyright 2026 Beffroi. Synthetic fixtures retain
that notice; no Beffroi graphical assets are imported into Reportist.
| Source | Disposition |
| --- | --- |
| `report.typ` | Generic entry point: retain author/date checks; replace fixed theme/logo lookup and add versioned YAML/JSON validation. |
| `modules/model.typ`: `dict-get`, `as-content`, `theme-color`, `severity-color` | Generic helpers; report strings must remain inert content. |
| `report-type-label`, `badge`, `metadata-line`, `section-title`, `subsection-title`, `callout`, `code-block` | Generic presentation; remove organisation-specific defaults. |
| `render-block`, `render-findings`, `render-timeline`, `render-actions` | Generic structured content; preserve evidence/assessment separation. |
| `confidence-bar`, `diagnostic-list`, `render-diagnostics` | Extract bars/lists/cards; supply domain labels and values as data. Never compute diagnostic confidence here. |
| `report-header`, `report-footer`, `report-model` | Generic layout; remove default Beffroi identity and mandatory logo. |
| `modules/diagnostics-model.typ` | Split widgets from fixed Windows sections and report assembly. Generic widgets go here, report shaping goes to beffroi-reports. |
| `modules/diagnostics-normalize.typ` | Excluded: generic interpretation goes to win-diagnostics; display shaping goes to beffroi-reports. |
| `diagnostics.typ`, `render-diagnostics.sh` | Excluded as renderer interfaces: replace raw-capture-to-PDF with diagnostic artifact → adapter → report input. |
| `render.sh` | Reuse single-report CLI behavior; leave incident discovery and category cleaning to orchestration. |
| `config/themes.yaml` | Generic palette/font defaults and external overrides; organisation choices belong in reports. |
| Diagnostic rules/watchlist | Technical matchers go to diagnostics; report-ready recommendations go to reports. |
| Real reports, captures, assets | beffroi-reports. |
| Packaging and publication | Integration orchestration. |
| `tools/check-diagnostics.typ` | Mixed synthetic/private analysis tests; do not copy wholesale. |
Diagnostic-model helpers are `color`, `get`, `ink`, `muted`, `accent`,
`line-color`, `soft`, `severity-color`, `badge`, `heading`, `part-title`, `panel`,
`metric`, `header`, `footer`, `short-text`, `finding-target`, `finding-card`,
`evidence`, and `diagnostics-model`. Extracting widgets does not justify moving
the final domain-specific model unchanged.
## Existing CLI and dependencies
The Bash wrapper accepts YAML/YML, one path or `--all`, and optional `--clean`.
It resolves caller/repository paths, preserves subfolders under `build/`, reserves
`build/diagnostics/`, and fails on missing input/tool or Typst errors. The entry
point requires nonblank `metadata.Author` and `metadata.Date`, rejects unknown
themes, and always supplies `/assets/beffroi.png`. There is no versioned schema.
Defaults use A4, DejaVu Sans and DejaVu Sans Mono. No external Typst packages are
imported. The new CLI must accept explicit input/output paths independently of
legacy incident directory conventions.
## Field mapping for version 1 (draft, not implemented)
| Existing fields | Proposed treatment |
| --- | --- |
| No schema version | Require an explicit new `schema_version`; migration adds it deliberately. |
| `title`, `subtitle`, `id`, `report_type` | Generic identity/purpose; require nonempty title, retain technical/briefing options. |
| `metadata.Date`, `metadata.Author`, extra labels | Preserve capitalization and extra display labels; dates remain strings. |
| `organization`, `theme`, fixed logo | Explicit branding/configuration with optional logo and neutral defaults; document external asset resolution. |
| `status`, `severity` | Supplied display values, never inferred conclusions. |
| `summary`, `closing` | Optional supplied prose. |
| `timeline`: `time`, `event`, `notes` | Optional generic timeline. |
| `findings`: title, severity, status, evidence, assessment | Preserve evidence and interpretation separately; define stable references. |
| `sections`, nested `content` | Preserve text, bullets, steps, callout, code, subsection; reject unknown block types explicitly. |
| `actions_title`, `actions`: title, status, text, commands | Generic action display; commands are inert text. |
| `diagnostics.hypotheses` and lists | Map to generic sections/cards or a documented generic assessment block. |
Schema validation, YAML/JSON parity, optional-field behavior, branding, and the
standalone CLI remain RT1/RT2 tasks; this is not a released interface.
## Baseline
The first two YAML examples from legacy `docs/examples.md` are copied unchanged
to `tests/fixtures/legacy/minimal.yaml` and `technical.yaml`. All names, services,
organisation, and timestamps are example data. No historical report was copied.
The macro migration runner renders these from pinned temporary legacy sources
and checks missing author/date and unknown theme rejection. It is a migration
comparison aid, not a Reportist runtime dependency. On 2026-09-15 Typst
`0.15.1 (586e1bd4)` produced a one-page minimal report and two-page technical
report. First-page technical-report review found readable metadata, timeline,
findings and sections without visible clipping. The Beffroi logo remains visible:
this is a known coupling to remove. Other pages, long-content pagination,
alternate branding, all optional constructs, and font-version reproducibility
still require tests.
Next: RT1 schema and validation examples, then the generic single-report slice.

9
tests/fixtures/legacy/LICENSE vendored Normal file
View File

@ -0,0 +1,9 @@
MIT License
Copyright (c) 2026 Beffroi
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

24
tests/fixtures/legacy/minimal.yaml vendored Normal file
View File

@ -0,0 +1,24 @@
id: "REP-2026-001"
organization: "Example Organization"
theme: default
title: "Short report title"
subtitle: "Optional context"
report_type: briefing
status: open
severity: info
metadata:
Date: "2026-09-05"
Author: "Your Name"
summary: >
State the situation, its impact, and the most important next step.
actions:
- title: "First next step"
status: pending
text: >
Describe the action and its expected result.
closing: >
Record the current state or handoff point.

84
tests/fixtures/legacy/technical.yaml vendored Normal file
View File

@ -0,0 +1,84 @@
id: "INC-2026-001"
organization: "Example Organization"
theme: cic
title: "Service Interruption Investigation"
subtitle: "Incident analysis and shift handoff"
report_type: technical
status: open
severity: high
metadata:
Date: "2026-09-05"
Author: "Your Name"
Service: "Example API"
Environment: "Production"
Owner: "Operations"
summary: >
The API is available but intermittently slow. Database connection exhaustion
is the strongest current lead. No permanent data loss has been observed.
timeline:
- time: "09:15"
event: "Alert received"
notes: "Latency exceeded the five-second threshold."
- time: "09:22"
event: "Initial mitigation"
notes: "One unhealthy application instance was removed from rotation."
findings:
- title: "Connection pool saturation"
severity: high
status: confirmed
evidence: >
Pool utilization remained at 100 percent during each latency spike.
assessment: >
Requests are waiting for database connections. Query duration and pool
sizing both need review.
- title: "No evidence of data loss"
severity: info
status: confirmed
evidence: >
Record counts and replication checks are consistent across nodes.
assessment: >
Continue monitoring, but recovery work can prioritize availability.
sections:
- title: "Operational precautions"
content:
- type: bullets
items:
- "Avoid schema changes during diagnosis."
- "Record exact timestamps for new latency spikes."
- type: callout
title: "Escalation condition"
kind: critical
text: "Escalate immediately if replication lag exceeds five minutes."
- title: "Diagnostic procedure"
content:
- type: steps
items:
- "Capture application and database metrics."
- "Correlate slow requests with query duration."
- "Test a pool-size adjustment in staging."
- type: subsection
title: "Useful command"
content:
- type: code
text: "systemctl status example-api"
actions_title: "Next-shift plan"
actions:
- title: "Capture a diagnostic bundle"
status: pending
text: "Collect logs and metrics covering the next occurrence."
commands:
- "journalctl -u example-api --since '1 hour ago'"
- title: "Validate mitigation in staging"
status: pending
text: "Load-test the proposed connection-pool configuration."
closing: >
Service is operational with intermittent degradation. The next priority is
to capture a complete occurrence and validate the pool adjustment in staging.