Integrate diagnostic plugin and retire analysis submodule

This commit is contained in:
Dandaedre 2026-09-16 18:03:05 +02:00
parent e48990c8ec
commit c1c22f15d5
Signed by: Dandaedre
GPG Key ID: 440C6592E8A26D99
13 changed files with 52 additions and 34 deletions

4
.gitmodules vendored
View File

@ -5,7 +5,3 @@
[submodule "reportist"]
path = reporter
url = https://proxy.dandaedre.com/gitea/Beffroi/reportist.git
[submodule "win-diagnostics"]
path = diagnostics
url = https://proxy.dandaedre.com/gitea/Beffroi/win-diagnostics-analysis.git

10
AGENT-TASKS.md Normal file
View File

@ -0,0 +1,10 @@
# Diagnostic plugin migration
- [x] Tag the pre-migration integration revision as `v0.1.0-rc.4`.
- [x] Run the existing tests and build a 17-PDF baseline.
- [x] Move diagnostic analysis, rules, schema, and tests into `reports/plugins/diagnostics`.
- [x] Define a reusable Reportist plugin contract and route diagnostic inputs through it.
- [x] Consolidate diagnostic rendering on the Reportist report engine, retaining the useful theme choices and a similar PDF layout.
- [x] Update root commands, publication, validation, CI, bootstrap, and documentation.
- [x] Remove the diagnostic analysis submodule and all runtime references to it.
- [x] Run component and integration tests, compare generated diagnostic PDFs with the baseline, and commit the migration.

View File

@ -21,8 +21,9 @@ To select a built-in palette in YAML, set `branding.theme` to `default` or
./beffroi.sh diagnostic-pdf capture.json diagnostic.pdf
```
This renders the capture directly with the established diagnostic layout. For
the evidence-backed analysis workflow, run:
This runs the diagnostic plugin through the common Reportist engine. Choose a
configured palette with `DIAGNOSTICS_THEME=default`, `cic`, or `eridani`.
For an evidence-backed draft generation, run:
```bash
./beffroi.sh diagnostic \

View File

@ -31,10 +31,9 @@ case "$command_name" in
;;
diagnostic-pdf)
[[ $# -eq 2 ]]||usage 2; require typst
reporter/render-diagnostic.sh "$1" \
--output "$2" \
reporter/render-plugin.sh reports/plugins/diagnostics "$1" "$2" \
--author "${DIAGNOSTICS_AUTHOR:-Beffroi}" \
--logo reports/assets/beffroi.png
--theme "${DIAGNOSTICS_THEME:-default}"
;;
diagnostic)
[[ $# -eq 7 ]]||usage 2; require git typst

View File

@ -26,7 +26,7 @@ if ! $check_only; then
git submodule update --init --recursive
fi
for component in diagnostics reporter reports; do
for component in reporter reports; do
if [[ ! -e "$component/.git" ]]; then
echo "Missing component checkout: $component" >&2
echo 'Run ./bootstrap.sh with network access to initialize pinned submodules.' >&2

@ -1 +0,0 @@
Subproject commit 59691960ae0c5dfcbcb5c449bd30003680ecc67a

View File

@ -53,7 +53,8 @@ git push --recurse-submodules=on-demand
## Repository boundaries
Keep orchestration in this repository. Diagnostic rules belong in Win
Diagnostics, investigation content belongs in Beffroi Reports, and rendering
logic belongs in Reportist. Do not introduce dependencies from a component back
Keep orchestration in this repository. Diagnostic analysis and rules belong in the Reports diagnostic plugin,
investigation content belongs in Beffroi Reports, and common rendering
logic belongs in Reportist. Additional plugins implement the same preparation
contract described in `reporter/README.md`. Do not introduce dependencies from a component back
to this workspace.

@ -1 +1 @@
Subproject commit 77a7830ed584648b35c516e064ba1dcd7a8866d7
Subproject commit 1cb6cba4c068908e5b14681fcd7b29c1e5e6a6bf

@ -1 +1 @@
Subproject commit c1eee6b7166a61e17d16216c1685a4e6c5ddf621
Subproject commit b0e2671f924882cbb9417815661f60bc12c34e09

View File

@ -24,10 +24,17 @@ mkdir -p "$output_root/reports" "$output_root/diagnostics"
reporter/tools/validate-all.sh reports/reports
reporter/tools/render-all.sh reports/reports --output-dir "$output_root/reports/pdfs"
reporter/render-diagnostics.sh reports/diagnostics \
--output-dir "$output_root/diagnostics" \
--author "${DIAGNOSTICS_AUTHOR:-Beffroi}" \
--logo reports/assets/beffroi.png
count=0
while IFS= read -r -d '' source; do
relative=${source#reports/diagnostics/}
output="$output_root/diagnostics/${relative%.json}.pdf"
mkdir -p "$(dirname "$output")"
reporter/render-plugin.sh reports/plugins/diagnostics "$source" "$output" \
--author "${DIAGNOSTICS_AUTHOR:-Beffroi}" --theme "${DIAGNOSTICS_THEME:-default}"
((count += 1))
done < <(find reports/diagnostics -type f -name '*.json' -print0 | sort -z)
((count > 0)) || { echo 'No diagnostic captures found' >&2; exit 1; }
echo "Rendered $count diagnostic PDFs into $output_root/diagnostics"
if [[ "$include_json" == true ]]; then
reporter/tools/export-json-all.sh reports/reports --output-dir "$output_root/reports/pdfs"

View File

@ -8,7 +8,7 @@ command -v uv >/dev/null 2>&1 || {
exit 1
}
for component in diagnostics reports; do
for component in reports; do
if [[ ! -f "$component/tests/requirements.txt" || ! -x "$component/tests/test.sh" ]]; then
echo "Missing $component checks. Run: git submodule update --init --recursive" >&2
exit 1
@ -26,8 +26,8 @@ command -v typst >/dev/null 2>&1 || {
typst --version
uv --version
for component in diagnostics; do
echo "Checking $component ($(git -C "$component" rev-parse HEAD))"
for component in reports/plugins/diagnostics; do
echo "Checking $component ($(git -C reports rev-parse HEAD))"
"$component/tests/test.sh"
done
@ -35,7 +35,7 @@ echo "Checking reporter ($(git -C reporter rev-parse HEAD))"
reporter/tests/test.sh
echo "Checking reports ($(git -C reports rev-parse HEAD))"
DIAGNOSTIC_VALIDATOR="$(pwd)/diagnostics/tools/validate.sh" \
DIAGNOSTIC_VALIDATOR="$(pwd)/reports/plugins/diagnostics/tools/validate.sh" \
REPORT_VALIDATOR="$(pwd)/reporter/tools/validate.sh" \
BRANDING="$(pwd)/reports/config/branding/default.json" \
BRANDING_ROOT="$(pwd)/reports" \
@ -49,8 +49,8 @@ pipeline_check_parent="$(mktemp -d "${TMPDIR:-/tmp}/beffroi-pipeline-check.XXXXX
trap 'rm -rf -- "$pipeline_check_parent"' EXIT
pipeline_check_root="$pipeline_check_parent/run"
bash scripts/workflow.sh all \
diagnostics/tests/fixtures/legacy/windiagnostics-v1.json \
diagnostics/tests/fixtures/legacy \
reports/plugins/diagnostics/tests/fixtures/legacy/windiagnostics-v1.json \
reports/plugins/diagnostics/tests/fixtures/legacy \
"$pipeline_check_root" \
2026-09-15T12:00:00Z \
'Synthetic diagnostic draft' 'CI Test' 2026-09-15
@ -60,4 +60,9 @@ typst eval --root "$pipeline_check_root" --input diagnostic=diagnostic.json \
'query(<valid>).first().value' >/dev/null
test "$(head -c 5 "$pipeline_check_root/report.pdf")" = '%PDF-'
reporter/render-plugin.sh reports/plugins/diagnostics \
reports/plugins/diagnostics/tests/fixtures/legacy/windiagnostics-v1.json \
"$pipeline_check_parent/plugin.pdf" --theme eridani --author 'CI Test'
test "$(head -c 5 "$pipeline_check_parent/plugin.pdf")" = '%PDF-'
echo 'Component suites and the raw-capture-to-PDF integration pipeline passed.'

View File

@ -8,14 +8,14 @@ fi
capture_dir=$1; evidence_root=$2; output_root=$3; reference_time=$4; title=$5; author=$6; report_date=$7
[[ ! -e "$output_root" ]]||{ echo "$output_root: output root already exists" >&2; exit 1; }
mkdir -p "$output_root"
diagnostics/analyse-all.sh "$capture_dir" --evidence-root "$evidence_root" \
reports/plugins/diagnostics/analyse-all.sh "$capture_dir" --evidence-root "$evidence_root" \
--output-dir "$output_root/diagnostics" --reference-time "$reference_time" \
--producer-version "$(git -C diagnostics rev-parse HEAD)"
reports/tools/diagnostic-to-report-all.sh --diagnostic-dir "$output_root/diagnostics" \
--producer-version "$(git -C reports rev-parse HEAD)"
reports/plugins/diagnostics/tools/diagnostic-to-report-all.sh --diagnostic-dir "$output_root/diagnostics" \
--evidence-root "$evidence_root" --output-root "$output_root/generations" \
--title "$title" --author "$author" --date "$report_date" \
--generator-version "$(git -C reports rev-parse HEAD)" \
--diagnostic-validator "$PWD/diagnostics/tools/validate.sh" \
--diagnostic-validator "$PWD/reports/plugins/diagnostics/tools/validate.sh" \
--report-validator "$PWD/reporter/tools/validate.sh" \
--branding "$PWD/reports/config/branding/default.json" --branding-root "$PWD/reports"
while IFS= read -r -d '' report; do

View File

@ -26,19 +26,19 @@ command -v typst >/dev/null || { echo "Missing runtime dependency: typst" >&2; e
analyse() {
[[ $# -eq 4 ]] || usage
require_values "$@"
bash diagnostics/analyse.sh "$1" \
bash reports/plugins/diagnostics/analyse.sh "$1" \
--evidence-root "$2" --output "$3" --reference-time "$4" \
--producer-version "$(git -C diagnostics rev-parse HEAD)"
--producer-version "$(git -C reports rev-parse HEAD)"
}
draft() {
[[ $# -eq 6 ]] || usage
require_values "$@"
bash reports/tools/diagnostic-to-report.sh \
bash reports/plugins/diagnostics/tools/diagnostic-to-report.sh \
--diagnostic "$1" --evidence-root "$2" --output-dir "$3" \
--title "$4" --author "$5" --date "$6" \
--generator-version "$(git -C reports rev-parse HEAD)" \
--diagnostic-validator "$(pwd)/diagnostics/tools/validate.sh" \
--diagnostic-validator "$(pwd)/reports/plugins/diagnostics/tools/validate.sh" \
--report-validator "$(pwd)/reporter/tools/validate.sh" \
--branding reports/config/branding/default.json \
--branding-root reports