Skip to content

feat: validate memory instrumentation + pending-heavy baseline tooling - #26

Merged
djradon merged 4 commits into
mainfrom
lane/validate-memory-baseline
Jul 31, 2026
Merged

feat: validate memory instrumentation + pending-heavy baseline tooling#26
djradon merged 4 commits into
mainfrom
lane/validate-memory-baseline

Conversation

@djradon

@djradon djradon commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

The instrumentation/attribution phase of the whole-mesh validate bounded-memory task (archive note wa.task.2026.2026-07-29_1220-whole-mesh-validate-bounded-memory, build + adversarial-review receipts inside). Rebased onto main after #25; the two-file overlap (weave.ts, version_execution.ts) reconciled so the classified validate path carries the optional memoryStats wiring.

  • feat(validate): instrument retained memory — opt-in WEAVE_MEMORY_STATS=1 JSON on stderr: retained bytes by role (created plan text by path class, updated map, overlay staged, read cache, candidate cache), planner loop iterations, peak RSS, V8 heap stats. Zero work when unset; node:v8 imported dynamically at finish only; fs-purity guard green.
  • test(validate): add pending-heavy baseline meshscripts/generate-pending-heavy-mesh.ts: self-contained generator for meshes with N pending extracted-term Knops (policy- and content-parameterized, no fixture-repo refs); honesty test proves untargeted validate performs exactly N recursive iterations.
  • feat(validate): discriminate retained memory after gcpostGcUsedHeapSize under --v8-flags=--expose-gc; --term-content-bytes knob.

Evidence this tooling produced (receipts in the archive note)

  • Reproduced the consumer-reported untargeted-validate heap exhaustion as a benchmark: N=1700 pending Knops at ~1 KB/term content hits V8's default ~4.09 GiB ceiling in 14 s (4.14 GiB peak RSS).
  • Attributed the mechanism: per-candidate full-source duplication dominates content-carrying meshes; content-0 runs are pure parse churn (post-GC heap collapses to ~15 MB at N=1700).

No behavior changes to validation semantics; instrumentation is inert unless WEAVE_MEMORY_STATS is set.

Test evidence

Full env -u NO_COLOR deno task ci: 737 passed / 0 failed on the rebased tip; focused memory-stats + generator honesty suites green.

🤖 Generated with Claude Code

djradon added 3 commits July 31, 2026 09:27
- add WEAVE_MEMORY_STATS command-end reporting for retained plan, overlay, read-cache, candidate-cache, heap, and RSS roles
- sample recursive planner iterations without changing validation behavior when disabled
- keep node:v8 behind a dynamic import and cover created-file path classification
- generate flat-source extracted-term meshes with explicit current-only or versioned MeshInventory history policy
- prove untargeted validation enters one recursive planning iteration per pending Knop
- verify instrumentation is silent when disabled and identifies the conditional history-snapshot arm
- report stable pre-GC and nullable post-GC V8 heap measurements when instrumentation is enabled
- add deterministic per-term content sizing to the pending-heavy mesh generator
- cover exposed-GC reporting, disabled behavior, and content-sized validation honesty
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@djradon, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 48 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: c181b1e2-fcd7-42c7-b930-079542ff7d6f

📥 Commits

Reviewing files that changed from the base of the PR and between f9b64ce and 929d5e8.

📒 Files selected for processing (7)
  • scripts/generate-pending-heavy-mesh.ts
  • src/runtime/weave/memory_stats.ts
  • src/runtime/weave/memory_stats_test.ts
  • src/runtime/weave/planning_context.ts
  • src/runtime/weave/version_execution.ts
  • src/runtime/weave/weave.ts
  • tests/scripts/pending_heavy_mesh_test.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 70.02457% with 122 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
scripts/generate-pending-heavy-mesh.ts 50.81% 82 Missing and 8 partials ⚠️
src/runtime/weave/planning_context.ts 53.57% 25 Missing and 1 partial ⚠️
src/runtime/weave/memory_stats.ts 96.20% 4 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

dnt's Node type checking shims the TextEncoder value but has no global
TextEncoder type; use a module-level encoder instead of typed params.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@djradon
djradon merged commit c0b25b3 into main Jul 31, 2026
6 checks passed
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