Share edit location and check protected names in full segments

This commit is contained in:
2026-11-16 04:09:25 +00:00
parent 43ce620122
commit 475557e4de
23 changed files with 488 additions and 269 deletions

View File

@@ -2,6 +2,8 @@ package proposals
import (
"fmt"
"gitea.maximumdirect.net/eric/audita/v3/internal/core/schema"
)
// CorrectionProposal is the base proposal emitted by correction modules.
@@ -39,3 +41,12 @@ func (p CorrectionProposal) Validate() error {
return nil
}
// SegmentIDAtReference maps a one-based model reference in the supplied
// section to the transcript's segment ID. Zero represents an invalid reference.
func SegmentIDAtReference(section *schema.Transcript, reference int) int {
if section == nil || reference <= 0 || reference > len(section.Segments) {
return 0
}
return section.Segments[reference-1].ID
}