recordTrajectory() saved stats.json synchronously but left the
ReasoningBank save to its 100 ms debounce timer. The one-shot bins call
process.exit(0) as soon as the command resolves, so the timer never
fired: patternsLearned went up while patterns.json was never written.
Flush the bank next to savePersistedStats() so the counter is never
persisted for a pattern that wasn't.
Review found the state.lock invariant has a gap with mixed versions: released
versions before the dead-owner fix take over any lock older than 30 s, even a
live owner's, so a writer suspended mid-write (e.g. a sleeping laptop) could
have its temp removed by a newer holder. Keep a temp while its writer pid is
alive on this host, and until it is 10 minutes old.
Tests: live-writer temps and 5-minute-old temps are kept, verify removes
orphans on its own, and the directory case is named for what it checks.
Co-Authored-By: Ruflo & AQE
Claude-Session: https://claude.ai/code/session_011Qe66m38aobVEJGHAbFVzv
A writer killed between creating <file>.<pid>.<uuid>.tmp and renaming it
(SIGKILL from a caller's timeout, OOM) never reaches writeJsonAtomic's
cleanup, so a full-size copy of state.json or ledger-anchors.json stays in
the policy directory forever. On a mature ledger each copy is ~250 MB; one
host had 13 of them (1.9 GB).
Every writer of state.json, ledger-anchors.json, state.anchor.json and
ledger-anchor-head.json holds the project's state.lock, so a transaction
or verify that holds the lock removes temp files of exactly those names.
Only regular files that match <name>.<pid>.<uuid>.tmp and are at least 60 s
old are removed; symlinks, directories, fresh temps and other files' temps
are left alone, and a failure never fails the caller.
Co-Authored-By: Ruflo & AQE
Claude-Session: https://claude.ai/code/session_011Qe66m38aobVEJGHAbFVzv
memory_import returns { error } for a missing or invalid file and
{ success: false, error, imported } when some writes fail. The CLI read
result.imported unconditionally, so a bad file printed "Imported from
undefined" and then died on a TypeError, and a partial import was reported
as a success. Check the result before printing, mirroring memory export.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Rudy Celekli <rudy@gradiahq.com>
daemon status printed config.ttlMs of the default-config WorkerDaemon it
builds in the status process, so a background daemon started with
--ttl 0 showed 'TTL: 12h (self-shutdown)'. Read ttlMs from
daemon-state.json when the background daemon is running, as is already
done for aiWorkersEnabled and for daemon status --all.
Map outcomes and steps to the fields consumed by ruvllm pattern extraction. Add coverage for success, failure, and partial trajectories.
Refs #4199 (part A).
* fix: bump @metaharness/darwin pin from ~0.10.2 to ~0.12.0 (#3219)
npm published 0.11.0 and 0.12.0 after the last pin bump, leaving the
optionalDependencies range, MH_DARWIN_PIN, and the plugin helper's
DARWIN_PIN_VERSION all stale. scripts/check-metaharness-pins.mjs now
reports clean (was: STALE), and the metaharness-pin-drift CI gate,
which runs on every PR touching these files, was failing repo-wide
as a result.
Verified: check-metaharness-pins.mjs exits 0; plugin test-pin-alignment.mjs
(12/12) and test-no-tool-time-npx.mjs (26/26) pass against the new pin.
Co-Authored-By: RuFlo <ruv@ruv.net>
* fix: update v3/pnpm-lock.yaml for the @metaharness/darwin ~0.12.0 bump
Minimal surgical patch (specifier/version + the resolution block's
version/integrity), not a full pnpm regen — a full `pnpm install
--no-frozen-lockfile` here also drags in unrelated transitive bumps
(ruvector 0.2.27->0.2.41, vite 7.3.0->8.3.4, etc.) that don't belong
in a pin-drift fix. Verified with `pnpm install --frozen-lockfile`.
Co-Authored-By: RuFlo <ruv@ruv.net>
---------
Co-authored-by: r <r@x>
* fix(memory): memory_import_claude re-imports edited files and says why one failed (#4197)
The section writes did not pass upsert, so any key already in the store was
rejected and the catch only counted skipped++, returning success:false with no
reason. Upsert like memory_store, and list the first errors.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
* fix(memory): resolve Claude import roots across Git worktrees
---------
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
The handler returned the legacy store's entry count as 'migrated' even when the
marker made ensureInitialized skip everything, and force deleted a marker path
(.swarm) that hasLegacyStore never reads. Record migrated/total in the marker,
report them, say so when the marker blocks a run, and clear the real marker.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The bloat guard no-cli-optdep-bloat-2561 deliberately forbids this package in the CLI's
optionalDependencies, so the packaging half of #3979 item 1 is dropped: the clear
'not installed, install with npm i ...' message stays. The message mapping is now an exported
function tested directly (the CI run showed the mock-factory error wrapping dropped the error
code), covering code-carrying, code-less wrapper and unrelated-package errors. package.json and
pnpm-lock.yaml return to main's.
Co-Authored-By: RuFlo <ruv@ruv.net>
- tui/parity.ts: a recorded decision for each of the console's views
(same / partial / equivalent / claude-only); tests/tui-parity.spec.ts fails
when a view in VIEWS has no decision or no row in ADR-489
- 0 opens the main menu (its keys open entries), : or / goes to a page by
name, Esc/Backspace is Back, --view takes any page; the console terminal
opens the AI page and the Room says on one screen that it needs Claude Code
- terminal renderer: a Box's width is honoured (the board's two groups side by
side) and the board's entry labels are drawn (they were blank)
- --mouse (opt-in, SGR): click a page chip, wheel scrolls; off by default,
switched off on exit, report bytes ignored without the flag
- CLI: --view validates against the loaded bundle's page list, --mouse flag
Co-Authored-By: RuFlo <ruv@ruv.net>
Merges both stores by namespace+key (newest updatedAt wins), reports per-store
counts, and warns instead of silently exporting a partial set.
Co-Authored-By: RuFlo <ruv@ruv.net>
The standalone terminal UI now leads each page with the same title art and
pictures the console draws, as coloured cells (Raster in the terminal kit),
in the console's looks (Classic BBS default, Orbital, plain), moving at
--fps with only the changed rows redrawn.
- tui/ansi.ts: Raster; control/escape/invisible/wide code points become
spaces, malformed or oversized cells draw nothing
- looks: --look, t key; --boot; --fps, --no-anim, --no-pictures
- focus reporting pauses the animation clock; NO_COLOR, dumb terminals,
and widths under 44 fall back to the words
- guide: flags, looks, the t key; corrects the confirm-card sentence
- ADR-489: phase 4 recorded, parity table skeleton
- README/guide SVGs regenerated from real frames (leak-checked)
Co-Authored-By: RuFlo <ruv@ruv.net>
The bare subpath import threw ERR_PACKAGE_PATH_NOT_EXPORTED and the catch
swallowed it. Resolve the package root via its exported entry and import by
file URL; autopilot_learn now reports the real load error.
Co-Authored-By: RuFlo <ruv@ruv.net>
A false negative gave learnFromDetection no threat to store yet returned
success. Record a hash of the normalised input as a known miss, flag it in
scan/is_safe, and report learned:0 honestly when nothing was learned.
Co-Authored-By: RuFlo <ruv@ruv.net>
Verified: convert gives every unit-norm input tanh(0.5)=0.4621171572, and
distance on unit-norm/off-ball points was acosh of a NaN or huge value that
serialised to null with success:true. Distance now uses the curvature-correct
formula and returns success:false outside the ball.
Co-Authored-By: RuFlo <ruv@ruv.net>