From 4f4b59aba584122b42bbdf2d71d560241aa22f5d Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Tue, 25 Nov 2025 00:21:28 -0800 Subject: [PATCH] fix: prevent internal fields from being exported to JSONL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ContentHash and SourceRepo were being exported to beads.jsonl even though they are internal database fields. This caused JSONL pollution where every issue got these extra fields, and re-exports would produce different output than the original clean JSONL. Changed JSON tags from `json:"...,omitempty"` to `json:"-"` for: - ContentHash: Internal optimization field for content-based diffing - SourceRepo: Internal metadata for multi-repo support This fixes the ZFC resurrection bug where re-exports after import would pollute the JSONL with internal fields. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- internal/types/types.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/types/types.go b/internal/types/types.go index dd45091e..93d9597d 100644 --- a/internal/types/types.go +++ b/internal/types/types.go @@ -10,7 +10,7 @@ import ( // Issue represents a trackable work item type Issue struct { ID string `json:"id"` - ContentHash string `json:"content_hash,omitempty"` // SHA256 hash of canonical content (excludes ID, timestamps) + ContentHash string `json:"-"` // Internal: SHA256 hash of canonical content (excludes ID, timestamps) - NOT exported to JSONL Title string `json:"title"` Description string `json:"description"` Design string `json:"design,omitempty"` @@ -29,7 +29,7 @@ type Issue struct { CompactedAt *time.Time `json:"compacted_at,omitempty"` CompactedAtCommit *string `json:"compacted_at_commit,omitempty"` // Git commit hash when compacted OriginalSize int `json:"original_size,omitempty"` - SourceRepo string `json:"source_repo,omitempty"` // Which repo owns this issue (multi-repo support) + SourceRepo string `json:"-"` // Internal: Which repo owns this issue (multi-repo support) - NOT exported to JSONL Labels []string `json:"labels,omitempty"` // Populated only for export/import Dependencies []*Dependency `json:"dependencies,omitempty"` // Populated only for export/import Comments []*Comment `json:"comments,omitempty"` // Populated only for export/import