Phase 4: Remove deprecated edge fields from Issue struct (Decision 004)

This is the final phase of the Edge Schema Consolidation. It removes
the deprecated edge fields (RepliesTo, RelatesTo, DuplicateOf, SupersededBy)
from the Issue struct and all related code.

Changes:
- Remove edge fields from types.Issue struct
- Remove edge field scanning from queries.go and transaction.go
- Update graph_links_test.go to use dependency API exclusively
- Update relate.go to use AddDependency/RemoveDependency
- Update show.go with helper functions for thread traversal via deps
- Update mail_test.go to verify thread links via dependencies
- Add migration 022 to drop columns from issues table
- Fix cycle detection to allow bidirectional relates-to links
- Fix migration 022 to disable foreign keys before table recreation

All edge relationships now use the dependencies table exclusively.
The old Issue fields are fully removed.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-12-18 02:48:13 -08:00
parent 3ec517cc1b
commit 7c8b69f5b3
18 changed files with 768 additions and 607 deletions

View File

@@ -174,7 +174,7 @@ func (s *Server) handleCreate(req *Request) Response {
// Messaging fields (bd-kwro)
Sender: createArgs.Sender,
Ephemeral: createArgs.Ephemeral,
RepliesTo: createArgs.RepliesTo,
// NOTE: RepliesTo now handled via replies-to dependency (Decision 004)
}
// Check if any dependencies are discovered-from type
@@ -234,6 +234,22 @@ func (s *Server) handleCreate(req *Request) Response {
}
}
// If RepliesTo was specified, add replies-to dependency (Decision 004)
if createArgs.RepliesTo != "" {
dep := &types.Dependency{
IssueID: issue.ID,
DependsOnID: createArgs.RepliesTo,
Type: types.DepRepliesTo,
ThreadID: createArgs.RepliesTo, // Use parent ID as thread root
}
if err := store.AddDependency(ctx, dep, s.reqActor(req)); err != nil {
return Response{
Success: false,
Error: fmt.Sprintf("failed to add replies-to dependency %s -> %s: %v", issue.ID, createArgs.RepliesTo, err),
}
}
}
// Add labels if specified
for _, label := range createArgs.Labels {
if err := store.AddLabel(ctx, issue.ID, label, s.reqActor(req)); err != nil {