Files
weichenandCursor 268a9bdb56 feat(service): implement docrevision Version/Revision kernel
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>
2026-09-13 06:15:20 +00:00

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
}