feat(008): Profile Isolation and Scale — multi-tenant profiles#43
Open
feat(008): Profile Isolation and Scale — multi-tenant profiles#43
Conversation
Drizzle ORM schema for profiles pgSchema (7 tables, 4 enums), shared types/constants, Zod validation schemas (no tenantId in inputs per Leash pattern), tenant-scoped query helpers with 10 unit tests. DB client extended to export profiles schema. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… execution Engine bridge (subprocess to Spec 005 Python engine), corpus snapshot service, generation pipeline orchestrator with advisory locks for tenant-isolated concurrency, structured operation logging, in-memory metrics. 43 tests passing, typecheck clean. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Pluggable parser interface + registry, PDF/DOCX/text parsers with shared normalization pipeline, SHA-256 content-hash deduplication (tenant-scoped per FR-007), intake orchestrator with per-document status tracking and partial failure recovery. pdf-parse + mammoth deps. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Immutable version management with monotonic integers, atomic rollback in single transaction, paginated version history, retention policy (90-day archive, 30-day hard-delete, active versions protected), feature vector comparison with delta/percent-change. 42 new tests, 95 total passing, typecheck clean. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Hierarchy management with circular reference detection and depth limit, nearest-ancestor-wins inheritance resolver, 129-feature vector merging with per-feature override tracking, override source tracing/reporting, cascade propagation for ancestor changes. 45 new tests, typecheck clean. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…alidation Database-backed cache for inheritance-merged profiles, transparent getOrResolve with hit/miss metrics, upsert semantics, inheritance-aware invalidation via hierarchy tree walk, cache warming for large tenants (threshold: 20+ profiles). 33 new tests, typecheck clean. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…tion + edge case tests 13 profile_ MCP tools (list, get, generate, rollback, history, intake, hierarchy, cache), profile-executor routing, ProfilesModule entry point with dependency-ordered service init, server wiring (tools/index, executor, main index). 16 cross-tenant isolation tests (zero leakage), 14 edge case tests (tenant deletion, zero-doc, single-author, no-author). 30 new tests, typecheck clean. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…cale 7 integration test suites (45 scenarios) covering tenant isolation, version lifecycle, batch ingestion, drift-retraining, cache behavior, session binding, and audit completeness. Tests skip gracefully when DATABASE_URL is not set; will run against real PostgreSQL when available. Feature 008 (Profile Isolation and Scale) is COMPLETE. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
profilespgSchema with tenant-scoped queriesprofile_*prefix) with executor routing and module entry pointStats
Test plan
npm run typecheck— zero errorsnpx vitest run tests/profiles/— 263 passed, 50 skipped (no DB), 0 failedprofilesschema applied🤖 Generated with Claude Code