|
6 | 6 |
|
7 | 7 | Status: Approved Specification |
8 | 8 |
|
9 | | -Revision: 1.2 |
| 9 | +Revision: 1.4 |
10 | 10 |
|
11 | 11 | Approved by: Steve Ebersole |
12 | 12 |
|
@@ -132,10 +132,21 @@ Revision history:: |
132 | 132 | remove-all/create-all, or row execution. This revision responds to graph |
133 | 133 | queue benchmarks which exposed the redundant |
134 | 134 | `CollectionChangeSet -> CollectionDelta -> CollectionChangeSet` path. |
| 135 | +* `1.3` -- Replaced aspirational acceptance-suite names with traceability to the |
| 136 | + concrete tests which now exercise the implementation. Added explicit partial |
| 137 | + and pending coverage markers so an unimplemented acceptance obligation cannot |
| 138 | + be mistaken for a passing test. This revision changes test traceability only; |
| 139 | + it does not change normative behavior. |
| 140 | +* `1.4` -- Mapped the tests added to close the remaining non-cascade |
| 141 | + `CFS-SCN-*` acceptance scenarios. Added coverage for move-local ordering, |
| 142 | + replacement statistics, failure suppression, database-cascade events, |
| 143 | + cross-collection listener mutation, conservative required-flush |
| 144 | + initialization, and frozen-state access. `CFS-SCN-010` remains the |
| 145 | + acceptance target for the subsequent `CFS-CAS-*` stage. |
135 | 146 |
|
136 | 147 | == Status and Relationship to the Design Proposal |
137 | 148 |
|
138 | | -Revision 1.2 is the approved specification for collection processing during a |
| 149 | +Revision 1.4 is the approved specification for collection processing during a |
139 | 150 | Hibernate flush. It is the implementation and conformance baseline, revised in |
140 | 151 | response to implementation and benchmark evidence. |
141 | 152 |
|
@@ -171,7 +182,7 @@ Working Specification |
171 | 182 | -> Approved Specification |
172 | 183 | ---- |
173 | 184 |
|
174 | | -Revision 1.2 is currently at the final state. |
| 185 | +Revision 1.4 is currently at the final state. |
175 | 186 |
|
176 | 187 | == Normative Language |
177 | 188 |
|
@@ -1851,65 +1862,214 @@ Both queues execute that projection without enumerating the collection again. |
1851 | 1862 |
|
1852 | 1863 | == Test Traceability |
1853 | 1864 |
|
1854 | | -[cols="1,2",options="header"] |
| 1865 | +[cols="1,4,2",options="header"] |
1855 | 1866 | |=== |
1856 | | -| Requirement group | Required named test suite |
| 1867 | +| Requirement group | Concrete current coverage | Remaining acceptance coverage |
1857 | 1868 |
|
1858 | 1869 | | `CFS-CTX-*`, `CFS-TRN-*` |
1859 | | -| `CollectionFlushContextTest` for identity state and |
1860 | | - `CollectionTransitionSelectionTest` for transition tables, plus |
1861 | | - `CollectionFlushTransitionIntegrationTest` against each queue |
| 1870 | +| `CollectionEntryFlushStateTest` covers flush-local reached/processed state and |
| 1871 | + duplicate visitation. `AbstractCollectionEventTest` covers new, updated, |
| 1872 | + removed, replaced, and moved collections through the full stack. |
| 1873 | + `CollectionInterpretationQueueExecutionTest` covers create and update through |
| 1874 | + both queue implementations. |
| 1875 | +| _Partial_: no focused test currently asserts the complete normalization table, |
| 1876 | + including loaded/current role-and-key combinations and explicit |
| 1877 | + `REMOVE_AND_CREATE` ordering. |
1862 | 1878 |
|
1863 | 1879 | | `CFS-INT-*` |
1864 | | -| `CollectionMutationInterpreterContractTest` parameterized over transition and |
1865 | | - every supported standard semantics, `CollectionPhysicalMutationTest` for |
1866 | | - exhaustive sealed variants and required payload, and |
1867 | | - `CollectionInterpretationQueueExecutionTest` against both queues. The graph |
1868 | | - execution test MUST detect a second collection comparison, a |
1869 | | - `CollectionDelta -> CollectionChangeSet` reconstruction, and live collection |
1870 | | - reads after freezing. |
| 1880 | +| `CollectionMutationInterpreterContractTest` covers interpreter selection, |
| 1881 | + create projection, structural freezing, indexed updates, identifier-bag row |
| 1882 | + changes, and conservative initialization. `CustomCollectionMutationInterpreterTest` |
| 1883 | + covers a specialized uninitialized interpretation. `CollectionInterpretationQueueExecutionTest` |
| 1884 | + covers standard set, bag, list, map, and one-to-many execution through both |
| 1885 | + queues. `CollectionRowCompactionTest`, `GroupedCollectionInsertBindPlanTest`, |
| 1886 | + and `OneToManyFallbackOrdinalTest` cover graph-native compact row projection, |
| 1887 | + per-row bindings, and fallback ordinals. |
| 1888 | +| No known group-level gap. `CollectionMutationInterpreterContractTest` |
| 1889 | + explicitly permits only mutation-generation validity checks after freezing |
| 1890 | + and rejects further live collection access. |
1871 | 1891 |
|
1872 | 1892 | | `CFS-DLT-*`, `CFS-QOP-*` |
1873 | | -| `CollectionDeltaInterpretationTest` parameterized over every supported |
1874 | | - semantics, `QueuedOperationDeltaTest`, `CollectionDeltaValidityTest`, and |
1875 | | - `CustomCollectionMutationInterpreterTest`, plus `QueuedOperationFailureTest` |
1876 | | - for entity-owned physical work and unsuccessful flush completion |
| 1893 | +| `CollectionMutationInterpreterContractTest`, `QueuedOperationDeltaTest`, |
| 1894 | + `CollectionDeltaValidityTest`, `CustomCollectionMutationInterpreterTest`, and |
| 1895 | + `QueuedOperationInitializationTest` cover delta content, provenance-sensitive |
| 1896 | + queued commands, validity, orphan projection, and initialization sequencing. |
| 1897 | + `ListDelayedOperationTest` and `QueuedOperationFailureTest` cover full-stack |
| 1898 | + queued list work and unsuccessful entity-owned physical work. |
| 1899 | +| No known group-level gap beyond the scenario-specific cascade integration and |
| 1900 | + required-flush custom-semantics cases identified below. |
1877 | 1901 |
|
1878 | 1902 | | `CFS-ACT-*`, `CFS-LFC-*` |
1879 | | -| `CollectionMutationLifecycleTest` and `OwnerCollectionLifecycleTest` covering |
1880 | | - queue-independent Hibernate events, interceptor hooks, Jakarta Persistence |
1881 | | - callbacks, monitoring, cache, and statistics |
| 1903 | +| The `AbstractCollectionEventTest` hierarchy, |
| 1904 | + `DetachedMultipleCollectionChangeTest`, and `MergeCollectionEventTest` cover |
| 1905 | + Hibernate collection-event pairs. `CollectionAutoFlushLifecycleTest` covers |
| 1906 | + interceptor, pre-event, and owner-callback deferral. `AssociationChangeTests` |
| 1907 | + and `OwnerUpdateCompletionCoordinatorTest` cover owner callback applicability, |
| 1908 | + deduplication, mutation visibility, ordering, and failure. `CollectionExecutionMonitorTest` |
| 1909 | + and `BatchingExecutionMonitorTest` cover diagnostic monitoring. |
| 1910 | + `CollectionMutationCompletionTest#failedPhysicalWorkSuppressesEverySuccessfulLifecycleConsumer` |
| 1911 | + covers joint suppression of state advancement, post-event, cache, queued-work, |
| 1912 | + and statistics completion consumers. |
| 1913 | +| No known group-level gap. |
1882 | 1914 |
|
1883 | 1915 | | `CFS-CMP-*`, `CFS-GRP-*` |
1884 | | -| `CollectionMutationCompletionTest`, `CollectionMutationGroupingTest`, and |
1885 | | - `CollectionMutationFixupTest` covering direct, planned, batched, and failed |
1886 | | - execution |
| 1916 | +| `CollectionMutationCompletionTest`, `CollectionMutationExecutorCompletionTest`, |
| 1917 | + `BatchingExecutionMonitorTest`, `FlushCoordinatorCollectionGroupingTest`, |
| 1918 | + `CollectionRowCompactionTest`, and `GroupedCollectionInsertBindPlanTest` cover |
| 1919 | + zero/direct/batched completion, failure, queued work, fixups, mutation identity, |
| 1920 | + compact row grouping, and per-row binding/result checks. |
| 1921 | +| No known group-level gap. |
1887 | 1922 |
|
1888 | 1923 | | `CFS-AFL-*` |
1889 | | -| `ActionQueueCheckpointTest` as a shared contract suite for every queue and |
1890 | | - `CollectionAutoFlushLifecycleTest` |
| 1924 | +| `ActionQueueCheckpointTest` invokes the checkpoint contract for both queues and |
| 1925 | + verifies durable orphan-collection removal. `CollectionAutoFlushLifecycleTest` |
| 1926 | + and `AutoFlushEventListenerTest` cover required and discarded auto-flush paths. |
| 1927 | +| No known group-level gap. |
1891 | 1928 |
|
1892 | 1929 | | `CFS-CAS-*` |
1893 | | -| `CollectionDeltaOrphanProjectionTest` covering valid/stale reuse, |
1894 | | - no-forced-initialization, standalone fallback, orphan timing, queued orphans, |
1895 | | - iteration, and lazy initialization |
| 1930 | +| `CollectionDeltaValidityTest#orphanProjectionContainsOnlyKnownRemovedState` |
| 1931 | + and `#mutationGenerationInvalidatesRetainedDelta` cover projection content and |
| 1932 | + invalidation primitives. |
| 1933 | +| _Pending_: cascade consumption, valid and stale delta reuse, standalone |
| 1934 | + fallback, no-forced-initialization, and regression coverage proving unchanged |
| 1935 | + orphan timing, queued-orphan behavior, collection iteration, and lazy behavior. |
1896 | 1936 |
|
1897 | 1937 | | `CFS-COM-*` |
1898 | | -| `CollectionFlushQueueConformanceTest` against both queues and focused |
1899 | | - regression tests named in `CFS-COM-002` |
| 1938 | +| `CollectionInterpretationQueueExecutionTest` is the explicit two-queue |
| 1939 | + full-stack suite. `ActionQueueCheckpointTest` exercises both queue checkpoint |
| 1940 | + implementations. `CrossCollectionListenerMutationTest` runs against both |
| 1941 | + queues. The collection event hierarchy and the existing |
| 1942 | + delayed-operation, orphan-delete, one-to-many, many-to-many, element-collection, |
| 1943 | + and cache regression suites provide broader compatibility coverage. |
| 1944 | +| No known acceptance-scenario gap. |
1900 | 1945 |
|
1901 | 1946 | | `CFS-MIG-*` |
1902 | | -| Static documentation review of the required anchors and final implemented |
1903 | | - signatures in `migration-guide.adoc`; no runtime test is required |
| 1947 | +| Static review of `migration-guide.adoc` verifies the required anchors, |
| 1948 | + `ActionQueue#checkpoint()` / `#restore(ActionQueueCheckpoint)`, and |
| 1949 | + `CollectionSemantics#getCollectionMutationInterpreter()`. |
| 1950 | +| No runtime test is required. |
1904 | 1951 | |=== |
1905 | 1952 |
|
1906 | | -The acceptance scenarios map to methods `scenario001NewCollection()` through |
1907 | | -`scenario016CreateAndBagUpdateRowProjection()` in |
1908 | | -`CollectionFlushAcceptanceTest`, executed against both queue implementations |
1909 | | -unless a scenario explicitly concerns one queue's internal representation. |
| 1953 | +[cols="1,4,1",options="header"] |
| 1954 | +|=== |
| 1955 | +| Acceptance scenario | Concrete test mapping | Coverage |
| 1956 | + |
| 1957 | +| `CFS-SCN-001` -- New collection |
| 1958 | +| `AbstractCollectionEventTest#testSaveParentEmptyChildren` and |
| 1959 | + `#testSaveParentOneChild`; |
| 1960 | + `CollectionInterpretationQueueExecutionTest.LegacyQueue#executesCreateAndUpdateDeltas` |
| 1961 | + and `CollectionInterpretationQueueExecutionTest.GraphQueue#executesCreateAndUpdateDeltas`; |
| 1962 | + `CollectionMutationCompletionTest#zeroOperationMutationCompletesWhenSealed` |
| 1963 | +| Covered |
| 1964 | + |
| 1965 | +| `CFS-SCN-002` -- Collection move |
| 1966 | +| `AbstractCollectionEventTest#testMoveCollectionToDifferentParent` and |
| 1967 | + `#testMoveCollectionToDifferentParentFlushMoveToDifferentParent`; |
| 1968 | + `CollectionMutationCompletionTest#statementGroupingDoesNotMergeMutationIdentity` |
| 1969 | +| Covered |
| 1970 | + |
| 1971 | +| `CFS-SCN-003` -- Update requiring physical replacement |
| 1972 | +| `CollectionInterpretationQueueExecutionTest.LegacyQueue#executesCreateAndUpdateDeltas` |
| 1973 | + and `CollectionInterpretationQueueExecutionTest.GraphQueue#executesCreateAndUpdateDeltas`; |
| 1974 | + `CollectionInterpretationQueueExecutionTest.GraphQueue#executesCompactBagRecreateAcrossJdbcBatches`; |
| 1975 | + both queue fixtures of |
| 1976 | + `CollectionInterpretationQueueExecutionTest#bagReplacementRecordsOneSemanticUpdate`; |
| 1977 | + the update cases in `AbstractCollectionEventTest` |
| 1978 | +| Covered |
| 1979 | + |
| 1980 | +| `CFS-SCN-004` -- Uninitialized queued list appends |
| 1981 | +| `QueuedOperationDeltaTest#listAppendsShareOnePersistedSizeHandle`; |
| 1982 | + `ListDelayedOperationTest#testSimpleAddManaged`; |
| 1983 | + `CollectionMutationCompletionTest#queuedWorkWaitsForSuccessfulFlush`; |
| 1984 | + `QueuedOperationFailureTest#failedEntityInsertDoesNotFinalizeQueuedCollectionWork` |
| 1985 | +| Covered |
| 1986 | + |
| 1987 | +| `CFS-SCN-005` -- Same-shape mutations |
| 1988 | +| `CollectionMutationCompletionTest#statementGroupingDoesNotMergeMutationIdentity`; |
| 1989 | + `BatchingExecutionMonitorTest#groupedRowsRetainPerRowBindingAndResultChecksWithOneCompletion`; |
| 1990 | + `CollectionMutationExecutorCompletionTest#directExecutionVisitsEveryGroupedBindingAndCompletesOnce` |
| 1991 | +| Covered |
| 1992 | + |
| 1993 | +| `CFS-SCN-006` -- Zero-SQL update |
| 1994 | +| `CollectionMutationCompletionTest#zeroOperationMutationCompletesWhenSealed`; |
| 1995 | + `FlushCoordinatorCollectionGroupingTest#noOpCompletionCarriersRemainMutationLocal` |
| 1996 | +| Covered |
| 1997 | + |
| 1998 | +| `CFS-SCN-007` -- Batch failure |
| 1999 | +| `BatchingExecutionMonitorTest#failedBatchSuppressesSemanticCompletion`; |
| 2000 | + `CollectionMutationCompletionTest#failureSuppressesSuccessfulCompletion`; |
| 2001 | + `#failedPhysicalWorkSuppressesEverySuccessfulLifecycleConsumer`; |
| 2002 | + `QueuedOperationFailureTest#failedEntityInsertDoesNotFinalizeQueuedCollectionWork`; |
| 2003 | + `OwnerUpdateCompletionCoordinatorTest#failureSuppressesPostUpdate` |
| 2004 | +| Covered |
| 2005 | + |
| 2006 | +| `CFS-SCN-008` -- Discarded auto-flush |
| 2007 | +| `CollectionAutoFlushLifecycleTest#lifecycleWaitsForPositiveFlushDecision`; |
| 2008 | + `AutoFlushEventListenerTest#testAutoFlushNotRequired`; |
| 2009 | + `ActionQueueCheckpointTest#checkpointContract` and |
| 2010 | + `#postCheckpointOrphanCollectionRemovalIsDurable` |
| 2011 | +| Covered |
| 2012 | + |
| 2013 | +| `CFS-SCN-009` -- Database-cascade remove |
| 2014 | +| `OnDeleteCascadeToElementCollectionTest#testCascadingDeleteUnloaded` and |
| 2015 | + `#testCascadingDeleteLoaded`, including their direct remove-event assertions; |
| 2016 | + collection remove event pairing in |
| 2017 | + `AbstractAssociationCollectionEventTest#testDeleteParentButNotChild` |
| 2018 | +| Covered |
| 2019 | + |
| 2020 | +| `CFS-SCN-010` -- Cascade orphan-projection reuse |
| 2021 | +| `CollectionDeltaValidityTest#orphanProjectionContainsOnlyKnownRemovedState` |
| 2022 | + and `#mutationGenerationInvalidatesRetainedDelta` cover the reusable |
| 2023 | + projection and its comparison-validity primitive. |
| 2024 | +| Pending cascade integration |
| 2025 | + |
| 2026 | +| `CFS-SCN-011` -- Cross-collection listener mutation |
| 2027 | +| Both queue fixtures of |
| 2028 | + `CrossCollectionListenerMutationTest#laterListenerMutationRepreparesEarlierCollection` |
| 2029 | +| Covered |
| 2030 | + |
| 2031 | +| `CFS-SCN-012` -- Owner callback deduplication |
| 2032 | +| `AssociationChangeTests#testOwnerElementCollectionChangeGuardrail`, |
| 2033 | + `#testOwnerToManyChangeGuardrail`, |
| 2034 | + `#ownerPreUpdateCollectionChangeIsIncludedInTheSameFlush`, and |
| 2035 | + `#ownerPreUpdateCollectionReplacementIsIncludedInAutoFlush`; |
| 2036 | + `OwnerUpdateCompletionCoordinatorTest#waitsForEntityAndEveryCollectionParticipant` |
| 2037 | +| Covered |
| 2038 | + |
| 2039 | +| `CFS-SCN-013` -- Initialization consumes queued operations |
| 2040 | +| `QueuedOperationInitializationTest#queuedCommandsAreAppliedAndClearedAfterSnapshotCapture` |
| 2041 | +| Covered |
| 2042 | + |
| 2043 | +| `CFS-SCN-014` -- Conservative custom-semantics fallback |
| 2044 | +| `CollectionMutationInterpreterContractTest#defaultInterpreterRequestsInitializationForUninitializedCustomWrapper`; |
| 2045 | + `CustomCollectionMutationInterpreterTest#requiredFlushInitializesForConservativeInterpreterAndThenFreezesCompleteDelta`; |
| 2046 | + `CustomCollectionMutationInterpreterTest#specializedInterpreterCanDescribeUninitializedStateWithoutInitialization`; |
| 2047 | + `QueuedOperationInitializationTest#queuedCommandsAreAppliedAndClearedAfterSnapshotCapture` |
| 2048 | +| Covered |
| 2049 | + |
| 2050 | +| `CFS-SCN-015` -- Graph row-change interpretation |
| 2051 | +| `CollectionInterpretationQueueExecutionTest.LegacyQueue#executesCreateAndUpdateDeltas` |
| 2052 | + and `CollectionInterpretationQueueExecutionTest.GraphQueue#executesCreateAndUpdateDeltas`; |
| 2053 | + `CollectionMutationInterpreterContractTest#createRetainsCurrentRowsWithoutSemanticAdditions`; |
| 2054 | + `CollectionMutationInterpreterContractTest#indexedUpdateRetainsOriginalChangeSet` |
| 2055 | + and `#changeSetFreezesStructuralLists` |
| 2056 | +| Covered |
| 2057 | + |
| 2058 | +| `CFS-SCN-016` -- Create and bag-update row projection |
| 2059 | +| `CollectionMutationInterpreterContractTest#createRetainsCurrentRowsWithoutSemanticAdditions`; |
| 2060 | + `CollectionInterpretationQueueExecutionTest.GraphQueue#executesCompactCreateAcrossJdbcBatches` |
| 2061 | + and `#executesCompactBagRecreateAcrossJdbcBatches`; |
| 2062 | + `CollectionRowCompactionTest`; `GroupedCollectionInsertBindPlanTest` |
| 2063 | +| Covered |
| 2064 | +|=== |
1910 | 2065 |
|
1911 | | -Every `MUST` requirement maps to at least one named test suite above or requires |
1912 | | -an explicitly recorded reason why static verification is sufficient. |
| 2066 | +These tables describe current coverage rather than prescribing nonexistent |
| 2067 | +monolithic suites. Every non-cascade `CFS-SCN-*` acceptance scenario now maps |
| 2068 | +to concrete tests; `CFS-SCN-010` remains the acceptance target for `CFS-CAS-*`. |
| 2069 | +A _Partial_ or _Pending_ row remains an open obligation. Before the |
| 2070 | +implementation is considered fully conformant, every `MUST` requirement must |
| 2071 | +map to a concrete test above or have an explicitly recorded reason why static |
| 2072 | +verification is sufficient. |
1913 | 2073 |
|
1914 | 2074 | == Approved Decisions |
1915 | 2075 |
|
@@ -2187,7 +2347,8 @@ existing cascade traversal architecture. |
2187 | 2347 |
|
2188 | 2348 | == Development-Team Review and Change Control |
2189 | 2349 |
|
2190 | | -Revision 1.2 was approved after satisfying these readiness criteria, including |
| 2350 | +Revision 1.4 remains approved under the same readiness criteria as revision 1.2, |
| 2351 | +including |
2191 | 2352 | acceptance of the resolved `OQ-012` performance gate and the new interpretation |
2192 | 2353 | test and benchmark obligations: |
2193 | 2354 |
|
|
0 commit comments