From 587d039076e8db23b9d1a3d4cf72b9b7b4845ab5 Mon Sep 17 00:00:00 2001 From: Dandaedre Date: Wed, 16 Sep 2026 01:38:33 +0200 Subject: [PATCH] chore: remove legacy reference repositories --- .gitmodules | 8 -- diagnostics | 2 +- docs/migration-baseline.md | 66 ---------------- references/WinDiagnostics | 1 - references/typist_reporter | 1 - reporter | 2 +- tests/check-legacy-baseline.py | 139 --------------------------------- 7 files changed, 2 insertions(+), 217 deletions(-) delete mode 100644 docs/migration-baseline.md delete mode 160000 references/WinDiagnostics delete mode 160000 references/typist_reporter delete mode 100644 tests/check-legacy-baseline.py diff --git a/.gitmodules b/.gitmodules index b3a640c..86db698 100644 --- a/.gitmodules +++ b/.gitmodules @@ -9,11 +9,3 @@ [submodule "win-diagnostics"] path = diagnostics url = https://proxy.dandaedre.com/gitea/Beffroi/win-diagnostics.git - -[submodule "references/WinDiagnostics"] - path = references/WinDiagnostics - url = https://proxy.dandaedre.com/gitea/Beffroi/WinDiagnostics.git - -[submodule "references/typist_reporter"] - path = references/typist_reporter - url = https://proxy.dandaedre.com/gitea/Beffroi/typst_reporter.git diff --git a/diagnostics b/diagnostics index c28c4ec..5770b61 160000 --- a/diagnostics +++ b/diagnostics @@ -1 +1 @@ -Subproject commit c28c4ec2701017a9fc0690dad9eef68225a9fa58 +Subproject commit 5770b61460ed69a095331916d6b5febcfc465182 diff --git a/docs/migration-baseline.md b/docs/migration-baseline.md deleted file mode 100644 index ce93e89..0000000 --- a/docs/migration-baseline.md +++ /dev/null @@ -1,66 +0,0 @@ -# First migration baseline - -## Run - -Requirements: Python 3, Git, Typst, Poppler's `pdftotext`, DejaVu Sans and DejaVu -Sans Mono fonts. Dependencies are checked, not installed automatically. -Choose a new output directory: - -```bash -uv venv --python 3.11 --allow-existing .venv/root-tests -uv run --python .venv/root-tests/bin/python tests/check-legacy-baseline.py --output /tmp/beffroi-baseline-review -``` - -The runner reads an explicit source allowlist from legacy renderer commit -`1d381904fff3d378a7c0e04588e75310a9b7ed60`, stages it in a temporary directory, -and executes synthetic fixtures owned by the destination components. It never -materializes legacy real captures/reports or modifies reference working trees. -Temporary sources are removed after execution. - -Outputs: five diagnostic PDFs, two example report PDFs, observed diagnostic JSON, -and a manifest of source revision, fixture hashes, Typst version, available -DejaVu fonts, and negative checks. Existing output directories are rejected. -PDFs are review artifacts, not committed content. - -## Verification - -- Five snapshots match reviewed expected diagnostic output: collection coverage, - findings, grouping, severity/confidence, and system facts. -- Independent assertions cover schema-1 service failure, schema-2 event counts and - grouping, incomplete-collection confidence, Compact unavailable checks, - unexpected collection status, and six watchlist candidate matches. -- Seven PDFs compile, have PDF signatures, and contain expected extracted titles. -- Missing author/date and an unknown theme fail with expected errors. - -This is a legacy comparison harness, **not the new integration pipeline**. -The new diagnostic schema, renderer, adapter and full pipeline remain -unimplemented. The old regression entry point mixes synthetic tests with private -captures and is deliberately not executed by this harness. - -## Observations and limits - -Initial run: 2026-09-15, Linux, Typst `0.15.1 (586e1bd4)`. PowerShell is absent; -no native collection ran. Font versions and metadata affect PDF bytes, so byte -identity is not asserted. The fixture dates explicitly fix analysis reference time. - -Schema-1 produces one service failure. Full/partial schema-2 preserves unknown -events and caps incomplete-collection confidence at 50. Compact unavailable checks -with zero counts remain unavailable. Its legacy display still shows a high numeric -score despite partial collection: this is observed behavior, not an accepted new -health contract. Generic synthetic reports still acquire the Beffroi logo. - -First-page visual review covered the technical report and Compact diagnostic: -both were readable without visible clipping and the diagnostic showed its partial -collection warning. Other pages, long-content pagination and alternate branding -remain open. Synthetic checks do not verify historical content or advisory -accuracy. Linked vendor guidance has not been revalidated. - -## Next pass - -- [Diagnostic inventory and draft contract](../diagnostics/docs/migration-inventory.md) -- [Renderer inventory and draft field mapping](../reporter/docs/migration-inventory.md) -- [Private preservation and adapter decisions](../reports/docs/migration-inventory.md) - -Implement versioned schemas with valid/invalid synthetic examples, then extract -one offline diagnostic and generic rendering slice against this baseline. Finish -private incident evidence mapping before claiming historical migration is verified. diff --git a/references/WinDiagnostics b/references/WinDiagnostics deleted file mode 160000 index 1de4d42..0000000 --- a/references/WinDiagnostics +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 1de4d425ecca3a97bcbffd4c8b5ebec464810ac8 diff --git a/references/typist_reporter b/references/typist_reporter deleted file mode 160000 index 1d38190..0000000 --- a/references/typist_reporter +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 1d381904fff3d378a7c0e04588e75310a9b7ed60 diff --git a/reporter b/reporter index a41ba1b..eff5e62 160000 --- a/reporter +++ b/reporter @@ -1 +1 @@ -Subproject commit a41ba1bb87ce91f47f5ca154e27a815f48954034 +Subproject commit eff5e623b75a74430025a3218a132708046063f2 diff --git a/tests/check-legacy-baseline.py b/tests/check-legacy-baseline.py deleted file mode 100644 index 1331a34..0000000 --- a/tests/check-legacy-baseline.py +++ /dev/null @@ -1,139 +0,0 @@ -#!/usr/bin/env python3 -"""Reproduce the migration baseline without modifying the legacy repositories.""" - -import argparse -import hashlib -import json -from pathlib import Path -import shutil -import subprocess -import tempfile - - -ROOT = Path(__file__).resolve().parents[1] -SOURCE = ROOT / "references/typist_reporter" -REVISION = "1d381904fff3d378a7c0e04588e75310a9b7ed60" -FIXTURES = ROOT / "diagnostics/tests/fixtures/legacy" -REPORTS = ROOT / "reporter/tests/fixtures/legacy" -EXPECTED = ROOT / "diagnostics/tests/legacy-baseline.json" -# Explicit allowlist: never materialize real reports or diagnostic captures. -SOURCE_FILES = ( - "LICENSE", "report.typ", "diagnostics.typ", "modules/model.typ", - "modules/diagnostics-model.typ", "modules/diagnostics-normalize.typ", - "config/themes.yaml", "config/diagnostics-rules.yaml", - "config/diagnostics-watchlist.yaml", "assets/beffroi.png", -) -BRIDGE = '''#import "modules/diagnostics-normalize.typ": normalize -#let data = normalize(json(sys.inputs.at("fixture")), - rules: yaml("config/diagnostics-rules.yaml"), source-name: "synthetic fixture") -#metadata(( - schema_version: data.schema_version, - mode: data.mode, - collection_incomplete: data.collection_incomplete, - analysis_confidence: data.analysis_confidence, - health_score: data.health_score, - event_counts: data.event_counts, - issue_counts: data.issue_counts, - system: data.system, - findings: data.findings, - event_groups: data.event_groups, - coverage: data.coverage, -)) -''' - - -def run(*args, cwd=None): - return subprocess.run(args, cwd=cwd, check=True, capture_output=True).stdout - - -def verify_semantics(results): - v1 = results["windiagnostics-v1"] - assert v1["system"]["ram_total_gb"] == 31.82 - assert any(f["title"] == "Service Control Manager ยท Event 7000" - for f in v1["findings"]) - full = results["windiagnostics-v2-full"] - assert full["event_counts"] == dict(critical=0, error=1, warning=2, information=1, unknown=0) - assert full["collection_incomplete"] and full["analysis_confidence"] <= 50 - assert any(e["level"] == 3 and e["count"] == 2 for e in full["event_groups"]) - compact = results["windiagnostics-v2-compact"] - assert not any(f["title"] == "Devices report problems" for f in compact["findings"]) - partial = results["windiagnostics-v2-partial"] - assert any(c["section"] == "services" and c["severity"] == "warning" - for c in partial["coverage"]) - watch = results["windiagnostics-watchlist"] - assert [f["watch_id"] for f in watch["findings"] if "watch_id" in f] == [ - "winring0", "dell-dbutil", "gigabyte-oc-guru", "obs-overlay", "obs-audio-hooks", "smb1"] - assert all(f["weight_factor"] == 0 for f in watch["findings"] if "watch_id" in f) - - -def main(): - parser = argparse.ArgumentParser(description=__doc__) - parser.add_argument("--output", type=Path, required=True, help="New directory for PDFs and observed JSON") - args = parser.parse_args() - for tool in ("git", "typst", "pdftotext"): - if not shutil.which(tool): - parser.error(f"{tool} is required; install it explicitly before running this check") - if args.output.exists(): - parser.error("output directory already exists; choose a new directory") - output = args.output.resolve() - output.mkdir(parents=True) - results = {} - manifest = {"source_revision": REVISION, "typst": run("typst", "--version").decode().strip(), - "fixture_sha256": {}, "pdfs": []} - with tempfile.TemporaryDirectory(prefix="beffroi-legacy-baseline-") as directory: - work = Path(directory) - for name in SOURCE_FILES: - target = work / name - target.parent.mkdir(parents=True, exist_ok=True) - target.write_bytes(run("git", "-C", str(SOURCE), "show", f"{REVISION}:{name}")) - (work / "baseline.typ").write_text(BRIDGE) - for fixture in sorted(FIXTURES.glob("*.json")): - shutil.copyfile(fixture, work / fixture.name) - manifest["fixture_sha256"][fixture.name] = hashlib.sha256(fixture.read_bytes()).hexdigest() - raw = run("typst", "query", "--root", directory, "--input", f"fixture={fixture.name}", - "baseline.typ", "", "--field", "value", "--one", cwd=work) - results[fixture.stem] = json.loads(raw) - pdf = output / f"{fixture.stem}.pdf" - run("typst", "compile", "--root", directory, "--input", f"diagnostics={fixture.name}", - "--input", "author=Synthetic baseline", "diagnostics.typ", str(pdf), cwd=work) - manifest["pdfs"].append(pdf.name) - verify_semantics(results) - for fixture in sorted(REPORTS.glob("*.yaml")): - shutil.copyfile(fixture, work / fixture.name) - manifest["fixture_sha256"][fixture.name] = hashlib.sha256(fixture.read_bytes()).hexdigest() - pdf = output / f"report-{fixture.stem}.pdf" - run("typst", "compile", "--root", directory, "--input", f"report={fixture.name}", - "report.typ", str(pdf), cwd=work) - manifest["pdfs"].append(pdf.name) - for name, content, message in ( - ("missing-author", 'metadata:\n Date: "2026-09-15"\n', "metadata.Author"), - ("missing-date", 'metadata:\n Author: "Synthetic"\n', "metadata.Date"), - ("unknown-theme", 'theme: unknown\nmetadata:\n Author: "Synthetic"\n Date: "2026-09-15"\n', "Unknown report theme"), - ): - (work / "invalid.yaml").write_text(content) - result = subprocess.run(["typst", "compile", "--input", "report=invalid.yaml", - "report.typ", str(work / "invalid.pdf")], cwd=work, capture_output=True) - assert result.returncode != 0 and message in result.stderr.decode(), name - manifest["negative_checks"] = ["missing-author", "missing-date", "unknown-theme"] - for name in manifest["pdfs"]: - assert (output / name).read_bytes().startswith(b"%PDF-"), name - text = run("pdftotext", str(output / name), "-").decode() - expected_title = {"report-minimal.pdf": "Short report title", - "report-technical.pdf": "Service Interruption Investigation"}.get( - name, "Windows diagnostic assessment") - assert expected_title in " ".join(text.split()), f"Missing rendered title: {name}" - manifest["fonts"] = [font for font in run("typst", "fonts").decode().splitlines() - if "DejaVu" in font] - (output / "diagnostics.json").write_text(json.dumps(results, indent=2, ensure_ascii=False) + "\n") - (output / "manifest.json").write_text(json.dumps(manifest, indent=2) + "\n") - if not EXPECTED.exists(): - parser.exit(1, f"Observed baseline written to {output}; reviewed expected snapshot is missing\n") - assert results == json.loads(EXPECTED.read_text()), "Diagnostic baseline differs; inspect diagnostics.json" - print(f"PASS: 5 diagnostic snapshots, 7 PDFs, 3 invalid inputs; artifacts: {output}") - - -if __name__ == "__main__": - try: - main() - except subprocess.CalledProcessError as error: - raise SystemExit(error.stderr.decode(errors="replace")) from error