v0.9.11: hl7-diff-set left/right identification header + cwd-default docs
Two Bryan UX asks on the batch route-set compare:
1. Identification header now labels which file is left vs right, with the
REAL matched filenames:
left (baseline) = <windows-prefix>.*
right (candidate) = <linux-prefix>.*
Printed to stdout on --format text; to stderr on --format tsv (keeps
stdout pure tsv). No change to PASS/DIFF/MISSING/EXTRA classification or
exit codes (0=clean, 1=any non-clean, 2=usage).
2. --dir already defaulted to cwd (DIR="." in v0.9.10) — this only fixes the
docs (usage header, --help, MANUAL.md) to lead with the no---dir,
cd-into-the-dir example.
Vera CODE-PASS (agent ade4360f): 0 defects; ran the scripts live against a
4-route fixture (PASS/DIFF/MISSING/EXTRA), verified header/stream-separation,
bash -n clean under /bin/bash 3.2.57, make-manifest --check clean, VERSION +
larry.sh agree at 0.9.11. Live-acceptance owner: Bryan (Gundersen box).
This commit is contained in:
parent
4828862a8e
commit
0046e88a8d
48
CHANGELOG.md
48
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
|
Versioning is loose-semver; bumps trigger the in-process self-update on every
|
||||||
running client via `LARRY_BASE_URL` + `MANIFEST`.
|
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: <file>` / `right: <file>`) — 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
|
## v0.9.10 — 2026-07-23
|
||||||
|
|
||||||
New: `hl7-diff-set` (`lib/hl7-diff-set.sh` + `bin/hl7-diff-set`, also runnable
|
New: `hl7-diff-set` (`lib/hl7-diff-set.sh` + `bin/hl7-diff-set`, also runnable
|
||||||
|
|||||||
10
MANIFEST
10
MANIFEST
@ -23,7 +23,7 @@
|
|||||||
# scripts/make-manifest.sh and bump VERSION.
|
# scripts/make-manifest.sh and bump VERSION.
|
||||||
|
|
||||||
# Top-level scripts
|
# Top-level scripts
|
||||||
larry.sh 322316fefec54d88f0a0ac346129874195b6de4786739b2aa43e15a4fa3eb206
|
larry.sh d598cf576896504e7caf3c220a2adb8dd4ba85dd7ab6e5b23901cb4452737ef7
|
||||||
larry-tunnel.sh 6b050e4eeab15669f4858eaf3b807f168f211ced07815db9521bc40a093f6aaa
|
larry-tunnel.sh 6b050e4eeab15669f4858eaf3b807f168f211ced07815db9521bc40a093f6aaa
|
||||||
larry-auth.sh a220cdf7878569dc3028951ee57fc8d5e706a8ca5c6aa45347b58facb386f831
|
larry-auth.sh a220cdf7878569dc3028951ee57fc8d5e706a8ca5c6aa45347b58facb386f831
|
||||||
larry-rollback.sh 91b5e9aa6c79266bf306dcfba4ca791c07971bd6924d67a779037531648aa6d0
|
larry-rollback.sh 91b5e9aa6c79266bf306dcfba4ca791c07971bd6924d67a779037531648aa6d0
|
||||||
@ -31,9 +31,9 @@ install-larry.sh 19f42e8f6e54eaffffe33e1464a8d245721260aed047270a75987c0b25c936c
|
|||||||
uninstall-larry.sh c53ad2d8354c7adeb243b541f027f3f481e4a8661eecfd7af14d7ca53cfcaad9
|
uninstall-larry.sh c53ad2d8354c7adeb243b541f027f3f481e4a8661eecfd7af14d7ca53cfcaad9
|
||||||
|
|
||||||
# Metadata
|
# Metadata
|
||||||
VERSION cd8f34a6873bdd24cb055e5d97d11fc0dac541a6939c13ef3b700c6bd28344e4
|
VERSION afb95cbb6514aced3e091a5d8e7e017db52ed7b7faa4dbcdce9685a8f4365c09
|
||||||
MANUAL.md 7f442b2e3e0bfa7d8cadb588abb3f197dc03bc44f47b84fc5458edba8010ddfa
|
MANUAL.md 88bf5f8244c5e584d889a2e9adfe54a9378475ddef927f9c8ffe2eda815186e2
|
||||||
CHANGELOG.md 4dc1258c1de7ec0d116c881e562140d140d0ca987110c3d2afb060903b4a8cfe
|
CHANGELOG.md fc2b96731ee6ba0c8d0b9c3d1c711e7318a947e72eea616a02d42ab44d0a650c
|
||||||
|
|
||||||
# Agent personas (system-prompt overlays)
|
# Agent personas (system-prompt overlays)
|
||||||
agents/larry.md 0a1ef737e7fc133ab35be09f79c3a4df33de814e0404b69b950932d0c8a01be1
|
agents/larry.md 0a1ef737e7fc133ab35be09f79c3a4df33de814e0404b69b950932d0c8a01be1
|
||||||
@ -75,7 +75,7 @@ lib/journal.sh 1c285df3f5677477c7b675c4f03236823005670b338a1781dd0c73d12fd1424f
|
|||||||
lib/hl7-sanitize.sh efd333dc3e267cf2280433e53bbb910023d0bc4b30724181b53873b410d83005
|
lib/hl7-sanitize.sh efd333dc3e267cf2280433e53bbb910023d0bc4b30724181b53873b410d83005
|
||||||
lib/hl7-desanitize.sh 2e5462a61ab1e8bd3fefb956bace8ca1ae33397a09024cbe766fa55c37a5aad6
|
lib/hl7-desanitize.sh 2e5462a61ab1e8bd3fefb956bace8ca1ae33397a09024cbe766fa55c37a5aad6
|
||||||
lib/hl7-diff.sh 79e92c5c9326f6dab49673b719259ae46aaa1020b37b8ac91b5a26869f17656b
|
lib/hl7-diff.sh 79e92c5c9326f6dab49673b719259ae46aaa1020b37b8ac91b5a26869f17656b
|
||||||
lib/hl7-diff-set.sh 40d40b1f8e688c584f03bc6efb9645e18daf0fd9081a595b08137d2438619777
|
lib/hl7-diff-set.sh 9e8c7adf5df18e0714f473afbe41b11737b431f63d2559ddf9dcac083b94c22f
|
||||||
lib/hl7-field.sh a640f7cbd9521dc96171ee1dbdf909170262101a1d7a433f6f0ce2bea8d42b02
|
lib/hl7-field.sh a640f7cbd9521dc96171ee1dbdf909170262101a1d7a433f6f0ce2bea8d42b02
|
||||||
lib/hl7-schema.sh 2ba4057a214867ff4950f10057ee4ffd7149e1a82ba94b07b6857d77bf10d75f
|
lib/hl7-schema.sh 2ba4057a214867ff4950f10057ee4ffd7149e1a82ba94b07b6857d77bf10d75f
|
||||||
|
|
||||||
|
|||||||
31
MANUAL.md
31
MANUAL.md
@ -450,7 +450,12 @@ adt_in_regression_out_linux_single.lab_adt_out
|
|||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```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 \
|
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
|
--dir /opt/cloverleaf/cis2025.01/integrator/adt/data/regression_testing/single
|
||||||
|
|
||||||
@ -459,24 +464,36 @@ hl7-diff-set <baseline-prefix> <candidate-prefix> --dir <path> \
|
|||||||
--ignore "MSH.7,MSH.10" --framing len10
|
--ignore "MSH.7,MSH.10" --framing len10
|
||||||
|
|
||||||
# Machine-parseable: one row per route, route<TAB>status<TAB>diff_count.
|
# Machine-parseable: one row per route, route<TAB>status<TAB>diff_count.
|
||||||
# The summary line prints to STDERR in this mode, so stdout stays clean tsv —
|
# The identification header + summary line print to STDERR in this mode, so
|
||||||
# recommended for scripting/CI gates.
|
# stdout stays clean tsv — recommended for scripting/CI gates.
|
||||||
hl7-diff-set <baseline-prefix> <candidate-prefix> --dir <path> --format tsv
|
hl7-diff-set <baseline-prefix> <candidate-prefix> --dir <path> --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 (`<prefix>.*`), so a route
|
Auto-discovers routes by globbing both prefixes (`<prefix>.*`), so a route
|
||||||
present on only ONE side is never silently dropped:
|
present on only ONE side is never silently dropped:
|
||||||
- both files present, 0 diffs → **PASS**
|
- both files present, 0 diffs → **PASS**
|
||||||
- both files present, N>0 diffs → **DIFF** (`--format text` also prints the
|
- 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: <file>` / `right: <file>` lines naming the exact paired
|
||||||
|
files for that route)
|
||||||
- baseline route has no candidate file → **MISSING** (a dropped output IS a
|
- 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
|
- 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
|
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
|
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"`.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
2
larry.sh
2
larry.sh
@ -100,7 +100,7 @@ set -o pipefail
|
|||||||
# ─────────────────────────────────────────────────────────────────────────────
|
# ─────────────────────────────────────────────────────────────────────────────
|
||||||
# Config
|
# Config
|
||||||
# ─────────────────────────────────────────────────────────────────────────────
|
# ─────────────────────────────────────────────────────────────────────────────
|
||||||
LARRY_VERSION="0.9.10"
|
LARRY_VERSION="0.9.11"
|
||||||
LARRY_HOME="${LARRY_HOME:-$HOME/.larry}"
|
LARRY_HOME="${LARRY_HOME:-$HOME/.larry}"
|
||||||
|
|
||||||
# ─────────────────────────────────────────────────────────────────────────────
|
# ─────────────────────────────────────────────────────────────────────────────
|
||||||
|
|||||||
@ -15,15 +15,28 @@
|
|||||||
#
|
#
|
||||||
# Usage:
|
# Usage:
|
||||||
# hl7-diff-set.sh <baseline-prefix> <candidate-prefix>
|
# hl7-diff-set.sh <baseline-prefix> <candidate-prefix>
|
||||||
# [--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
|
# [--ignore "FIELD,..."] # forwarded to hl7-diff. Default: MSH.7
|
||||||
# [--include-fields "F,.."] # forwarded to hl7-diff (overrides --ignore for that set)
|
# [--include-fields "F,.."] # forwarded to hl7-diff (overrides --ignore for that set)
|
||||||
# [--framing auto|nl|0x1c|len10] # forwarded to hl7-diff. Default: auto
|
# [--framing auto|nl|0x1c|len10] # forwarded to hl7-diff. Default: auto
|
||||||
# [--format text|tsv] # how THIS command reports. Default: text
|
# [--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 \
|
# 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
|
# --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:
|
# What it does:
|
||||||
# 1. Globs "<dir>/<baseline-prefix>.*", derives each route suffix (the part
|
# 1. Globs "<dir>/<baseline-prefix>.*", derives each route suffix (the part
|
||||||
# after "<baseline-prefix>."), and pairs it with "<dir>/<candidate-prefix>.<suffix>".
|
# after "<baseline-prefix>."), and pairs it with "<dir>/<candidate-prefix>.<suffix>".
|
||||||
@ -47,7 +60,8 @@
|
|||||||
# --format tsv prints ONE machine row per route to stdout:
|
# --format tsv prints ONE machine row per route to stdout:
|
||||||
# route<TAB>status<TAB>diff_count
|
# route<TAB>status<TAB>diff_count
|
||||||
# (diff_count is "-" for MISSING/EXTRA, since no diff was actually run) —
|
# (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-
|
# 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
|
# header mislabel is fixed as of this release (F-8), but tsv remains the
|
||||||
# safer machine-parseable choice regardless.
|
# safer machine-parseable choice regardless.
|
||||||
@ -85,7 +99,7 @@ while [ $# -gt 0 ]; do
|
|||||||
--include-fields) shift; INCLUDE="$1" ;;
|
--include-fields) shift; INCLUDE="$1" ;;
|
||||||
--framing) shift; FRAMING="$1" ;;
|
--framing) shift; FRAMING="$1" ;;
|
||||||
--format) shift; FORMAT="$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" ;;
|
-*) die "unknown flag: $1" ;;
|
||||||
*)
|
*)
|
||||||
if [ -z "$BASE_PREFIX" ]; then BASE_PREFIX="$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
|
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
|
if [ "$FORMAT" = "text" ]; then
|
||||||
printf 'hl7-diff-set: baseline=%s candidate=%s dir=%s\n' "$BASE_PREFIX" "$CAND_PREFIX" "$DIR"
|
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"
|
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
|
fi
|
||||||
|
|
||||||
while IFS= read -r route; do
|
while IFS= read -r route; do
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user