|
| 1 | +<!-- markdownlint-disable-next-line MD041 --> |
| 2 | +# Offline Real-History Corpus |
| 3 | + |
| 4 | +This note defines the phase-1 contract for the offline real-history corpus |
| 5 | +seeded by issue `#894`. |
| 6 | + |
| 7 | +## Checked-in inputs |
| 8 | + |
| 9 | +- Target catalog: `fixtures/real-history/offline-corpus.targets.json` |
| 10 | +- Catalog schema: |
| 11 | + `docs/schemas/offline-real-history-corpus-targets-v1.schema.json` |
| 12 | +- Run envelope schema: |
| 13 | + `docs/schemas/offline-real-history-corpus-run-v1.schema.json` |
| 14 | +- Seed target: `icon-editor-settings-init` |
| 15 | + - repo slug: `svelderrainruiz/labview-icon-editor` |
| 16 | + - target VI: |
| 17 | + `resource/plugins/NIIconEditor/Miscellaneous/Settings Init.vi` |
| 18 | + - requested modes: `default`, `attributes` |
| 19 | + |
| 20 | +The checked-in catalog is intentionally small. It captures the seed slice and |
| 21 | +the storage policy, not bulky raw reports. |
| 22 | + |
| 23 | +## Generated outputs |
| 24 | + |
| 25 | +Offline corpus runs write under: |
| 26 | + |
| 27 | +- `tests/results/offline-real-history/<target-id>/<run-id>/` |
| 28 | + |
| 29 | +Each run directory contains: |
| 30 | + |
| 31 | +- `offline-real-history-run.json` |
| 32 | + - schema: `vi-history/offline-real-history-run@v1` |
| 33 | + - records repo/ref selection, requested and executed modes, compare policy, |
| 34 | + NI image identity, LabVIEW version hint, CLI path, and output paths |
| 35 | +- `history/` |
| 36 | + - aggregate `Compare-VIHistory` manifest |
| 37 | + - per-mode manifests |
| 38 | + - rendered `history-report.md` and `history-report.html` |
| 39 | + - translated `lvcompare-capture.json` files |
| 40 | + - raw `ni-windows-container-capture.json` files |
| 41 | + |
| 42 | +Raw artifacts stay local under `tests/results/`; they are not committed to git. |
| 43 | + |
| 44 | +## Harness |
| 45 | + |
| 46 | +Entry point: |
| 47 | + |
| 48 | +```powershell |
| 49 | +node tools/npm/run-script.mjs history:corpus:offline -- --PlanOnly |
| 50 | +``` |
| 51 | + |
| 52 | +The harness: |
| 53 | + |
| 54 | +1. Loads the checked-in target catalog. |
| 55 | +2. Resolves a local external repo path from `-RepoPath` or the catalog's local |
| 56 | + path hints. |
| 57 | +3. Reuses `Compare-VIHistory.ps1`. |
| 58 | +4. Routes pair execution through |
| 59 | + `tools/Invoke-NIWindowsContainerCompareBridge.ps1`. |
| 60 | +5. Emits the run envelope plus standard VI history outputs. |
| 61 | + |
| 62 | +The bridge calls `tools/Run-NIWindowsContainerCompare.ps1` so history capture |
| 63 | +uses the existing NI Windows container lane instead of a parallel compare path. |
| 64 | + |
| 65 | +## Local refresh flow |
| 66 | + |
| 67 | +Prerequisites: |
| 68 | + |
| 69 | +- a local checkout of the external repo already exists |
| 70 | +- the NI Windows image already exists locally |
| 71 | +- Docker Desktop is running in Windows container mode |
| 72 | + |
| 73 | +Plan without running the corpus: |
| 74 | + |
| 75 | +```powershell |
| 76 | +node tools/npm/run-script.mjs history:corpus:offline -- --PlanOnly --RunId plan-only |
| 77 | +``` |
| 78 | + |
| 79 | +Run the seeded slice against an existing checkout: |
| 80 | + |
| 81 | +```powershell |
| 82 | +node tools/npm/run-script.mjs history:corpus:offline -- ` |
| 83 | + --TargetId icon-editor-settings-init ` |
| 84 | + --RepoPath ..\labview-icon-editor ` |
| 85 | + --RunId local-smoke |
| 86 | +``` |
| 87 | + |
| 88 | +Useful overrides: |
| 89 | + |
| 90 | +- `-WindowsImage <tag>` to pin a different local NI Windows image |
| 91 | +- `-WindowsLabVIEWPath <path>` to record a different in-container LabVIEW path |
| 92 | +- `-WindowsCliPath <path>` to record a different in-container CLI path |
| 93 | +- `-ComparePolicy <policy>` to annotate the capture envelope |
| 94 | +- `-CompareTimeoutSeconds <n>` to raise or lower pair timeout |
| 95 | + |
| 96 | +The harness does not clone or pull the external repository. Refresh is |
| 97 | +explicitly local/offline once the repo and image already exist on disk. |
| 98 | + |
| 99 | +## Storage boundary |
| 100 | + |
| 101 | +- Commit: the seed catalog and schemas |
| 102 | +- Keep local-only: raw HTML/XML/text reports, translated capture JSON, raw |
| 103 | + NI-container capture JSON, stdout/stderr, and per-run history bundles |
| 104 | + |
| 105 | +That boundary keeps the repository deterministic while still preserving real |
| 106 | +execution evidence on the operator machine. |
0 commit comments