The status backfill set modified=true even when the UPDATE touched 0 rows, so
every open of an up-to-date store re-exported and rewrote the whole image; with
encryption at rest each write uses a fresh nonce, so read-only commands such as
'memory stats' changed the RFE1 bytes every call. Gate on getRowsModified().
Co-Authored-By: RuFlo <ruv@ruv.net>
The anchor mirror and trust key were resolved with userInfo().homedir, which
ignores a throwaway HOME, so tests wrote into the developer's real
~/.config/ruflo/policy-trust and later failed closed on a reused path.
Resolve from the environment at call time (XDG_CONFIG_HOME when absolute,
else os.homedir()/.config; legacy location kept for XDG users who already
have trust state there). mcp-client-guardrail.test.ts now uses a scratch
cwd and HOME.
Co-Authored-By: RuFlo <ruv@ruv.net>
vitest 4.1.8 does not export ./vitest.mjs, and pnpm's .bin shim exports NODE_PATH with
every workspace dependency, so the optional-package absence guards in the #3904, #3907
and #3910 fixtures failed under 'pnpm test'.
Co-Authored-By: RuFlo <ruv@ruv.net>
Found by running the 3.54.1 CLI with missing and bad arguments:
1. `agent status <unknown>` and `task status <unknown>`: the MCP tool answers
{ status: 'not_found' } and the command rendered it as a record,
"Agent: undefined", "Created: Invalid Date", "Progress: undefined%",
and exited 0, so scripts and agents read it as success. Both now print
"<Agent|Task> not found: <id>" (or the raw JSON under --format json) and
exit 1.
2. A string/number option given with no value (`hooks route --task`,
`memory retrieve --key`, or followed by another flag) was parsed as
boolean `true`, and commands used it as the value: `hooks route --task`
failed with "task.trim is not a function", `memory retrieve --key` looked
up the key "true". validateFlags now reports "Option --<name> needs a
value" for every declared string/number option, so all commands get it.
Co-Authored-By: Ruflo & AQE
Claude-Session: https://claude.ai/code/session_01RMjr52YGVk9fkqtNvb5jg2