Summary
The Build() function and CLI --catalog flag currently accept a single CatalogData as the base. Users with multiple catalogs (hand-crafted + team-shared + previous build) must manually merge them before building.
Proposed Changes
- Library: Add
MergeCatalogs(catalogs ...CatalogData) CatalogData that deduplicates by pattern (lower-cased), keeping the entry with highest confidence when duplicates exist. Last-writer-wins for version string.
- CLI: Change
--catalog to accept multiple values (cobra StringSliceVar), load each, merge, then pass to Build().
Build() signature stays the same — callers that want multi-catalog support call MergeCatalogs() first. No breaking change.
Example Usage
frictionax catalog build \
--catalog hand-crafted.json \
--catalog team-shared.json \
--server https://api.sageox.ai/v1/agentx/myapp/friction/patterns \
--output catalog.json
Why
AgentX users will have hand-crafted catalogs they want to preserve when building from SageOx telemetry patterns. Forcing manual pre-merge adds friction to the catalog building workflow.
Current Behavior
--catalog accepts one file (default: default_catalog.json)
Build() takes one CatalogData as existing
- Deduplication works against that single base
- Hand-crafted entries are preserved in the output
Merge Strategy
When the same pattern (case-insensitive) appears in multiple catalogs:
- Keep the entry with highest
confidence
- If equal, prefer the entry with a non-empty
target
- Tokens: deduplicate by
pattern + kind key
Summary
The
Build()function and CLI--catalogflag currently accept a singleCatalogDataas the base. Users with multiple catalogs (hand-crafted + team-shared + previous build) must manually merge them before building.Proposed Changes
MergeCatalogs(catalogs ...CatalogData) CatalogDatathat deduplicates by pattern (lower-cased), keeping the entry with highest confidence when duplicates exist. Last-writer-wins for version string.--catalogto accept multiple values (cobra StringSliceVar), load each, merge, then pass toBuild().Build()signature stays the same — callers that want multi-catalog support callMergeCatalogs()first. No breaking change.Example Usage
Why
AgentX users will have hand-crafted catalogs they want to preserve when building from SageOx telemetry patterns. Forcing manual pre-merge adds friction to the catalog building workflow.
Current Behavior
--catalogaccepts one file (default:default_catalog.json)Build()takes oneCatalogDataasexistingMerge Strategy
When the same pattern (case-insensitive) appears in multiple catalogs:
confidencetargetpattern + kindkey