Repository navigation
Harlo v0.1.5 — engine packaged · Rule 1 real on macOS · HarloPulse sidecar scaffold
Pre-releasePre-release marker — code-only. v0.1.0 DMG remains the latest signed binary.
Why this release exists
v0.1.4 closed with three items queued from the CTO review (docs/CTO_REVIEW_2026-06-09.md): D67 (is HealthKit-on-Mac viable at all?), D56 (the dual-engine fork), and D60–D63 (the seams that make HealthKit do something). This release lands all three — and D67 got answered the hard way: probed empirically on the target machine, the Mac-native HealthKit bet fails today. The strategic consequence is ADR-0002: the iPhone sidecar (HarloPulse) moves from "deferred" to "required" as the biometric signal source.
The other headline: the v9 cognitive engine — the advertised flagship — was absent from every wheel and bundle, reachable only via a sys.path hack from a source checkout. D56 fork (A) promotes it to a real packaged subpackage, harlo.engine.
What changed
| Decision | Before | After |
|---|---|---|
| D67 — resolved (empirical) | Open strategic gate: the code bet on macOS-27 Health sync nobody had verified exists | Probed on the target machine itself (Darwin 27.0.0): HKHealthStore.isHealthDataAvailable() is false — no Health.app, no local Health store. The API links; the data layer does not exist on any Mac through macOS 27. Verdict recorded in the review doc; reopening requires its own ADR |
| ADR-0002 — accepted | ADR-0001 deferred the iPhone-sidecar alternative | HarloPulse (minimal iOS companion) is the sole biometric signal source: HealthKit on the phone, where the data actually is, emitting the exact existing Mac contract — biometric_sample_schema.json JSON, D61 length-prefixed frames, biometric_barrier, D60 modulation_state. Zero new Mac ingest code. Transport v1 = LAN/Bonjour, token-paired; v2 = USB via usbmuxd (blocked today by missing trust pairing/tooling — D82). Watch app explicitly out of scope (D83) |
| D60 — keystone | biometric_force_red was computed, then discarded in a process-local deque — Rule 9 "High = DEPLETED" and Rule 28 were dead end-to-end |
New harlo.modulation.state_store: single-row modulation_state table in twin.db holding the derived verdict only (raw samples never touch disk — Rule 9 holds); coach + status MCP tools surface it; verdicts older than 30 min report stale and never inhibit |
| D61 | Swift sent 4-byte big-endian length-prefixed frames; the daemon read newline JSON — 100% of bridge frames died at json.loads |
Daemon sniffs the first byte and speaks both framings (0x00 = length-prefixed, else legacy newline-JSON); any length-prefixed frame is < 16 MiB by construction |
| D62 | Sandboxed bridge wrote socket/anchor to its container while the daemon listened elsewhere; the container path silently truncated past the 104-byte sun_path limit |
SharedPaths.swift resolves socket + anchor through the App Group container (233JSS4X69.com.harlo.shared) with unsandboxed fallback and a sun_path guard; Harlo.app's entitlements gain the matching application-groups key; AnchorStore now lands where ADR-0001's revocation path can actually delete it |
| D63 | isHealthDataAvailable()==false → exit(1) + KeepAlive{Crashed:true} = infinite ~10s relaunch loop on every current Mac |
Unavailable/denied now exit(0) — a successful exit launchd does not relaunch. The bridge stays in-tree as a dormant Mac-native path that lights up unchanged if a future macOS ever ships Health-on-Mac |
| D56 — fork (A) | v9 engine (USD twin, predictor, schemas, delegates) lived in src/, never packaged — three sys.path surgeries in mcp_server.py, invisible to wheels and bundles |
git mv src/ → python/harlo/engine/ (history preserved), 34 files' imports rewritten, all sys.path hacks deleted, Makefile -m targets and compliance greps repointed |
| D81 — mostly closed | engine_config.py defaulted state paths into the repo tree — installed runs wrote engine state into the source checkout |
STAGE_DIR/BUFFER_DB_PATH/OBSERVATION_DIR derive from harlo.daemon.config.DATA_DIR with HARLO_STAGE_DIR/HARLO_BUFFER_DB env overrides honored end-to-end; MODEL_PATH resolves env → source checkout → DATA_DIR; predictor degrades to None when absent |
| D74 — closed | Makefile defaulted to .venv314, where import harlo was broken (stale .so); four docs disagreed on the venv story |
.venv312 is canonical; Makefile prefers it; harlo/__init__ guards the hippocampus import so pure-Python engine work (sim/train/schemas) imports without the compiled .so |
The three adversarial-review catches (fixed in the same D56 commit)
The engine promotion went through an adversarial review before landing; all three blocking findings were fixed in-commit:
- B1 — networkx bundle dep. The bundle now ships the engine, so
networkx(mock_cogexec's DAG dependency) joins the CI bundle-dep line. Without it, every in-bundle exchange would raiseModuleNotFoundErrorwhilestatusreported a healthy engine. - B2 — observation history would have forked. The
BUFFER_DB_PATHflip stranded legacy observation rows (repodata/had 928 vs DATA_DIR's 115). A new versioned first-run migration (.obs_merge_v1) merges legacy rows losslessly viaINSERT OR IGNOREonobs_id. Executed on the dev machine: 928 merged → 1,043 total, zero collisions. Tested lossless + idempotent. - B3 —
make regen-*broke under the default venv. This catch is what closed D74 (canonical.venv312+ the.soimport guard, verified on.venv314).
Advisories fixed alongside: start_daemon --bg ran a nonexistent src/daemon path (now -m harlo.daemon.main); first_session/health_check sandbox their engine state instead of mutating live DATA_DIR; the orphaned Windows MCP sample config was replaced with the macOS entry-point form.
Verification
- 406 tests pass on the seam-fix commit, including new wire-framing socketpair tests and modulation state-store tests;
swiftc -typecheckclean across all bridge sources - Engine promotion: full-suite failure set byte-identical to the pre-move baseline (46 environmental), +2 new passing
wave1_harness7/7 PASS- Packaged engine boots
stage_type=real_usd predictor=yesfromharlo.engine; the predictor joblib unpickles post-move; the Swift bridge is untouched by the move - Observation merge executed for real, not just unit-tested: 928 legacy rows merged, 1,043 total, zero
obs_idcollisions - D67 was probed on the target machine itself — the verdict is device evidence, not documentation inference
Late additions — landed in this release
| Decision | Before | After |
|---|---|---|
| D69–D73 — Rule 1 works on macOS | Socket activation was systemd-shaped (LISTEN_FDS) — launchd never sets it, so the "activated" daemon unlinked launchd's own socket and stranded the client; one connection per activation; idle exit force-closed every live session; DMN teardown was dead code with a /dev/shm temp path that doesn't exist on macOS |
New harlo.daemon.socket_activation: real launchd adoption via ctypes launch_activate_socket("HarloCommand") → systemd → dev fallback (which now refuses to hijack a live listener). serve() accept-loop handles connections serially until the idle timeout (0% CPU in accept() — Rule 1 holds), idle exit expires stale sessions only, the installer rewrites ~ to $HOME (launchd performs no tilde expansion) and finds plists inside the bundle, the 30s DMN budget is enforced, abort() is wired to connection-preemption (Rule 19), and placeholder synthesis logs itself as placeholder |
| HarloPulse scaffold (ADR-0002 v1) | The sidecar was a decision with no code | ios/HarloPulse/ — xcodegen-ready iOS 17 app (per-type toggles default OFF, anchored HealthKit reads, schema-exact SampleEncoder ported line-for-line from the proven macOS encoder, NWConnection client speaking the daemon's D61 length-prefixed framing, Keychain token storage) + harlo pulse pair / harlo pulse listen on the Mac (6-word pairing token stored hash-only at 0600, timing-safe HMAC, frames forwarded in-process through the real biometric_barrier). A live end-to-end smoke ran during the build: pair → listen → auth → heart-rate frame → accepted: 1. Known v1 accepted risk (recorded in-commit): auth-frame replay inside the 300 s window — blast radius capped at the Modulation Layer, fail-safe direction; per-frame MACs queued for transport v2 |
Built by MOE agent teams (architect → builder → red-team with repair rounds) under the orchestrator; full-suite failure set stayed byte-identical to the environmental baseline throughout (1,373 passing). Frontier research from the same run is up for review in PR #12.
What's next (per the review's sequencing)
- HarloPulse transport v1 — LAN/Bonjour token-paired listener (
harlo pulse pair), reusing D61 framing end-to-end; USB via usbmuxd stays transport v2 behind D82 - D57 — composition engines 3 → 1 (unblocked by D56)
- D68 — HealthBridge build/sign/CI stays gated until Health-on-Mac exists or HarloPulse ships
🤖 Generated with Claude Code