Skip to content

Commit c3eeb2b

Browse files
committed
Exercise valid relational schema migration refusal
1 parent 3a744d1 commit c3eeb2b

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

‎ai-database-sql.plan.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ no reliable cheaper-tier correctness/routing evidence is available in this run.
2626
| TASK-AISQL-011; exact baseline finding and Accepted ADR-036 contract | SQL worker; OrleansNode.cs, NEW Server/Features/ClusterRouting/OrleansRpcFailure.cs and UnitTests/Features/ClusterRouting/OrleansRpcFailureTests.cs only; root owns trusted gateway/auth caller joins and docs | 011,009 | Native-exception regression sources, narrow initial-RPC classification, no retry/suppression/domain recoding; root reviews then exact-SHA build/unit/RF3 catch-up proof |
2727
| TASK-AISQL-012A; Accepted ADR-054 integration repair | models worker; Client/Features/BlobStorage/BlobClient.cs and NEW UnitTests/Features/BlobStorage/BlobSdkArgumentTests.cs only; root owns Send access join | 012,006,009 | Tests-first public null guards, source-compatible feature extension methods, same transport/IDs; root review + exact build/RF3 |
2828
| TASK-AISQL-012B; Accepted ADR-054 integration repair | gates worker; QueryCandidateReader.cs only | 008,009 | Remove depth4 nesting without new allocations/semantic changes; existing25 real-store regression cases + exact build |
29+
| TASK-AISQL-018; root static scenario review | models worker; RelationalSchemaTests.cs only | 002,004,009 | Ensure schema-change fixture is independently valid (retain indexed name column), then assert exact UnsupportedCapability and unchanged persisted schema; malformed-index validation remains separately tested. No production precedence change or assertion weakening |
2930
| TASK-AISQL-015; exact UnitTests compiler diagnostics | models worker; RelationalLinkageTests.cs, RelationalTestData.cs and RelationalRowTests.cs only | 002–004,009 | Correct actual ordered TUnit collection comparison and cache CompositeFormat without altering exact raw decimal fixtures or assertions; exact-SHA compiler/units join |
3031
| TASK-AISQL-016; exact UnitTests compiler diagnostics | SQL worker; OrleansRpcFailureTests.cs, SqlOperationBudgetTests.cs and SqlOperationCompilerTests.cs only | 005,007,011,009 | Await native CancelAsync before cancellation assertions and remove imports proven redundant by actual compiler; same errors and test coverage, no suppression |
3132
| TASK-AISQL-014; exact RF3 compiler diagnostics | gates worker; SqlRf3AdmissionTests.cs only, root owns static scenario member | 004,007,009 | Isolate existing per-node using/await-using ownership in VerifyNodeAsync outside fixture try/finally/loop analysis; start caller deadline after separately bounded fixture readiness; preserve all3 real-node assertions, same-ID control progress and schema/linkage contracts; no suppression/test weakening |
@@ -176,3 +177,9 @@ The same candidate Ubuntu job111045551116 exposed additional unit source failure
176177
- [ ] IDE0005 unused UnitTests imports in OrleansRpcFailureTests/SqlOperationCompilerTests: remove only compiler-identified redundant imports.
177178

178179
TASK-AISQL-014/015/016 are complete source artifacts, reviewed and joined by root. Per-node disposal extraction, static vector-space helper, actual TUnit namespace, cached invariant formatting, awaited cancellation and unused-import removals retain every contract/assertion. Exact-SHA build/tests remain pending.
180+
181+
Candidate3a744d19aa4443a522d303d8d91257f2e20396da / [37070004864](https://github.com/managedcode/KeyLoad/actions/runs/37070004864) contains reviewed TASK-AISQL-014/015/016 repairs. The superseded9f3 run37069574976 was explicitly cancelled after recorded required build failures to release same-ref CI concurrency; its unfinished comparisons cannot count as passing evidence. The new run must execute every required suite.
182+
183+
Root source review found the schema-migration test removed the indexed name column while retaining its index. ValidateResource correctly rejects that malformed schema before checking migration. TASK-AISQL-018 changes only the intended valid changed-schema fixture and proves it validates independently; migration refusal and unchanged original persisted schema must remain exact. CI3a744d19a is already running, so its observed result remains authoritative and the repaired fixture needs a later exact-SHA run.
184+
185+
TASK-AISQL-017 independent review is complete/clean for all11 original compiler diagnostics. TASK-AISQL-018 is source-complete and root-reviewed: valid nullable Name change with preserved indexes, explicit schema validity, exact migration refusal and byte-for-byte persisted-resource equality. GitHub execution remains required.

‎tests/KeyLoad.UnitTests/Features/RelationalStorage/RelationalSchemaTests.cs‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,15 @@ public async Task AcAisql002SchemaPersistsAndChangingItsContractRequiresMigratio
2020
await Assert.That(JsonDefaults.Serialize(configured).SequenceEqual(JsonDefaults.Serialize(definition))).IsTrue();
2121
var persisted = database.Store.Read(view => database.Database.Resource(view, database.Partition, RelationalTestData.Table));
2222
await Assert.That(persisted.RelationalSchema!.Columns.Length).IsEqualTo(RelationalTestData.Columns.Length);
23-
var changed = definition with { RelationalSchema = new(RelationalTestData.Key, [new(RelationalTestData.Key, RelationalColumnType.Text)]) };
23+
var changed = definition with
24+
{
25+
RelationalSchema = new(RelationalTestData.Key, [.. RelationalTestData.Columns.Select(column =>
26+
column.Name == RelationalTestData.Name ? column with { Nullable = true } : column)])
27+
};
28+
RelationalRowValidation.ValidateSchema(changed);
2429
await Assert.That(RelationalTestData.ConfigureResult(database, changed).Error).IsEqualTo(ErrorCode.UnsupportedCapability);
30+
var persistedAfter = database.Store.Read(view => database.Database.Resource(view, database.Partition, RelationalTestData.Table));
31+
await Assert.That(JsonDefaults.Serialize(persistedAfter).SequenceEqual(JsonDefaults.Serialize(persisted))).IsTrue();
2532
}
2633

2734
[Test]

0 commit comments

Comments
 (0)