From 5661ea1b649fc843f0701d2a6ddbdba82e3961fe Mon Sep 17 00:00:00 2001 From: Dandaedre Date: Wed, 16 Sep 2026 17:20:22 +0200 Subject: [PATCH] Render stored reports directly from native YAML --- .gitignore | 3 +++ README.md | 14 +++++--------- beffroi.sh | 2 +- reporter | 2 +- reports | 2 +- scripts/build-publication.sh | 18 ++++-------------- scripts/check-components.sh | 3 +++ 7 files changed, 18 insertions(+), 26 deletions(-) diff --git a/.gitignore b/.gitignore index c482212..f7645fc 100644 --- a/.gitignore +++ b/.gitignore @@ -224,3 +224,6 @@ core.* # # Ignore generated instances by DIRECTORY instead. # ============================================================================= + +# Local architecture audits are working notes, not repository artifacts. +/audit/ diff --git a/README.md b/README.md index 0c8b477..07e1ebf 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,8 @@ Write a Reportist YAML or JSON file, then run: ``` See [`reporter/examples`](reporter/examples) for complete inputs. +To select a built-in palette in YAML, set `branding.theme` to `default` or +`teal`; an explicit theme object is also supported. ## Generate one diagnostic report @@ -43,14 +45,8 @@ commit them with the reports submodule update, and run: ./beffroi.sh all build/publication ``` -Converted Reportist JSON is temporary and removed after a successful build. -Use `--keep-intermediates` to retain it for troubleshooting: - -```bash -./beffroi.sh all build/publication --keep-intermediates -``` - -Use `--include-json` to place the structured report JSON beside report PDFs and +Stored report YAML is validated and rendered directly. Use `--include-json` to +export structured report JSON beside report PDFs and the original diagnostic JSON beside diagnostic PDFs. Packaging includes these JSON files, which is useful for downstream automation: @@ -68,7 +64,7 @@ destination. ./beffroi.sh report INPUT OUTPUT.pdf ./beffroi.sh diagnostic-pdf CAPTURE OUTPUT.pdf ./beffroi.sh diagnostic CAPTURE EVIDENCE_ROOT OUTPUT_DIR REFERENCE_TIME TITLE AUTHOR DATE -./beffroi.sh all NEW_OUTPUT_DIR [--keep-intermediates] [--include-json] +./beffroi.sh all NEW_OUTPUT_DIR [--include-json] ./beffroi.sh package BUILD_DIR ARTIFACT_DIR ./beffroi.sh test ./beffroi.sh bootstrap diff --git a/beffroi.sh b/beffroi.sh index a765a6c..324af92 100755 --- a/beffroi.sh +++ b/beffroi.sh @@ -8,7 +8,7 @@ Usage: ./beffroi.sh report INPUT OUTPUT.pdf ./beffroi.sh diagnostic-pdf CAPTURE OUTPUT.pdf ./beffroi.sh diagnostic CAPTURE EVIDENCE_ROOT OUTPUT_DIR REFERENCE_TIME TITLE AUTHOR DATE - ./beffroi.sh all NEW_OUTPUT_DIR [--keep-intermediates] [--include-json] + ./beffroi.sh all NEW_OUTPUT_DIR [--include-json] ./beffroi.sh package BUILD_DIR ARTIFACT_DIR ./beffroi.sh test ./beffroi.sh bootstrap diff --git a/reporter b/reporter index d4b0f9f..e448205 160000 --- a/reporter +++ b/reporter @@ -1 +1 @@ -Subproject commit d4b0f9f175a08ccaa490cda6d33e63f18a330e62 +Subproject commit e44820591e0fe3f7acb0cf27d09d9aecbb5970c4 diff --git a/reports b/reports index a7cfd8b..c1eee6b 160000 --- a/reports +++ b/reports @@ -1 +1 @@ -Subproject commit a7cfd8b3f9e9ae2476446cd3e5d5e858a42c2958 +Subproject commit c1eee6b7166a61e17d16216c1685a4e6c5ddf621 diff --git a/scripts/build-publication.sh b/scripts/build-publication.sh index 9f17124..04c637f 100755 --- a/scripts/build-publication.sh +++ b/scripts/build-publication.sh @@ -2,7 +2,7 @@ set -euo pipefail cd "$(dirname "${BASH_SOURCE[0]}")/.." usage() { - echo "Usage: $0 NEW_OUTPUT_ROOT [--keep-intermediates] [--include-json]" >&2 + echo "Usage: $0 NEW_OUTPUT_ROOT [--include-json]" >&2 exit 2 } @@ -10,11 +10,9 @@ output_root=${1:-} [[ -n "$output_root" ]] || usage shift -keep_intermediates=false include_json=false while (($#)); do case $1 in - --keep-intermediates) keep_intermediates=true ;; --include-json) include_json=true ;; *) usage ;; esac @@ -24,23 +22,15 @@ done [[ ! -e "$output_root" ]]||{ echo "$output_root: output root already exists" >&2; exit 1; } mkdir -p "$output_root/reports" "$output_root/diagnostics" -if [[ "$keep_intermediates" == true ]]; then - intermediate_dir=$output_root/reports/intermediates -else - intermediate_dir=$(mktemp -d "${TMPDIR:-/tmp}/beffroi-report-sources.XXXXXXXX") - trap 'rm -rf "$intermediate_dir"' EXIT -fi - -reports/tools/convert-legacy-reports.sh reports/reports "$intermediate_dir" -reporter/tools/validate-all.sh "$intermediate_dir" -reporter/tools/render-all.sh "$intermediate_dir" --output-dir "$output_root/reports/pdfs" +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 if [[ "$include_json" == true ]]; then - cp -R "$intermediate_dir/." "$output_root/reports/pdfs/" + reporter/tools/export-json-all.sh reports/reports --output-dir "$output_root/reports/pdfs" while IFS= read -r -d '' source; do relative=${source#reports/diagnostics/} mkdir -p "$output_root/diagnostics/$(dirname "$relative")" diff --git a/scripts/check-components.sh b/scripts/check-components.sh index a138f2b..dc2a5a9 100755 --- a/scripts/check-components.sh +++ b/scripts/check-components.sh @@ -42,6 +42,9 @@ BRANDING_ROOT="$(pwd)/reports" \ BRANDING_DIRECTORY="$(pwd)/reports/config/branding" \ reports/tests/test.sh +echo 'Checking stored Reportist YAML' +reporter/tools/validate-all.sh reports/reports + pipeline_check_parent="$(mktemp -d "${TMPDIR:-/tmp}/beffroi-pipeline-check.XXXXXX")" trap 'rm -rf -- "$pipeline_check_parent"' EXIT pipeline_check_root="$pipeline_check_parent/run"