Redact summaries in fsstore via shared checkpoint.RedactSummary · Entire

Redact summaries in fsstore via shared checkpoint. RedactSummary

64ef4e7main

Final review caveat: the git store redacts checkpoint summaries before storing them, but fsstore stored opts.Summary / SessionSummary directly. Export checkpoint.RedactSummary (was the private redactSummary) and use it in fsstore's session write and summary write so the reference backend models the same redaction the git store performs. Broaden the package doc to note the remaining intentional gaps (cross-session token aggregation, derived CLI/skill-events version stamps).

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

Sessions

4917f3fb8f7fView transcript

Changes

3

func TestRedactSummary_Nil(t *testing.T) {
    t.Parallel()
    result := redactSummary(nil)
    result := RedactSummary(nil)
    if result != nil {
        t.Error("redactSummary(nil) should return nil")
        t.Error("RedactSummary(nil) should return nil")
    }
}

// Verify secrets are removed from all text fields if strings.Contains(result.Intent, highEntropySecret) {

// git leakage concrete. // It is faithful to the contract's per-session metadata and write-request // semantics, but it does not replicate the git store's cross-session // aggregation: the root summary's TokenUsage reflects the latest session rather // than a sum across sessions. That aggregation is not needed to validate the // pluggable seam and is intentionally omitted. // semantics — including prompt and summary redaction via the shared // checkpoint helpers — but it does not replicate two git-writer behaviors: // cross-session aggregation (the root summary's TokenUsage reflects the latest // session, not a sum) and derived stamps the git writer adds (CLI version, // skill-events version). Neither is needed to validate the pluggable seam.

package fsstore

import (

// Update the summary existingMetadata.Summary = redactSummary(summary) existingMetadata.Summary = RedactSummary(summary)

// Write updated session metadata metadataJSON, err := jsonutil.MarshalIndentWithNewline(existingMetadata, "", " ")

// redactSummary returns a copy of the summary with text fields redacted. // Structural fields (Path, Line, EndLine) are preserved. func redactSummary(s *Summary) *Summary { if s == nil { return nil } }