diff --git a/JobTrackerApi.Tests/MigrationChainTests.cs b/JobTrackerApi.Tests/MigrationChainTests.cs index 780a47e..6542a81 100644 --- a/JobTrackerApi.Tests/MigrationChainTests.cs +++ b/JobTrackerApi.Tests/MigrationChainTests.cs @@ -656,6 +656,53 @@ public sealed class MigrationChainTests Assert.Empty(await db.Database.GetPendingMigrationsAsync()); } + [Fact] + public async Task Ai_interaction_adoption_preserves_history_usage_and_cascade() + { + await using var connection = new SqliteConnection("Data Source=:memory:"); + await connection.OpenAsync(); + await using var db = Context(connection); + var migrator = db.GetService(); + await migrator.MigrateAsync("20260830128000_AdoptCvVariantSchema"); + await ExecuteAsync(connection, """ + INSERT INTO Companies (Name) VALUES ('Fixture company'); + INSERT INTO JobApplications + (CompanyId, JobTitle, DateApplied, SavedAt, Status, ResponseReceived, OwnerUserId, + HasResume, HasCoverLetter, HasPortfolio, HasOtherAttachment, IsDeleted) + VALUES + (1, 'Fixture role', '2026-08-01T09:00:00', '2026-07-20T09:00:00', + 'Applied', 0, 'owner-fixture', 0, 0, 0, 0, 0); + INSERT INTO AiInteractions + (OwnerUserId, JobApplicationId, Module, Mode, Title, Provider, ResultJson, + InputCharacterCount, OutputCharacterCount, EstimatedTokenCount, CreatedAtUtc) + VALUES + ('owner-fixture', 1, 'cover-letter', 'professional', 'Cover letter draft', + 'fixture-provider', '{"text":"preserve me"}', 1200, 640, 460, + '2026-08-30T09:00:00+00:00'); + """); + + await migrator.MigrateAsync(); + Assert.Equal("{\"text\":\"preserve me\"}", await ScalarAsync(connection, + "SELECT ResultJson FROM AiInteractions WHERE Id = 1;")); + Assert.Equal(460L, await ScalarAsync(connection, + "SELECT EstimatedTokenCount FROM AiInteractions WHERE Id = 1;")); + + await migrator.MigrateAsync("20260830128000_AdoptCvVariantSchema"); + Assert.Equal("professional", await ScalarAsync(connection, + "SELECT Mode FROM AiInteractions WHERE Id = 1;")); + await migrator.MigrateAsync(); + Assert.Equal(2L, await ScalarAsync(connection, """ + SELECT COUNT(*) FROM sqlite_master + WHERE type = 'index' AND name IN ( + 'IX_AiInteractions_JobApplicationId', + 'IX_AiInteractions_Owner_Job_Module_Created'); + """)); + + await ExecuteAsync(connection, "DELETE FROM JobApplications WHERE Id = 1;"); + Assert.Equal(0L, await ScalarAsync(connection, "SELECT COUNT(*) FROM AiInteractions;")); + Assert.Empty(await db.Database.GetPendingMigrationsAsync()); + } + private static JobTrackerContext Context(SqliteConnection connection) { var currentUser = new Mock(); diff --git a/JobTrackerApi/Migrations/20260830129000_AdoptAiInteractionSchema.cs b/JobTrackerApi/Migrations/20260830129000_AdoptAiInteractionSchema.cs new file mode 100644 index 0000000..9872b46 --- /dev/null +++ b/JobTrackerApi/Migrations/20260830129000_AdoptAiInteractionSchema.cs @@ -0,0 +1,76 @@ +using System; +using JobTrackerApi.Data; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace JobTrackerApi.Migrations; + +/// +/// Establishes explicit migration ownership for append-only AI interaction history while retaining +/// rows provisioned by the historical compatibility bootstrap or startup reconciler. +/// +[DbContext(typeof(JobTrackerContext))] +[Migration("20260830129000_AdoptAiInteractionSchema")] +public sealed class AdoptAiInteractionSchema : Migration +{ + protected override void Up(MigrationBuilder migrationBuilder) + { + if (ActiveProvider.Contains("MySql", StringComparison.OrdinalIgnoreCase)) + { + migrationBuilder.Sql(""" + CREATE TABLE IF NOT EXISTS `AiInteractions` ( + `Id` int NOT NULL AUTO_INCREMENT, + `OwnerUserId` varchar(255) NOT NULL, + `JobApplicationId` int NOT NULL, + `Module` varchar(64) NOT NULL, + `Mode` varchar(64) NULL, + `Title` varchar(255) NOT NULL, + `Provider` varchar(100) NOT NULL, + `ResultJson` longtext NOT NULL, + `InputCharacterCount` int NOT NULL DEFAULT 0, + `OutputCharacterCount` int NOT NULL DEFAULT 0, + `EstimatedTokenCount` int NOT NULL DEFAULT 0, + `CreatedAtUtc` datetime(6) NOT NULL, + PRIMARY KEY (`Id`), + CONSTRAINT `FK_AiInteractions_JobApplications_JobApplicationId` + FOREIGN KEY (`JobApplicationId`) REFERENCES `JobApplications` (`Id`) ON DELETE CASCADE + ) CHARACTER SET=utf8mb4; + CREATE INDEX IF NOT EXISTS `IX_AiInteractions_JobApplicationId` + ON `AiInteractions` (`JobApplicationId`); + CREATE INDEX IF NOT EXISTS `IX_AiInteractions_Owner_Job_Module_Created` + ON `AiInteractions` (`OwnerUserId`, `JobApplicationId`, `Module`, `CreatedAtUtc`); + """); + return; + } + + migrationBuilder.Sql(""" + CREATE TABLE IF NOT EXISTS "AiInteractions" ( + "Id" INTEGER NOT NULL CONSTRAINT "PK_AiInteractions" PRIMARY KEY AUTOINCREMENT, + "OwnerUserId" TEXT NOT NULL, + "JobApplicationId" INTEGER NOT NULL, + "Module" TEXT NOT NULL, + "Mode" TEXT NULL, + "Title" TEXT NOT NULL, + "Provider" TEXT NOT NULL, + "ResultJson" TEXT NOT NULL, + "InputCharacterCount" INTEGER NOT NULL DEFAULT 0, + "OutputCharacterCount" INTEGER NOT NULL DEFAULT 0, + "EstimatedTokenCount" INTEGER NOT NULL DEFAULT 0, + "CreatedAtUtc" TEXT NOT NULL, + CONSTRAINT "FK_AiInteractions_JobApplications_JobApplicationId" + FOREIGN KEY ("JobApplicationId") REFERENCES "JobApplications" ("Id") ON DELETE CASCADE + ); + CREATE INDEX IF NOT EXISTS "IX_AiInteractions_JobApplicationId" + ON "AiInteractions" ("JobApplicationId"); + CREATE INDEX IF NOT EXISTS "IX_AiInteractions_Owner_Job_Module_Created" + ON "AiInteractions" ("OwnerUserId", "JobApplicationId", "Module", "CreatedAtUtc"); + """); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + // Preserve append-only AI history that may pre-date explicit migration ownership. + } +} diff --git a/JobTrackerApi/Services/StartupInitializationExtensions.cs b/JobTrackerApi/Services/StartupInitializationExtensions.cs index ebe5e23..7e33b66 100644 --- a/JobTrackerApi/Services/StartupInitializationExtensions.cs +++ b/JobTrackerApi/Services/StartupInitializationExtensions.cs @@ -705,31 +705,11 @@ public static class StartupInitializationExtensions Exec(c, """CREATE INDEX IF NOT EXISTS "IX_CareerLanguages_OwnerUserId_CareerProfileId_SortOrder" ON "CareerLanguages" ("OwnerUserId", "CareerProfileId", "SortOrder");"""); } - // Phase 5 AI Workspace: append-only AI interaction history per job application. - static void EnsureAiInteractionsTable(DbConnection c) + static void ReconcileAiInteractionUsageColumns(DbConnection c) { - Exec(c, """ - CREATE TABLE IF NOT EXISTS "AiInteractions" ( - "Id" INTEGER NOT NULL CONSTRAINT "PK_AiInteractions" PRIMARY KEY AUTOINCREMENT, - "OwnerUserId" TEXT NOT NULL, - "JobApplicationId" INTEGER NOT NULL, - "Module" TEXT NOT NULL, - "Mode" TEXT NULL, - "Title" TEXT NOT NULL, - "Provider" TEXT NOT NULL, - "ResultJson" TEXT NOT NULL, - "InputCharacterCount" INTEGER NOT NULL DEFAULT 0, - "OutputCharacterCount" INTEGER NOT NULL DEFAULT 0, - "EstimatedTokenCount" INTEGER NOT NULL DEFAULT 0, - "CreatedAtUtc" TEXT NOT NULL, - CONSTRAINT "FK_AiInteractions_JobApplications_JobApplicationId" FOREIGN KEY ("JobApplicationId") REFERENCES "JobApplications" ("Id") ON DELETE CASCADE - ); - """); EnsureColumn(c, "AiInteractions", "InputCharacterCount", "ALTER TABLE AiInteractions ADD COLUMN InputCharacterCount INTEGER NOT NULL DEFAULT 0;"); EnsureColumn(c, "AiInteractions", "OutputCharacterCount", "ALTER TABLE AiInteractions ADD COLUMN OutputCharacterCount INTEGER NOT NULL DEFAULT 0;"); EnsureColumn(c, "AiInteractions", "EstimatedTokenCount", "ALTER TABLE AiInteractions ADD COLUMN EstimatedTokenCount INTEGER NOT NULL DEFAULT 0;"); - Exec(c, """CREATE INDEX IF NOT EXISTS "IX_AiInteractions_JobApplicationId" ON "AiInteractions" ("JobApplicationId");"""); - Exec(c, """CREATE INDEX IF NOT EXISTS "IX_AiInteractions_Owner_Job_Module_Created" ON "AiInteractions" ("OwnerUserId", "JobApplicationId", "Module", "CreatedAtUtc");"""); } // Phase 5 Milestone 2: the application checklist (workflow guidance over readiness signals). @@ -803,7 +783,7 @@ public static class StartupInitializationExtensions ReconcileGmailConnectionColumns(conn); EnsureCareerProfileTables(conn); - EnsureAiInteractionsTable(conn); + ReconcileAiInteractionUsageColumns(conn); EnsureApplicationChecklistTable(conn); EnsureCoverLetterVersionsTable(conn); EnsureInterviewPrepItemsTable(conn); @@ -1200,28 +1180,6 @@ public static class StartupInitializationExtensions DropMalformedMySqlTable(conn, "CoverLetterVersions", "CreatedAtUtc", "datetime"); DropMalformedMySqlTable(conn, "InterviewPrepItems", "CreatedAtUtc", "datetime"); - if (!HasMySqlTable(conn, "AiInteractions") && HasMySqlTable(conn, "JobApplications")) - { - using var cmd = conn.CreateCommand(); - cmd.CommandText = @"CREATE TABLE IF NOT EXISTS `AiInteractions` ( - `Id` int NOT NULL AUTO_INCREMENT, - `OwnerUserId` varchar(255) NOT NULL, - `JobApplicationId` int NOT NULL, - `Module` varchar(64) NOT NULL, - `Mode` varchar(64) NULL, - `Title` varchar(255) NOT NULL, - `Provider` varchar(100) NOT NULL, - `ResultJson` longtext NOT NULL, - `InputCharacterCount` int NOT NULL DEFAULT 0, - `OutputCharacterCount` int NOT NULL DEFAULT 0, - `EstimatedTokenCount` int NOT NULL DEFAULT 0, - `CreatedAtUtc` datetime(6) NOT NULL, - PRIMARY KEY (`Id`), - CONSTRAINT `FK_AiInteractions_JobApplications_JobApplicationId` FOREIGN KEY (`JobApplicationId`) REFERENCES `JobApplications` (`Id`) ON DELETE CASCADE - );"; - cmd.ExecuteNonQuery(); - } - if (!HasMySqlTable(conn, "ApplicationChecklistItems") && HasMySqlTable(conn, "JobApplications")) { using var cmd = conn.CreateCommand(); diff --git a/JobTrackerApi/Services/StartupSchemaOwnership.cs b/JobTrackerApi/Services/StartupSchemaOwnership.cs index 4706941..45e15b4 100644 --- a/JobTrackerApi/Services/StartupSchemaOwnership.cs +++ b/JobTrackerApi/Services/StartupSchemaOwnership.cs @@ -13,6 +13,7 @@ internal static class StartupSchemaOwnership "AccountDeletionRequests", "AiUsageRecords", "AiWorkspaceNotes", + "AiInteractions", "Attachments", "Companies", "Correspondences", @@ -43,7 +44,6 @@ internal static class StartupSchemaOwnership internal static readonly IReadOnlySet ReconcilerOwnedTables = new HashSet(StringComparer.Ordinal) { - "AiInteractions", "ApplicationChecklistItems", "AspNetRoleClaims", "AspNetRoles", @@ -67,5 +67,5 @@ internal static class StartupSchemaOwnership // Historical migrations contain guarded compatibility bootstraps for these tables so direct // EF tooling can traverse the chain. Their current creation owner remains the reconciler. internal static readonly IReadOnlySet MigrationCompatibilityBootstrapTables = - new HashSet(StringComparer.Ordinal) { "AiInteractions", "AspNetUsers" }; + new HashSet(StringComparer.Ordinal) { "AspNetUsers" }; } diff --git a/docs/audits/audit-remediation-backlog.md b/docs/audits/audit-remediation-backlog.md index 839af04..a08151d 100644 --- a/docs/audits/audit-remediation-backlog.md +++ b/docs/audits/audit-remediation-backlog.md @@ -558,7 +558,7 @@ SEC-008 implements the same durable state machine with `.uploading` and ` ### P3-1 — Reduce dual schema ownership incrementally -**Status (2026-08-30): in progress.** All 49 model tables now have an executable, disjoint creation-owner classification. Sixteen formerly reconciler-created tables—including authentication support, email-provider connections, CV extraction persistence, tailored CV drafts, job-workspace AI notes, and CV variant history—have moved through additive provider-aware migrations with legacy-row preservation, downgrade/retry safety, startup-DDL removal, fresh SQLite runtime proof and generated MariaDB SQL. The Gmail decision migration also closes its missing MariaDB creation path. Nineteen startup-created tables remain; see `docs/verification/jt-019-schema-ownership.md` and V-194–V-202. +**Status (2026-08-30): in progress.** All 49 model tables now have an executable, disjoint creation-owner classification. Seventeen formerly reconciler-created tables—including authentication support, email-provider connections, CV extraction persistence, tailored CV drafts, job-workspace AI notes, CV variant history, and append-only AI interactions—have moved through additive provider-aware migrations with legacy-row preservation, downgrade/retry safety, startup-DDL removal, fresh SQLite runtime proof and generated MariaDB SQL. The Gmail decision migration also closes its missing MariaDB creation path. Eighteen startup-created tables remain; see `docs/verification/jt-019-schema-ownership.md` and V-194–V-203. - **Findings/scope:** JT-019; inventory reconciler operations and move stable schema ownership to EF migrations in small steps. - **Dependencies:** provider upgrade fixtures and P2-2 restore safety. diff --git a/docs/audits/verification-log.md b/docs/audits/verification-log.md index 069f4a0..fa3308c 100644 --- a/docs/audits/verification-log.md +++ b/docs/audits/verification-log.md @@ -234,3 +234,4 @@ Output was reduced to filenames and commit counts. The token artifact appears un | V-200 | Ownership/migration chain; populated adoption/downgrade/retry; FK/index assertions; MariaDB script; full backend | Repository root / disposable local SQLite | Move job-specific tailored CV drafts to migration ownership without losing generated or edited content | PASS — focused ownership/migration 12/12; summary, custom-section and context data survive adoption, downgrade and re-upgrade; both indexes exist; deleting the parent application cascades to the draft; generated MariaDB SQL is provider-safe; startup no longer creates the table; full backend 728/728 | MariaDB SQL generated only; no provider account or production migration. Guarded MariaDB index/auto-increment repairs remain temporarily. Twenty-three reconciler-owned tables remain | JT-019 tailored CV transfer complete; career-profile aggregate remains a dependency-aware future batch | | V-201 | Ownership/migration chain; populated adoption/downgrade/retry; FK/index assertions; MariaDB script; full backend | Repository root / disposable local SQLite | Move persisted interview-preparation and irregular AI workspace notes to migration ownership without losing reviewed outputs | PASS — focused ownership/migration 13/13; interview summary and candidate-fit JSON survive adoption, downgrade and re-upgrade; both uniqueness indexes exist; deleting the parent application cascades through both tables; generated MariaDB SQL is provider-safe; startup creates neither table; full backend 729/729 | MariaDB SQL generated only; no provider account or production migration. Guarded MariaDB index/auto-increment repairs remain temporarily. Twenty-one reconciler-owned tables remain | JT-019 job-workspace note transfer complete; CV variants and career-profile aggregates remain dependency-aware batches | | V-202 | Ownership/migration chain; populated adoption/downgrade/retry; relationship/index assertions; MariaDB script; full backend | Repository root / disposable local SQLite | Move saved CV variants and append-only revision history to migration ownership without losing user documents | PASS — focused ownership/migration 14/14; public slug, settings and two revisions survive adoption, downgrade and re-upgrade; four indexes exist; deleting the job nulls only the CV link and deleting the CV cascades through revisions; generated MariaDB SQL is provider-safe; startup creates neither table; full backend 730/730 | MariaDB SQL generated only; no provider account or production migration. Guarded malformed-empty/index/auto-increment repair remains temporarily. Nineteen reconciler-owned tables remain | JT-019 CV variant aggregate transfer complete; career-profile aggregate and remaining feature tables continue incrementally | +| V-203 | Ownership/migration chain; populated adoption/downgrade/retry; usage/FK/index assertions; MariaDB script; full backend | Repository root / disposable local SQLite | Move append-only AI interaction history to explicit migration ownership without losing generated results or usage data | PASS — focused ownership/migration 15/15; result JSON, mode, provider and usage counters survive adoption, downgrade and re-upgrade; both indexes exist; deleting the parent application cascades through history; generated MariaDB SQL is provider-safe; startup no longer creates the table; full backend 731/731 | MariaDB SQL generated only; no provider account or production migration. Historical compatibility bootstrap and guarded counter/shape/index repairs remain. Eighteen reconciler-owned tables remain | JT-019 AI interaction transfer complete; checklist/document/preparation tables continue incrementally | diff --git a/docs/infrastructure/database-ownership.md b/docs/infrastructure/database-ownership.md index cbec4d0..35c65d9 100644 --- a/docs/infrastructure/database-ownership.md +++ b/docs/infrastructure/database-ownership.md @@ -66,7 +66,8 @@ already-correct database. Two consequences worth knowing: Created by EF migrations, never by the reconciler: -`AccountDeletionFiles`, `AccountDeletionRequests`, `AiUsageRecords`, `AiWorkspaceNotes`, `Attachments`, `Companies`, +`AccountDeletionFiles`, `AccountDeletionRequests`, `AiInteractions`, `AiUsageRecords`, `AiWorkspaceNotes`, +`Attachments`, `Companies`, `Correspondences`, `CvExtractionRuns`, `CvUploadArtifacts`, `CvVariants`, `CvVariantVersions`, `EmailDrafts`, `EmailSendAttempts`, `GmailConnections`, `GmailReviewDecisions`, `ImapConnections`, `InterviewPrepNotes`, `JobApplications`, `JobEvents`, `Jobs`, @@ -110,6 +111,10 @@ The CV builder aggregate (`CvVariants` and `CvVariantVersions`) moved in `20260830128000_AdoptCvVariantSchema`. Public slugs remain unique, deleting a linked application sets the CV link to null, and deleting a CV cascades through its append-only revision history. +`AiInteractions` moved in `20260830129000_AdoptAiInteractionSchema`. The older cross-feature usage +migration retains its compatibility bootstrap for historical chain traversal, but startup no longer +creates the table; only additive counter and guarded MariaDB shape/index repairs remain. + The reconciler may **repair** these (add a missing column, add an index, fix a non-`AUTO_INCREMENT` primary key) and may seed the default `RuleSettings` row — but it must never `CREATE TABLE` them. It used to create `RuleSettings`, which is precisely why a clean install failed with @@ -121,12 +126,14 @@ Created by `StartupInitializationExtensions`, with a **no-op migration** holding `CareerProfiles`, `CareerProfileVersions`, the six CareerProfile children (`CareerExperiences`, `CareerEducations`, `CareerSkills`, `CareerProjects`, `CareerCertifications`, `CareerLanguages`), -`AiInteractions`, `ApplicationChecklistItems`, `CoverLetterVersions`, and `InterviewPrepItems`. +`ApplicationChecklistItems`, `CoverLetterVersions`, and `InterviewPrepItems`. The seven ASP.NET Identity tables are also currently reconciler-owned, despite older wording that called them migration-owned: `AspNetRoles`, `AspNetUsers`, `AspNetRoleClaims`, `AspNetUserClaims`, `AspNetUserLogins`, `AspNetUserRoles`, and `AspNetUserTokens`. Guarded migration bootstraps for -`AspNetUsers` and `AiInteractions` support standalone traversal but do not yet transfer ownership. +`AspNetUsers` supports standalone traversal but does not yet transfer ownership. The historical +`AiInteractions` bootstrap remains in the migration chain, but its current owner is the later +provider-aware adoption migration. `StartupSchemaOwnership` is the executable inventory. Its tests require every EF model table to have exactly one creation owner and keep compatibility bootstraps out of the migration-owned set. @@ -137,7 +144,7 @@ No-op migrations, each with a comment explaining why: |---|---| | `20260717222917_AddCareerProfileRelationalChildren` | the six CareerProfile children | | `20260718074509_AddCvVariants` | historical no-op; ownership transferred by `20260830128000_AdoptCvVariantSchema` | -| `20260718131138_AddAiInteractions` | `AiInteractions` | +| `20260718131138_AddAiInteractions` | historical no-op; ownership transferred by `20260830129000_AdoptAiInteractionSchema` | | `20260719085904_AddApplicationChecklistItems` | `ApplicationChecklistItems` | | `20260719094728_SyncCareerChildKeyLengths` | snapshot sync only | | `20260719120954_AddCoverLetterVersions` | `CoverLetterVersions` | diff --git a/docs/verification/jt-019-schema-ownership.md b/docs/verification/jt-019-schema-ownership.md index 341daf7..8678d29 100644 --- a/docs/verification/jt-019-schema-ownership.md +++ b/docs/verification/jt-019-schema-ownership.md @@ -33,6 +33,8 @@ cohesive table groups. It does not attempt to delete the legacy reconciler whole workspace results, retaining reviewed output and both application cascade relationships. - Added `20260830128000_AdoptCvVariantSchema` for saved CVs and their append-only revision history, retaining public slugs, builder settings, and job-link/version retention semantics. +- Added `20260830129000_AdoptAiInteractionSchema` to take ownership from both the startup reconciler + and historical compatibility bootstrap while retaining append-only results and usage counters. - Corrected the ownership runbook: new tables now default to migrations; the reconciler is legacy compatibility code to retire one dependency group at a time. @@ -64,14 +66,16 @@ migration. re-upgrade; deleting the parent application still deletes both cached note types. - A representative CV and two saved revisions survive adoption, downgrade, and re-upgrade; deleting its job clears only the optional link, while deleting the CV cascades through its revisions. +- A representative AI result, mode, provider, and usage counts survive adoption, downgrade, and + re-upgrade; deleting the parent application still cascades through its interaction history. - Generated MariaDB SQL contains the provider-correct `SystemEmailSettings` DDL. -- Full backend: 730/730 passed after the CV variant and history transfer. +- Full backend: 731/731 passed after the AI interaction history transfer. - Fresh application startup over a new disposable SQLite database applied `20260830120000_AdoptSystemEmailSettingsSchema` and reached the healthy listening state. ## Remaining JT-019 work -Nineteen model tables remain startup-created, including the Identity group and several tables +Eighteen model tables remain startup-created, including the Identity group and several tables with parent dependencies. Transfer them in small dependency-aware migrations with blank, populated, retry and MariaDB runtime proof. Column/index repairs must remain until historical upgrade fixtures prove each one redundant. diff --git a/docs/work-programmes/master-progress.md b/docs/work-programmes/master-progress.md index c1c045d..1074bbb 100644 --- a/docs/work-programmes/master-progress.md +++ b/docs/work-programmes/master-progress.md @@ -52,6 +52,7 @@ Updated: 2026-08-30 - Moved job-specific tailored CV drafts into a provider-aware migration; generated and edited content, indexes, and application cascade semantics are preserved. - Moved persisted interview-preparation and AI workspace notes into one provider-aware migration; reviewed outputs, uniqueness, and application cascades are preserved. - Moved saved CV variants and append-only revision history into one provider-aware migration; public slugs, settings, indexes, job-link nulling, and history cascades are preserved. +- Moved append-only AI interaction history into a provider-aware migration; generated results, modes, providers, usage counters, indexes, and application cascades are preserved. ### In progress @@ -82,7 +83,7 @@ Updated: 2026-08-30 - Focused frontend: 2 suites, 6 tests passed. - Full frontend: 64 suites, 272 tests passed. - Next production build and TypeScript: passed. -- Full backend: 730/730 tests passed after the CV variant/history JT-019 transfer. +- Full backend: 731/731 tests passed after the AI interaction history JT-019 transfer. - Portable Playwright launcher: resolved the user-local .NET 9 SDK; backend Release build passed with 0 warnings/errors. - Playwright: initial full run 9/10 exposed the intentional mobile Settings control change; updated focused rerun passed 1/1. A final complete browser rerun remains in the end-of-batch gate. - Focused backend match/intelligence verification: 34/34 passed.