cloverleaf-larry/lib
bj ea9f4c2399 v0.9.0: broker mode is the DEFAULT — wire the remote kill-switch into every Cloverleaf-Larry
Phase 3 of the Larry remote kill-switch (Pax design; Mack's broker on .135 LAN
8181 / Tailscale 100.86.16.114:8181). Deployed Larry no longer holds a long-lived
sk-ant-… key: it holds a per-deployment enrollment secret, mints a short-lived
token from the broker, and routes every LLM call THROUGH the broker /v1/messages
(real key injected server-side). set-authorized <id> false => the deployment 401s
and dies, no box access required.

- LARRY_AUTH_MODE=broker is the DEFAULT (was apikey). Self-update flips existing
  installs to broker-mode too, so upgrading Gundersen delivers the kill-switch.
  Escape hatch (documented, not default): LARRY_AUTH_MODE=apikey (no kill-switch,
  never for PHI boxes).
- New lib/broker.sh: enroll+mint, fail-closed heartbeat, best-effort PHI wipe
  (reuses uninstall-larry.sh's shred/overwrite secure-delete + LARRY_HOME guard).
- Fail-closed preflight at launch + in-REPL heartbeat (default 60s, 3-miss budget):
  disabled => refuse to run (+ PHI wipe for profile:phi); unreachable past budget
  => refuse to run (NO wipe on a network blip — only an explicit disable wipes).
- call_api / call_api_stream broker branch: Bearer short-lived token, no x-api-key,
  token never on disk.
- install-larry.sh enrollment provisioning: LARRY_DEPLOYMENT_ID + LARRY_ENROLL_SECRET
  (+ LARRY_PROFILE/LARRY_BROKER_URL) baked 0600 + into the shim; box shows up in the
  dashboard ready to toggle.
- /auth reports broker state.

Reachability (flagged for Bryan): the broker is LAN + Tailscale only (no public
route). Egress-restricted boxes reach it over Tailscale (default URL = tailnet).
A box that can reach neither fail-closes = won't run (correct kill, useless work
state) — such a box MUST run Tailscale, or Bryan must stand up a hardened public
broker ingress.

Bug fixed in test: _broker_json_field jq `// empty` rendered literal false as
empty, mis-classifying a DISABLED deployment as an unreachable MISS (delaying
fail-close + skipping the PHI wipe). Fixed to `if has($k) then .[$k] else "" end`.
Verified end-to-end against the live broker: enroll -> mint -> proxied call ->
disable -> instant 401 + heartbeat fail-close + 5 PHI files shredded.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 23:10:09 -07:00
..
broker.sh v0.9.0: broker mode is the DEFAULT — wire the remote kill-switch into every Cloverleaf-Larry 2026-05-31 23:10:09 -07:00
csv-to-table.sh v0.4.1: each / each-site / len2nl / csv-to-table / table-to-csv 2026-05-26 11:05:19 -07:00
cygwin-safe.sh v0.8.26: harden control-byte sanitize across the tool suite + ssh-helper traps 2026-05-28 16:35:06 -07:00
each-site.sh v0.4.1: each / each-site / len2nl / csv-to-table / table-to-csv 2026-05-26 11:05:19 -07:00
each.sh v0.4.1: each / each-site / len2nl / csv-to-table / table-to-csv 2026-05-26 11:05:19 -07:00
fetch-safe.sh v0.8.11: API-key default rail (OAuth-impersonation off, secure per-client /set-api-key) + manifest-hashing auto-update speedup 2026-05-27 22:40:18 -07:00
headers-sync.sh v0.8.6: work-box → Mac headers.log sync (tsk-2026-05-27-023) 2026-05-27 21:01:54 -07:00
hl7-desanitize.sh v0.8.26: harden control-byte sanitize across the tool suite + ssh-helper traps 2026-05-28 16:35:06 -07:00
hl7-diff.sh v0.8.26: harden control-byte sanitize across the tool suite + ssh-helper traps 2026-05-28 16:35:06 -07:00
hl7-field.sh v0.8.26: harden control-byte sanitize across the tool suite + ssh-helper traps 2026-05-28 16:35:06 -07:00
hl7-sanitize.sh v0.8.26: harden control-byte sanitize across the tool suite + ssh-helper traps 2026-05-28 16:35:06 -07:00
hl7-schema.sh v0.7.0: HL7-aware tab completion + REPL mouse mode 2026-05-27 16:15:11 -07:00
journal.sh v0.7.5: OAuth CR-taint fix + mouse opt-in + CR-safety sweep 2026-05-27 19:17:48 -07:00
len2nl.sh v0.4.1: each / each-site / len2nl / csv-to-table / table-to-csv 2026-05-26 11:05:19 -07:00
lessons.sh v0.8.30: write/mutate tool validation pass — 2 fixes; rollback proven reliable 2026-05-28 18:28:21 -07:00
nc-create-thread.sh v0.8.30: write/mutate tool validation pass — 2 fixes; rollback proven reliable 2026-05-28 18:28:21 -07:00
nc-diff-interface.sh v0.8.29: read/inspect tool validation pass — 7 portability/correctness fixes 2026-05-28 18:11:22 -07:00
nc-document.sh v0.8.26: harden control-byte sanitize across the tool suite + ssh-helper traps 2026-05-28 16:35:06 -07:00
nc-engine.sh v0.8.28: expose 5 lib-only tools + fix nc-engine arg-parsing crash 2026-05-28 17:18:23 -07:00
nc-find.sh v0.8.29: read/inspect tool validation pass — 7 portability/correctness fixes 2026-05-28 18:11:22 -07:00
nc-inbound.sh v0.3.0: initial release of Larry-Anywhere 2026-05-26 09:46:20 -07:00
nc-insert-protocol.sh v0.7.5: OAuth CR-taint fix + mouse opt-in + CR-safety sweep 2026-05-27 19:17:48 -07:00
nc-make-jump.sh v0.3.0: initial release of Larry-Anywhere 2026-05-26 09:46:20 -07:00
nc-msgs.sh v0.8.26: harden control-byte sanitize across the tool suite + ssh-helper traps 2026-05-28 16:35:06 -07:00
nc-parse.sh v0.8.29: read/inspect tool validation pass — 7 portability/correctness fixes 2026-05-28 18:11:22 -07:00
nc-paths.sh v0.8.20: nc_paths route-chain tracer — parse-once in-memory engine (84s→0.7s single, ~5.5s full-tree), authoritative destination-block cross-site resolution, v1-fidelity output (site/thread nodes, --> intra-route / ==> cross-site) as default + --format table/nodes, pipe-first (site/thread in, awk field-1 = root). Verified EXACT vs v1 on the real 24-site integrator. 2026-05-28 11:26:31 -07:00
nc-provision-jumps.sh v0.8.32: nc_provision_jumps — capstone inter-server jump-thread provisioner 2026-05-28 19:38:07 -07:00
nc-regression.sh v0.8.23: regression chain-walk route-test capture (nc-regression --chain-walk) 2026-05-28 12:44:38 -07:00
nc-revisions.sh v0.8.27: nc-revisions — NetConfig change-history / revision diff 2026-05-28 16:53:10 -07:00
nc-set-field.sh v0.8.31: nc_set_field — change a thread's PORT/HOST/PROCESSNAME/ENCODING (journaled) 2026-05-28 18:43:27 -07:00
nc-smat-diff.sh v0.8.29: read/inspect tool validation pass — 7 portability/correctness fixes 2026-05-28 18:11:22 -07:00
nc-status.sh v0.8.29: read/inspect tool validation pass — 7 portability/correctness fixes 2026-05-28 18:11:22 -07:00
nc-table.sh v0.7.5: OAuth CR-taint fix + mouse opt-in + CR-safety sweep 2026-05-27 19:17:48 -07:00
nc-tclgen.sh v0.8.28: expose 5 lib-only tools + fix nc-engine arg-parsing crash 2026-05-28 17:18:23 -07:00
nc-xlate.sh v0.8.29: read/inspect tool validation pass — 7 portability/correctness fixes 2026-05-28 18:11:22 -07:00
oauth.sh v0.7.5: OAuth CR-taint fix + mouse opt-in + CR-safety sweep 2026-05-27 19:17:48 -07:00
phi-client.sh v0.8.2: Presidio sidecar for free-text NER (tier-5) — closes V1 2026-05-27 20:00:23 -07:00
phi-presidio-sidecar.py v0.8.2: Presidio sidecar for free-text NER (tier-5) — closes V1 2026-05-27 20:00:23 -07:00
phi-sidecar.sh v0.8.2: Presidio sidecar for free-text NER (tier-5) — closes V1 2026-05-27 20:00:23 -07:00
ssh-helper.sh v0.8.26: harden control-byte sanitize across the tool suite + ssh-helper traps 2026-05-28 16:35:06 -07:00
table-to-csv.sh v0.4.1: each / each-site / len2nl / csv-to-table / table-to-csv 2026-05-26 11:05:19 -07:00