From 5967f3e843ba4e7442f8ee47ccec861ea31af960 Mon Sep 17 00:00:00 2001 From: Dandaedre Date: Wed, 16 Sep 2026 01:20:41 +0200 Subject: [PATCH] refactor: adopt typst and rust runtime --- AGENTS-TASKS.md | 4 ++-- AGENTS.md | 4 ++-- README.md | 4 ++-- bootstrap.sh | 7 +++---- diagnostics | 2 +- reporter | 2 +- reports | 2 +- scripts/check-components.sh | 4 +++- scripts/check-diagnostic.typ | 4 ++++ scripts/workflow.sh | 4 ++-- 10 files changed, 21 insertions(+), 16 deletions(-) create mode 100644 scripts/check-diagnostic.typ diff --git a/AGENTS-TASKS.md b/AGENTS-TASKS.md index 6226fcb..7501360 100644 --- a/AGENTS-TASKS.md +++ b/AGENTS-TASKS.md @@ -2,14 +2,14 @@ ## Pass 7 — Remove production Python -- [x] P7.1 Rewrite agent instructions and public commands around Make, shell, jq, PowerShell, and Typst; confine Python to uv-managed tests. +- [x] P7.1 Rewrite agent instructions and public commands around Make, shell, Typst, PowerShell, and Rust/Cargo; confine Python to uv-managed tests. - [x] P7.2 Replace win-diagnostics Python normalization, analysis, and validation without changing contract or rule outcomes. - [x] P7.3 Replace beffroi-reports Python adaptation and immutable publication while preserving race safety and regeneration guarantees. - [x] P7.4 Replace Reportist Python validation/rendering while preserving input, asset, overwrite, and standalone behavior. - [x] P7.5 Remove Python from bootstrap and runtime dependency checks; make uv and Python test-only dependencies. - [x] P7.6 Run component tests through uv, then verify capture-to-PDF integration without Python on the runtime PATH. -Validation: 70 component tests pass through uv-managed environments, including all five owning-validator adapter integration tests. The root workflow then performs capture analysis, draft generation, validation, and PDF rendering using only shell, jq, Typst, and the native publication helper. +Validation: 70 component tests pass through uv-managed environments, including all five owning-validator adapter integration tests. The root workflow then performs capture analysis, draft generation, validation, and PDF rendering using only shell, Typst, and the Rust publication helper. ## How to use this tracker diff --git a/AGENTS.md b/AGENTS.md index aaeda54..3c661ae 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -119,8 +119,8 @@ actually owns it. ## Implementation constraints -Production workflows use Make, POSIX-oriented shell, jq, PowerShell where -Windows collection requires it, and Typst. Python is allowed only under test +Production workflows use Make, POSIX-oriented shell, Typst, Rust for the +publication helper, and PowerShell where Windows collection requires it. Python is allowed only under test directories as a test harness or independent oracle; it must never be required to bootstrap, analyse, adapt, validate, render, package, or publish a report. diff --git a/README.md b/README.md index 6dc9072..aa7163f 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,8 @@ versions and high-level commands for the complete workflow. ## Requirements -The runtime uses Bash, Git, Make, jq, Typst 0.15 or newer, and a C compiler. -The compiler builds a small helper used for atomic, no-replace publication. +The runtime uses Bash, Git, Make, Typst 0.15 or newer, and Rust/Cargo. Cargo +installs a small helper used for atomic, no-replace publication. Selected report fonts must also be installed; the examples use DejaVu Sans and DejaVu Sans Mono. diff --git a/bootstrap.sh b/bootstrap.sh index 7076abe..5df2060 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -13,12 +13,12 @@ elif [[ $# -ne 0 ]]; then fi missing=() -for command in git make jq typst cc; do +for command in git make typst cargo; do command -v "$command" >/dev/null 2>&1 || missing+=("$command") done if ((${#missing[@]})); then echo "Missing required tools: ${missing[*]}" >&2 - echo 'Install Git, Make, jq, Typst, and a C compiler, then rerun bootstrap.' >&2 + echo 'Install Git, Make, Typst, and Rust/Cargo, then rerun bootstrap.' >&2 exit 1 fi @@ -41,9 +41,8 @@ while IFS= read -r status; do fi done < <(git submodule status --recursive) git --version -jq --version typst --version -cc --version | head -n 1 +cargo --version if $check_only; then echo 'Pinned components and required tools are available.' diff --git a/diagnostics b/diagnostics index 00a7e81..e1ae8bb 160000 --- a/diagnostics +++ b/diagnostics @@ -1 +1 @@ -Subproject commit 00a7e8122c654b8e7650aeb41009ac616bbca7fb +Subproject commit e1ae8bb5dfb30ed53cc19f2755d9aa81fde665fc diff --git a/reporter b/reporter index a82bda2..5902c6b 160000 --- a/reporter +++ b/reporter @@ -1 +1 @@ -Subproject commit a82bda2b4fd83eee118c81c3e7dd357bfcf14011 +Subproject commit 5902c6bc436fab99d055ad668d3d903fb58cf258 diff --git a/reports b/reports index c401e9f..419132b 160000 --- a/reports +++ b/reports @@ -1 +1 @@ -Subproject commit c401e9fb585d91f05b78c22acc796c408adc59ba +Subproject commit 419132b85f737f967fea71a823c8e80dc4c2b536 diff --git a/scripts/check-components.sh b/scripts/check-components.sh index b1b7a9a..d1a9877 100644 --- a/scripts/check-components.sh +++ b/scripts/check-components.sh @@ -44,7 +44,9 @@ bash scripts/workflow.sh all \ "$pipeline_check_root" \ 2026-09-15T12:00:00Z \ 'Synthetic diagnostic draft' 'CI Test' 2026-09-15 -jq -e '.findings[0].id == "event-service-control-manager-7000" and .findings[0].evidence == ["event-recent_system_errors-1"]' "$pipeline_check_root/diagnostic.json" >/dev/null +cp scripts/check-diagnostic.typ "$pipeline_check_root/check-diagnostic.typ" +typst query --root "$pipeline_check_root" --input diagnostic=diagnostic.json \ + "$pipeline_check_root/check-diagnostic.typ" '' --field value --one >/dev/null test "$(head -c 5 "$pipeline_check_root/report.pdf")" = '%PDF-' echo 'Component suites and the raw-capture-to-PDF integration pipeline passed.' diff --git a/scripts/check-diagnostic.typ b/scripts/check-diagnostic.typ new file mode 100644 index 0000000..c4ba218 --- /dev/null +++ b/scripts/check-diagnostic.typ @@ -0,0 +1,4 @@ +#let diagnostic = json(sys.inputs.at("diagnostic")) +#assert(diagnostic.findings.first().id == "event-service-control-manager-7000") +#assert(diagnostic.findings.first().evidence == ("event-recent_system_errors-1",)) +#metadata(true) diff --git a/scripts/workflow.sh b/scripts/workflow.sh index aa0d8ee..4f2e4af 100755 --- a/scripts/workflow.sh +++ b/scripts/workflow.sh @@ -21,8 +21,8 @@ require_values() { done } -for executable in jq typst; do command -v "$executable" >/dev/null || { echo "Missing runtime dependency: $executable" >&2; exit 1; }; done -[[ -x reports/build/publish-exclusive ]] || make -C reports build +for executable in typst cargo; do command -v "$executable" >/dev/null || { echo "Missing runtime dependency: $executable" >&2; exit 1; }; done +[[ -x reports/.tools/bin/publish-exclusive ]] || make -C reports build analyse() { [[ $# -eq 4 ]] || usage