Record chunking metadata in process runs
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
"gitea.maximumdirect.net/eric/audita/internal/core/chunking"
|
||||
"gitea.maximumdirect.net/eric/audita/internal/core/normalization"
|
||||
"gitea.maximumdirect.net/eric/audita/internal/core/reporting"
|
||||
"gitea.maximumdirect.net/eric/audita/internal/core/schema"
|
||||
@@ -119,7 +120,20 @@ func (r *RunDirectory) WriteErrorLog(errorMessage string) error {
|
||||
return os.WriteFile(errorPath, []byte(errorMessage+"\n"), 0o644)
|
||||
}
|
||||
|
||||
// ApplyRetention applies a minimal phase-2 retention policy.
|
||||
// WriteChunkingSummary writes the chunking summary artifact
|
||||
func (r *RunDirectory) WriteChunkingSummary(summary *chunking.DetailedSummary) error {
|
||||
summaryPath := filepath.Join(r.path, "chunking-summary.json")
|
||||
bytes, err := json.MarshalIndent(summary, "", " ")
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to marshal chunking summary: %w", err)
|
||||
}
|
||||
bytes = append(bytes, '\n')
|
||||
if err := os.WriteFile(summaryPath, bytes, 0o644); err != nil {
|
||||
return fmt.Errorf("failed to write chunking summary: %w", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// TODO: In later phases, implement full "auto" semantics based on skip/report outcomes.
|
||||
func (r *RunDirectory) ApplyRetention(runSucceeded bool) error {
|
||||
if !runSucceeded {
|
||||
|
||||
Reference in New Issue
Block a user