Skip to content

feat(reclaim): verify resource recovery and keep collection responsive - #102

Merged
vishr merged 16 commits into
mainfrom
feat/disk-reclaim
Nov 10, 2026
Merged

vishr merged 16 commits into
mainfrom
feat/disk-reclaim

Conversation

@vishr

@vishr vishr commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Summary

Driga now reviews disk, CPU and memory opportunities through driga reclaim, including detached processes and booted simulators. General process and simulator review remains read-only; existing confirmed actions recheck consent, native identity, activity and ownership, then preserve observed outcomes in bounded private history.

reclaim → review disk / orphan / session / detached process / simulator
confirmed action → consent → fresh identity + activity + ownership
                 → mutation → observed outcome → private receipt

Build/cache cleanup expands disk reclamation. Background Git inventory and reduced allocation work keep process collection responsive. Dashboard reads can finish beyond the polling interval and publish independently.

The PR also includes the earlier header stat/bar presentation fixes and restart of an outdated service during explicit install; those commits are included in the consolidated review.

Evidence

  • Before: a new native agent absent from stored sessions could fail to protect an overlapping helper; a filtered-out live PID could be counted as stopped; a restarted collector could inherit a same-PID runtime sample.
    After: shared native ownership protection includes configured signatures and fresh canonical directories; omitted targets require explicit per-PID observation before counting exit; runtime samples match a fresh collector-run identity. Independent reviewers found no remaining blocker in these corrections.
  • Before: venv reconstruction information was saved after deletion, and macOS escaped filenames could disappear from open-file evidence.
    After: a bounded private reconstruction record is synchronized before deletion, including recovery after a partial prior append. macOS names are decoded; ambiguous evidence refuses cleanup, while unavailable suffixes retain directory protection. Both defects were reproduced before correction and independently re-reviewed.
  • Regression fixtures reproduced both shutdown defects before correction. Focused ownership, platform, shutdown-accounting and runtime-lifecycle checks pass. Final combined full Go tests and full isolated just race pass (GOFLAGS=-p=4 bounds concurrent packages; race instrumentation and within-package concurrency stay enabled).
  • Native and full Windows vet, Linux build and formatting/diff checks pass. Gitleaks scanned the complete sixteen-commit PR range without finding leaks. All CI checks passed on abd50a8; final cleanup corrections receive fresh CI.
  • The preceding complete isolated checks passed all Go tests, race checks, 1,216 browser catalog tests and 212 UI tests. This follow-up changes Go/tests/docs only; browser source and generated assets remain at that tested version.
  • Consolidated pre-merge review collects every change from actual remote main: five earlier commits, the original cleanup feature, eight session commits, and independently reviewed corrections. All 160 final paths are accounted for. Minified JavaScript was assessed through source and generated-output checks.

Merge Danger

Door: one-way for executed deletion or shutdown; the code installation can be rolled back.

Blast Radius: local developer workloads and monitoring.

No automatic blanket cleanup or new shutdown authority for generic review candidates. Unknown required safety observations refuse actions or remain unknown in receipts. No database migration, agent-setting change or fleet wire-format change; approved full identities stay ephemeral.

Performance remains open: the installed preceding collector measured 61–68 MB physical footprint, above its 50 MB target, and a complete 11.9%-of-one-core CPU sample. Large-inventory Home/Header reads still exceeded 40 seconds. These are not idle or sustained-budget guarantees. The last native desktop smoke attempt could not bind a window; final native rendering remains unverified. Agent user tests rated CLI usefulness 4/5 and desktop 3/5 after reload; these are simulated impressions.

The installed local review3 bundle remains at d73488f; the new due-diligence corrections are source/PR changes pending a subsequent install. No original workload or simulator was stopped during this review. Claude/Codex/Copilot assistant selection is explicitly deferred to a separate PR after this release.

vishr added 15 commits October 31, 2026 13:15
Header tiles filled the whole 55 px row, so labels touched the header's top
edge, and the inline-block tile box added descender space below a tile
shorter than the row (the CPU ring), so it sat high. Tighter header line
heights and a 3 px bar strip make tiles about 48 px with equal room above
and below, and the tile box aligns to the top of its slot. The header
stories check that every tile has at least 2 px above it and equal room
above and below.
After a Homebrew upgrade the cask runs driga service install, but Start
leaves a running service alone, so the service kept running the replaced
executable's version until the app or the user restarted it. Install now
restarts a running service whose version differs from this binary's, and
the CLI passes its version to the lifecycle.
TestPermissionHookBuiltBinary moved HOME to a temporary directory before
running go build. With GOPATH unset, go then downloaded every module into a
cache under that HOME, whose files are read-only, so the test failed at
cleanup ("TempDir RemoveAll cleanup: unlinkat ... permission denied") on
any machine without GOMODCACHE set, and took 25 seconds. CI sets the cache
paths, so it passed there.

The build now uses the module and build caches go reports before HOME
moves. The test passes locally in about 3 seconds.
A header tile in need of attention also took the board tile's tint and
left rule. In the bare header row that looked like the selected tile, and
it stacked five signals for one state. Header tiles now keep only the
colored icon, dot and sparkline; board tiles keep the tint and rule.
In the header, a gauge drew a ring with its label beside it, centred on
the ring, while every other tile puts its label above its value. The
header now draws a gauge like Memory and Disk: icon and label on top, the
reading below, and a bar for the share of its maximum. Boards keep the
ring.
Add two cleanup kinds. build removes regenerable directories (node_modules,
target, .venv and others) inside idle checkouts, including siblings of known
repos, when git reports the directory ignored and its manifest sits beside it.
It deletes through os.Root and reports the bytes actually freed. cache runs a
tool's own clean command (go, uv, npm, pnpm, bun, brew) from the CLI only and
reports model caches, VM disks and toolchains without touching them.

Open files are read once per pass instead of one lsof walk per candidate.
cleanup.regenerable now only adds names to the built-in rules.
Protect nested and aliased session directories, recheck direct cache activity, and preserve shutdown status when output fails. Update the cleanup kind hint.
@vishr
vishr enabled auto-merge (squash) November 10, 2026 03:06
@vishr
vishr disabled auto-merge November 10, 2026 03:08
@vishr
vishr enabled auto-merge (squash) November 10, 2026 03:28
@vishr
vishr merged commit ed5747b into main Nov 10, 2026
7 checks passed
@vishr
vishr deleted the feat/disk-reclaim branch November 10, 2026 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant