Use main for the main provenance layer
This commit is contained in:
@@ -107,7 +107,7 @@ func TestTierSequenceHistoryReplaysSelectedOperation(t *testing.T) {
|
||||
t.Fatal(diagnostics)
|
||||
}
|
||||
assembly := newAssemblyAccumulator(lower)
|
||||
if diagnostics := assembly.applyOverlayWithCollectionPolicy(higher.root, higher.origins, higher.collectionPolicies, higher.applications, LayerBase, policy, declarations); len(diagnostics) != 0 {
|
||||
if diagnostics := assembly.applyOverlayWithCollectionPolicy(higher.root, higher.origins, higher.collectionPolicies, higher.applications, LayerMain, policy, declarations); len(diagnostics) != 0 {
|
||||
t.Fatal(diagnostics)
|
||||
}
|
||||
if len(assembly.current.applications) != 3 {
|
||||
@@ -176,7 +176,7 @@ func TestSequenceHistoryPreservesTierReplacementAndEmptyLists(t *testing.T) {
|
||||
if diagnostics := assembly.applyOverlay(second.root, second.origins, second.applications, LayerUnderlay); len(diagnostics) != 0 {
|
||||
t.Fatalf("second tier handoff diagnostics = %#v", diagnostics)
|
||||
}
|
||||
if diagnostics := assembly.applyOverlay(main.root, main.origins, main.applications, LayerBase); len(diagnostics) != 0 {
|
||||
if diagnostics := assembly.applyOverlay(main.root, main.origins, main.applications, LayerMain); len(diagnostics) != 0 {
|
||||
t.Fatalf("main handoff diagnostics = %#v", diagnostics)
|
||||
}
|
||||
if len(assembly.current.applications) != 4 {
|
||||
@@ -201,7 +201,7 @@ func TestSequenceHistoryPreservesTierReplacementAndEmptyLists(t *testing.T) {
|
||||
// The same identity may appear in separate tiers, while each tier still
|
||||
// retains its individual source applications for explanation replay.
|
||||
if got := []Layer{assembly.current.applications[0].layer, assembly.current.applications[1].layer,
|
||||
assembly.current.applications[2].layer, assembly.current.applications[3].layer}; !reflect.DeepEqual(got, []Layer{LayerUnderlay, LayerUnderlay, LayerUnderlay, LayerBase}) {
|
||||
assembly.current.applications[2].layer, assembly.current.applications[3].layer}; !reflect.DeepEqual(got, []Layer{LayerUnderlay, LayerUnderlay, LayerUnderlay, LayerMain}) {
|
||||
t.Fatalf("application layers = %#v", got)
|
||||
}
|
||||
}
|
||||
@@ -250,14 +250,14 @@ func TestLayeredUpsertExplanationFollowsStructuralOrder(t *testing.T) {
|
||||
t.Fatal("structural upsert was misreported as a decoding reconciliation")
|
||||
}
|
||||
}
|
||||
if last := explanation.History[len(explanation.History)-1]; last.After.YAML != explanation.Effective.YAML || last.Origin.Layer != LayerBase {
|
||||
if last := explanation.History[len(explanation.History)-1]; last.After.YAML != explanation.Effective.YAML || last.Origin.Layer != LayerMain {
|
||||
t.Fatalf("main contribution did not produce the effective collection: %#v", last)
|
||||
}
|
||||
removed, ok := loaded.Explain(Keys("records").Index(1).Key("removed"))
|
||||
if !ok || len(removed.History) == 0 || removed.Effective.Present {
|
||||
t.Fatalf("missing displaced field history: %#v, %v", removed, ok)
|
||||
}
|
||||
if last := removed.History[len(removed.History)-1]; last.After.Present || last.Origin.Layer != LayerBase || last.Origin.Operation == ChangeDecoding {
|
||||
if last := removed.History[len(removed.History)-1]; last.After.Present || last.Origin.Layer != LayerMain || last.Origin.Operation == ChangeDecoding {
|
||||
t.Fatalf("upsert removal attribution = %#v", last)
|
||||
}
|
||||
}
|
||||
@@ -650,7 +650,7 @@ func TestHistorySourceSequenceReplacementTracksMappedAndWholeSides(t *testing.T)
|
||||
finalSequence, _ := documentAtPath(finalRoot, Keys("records"))
|
||||
*finalSequence = *document.Clone(combined.value)
|
||||
lowerOrigins := make(map[string]Origin)
|
||||
collectOverlayOrigins(lowerOrigins, lowerRoot, Path{}, LayerBase)
|
||||
collectOverlayOrigins(lowerOrigins, lowerRoot, Path{}, LayerMain)
|
||||
higherOrigins := make(map[string]Origin)
|
||||
collectOverlayOrigins(higherOrigins, higherRoot, Path{}, LayerOverlay)
|
||||
assembly := newAssemblyAccumulator(&composedDocument{root: finalRoot, origins: lowerOrigins})
|
||||
@@ -667,7 +667,7 @@ func TestHistorySourceSequenceReplacementTracksMappedAndWholeSides(t *testing.T)
|
||||
}
|
||||
higherApplication.sequencesByPath = indexSequenceHistoryContributions(higherApplication.sequences)
|
||||
applications := []historyApplication{
|
||||
{layer: LayerBase, value: lowerRoot}, higherApplication,
|
||||
{layer: LayerMain, value: lowerRoot}, higherApplication,
|
||||
}
|
||||
builder := newHistoryBuilder()
|
||||
builder.observeSourceEvidence(finalRoot, assembly.current.origins, applications, assembly.current.overlays)
|
||||
@@ -728,7 +728,7 @@ func TestHistorySourceSequenceReplacementTracksMappedAndWholeSides(t *testing.T)
|
||||
wholeFinalSequence, _ := documentAtPath(wholeFinal, Keys("records"))
|
||||
*wholeFinalSequence = *document.Clone(whole.value)
|
||||
wholeLowerOrigins := make(map[string]Origin)
|
||||
collectOverlayOrigins(wholeLowerOrigins, wholeLower, Path{}, LayerBase)
|
||||
collectOverlayOrigins(wholeLowerOrigins, wholeLower, Path{}, LayerMain)
|
||||
wholeHigherOrigins := make(map[string]Origin)
|
||||
collectOverlayOrigins(wholeHigherOrigins, wholeHigher, Path{}, LayerOverlay)
|
||||
wholeAssembly := newAssemblyAccumulator(&composedDocument{root: wholeFinal, origins: wholeLowerOrigins})
|
||||
@@ -743,7 +743,7 @@ func TestHistorySourceSequenceReplacementTracksMappedAndWholeSides(t *testing.T)
|
||||
wholeHigherApplication.sequencesByPath = indexSequenceHistoryContributions(wholeHigherApplication.sequences)
|
||||
wholeBuilder := newHistoryBuilder()
|
||||
wholeBuilder.observeSourceEvidence(wholeFinal, wholeAssembly.current.origins, []historyApplication{
|
||||
{layer: LayerBase, value: wholeLower}, wholeHigherApplication,
|
||||
{layer: LayerMain, value: wholeLower}, wholeHigherApplication,
|
||||
}, wholeAssembly.current.overlays)
|
||||
wholeModel := wholeBuilder.freeze()
|
||||
if len(wholeAssembly.current.overlays) != 1 {
|
||||
|
||||
Reference in New Issue
Block a user