Skip to content

Add bounded debugger storage inspection - #159

Closed
bjdodson-openai wants to merge 1 commit into
bjd/debugger-devtools-corefrom
bjd/debugger-storage-inspector
Closed

Add bounded debugger storage inspection#159
bjdodson-openai wants to merge 1 commit into
bjd/debugger-devtools-corefrom
bjd/debugger-storage-inspector

Conversation

@bjdodson-openai

Copy link
Copy Markdown
Collaborator

Description

Adds a compatibility-preserving, bounded, read-only snapshot over the existing web PersistentStore implementation.

  • Leaves the on-disk key format and ordinary persistence behavior unchanged.
  • Bounds hostile keys, values, retained state, and error projection.
  • Adds memory, localStorage, TTL reload, and failure-recovery coverage.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • Documentation improvement
  • Performance optimization
  • Test improvement
  • Other (new debugger capability)

Testing

  • Tests pass locally (bazel test //...)
  • Added/updated tests for changes (if applicable)
  • Tested on multiple platforms (iOS/Android/Web/macOS as applicable)
  • Manual testing performed (describe below)

Testing Details

  • Incremental branch: Focused persistence web Bazel target passed; strict TypeScript, bounded-iterator compatibility, formatting, and diff checks passed.
  • Assembled debugger stack: npm test passed 436/436; the CLI production build passed.
  • Focused //src/valdi_modules/src/valdi/web_renderer:test passed.
  • bazel query //... passed.
  • The broad Valdi suite reproduced the established 12 unrelated failures; all new debugger specs passed.

Checklist

  • Code follows project style guidelines
  • Documentation updated (if needed)
  • No breaking changes (or documented in description)
  • Commit messages follow conventional format
  • No secrets, API keys, or internal URLs included

Related Issues

Relates to #154

Additional Context

Stack 6/22. Stacked on #158 (bjd/debugger-devtools-core). Review this PR as the single incremental commit 06c5b4e0 against that base; do not merge it before its parent.

@github-actions

Copy link
Copy Markdown

📊 PR Size: size/XL

Total changes: 1289 lines (3 files)

Top files changed:

  • src/valdi_modules/src/valdi/persistence/web/PersistentStoreNative.ts: +664 -2
  • src/valdi_modules/src/valdi/persistence/web/test/PersistentStoreNativeWebTest.ts: +523 -90
  • docs/docs/stdlib-persistence.md: +10 -0

Size calculated as additions + deletions. Labels: XS (<10), S (<50), M (<250), L (<1000), XL (1000+)

@github-actions github-actions Bot added the area/docs Documentation label Aug 26, 2026
@github-actions

Copy link
Copy Markdown

⚠️ Bazel & CI Test Results

Test Suite Result
valdi_web Integration Test ✅ success
Valdi Smoke Tests ✅ success
Linux: Module Tests ✅ success
Snapshot Tests ✅ success
Linux: C++ Tests ❌ failure
API Surface Check ✅ success
Linux: Build & Export ✅ success
macOS: C++ & Platform Tests ❌ failure
Test Coverage Delta ✅ success
Linux: Registry Validation ✅ success
Linux: Build Compiler ✅ success
Linux: Hotreload Smoke ✅ success

Some tests failed. Please check the workflow logs for details.

🚀 Bazel remote cache is now enabled - future builds will be faster!

Workflow: Valdi CI

@clholgat clholgat left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Storage-inspection review. One medium item inline below.

Note: this stack is being squashed to ~3 PRs — please carry this feedback into whichever squashed PR this change lands in.

}

/** Return a bounded, read-only view over current and persisted legacy web stores. */
export function getPersistentStoreSnapshot(): WebPersistentStoreSnapshot {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 Med — getPersistentStoreSnapshot enforces thorough size/entry/store/aggregate caps, but it performs no redaction and has no isDebugEnabled/opt-in gate: it returns the raw persisted values (auth tokens, session data, PII), truncated only by length. The "bounded" guarantee here is about DoS, not confidentiality.

Failure scenario: once a later PR wires this over the __VALDI_WEB_DEBUGGER__ bridge, any attached client (or any same-runtime script that can call the export) can read every persisted secret verbatim.

Suggested fix: gate the snapshot behind the same debug-enabled + nonce/loopback transport the bridge PR introduces, and redact/hash values for keys matching common secret patterns (token/auth/session/key), surfacing only length + presence by default. At minimum, add a doc comment stating this returns unredacted values and must never be exposed on an ungated transport.

@clholgat clholgat left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Storage-inspection review. One medium item inline below.

Note: this stack is being squashed to ~3 PRs — please carry this feedback into whichever squashed PR this change lands in.

@bjdodson-openai

Copy link
Copy Markdown
Collaborator Author

Superseded by #180, which consolidates this patch into the reviewed debugger capabilities landing unit. The replacement carries forward the feedback and fixes discussed here. Closing this draft to reduce the active stack; this PR and its discussion remain the historical review record.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants