feat(badge/status/installer): fix badge, add status inventory, agy trust - #50
Conversation
Land three related okfmem changes together on one umbrella branch: - fix(badge): scratch/temp file writes no longer count as "work" toward the save-state badge, so a session that only touches throwaway files isn't nagged to save. - feat(status): `okfmem status` gains a per-project inventory section (page/archive counts) surfaced directly from the engine. - feat(installer): install/uninstall scripts pre-grant Antigravity/agy trust for the store path via `~/.gemini/trustedFolders.json`, gated on user consent, with matching uninstall cleanup. Resolves #49 Resolves #43 Resolves #42
2b2504b to
38c05d4
Compare
Windows testingPulled the branch and ran the full gate on Windows 11 / PowerShell — reproduced the red Root cause of the CI failure
FixAdded Verified on Windows
CI after amend
|
Summary
Three related okfmem changes landed together on one umbrella branch as a single
commit:
the save-state badge, so a session that only touches throwaway files isn't
nagged to save. Tightened during review (see below) so a project-internal
docs/scratchpad/can never be mistaken for the harness scratchpad.okfmem statusgains a per-project inventory section(page/archive counts,
MEMORY.mdline count with the 200-line auto-loadwarning, cwd→project marker,
decay:line), surfaced from the engine so/okfmemreports identically on macOS and Windows; skill loses its POSIX-onlyshell loop.
trust for the store path via
~/.gemini/trustedFolders.json(least-privilegeTRUST_FOLDERon the store abspath), gated on[y/N]consent, skippablenon-interactively (prints
okfmem init --grant-agy), with matching uninstallcleanup that removes only okfmem's own entry.
Resolves #49
Resolves #43
Resolves #42
Also note: #44 (structural save-state parser) was already shipped by #45/#47 and
is not part of this diff — it can be closed separately.
Test plan
python3 scripts/check-leaks.pyexits 0 (64 files, no leaks)python3 -m pytest -q→ 246 passed, 1 skippedbash -n install.sh uninstall.shOK;.ps1files pure ASCIIverify) greenokfmem status/okfmem status --allrender the new sectionAdversarial review
An independent reviewer attacked the accumulated diff before this PR was opened.
Round 1 — 1 blocking finding (fixed):
is_scratch_path's blanketscratchpad-path-segment fallback matched any path containing a directorynamed
scratchpadat any depth — so a committeddocs/scratchpad/adr.mdeditwould classify as non-work, clear the badge, and silently lose a genuinely
uncaptured session (the exact failure the badge exists to prevent). Fixed by
dropping the blanket fallback:
is_scratch_pathnow returnsTrueonly forpaths under
_ephemeral_roots()(OS temp roots +$CLAUDE_SCRATCHPAD_DIR). Thereal harness scratchpad already lives under
/private/tmp, so it's still caught;a project-internal
scratchpad/is not. Regression tests added; the strictlynarrower rule can only ever err toward a benign
unsavednag, never a falsesaved.Nits (not blocking): corrupt hand-edited
trustedFolders.jsonis replacedrather than merged on grant (mitigated — a
.okfmem.bakbackup is writtenfirst);
/okfmemno longer reports the engine clone's own git status (arguableintentional scope-narrowing to store-backup health).
Reviewer verdict after the fix: #43 status-inventory and #42 agy-grant consent
gating were both found solid — consent complete on every rung-2 write path,
probes read-only and dispatched before the store-shape check, revoke touches
only okfmem's own entry, no argparse-flag collisions.
Provenance
verify