feat(docgov): record duty_policy on lifecycle audit details

Surface the document duty mode on submit/review/approve transitions for
consistent logs under author_only.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
weichen
2026-09-17 13:15:05 +00:00
co-authored by Cursor
parent f02600d75c
commit 3f7358d454
+5 -2
View File
@@ -83,7 +83,7 @@ func (sm *StateMachine) TransitionSubmitForReview(doc *DocumentRecord, actorID i
ActorRole: actorRole,
FromState: fromState,
ToState: toState,
Details: map[string]any{"timestamp": now},
Details: map[string]any{"timestamp": now, "duty_policy": doc.DutyPolicy},
CreatedAt: now,
}, nil
}
@@ -120,7 +120,7 @@ func (sm *StateMachine) TransitionReviewApprove(doc *DocumentRecord, actorID int
ActorRole: actorRole,
FromState: fromState,
ToState: toState,
Details: map[string]any{"comment": comment, "timestamp": now},
Details: map[string]any{"comment": comment, "timestamp": now, "duty_policy": doc.DutyPolicy},
CreatedAt: now,
}, nil
}
@@ -169,6 +169,7 @@ func (sm *StateMachine) TransitionReviewReject(doc *DocumentRecord, actorID int6
Details: map[string]any{
"reject_reason": trimmedReason,
"timestamp": now,
"duty_policy": doc.DutyPolicy,
},
CreatedAt: now,
}, nil
@@ -209,6 +210,7 @@ func (sm *StateMachine) TransitionApproverApprove(doc *DocumentRecord, actorID i
Details: map[string]any{
"comment": comment,
"timestamp": now,
"duty_policy": doc.DutyPolicy,
},
CreatedAt: now,
}, nil
@@ -276,6 +278,7 @@ func (sm *StateMachine) TransitionApproverReject(doc *DocumentRecord, actorID in
"reject_reason": trimmedReason,
"rollback_to": toState,
"timestamp": now,
"duty_policy": doc.DutyPolicy,
},
CreatedAt: now,
}, nil