Cut metadata history over to shared model
This commit is contained in:
@@ -33,6 +33,7 @@ func (builder *historyBuilder) observeBaseline(root *document.Node) {
|
||||
return
|
||||
}
|
||||
builder.model.baseline = root
|
||||
builder.registerDocumentRoot(root)
|
||||
payload := builder.nextPayload(historyPhaseBaseline)
|
||||
defaultAttribution := builder.addAttribution(Origin{Layer: LayerDefault}, nil, nil)
|
||||
walkDocument(root, Path{}, func(path Path, node *document.Node) {
|
||||
@@ -69,6 +70,17 @@ func (builder *historyBuilder) observeSourceEvidence(root *document.Node, origin
|
||||
for index := range records {
|
||||
record := records[index]
|
||||
payload := builder.addSourcePayload(nil, &record)
|
||||
for displacedIndex, displaced := range record.displaced {
|
||||
definitionPayload := payload
|
||||
definitionPayload.substep = displacedIndex + 1
|
||||
definition := builder.addAttribution(displaced.origin, nil, nil)
|
||||
builder.addObservation(historyObservation{
|
||||
path: displaced.path, phase: historyPhaseSources, payload: definitionPayload,
|
||||
reportedPath: displaced.path, role: historyRoleDefinition,
|
||||
beforePresent: true,
|
||||
attributionRef: definition,
|
||||
})
|
||||
}
|
||||
attribution := builder.addAttribution(record.change.Origin, nil, nil)
|
||||
for _, displaced := range record.displaced {
|
||||
builder.addObservation(historyObservation{
|
||||
|
||||
Reference in New Issue
Block a user