diff --git a/CHANGELOG.md b/CHANGELOG.md index e9aac4e..e5e49c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,54 @@ All notable changes to `cloverleaf-larry` / `larry-anywhere` are recorded here. Versioning is loose-semver; bumps trigger the in-process self-update on every running client via `LARRY_BASE_URL` + `MANIFEST`. +## v0.9.11 — 2026-07-23 + +Small UX patch on top of v0.9.10's `hl7-diff-set`, both from Bryan's live +feedback after a successful first run (`lib/hl7-diff-set.sh` only; no change +to `hl7-diff.sh` / the F-8 engine): + +1. **Docs/help clarity: `--dir` already defaulted to the current directory.** + Bryan reported he had to pass `--dir` explicitly. Investigated and + confirmed the v0.9.10 code already defaults `DIR="."` and only overrides + on an explicit `--dir` — verified working both via the `bin/` wrapper and + directly, with `LARRY_LIB_DIR`/`LARRY_HOME` unset, from inside a fixture + directory (`dir=.` in the header output confirms it). No functional + change was needed; `--help` and the top-of-file usage comment now state + the default up front with a "run from inside the directory, no --dir + needed" example first (previously every example showed `--dir` explicitly, + which read as if it were required). +2. **Fix: label which side is left vs right, up front.** The per-diff-line + `left=... right=...` labels (F-8, v0.9.10) say a value came from "left" + or "right" but never stated WHICH FILE PREFIX left/right actually is. + Every run now prints an identification header naming both sides + explicitly: + ``` + left (baseline) = adt_in_regression_out_windows_single.* + right (candidate) = adt_in_regression_out_linux_single.* + ``` + First positional arg is always left/baseline, second is always + right/candidate — consistently, everywhere; the header states this so + Bryan never has to guess or remember which prefix is which. Per-route + filenames were already surfaced for MISSING/EXTRA routes (the dropped/new + file path) and for DIFF routes (the embedded `hl7-diff --format text` + detail already prints `left: ` / `right: `) — unchanged. + `--format text`: header prints to stdout as part of the normal report. + `--format tsv`: header prints to STDERR (same as the summary line) so + stdout stays pure machine-parseable tsv rows. + +`VERSION`: `0.9.10` → `0.9.11`. `LARRY_VERSION` in `larry.sh` bumped to +match. `MANIFEST` regenerated (`scripts/make-manifest.sh`, `--check` clean). +Self-tested: (a) no `--dir`, run from inside a 4-route mixed fixture +directory (PASS/DIFF/MISSING/EXTRA) and a clean-only fixture — both +correctly show `dir=.` and produce identical results to the equivalent +explicit `--dir` invocation; (b) the identification header correctly names +both prefixes with the left=baseline/right=candidate convention stated, in +both `--format text` (stdout) and `--format tsv` (stderr, confirmed stdout +stays pure tsv with stderr discarded, and the header/summary appear when +stdout is discarded instead). Verified `bash -n` clean and identical output +under both bash 5.3.9 and the real `/bin/bash` 3.2.57 on this Mac. +`make-manifest.sh --check` clean. + ## v0.9.10 — 2026-07-23 New: `hl7-diff-set` (`lib/hl7-diff-set.sh` + `bin/hl7-diff-set`, also runnable diff --git a/MANIFEST b/MANIFEST index 2b45159..517055f 100644 --- a/MANIFEST +++ b/MANIFEST @@ -23,7 +23,7 @@ # scripts/make-manifest.sh and bump VERSION. # Top-level scripts -larry.sh 322316fefec54d88f0a0ac346129874195b6de4786739b2aa43e15a4fa3eb206 +larry.sh d598cf576896504e7caf3c220a2adb8dd4ba85dd7ab6e5b23901cb4452737ef7 larry-tunnel.sh 6b050e4eeab15669f4858eaf3b807f168f211ced07815db9521bc40a093f6aaa larry-auth.sh a220cdf7878569dc3028951ee57fc8d5e706a8ca5c6aa45347b58facb386f831 larry-rollback.sh 91b5e9aa6c79266bf306dcfba4ca791c07971bd6924d67a779037531648aa6d0 @@ -31,9 +31,9 @@ install-larry.sh 19f42e8f6e54eaffffe33e1464a8d245721260aed047270a75987c0b25c936c uninstall-larry.sh c53ad2d8354c7adeb243b541f027f3f481e4a8661eecfd7af14d7ca53cfcaad9 # Metadata -VERSION cd8f34a6873bdd24cb055e5d97d11fc0dac541a6939c13ef3b700c6bd28344e4 -MANUAL.md 7f442b2e3e0bfa7d8cadb588abb3f197dc03bc44f47b84fc5458edba8010ddfa -CHANGELOG.md 4dc1258c1de7ec0d116c881e562140d140d0ca987110c3d2afb060903b4a8cfe +VERSION afb95cbb6514aced3e091a5d8e7e017db52ed7b7faa4dbcdce9685a8f4365c09 +MANUAL.md 88bf5f8244c5e584d889a2e9adfe54a9378475ddef927f9c8ffe2eda815186e2 +CHANGELOG.md fc2b96731ee6ba0c8d0b9c3d1c711e7318a947e72eea616a02d42ab44d0a650c # Agent personas (system-prompt overlays) agents/larry.md 0a1ef737e7fc133ab35be09f79c3a4df33de814e0404b69b950932d0c8a01be1 @@ -75,7 +75,7 @@ lib/journal.sh 1c285df3f5677477c7b675c4f03236823005670b338a1781dd0c73d12fd1424f lib/hl7-sanitize.sh efd333dc3e267cf2280433e53bbb910023d0bc4b30724181b53873b410d83005 lib/hl7-desanitize.sh 2e5462a61ab1e8bd3fefb956bace8ca1ae33397a09024cbe766fa55c37a5aad6 lib/hl7-diff.sh 79e92c5c9326f6dab49673b719259ae46aaa1020b37b8ac91b5a26869f17656b -lib/hl7-diff-set.sh 40d40b1f8e688c584f03bc6efb9645e18daf0fd9081a595b08137d2438619777 +lib/hl7-diff-set.sh 9e8c7adf5df18e0714f473afbe41b11737b431f63d2559ddf9dcac083b94c22f lib/hl7-field.sh a640f7cbd9521dc96171ee1dbdf909170262101a1d7a433f6f0ce2bea8d42b02 lib/hl7-schema.sh 2ba4057a214867ff4950f10057ee4ffd7149e1a82ba94b07b6857d77bf10d75f diff --git a/MANUAL.md b/MANUAL.md index 5fdd74d..d4566e9 100644 --- a/MANUAL.md +++ b/MANUAL.md @@ -450,7 +450,12 @@ adt_in_regression_out_linux_single.lab_adt_out ``` ```bash -# Bryan's real single-site regression directory — the actual command he runs: +# Bryan's real workflow — cd into the directory, no --dir needed (--dir +# DEFAULTS TO THE CURRENT DIRECTORY; it is an override, not required): +cd /opt/cloverleaf/cis2025.01/integrator/adt/data/regression_testing/single +hl7-diff-set adt_in_regression_out_windows_single adt_in_regression_out_linux_single + +# Or from anywhere, with an explicit --dir override: hl7-diff-set adt_in_regression_out_windows_single adt_in_regression_out_linux_single \ --dir /opt/cloverleaf/cis2025.01/integrator/adt/data/regression_testing/single @@ -459,24 +464,36 @@ hl7-diff-set --dir \ --ignore "MSH.7,MSH.10" --framing len10 # Machine-parseable: one row per route, routestatusdiff_count. -# The summary line prints to STDERR in this mode, so stdout stays clean tsv — -# recommended for scripting/CI gates. +# The identification header + summary line print to STDERR in this mode, so +# stdout stays clean tsv — recommended for scripting/CI gates. hl7-diff-set --dir --format tsv ``` +**The first prefix argument is always left/baseline; the second is always +right/candidate — consistently, everywhere.** Every run prints an +identification header stating this explicitly (v0.9.11), so you never have +to guess or remember which prefix is which: + +``` + left (baseline) = adt_in_regression_out_windows_single.* + right (candidate) = adt_in_regression_out_linux_single.* +``` + Auto-discovers routes by globbing both prefixes (`.*`), so a route present on only ONE side is never silently dropped: - both files present, 0 diffs → **PASS** - both files present, N>0 diffs → **DIFF** (`--format text` also prints the - full `hl7-diff --format text` detail, indented, for that route) + full `hl7-diff --format text` detail, indented, for that route — including + its own `left: ` / `right: ` lines naming the exact paired + files for that route) - baseline route has no candidate file → **MISSING** (a dropped output IS a - regression — counts as a failure) + regression — counts as a failure; the dropped file path is shown) - candidate has a route the baseline does not → **EXTRA** (reported, also - counts as non-clean) + counts as non-clean; the unexpected file path is shown) Prints a final summary line, e.g. `4 routes: 3 clean, 1 differs`. **Exit 0 iff every route is PASS — non-zero otherwise — so it is a single scriptable -regression gate:** `hl7-diff-set ... --dir ... || echo "regression FAILED"`. +regression gate:** `hl7-diff-set ... || echo "regression FAILED"`. --- diff --git a/VERSION b/VERSION index 56f3151..8225a4b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.9.10 +0.9.11 diff --git a/larry.sh b/larry.sh index 8f1dccb..1d7fe69 100755 --- a/larry.sh +++ b/larry.sh @@ -100,7 +100,7 @@ set -o pipefail # ───────────────────────────────────────────────────────────────────────────── # Config # ───────────────────────────────────────────────────────────────────────────── -LARRY_VERSION="0.9.10" +LARRY_VERSION="0.9.11" LARRY_HOME="${LARRY_HOME:-$HOME/.larry}" # ───────────────────────────────────────────────────────────────────────────── diff --git a/lib/hl7-diff-set.sh b/lib/hl7-diff-set.sh index bc4aaba..fbc2fad 100755 --- a/lib/hl7-diff-set.sh +++ b/lib/hl7-diff-set.sh @@ -15,15 +15,28 @@ # # Usage: # hl7-diff-set.sh -# [--dir PATH] # directory holding the paired files (default: .) +# [--dir PATH] # directory holding the paired files. +# # DEFAULTS TO THE CURRENT DIRECTORY (.) if +# # omitted -- --dir is an OVERRIDE, not +# # required. Run from inside the regression +# # directory and just pass the two prefixes. # [--ignore "FIELD,..."] # forwarded to hl7-diff. Default: MSH.7 # [--include-fields "F,.."] # forwarded to hl7-diff (overrides --ignore for that set) # [--framing auto|nl|0x1c|len10] # forwarded to hl7-diff. Default: auto # [--format text|tsv] # how THIS command reports. Default: text # +# # from inside the regression directory -- no --dir needed: +# cd /opt/cloverleaf/cis2025.01/integrator/adt/data/regression_testing/single +# hl7-diff-set.sh adt_in_regression_out_windows_single adt_in_regression_out_linux_single +# +# # or from anywhere, with an explicit --dir override: # hl7-diff-set.sh adt_in_regression_out_windows_single adt_in_regression_out_linux_single \ # --dir /opt/cloverleaf/cis2025.01/integrator/adt/data/regression_testing/single # +# The FIRST prefix argument is always LEFT/baseline; the SECOND is always +# RIGHT/candidate -- consistently, everywhere (the per-run header states this +# explicitly so you never have to remember or guess which is which; v0.9.11). +# # What it does: # 1. Globs "/.*", derives each route suffix (the part # after "."), and pairs it with "/.". @@ -47,7 +60,8 @@ # --format tsv prints ONE machine row per route to stdout: # routestatusdiff_count # (diff_count is "-" for MISSING/EXTRA, since no diff was actually run) — -# the summary line still prints, to STDERR, so stdout stays clean tsv. +# the left/right identification header and the summary line still print, +# to STDERR, so stdout stays clean tsv. # Recommended for scripting: hl7-diff.sh's OWN v0.9.9 text-mode message- # header mislabel is fixed as of this release (F-8), but tsv remains the # safer machine-parseable choice regardless. @@ -85,7 +99,7 @@ while [ $# -gt 0 ]; do --include-fields) shift; INCLUDE="$1" ;; --framing) shift; FRAMING="$1" ;; --format) shift; FORMAT="$1" ;; - -h|--help) sed -n '2,52p' "$NC_SELF"; exit 0 ;; + -h|--help) sed -n '2,70p' "$NC_SELF"; exit 0 ;; -*) die "unknown flag: $1" ;; *) if [ -z "$BASE_PREFIX" ]; then BASE_PREFIX="$1" @@ -135,9 +149,25 @@ diff_args=(--ignore "$IGNORE" --framing "$FRAMING") n_routes=0 n_pass=0 n_diff=0 n_missing=0 n_extra=0 +# v0.9.11 (Bryan UX ask): name which side is which, ONCE, up front — the +# per-diff-line `left=... right=...` labels (F-8, v0.9.10) tell you a value +# came from "left" or "right", but not WHICH FILE PREFIX left/right actually +# is. First positional arg is always left/baseline, second is always +# right/candidate -- consistently, everywhere -- so state it plainly here. +# text mode: part of the normal stdout report. tsv mode: routed to STDERR +# (same as the summary line) so stdout stays pure machine-parseable tsv rows. if [ "$FORMAT" = "text" ]; then printf 'hl7-diff-set: baseline=%s candidate=%s dir=%s\n' "$BASE_PREFIX" "$CAND_PREFIX" "$DIR" + printf ' left (baseline) = %s.*\n' "$BASE_PREFIX" + printf ' right (candidate) = %s.*\n' "$CAND_PREFIX" printf ' ignore: %s framing: %s\n\n' "$IGNORE" "$FRAMING" +else + { + printf 'hl7-diff-set: baseline=%s candidate=%s dir=%s\n' "$BASE_PREFIX" "$CAND_PREFIX" "$DIR" + printf ' left (baseline) = %s.*\n' "$BASE_PREFIX" + printf ' right (candidate) = %s.*\n' "$CAND_PREFIX" + printf ' ignore: %s framing: %s\n' "$IGNORE" "$FRAMING" + } >&2 fi while IFS= read -r route; do