Surface common tracker pattern link across APIs

Expose the existing tracker_patterns.common_tracker_pattern_id foreign
key on the TrackerPattern type so it is possible to tell whether a
pattern is linked to the global common-tracker catalog (its description
likely came from the seed or the mapping/enrichment agents) or has no
link (added manually or inherited). This is a read-only debugging aid
for agent-generated descriptions; no migration or write path changes.

The field is added in sync across all four API surfaces (GraphQL, MCP,
CLI, n8n) plus the console UI, and covered by e2e assertions for both
the linked and unlinked cases.

Signed-off-by: Émile Ré <emile@probo.com>
This commit is contained in:
Émile Ré
2026-06-02 17:31:54 +02:00
parent 9ac71f948f
commit aebb2a1ed0
12 changed files with 208 additions and 53 deletions

View File

@@ -40,6 +40,7 @@ query($id: ID!, $first: Int, $after: CursorKey) {
source
excluded
lastMatchedAt
commonTrackerPatternId
}
}
pageInfo {
@@ -53,14 +54,15 @@ query($id: ID!, $first: Int, $after: CursorKey) {
`
type trackerPattern struct {
ID string `json:"id"`
Pattern string `json:"pattern"`
MatchType string `json:"matchType"`
TrackerType string `json:"trackerType"`
DisplayName string `json:"displayName"`
Source *string `json:"source"`
Excluded bool `json:"excluded"`
LastMatchedAt *string `json:"lastMatchedAt"`
ID string `json:"id"`
Pattern string `json:"pattern"`
MatchType string `json:"matchType"`
TrackerType string `json:"trackerType"`
DisplayName string `json:"displayName"`
Source *string `json:"source"`
Excluded bool `json:"excluded"`
LastMatchedAt *string `json:"lastMatchedAt"`
CommonTrackerPatternID *string `json:"commonTrackerPatternId"`
}
func NewCmdList(f *cmdutil.Factory) *cobra.Command {
@@ -157,10 +159,15 @@ func NewCmdList(f *cmdutil.Factory) *cobra.Command {
lastMatched = cmdutil.FormatTime(*p.LastMatchedAt)
}
rows = append(rows, []string{p.ID, p.Pattern, p.MatchType, p.TrackerType, p.DisplayName, source, excluded, lastMatched})
commonPatternID := ""
if p.CommonTrackerPatternID != nil {
commonPatternID = *p.CommonTrackerPatternID
}
rows = append(rows, []string{p.ID, p.Pattern, p.MatchType, p.TrackerType, p.DisplayName, source, excluded, lastMatched, commonPatternID})
}
t := cmdutil.NewTable("ID", "PATTERN", "MATCH TYPE", "TRACKER TYPE", "DISPLAY NAME", "SOURCE", "EXCLUDED", "LAST MATCHED").Rows(rows...)
t := cmdutil.NewTable("ID", "PATTERN", "MATCH TYPE", "TRACKER TYPE", "DISPLAY NAME", "SOURCE", "EXCLUDED", "LAST MATCHED", "COMMON PATTERN ID").Rows(rows...)
_, _ = fmt.Fprintln(f.IOStreams.Out, t)
if totalCount > len(patterns) {