Skip to content

feat: logger DI and doc cleanup#110

Draft
Coldaine wants to merge 4 commits into
mainfrom
feat/logger-di-and-doc-cleanup
Draft

feat: logger DI and doc cleanup#110
Coldaine wants to merge 4 commits into
mainfrom
feat/logger-di-and-doc-cleanup

Conversation

@Coldaine

@Coldaine Coldaine commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Preserved 34-day WIP

Coldaine and others added 4 commits June 2, 2026 04:29
Wire a real model-inference live test (DeepSeek v4 Flash through the OpenAI-compatible client) over the real ~/.claude session, run from the pre-push hook via doppler run. Proves the Interpret pillar end-to-end, not just the read pipeline. Skips loudly without a key (CI-safe).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Single-user tool watching your own sessions on your own machine with your own keys. The inherited multi-tenant privacy posture default-DISABLED the actual product.

- DEFAULT_TRANSCRIPT_PRIVACY_SETTINGS now both-on (off-host + raw).
- Collapse the gate sprawl to ONE kill switch: SHADOW_LOCAL_ONLY=1 restores fully-local; granular env keys still override per-setting.
- sanitizeTranscriptText is secret-scrub ONLY (tokens/keys); drop the overzealous + ineffective email/path redaction that blinded the observer to the files it exists to explain.
- Suite updated to assert the new defaults with both-direction kill-switch coverage (385 green, tsc clean).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…on subsystem

A prior agent copied sidecar's multi-tenant privacy DEBT (consent gates, off-host opt-in, redaction theater, a privacy-settings UI) when only its ingestion PATTERN was wanted. For a single-user tool watching your own sessions with your own key, every gate just default-disabled the product.

Delete the whole subsystem: src/shared/privacy.ts, the SHADOW_ALLOW_*/SHADOW_LOCAL_ONLY env gates, sanitize/redaction, assertOffHostInferenceAllowed, prepareEventsForStorage gating, PrivacyPolicy/processingMode types and SnapshotPayload.privacy, the privacy IPC channel + renderer UI, and the credential-consent flag. Data flows raw end-to-end. -1464/+209 LOC across 43 files; build green, 366 tests pass, live DeepSeek inference verified intact, zero privacy symbols left in src/.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…e + tools, new inference clients

Preserves 34-day-old in-progress work found during a quiet-dirty-repo remediation sweep.

New:
- src/db/ (database.ts + 001-initial.sql) and src/persistence/database-replay-store.ts
- src/patterns/ (pattern-library, pattern-matcher, seeds)
- src/presentation/presentation-state.ts
- src/shadow/ (shadow-runtime + tools: read-active-patterns, read-event-window,
  read-session-continuity, select-pattern, write-interpretation, write-presentation, types)
- src/inference/ deepseek-client.ts, openai-responses-client.ts
- tests/ for db, patterns, presentation, shadow

Modified: inference client factory/interface, shadow-inference-engine, electron
start-main-process, persistence index, package.json/lock (deps for the above).

.kilo/ (Kilo Code agent tooling state) added to .gitignore alongside the other
agent-state ignores; not part of the product.

Incomplete WIP preserved for review -- not verified against the build/test suite.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 880cbbf7-f70a-4600-8d64-b97a3d929914

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/logger-di-and-doc-cleanup

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.

@charliecreates charliecreates Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Blocking feedback

  1. Database startup reads a migration file that is not bundled with the Electron main build — src/db/database.ts#L84
  2. Shadow runtime initialization is race-prone and can stay disabled for the entire app session — src/inference/shadow-inference-engine.ts#L159

If you'd like me to push fixes, reply with item numbers (for example: please fix 1-2).

Comment thread src/db/database.ts

function loadMigrationSql(version: number): string {
const filePath = join(migrationsDir(), `${String(version).padStart(3, '0')}-initial.sql`);
return readFileSync(filePath, 'utf8');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Blocking: loadMigrationSql() reads 001-initial.sql from disk at runtime, but electron.esbuild.mjs only emits bundled JS files and does not copy this SQL asset. In packaged runs this will throw ENOENT during createDatabase() before the app window comes up.

Suggested fix: either bundle migration SQL into JS (import as text at build time), or copy src/db/migrations into dist-electron during build:electron and resolve against that emitted path.

}

if (db) {
const events = await buffer.getAll();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Blocking: shadowRuntime is initialized exactly once from await buffer.getAll() during start(). In start-main-process.ts, capture is started asynchronously (void currentSessionManager.start()), so the buffer is often empty here; shadowRuntime stays null and the tool-backed runtime path never activates. It also never rebinds when the session id changes.

Suggested fix: lazily create/refresh shadowRuntime inside runInference (or on first eligible event), keyed by current events[0]?.sessionId, and recreate it whenever the session id changes.

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