Add canonicalize, stable block map, diff, risk floor, memory ledger service, contract fixtures, concurrency tests, and backfill CLI. Co-authored-by: Cursor <cursoragent@cursor.com>
26 lines
640 B
Go
26 lines
640 B
Go
package docrevision
|
|
|
|
// ImpactFromLineage builds deterministic document impacts from known downstream doc IDs.
|
|
func ImpactFromLineage(downstream []struct {
|
|
DocID string
|
|
Reason string
|
|
}) []DocImpact {
|
|
out := make([]DocImpact, 0, len(downstream))
|
|
for _, d := range downstream {
|
|
if d.DocID == "" {
|
|
continue
|
|
}
|
|
reason := d.Reason
|
|
if reason == "" {
|
|
reason = "上游文档内容变更,下游需复核"
|
|
}
|
|
out = append(out, DocImpact{
|
|
DocID: d.DocID,
|
|
ImpactType: "stale_candidate",
|
|
Reason: reason,
|
|
RecommendedAction: "由编制负责人复核并重新基线",
|
|
})
|
|
}
|
|
return out
|
|
}
|