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

@@ -362,9 +362,7 @@ func runMailInbox(cmd *cobra.Command, args []string) error {
fmt.Printf(" %s: %s%s\n", msg.ID, msg.Title, priorityStr)
fmt.Printf(" From: %s (%s)\n", msg.Sender, timeStr)
if msg.RepliesTo != "" {
fmt.Printf(" Re: %s\n", msg.RepliesTo)
}
// NOTE: Thread info now in dependencies (Decision 004)
fmt.Println()
}
@@ -418,9 +416,7 @@ func runMailRead(cmd *cobra.Command, args []string) error {
if issue.Priority <= 1 {
fmt.Printf("Priority: P%d\n", issue.Priority)
}
if issue.RepliesTo != "" {
fmt.Printf("Re: %s\n", issue.RepliesTo)
}
// NOTE: Thread info (RepliesTo) now in dependencies (Decision 004)
fmt.Printf("Status: %s\n", issue.Status)
fmt.Println(strings.Repeat("─", 66))
fmt.Println()
@@ -593,10 +589,11 @@ func runMailReply(cmd *cobra.Command, args []string) error {
Assignee: recipient,
Sender: sender,
Ephemeral: true,
RepliesTo: messageID, // Thread link
CreatedAt: now,
UpdatedAt: now,
// NOTE: RepliesTo now handled via dependency API (Decision 004)
CreatedAt: now,
UpdatedAt: now,
}
_ = messageID // RepliesTo handled via CreateArgs.RepliesTo -> server creates dependency
if daemonClient != nil {
// Daemon mode - create reply with all messaging fields