From c1c22f15d5bc834e2d6302a4a55e34a65e5b77a6 Mon Sep 17 00:00:00 2001 From: Dandaedre Date: Wed, 16 Sep 2026 18:03:05 +0200 Subject: [PATCH] Integrate diagnostic plugin and retire analysis submodule --- .gitmodules | 4 ---- AGENT-TASKS.md | 10 ++++++++++ README.md | 5 +++-- beffroi.sh | 5 ++--- bootstrap.sh | 2 +- diagnostics | 1 - docs/development.md | 7 ++++--- reporter | 2 +- reports | 2 +- scripts/build-publication.sh | 15 +++++++++++---- scripts/check-components.sh | 17 +++++++++++------ scripts/workflow-all.sh | 8 ++++---- scripts/workflow.sh | 8 ++++---- 13 files changed, 52 insertions(+), 34 deletions(-) create mode 100644 AGENT-TASKS.md delete mode 160000 diagnostics diff --git a/.gitmodules b/.gitmodules index 76b65af..ec723e4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 diff --git a/AGENT-TASKS.md b/AGENT-TASKS.md new file mode 100644 index 0000000..6c14ce5 --- /dev/null +++ b/AGENT-TASKS.md @@ -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. diff --git a/README.md b/README.md index 07e1ebf..37a7d69 100644 --- a/README.md +++ b/README.md @@ -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 \ diff --git a/beffroi.sh b/beffroi.sh index 324af92..eb01885 100755 --- a/beffroi.sh +++ b/beffroi.sh @@ -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 diff --git a/bootstrap.sh b/bootstrap.sh index e57ec4e..d11ee46 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -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 diff --git a/diagnostics b/diagnostics deleted file mode 160000 index 5969196..0000000 --- a/diagnostics +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 59691960ae0c5dfcbcb5c449bd30003680ecc67a diff --git a/docs/development.md b/docs/development.md index 92e2090..ff42d90 100644 --- a/docs/development.md +++ b/docs/development.md @@ -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. diff --git a/reporter b/reporter index 77a7830..1cb6cba 160000 --- a/reporter +++ b/reporter @@ -1 +1 @@ -Subproject commit 77a7830ed584648b35c516e064ba1dcd7a8866d7 +Subproject commit 1cb6cba4c068908e5b14681fcd7b29c1e5e6a6bf diff --git a/reports b/reports index c1eee6b..b0e2671 160000 --- a/reports +++ b/reports @@ -1 +1 @@ -Subproject commit c1eee6b7166a61e17d16216c1685a4e6c5ddf621 +Subproject commit b0e2671f924882cbb9417815661f60bc12c34e09 diff --git a/scripts/build-publication.sh b/scripts/build-publication.sh index 04c637f..ac3ccaa 100755 --- a/scripts/build-publication.sh +++ b/scripts/build-publication.sh @@ -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" diff --git a/scripts/check-components.sh b/scripts/check-components.sh index dc2a5a9..f1c817a 100755 --- a/scripts/check-components.sh +++ b/scripts/check-components.sh @@ -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().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.' diff --git a/scripts/workflow-all.sh b/scripts/workflow-all.sh index ef510aa..75620b4 100755 --- a/scripts/workflow-all.sh +++ b/scripts/workflow-all.sh @@ -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 diff --git a/scripts/workflow.sh b/scripts/workflow.sh index 7cf3a52..21648f0 100755 --- a/scripts/workflow.sh +++ b/scripts/workflow.sh @@ -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