@ainyc/canonry 4.27.2 → 4.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -45,6 +45,7 @@ Detailed playbooks live alongside this file. Read them on demand when the task m
45
45
  |---|---|
46
46
  | `references/orchestration.md` | Planning a multi-step or recurring workflow (baseline, weekly review, content-gap analysis) |
47
47
  | `references/regression-playbook.md` | A query lost its citation and you need to triage and respond |
48
+ | `references/aeo-discovery.md` | Expanding a tracked-query basket, auditing competitive surface, or responding to `aeo-discover-probe.completed` |
48
49
  | `references/memory-patterns.md` | Deciding whether to remember a fact in agent memory or re-query canonry |
49
50
  | `references/reporting.md` | Producing a client-facing weekly or monthly summary |
50
51
  | `references/wordpress-elementor-mcp.md` | Editing WordPress pages with the Elementor MCP integration |
@@ -45,9 +45,53 @@ Per session: ~$1 at the default probe budget (100 queries × 1 Gemini grounded c
45
45
  Things to call out without being asked:
46
46
 
47
47
  - **High wasted-surface ratio** (≥ 40% of probes, or > cited count at ≥ 20%) → the project is missing from its own competitive space. The auto-written `discovery.basket-divergence` insight flags this as `high` severity.
48
- - **New competitor domains** in `competitorMap` that aren't already in the project's tracked competitor list → suggest adding via `canonry competitor add <project> <domain>`. PR 2's `canonry discover promote` will automate this.
48
+ - **Recurring new competitor domains** in `competitorMap` that aren't already in the project's tracked competitor list → `canonry discover promote` adopts domains with at least 2 hits automatically alongside the queries; or add them à la carte with `canonry competitor add <project> <domain>`.
49
49
  - **Aspirational greenfield** queries with no tracked competitor and no canonical cite → low-friction content opportunities.
50
50
 
51
+ ## Promoting a session into the tracked basket
52
+
53
+ Once a session is `completed`, preview first unless the operator has already approved the write:
54
+
55
+ ```bash
56
+ canonry discover promote preview <project> <session-id>
57
+ ```
58
+
59
+ Or the MCP equivalent: `canonry_discover_promote_preview` with `{ project, sessionId }`.
60
+
61
+ The preview returns every bucket so you can explain the tradeoff:
62
+
63
+ - `cited` — already grounded to the project, safe to track.
64
+ - `aspirational` — greenfield ICP-fit opportunities, safe to track as a growth basket.
65
+ - `wasted-surface` — competitor-cited but project-missing. Treat as content-planning evidence first; do not add it to the weekly tracked basket unless the operator explicitly wants those off-ICP competitor gaps tracked.
66
+ - `suggestedCompetitors` — recurring domains not already tracked. The promote path only auto-adopts domains with at least 2 hits.
67
+
68
+ Promote with one of these paths:
69
+
70
+ ```bash
71
+ canonry discover promote <project> <session-id> # cited + aspirational buckets + recurring competitor domains
72
+ canonry discover promote <project> <session-id> --bucket aspirational # scope to a bucket subset (repeatable / comma-separated)
73
+ canonry discover promote <project> <session-id> --bucket wasted-surface # explicitly track off-ICP competitor gaps
74
+ canonry discover promote <project> <session-id> --no-competitors # queries only, skip the competitor merge
75
+ ```
76
+
77
+ Or the MCP equivalent:
78
+
79
+ ```json
80
+ { "project": "<project>", "sessionId": "<session-id>" }
81
+ ```
82
+
83
+ That default request promotes `cited` + `aspirational` queries and recurring competitors. For scoped writes, pass `request`:
84
+
85
+ ```json
86
+ { "project": "<project>", "sessionId": "<session-id>", "request": { "buckets": ["aspirational"], "includeCompetitors": false } }
87
+ ```
88
+
89
+ - **Default is cited + aspirational.** `wasted-surface` queries are off-ICP competitor gaps; promote them only when the operator explicitly wants those tracked in the weekly basket.
90
+ - **Competitor promotion requires recurrence.** Default competitor merge ignores one-off domains and adopts only domains with at least 2 hits.
91
+ - **Add-only and idempotent.** Queries and competitor domains already tracked are returned under `skipped`, never inserted twice. Re-running a promote is safe.
92
+ - **Completed sessions only.** Promoting a `queued`/`seeding`/`probing`/`failed` session is rejected — the buckets aren't final.
93
+ - Promoted rows carry `provenance="discovery:<sessionId>"`, so a tracked query can always be traced back to the session that surfaced it.
94
+
51
95
  ## When you wake on `aeo-discover-probe.completed`
52
96
 
53
97
  The follow-up payload `RunCoordinator` queues for you includes:
@@ -62,14 +106,15 @@ Respond with:
62
106
 
63
107
  1. A one-line headline naming the dominant bucket.
64
108
  2. The top 2-3 wasted-surface queries (call `canonry_discover_session_get` to fetch them — don't guess).
65
- 3. The top 1-2 new competitor domains worth tracking.
66
- 4. A single recommended next step. Examples: "add competitor.com to the tracked list", "the wasted-surface set warrants a content plan around X", "the aspirational set is greenfield — pick the 3 with highest commercial intent and write content".
109
+ 3. The top 1-2 recurring new competitor domains worth tracking, ignoring one-hit domains unless the operator asks for the full long tail.
110
+ 4. A single recommended next step. Examples: "preview and promote cited + aspirational findings (`canonry discover promote preview`, then `canonry discover promote`)", "the wasted-surface set warrants a content plan around X before tracking", "the aspirational set is greenfield — pick the 3 with highest commercial intent and write content".
111
+
112
+ Do not recommend "promote everything" as the default. The safe path is: inspect session detail, preview promotion candidates, then promote the default cited + aspirational set. Escalate `wasted-surface` to tracking only when the operator deliberately chooses that tradeoff.
67
113
 
68
114
  Keep it tight. The operator wakes to a short, decision-ready summary, not a full report.
69
115
 
70
116
  ## What discovery does NOT do (yet)
71
117
 
72
- - **No promotion.** PR 2 ships `canonry discover promote` which adopts queries into the project's tracked basket with `provenance='discovery:<sessionId>'`. Until then, the operator merges manually via `canonry query add` / `canonry competitor add`.
73
118
  - **No multi-provider amplification.** v1 probes Gemini only. v2 will probe across Gemini + ChatGPT + Claude in one session (the schema is already shaped for it — `discovery_probes` has no `UNIQUE(session_id, query)` exactly because of this).
74
119
  - **No re-run drift.** Each session is independent. Comparing sessions over time is on the PR 4 / PR 5 roadmap.
75
120
 
@@ -233,10 +233,12 @@ canonry discover run <project> --icp "..." --max-probes 100 # per-sessio
233
233
 
234
234
  canonry discover list <project> # newest-first session list
235
235
  canonry discover show <project> <session-id> # per-query probe rows + buckets
236
- canonry discover promote preview <project> <session-id> # preview the basket PR 2 will write (read-only)
236
+ canonry discover promote preview <project> <session-id> # preview bucketed candidates + recurring suggested competitors (read-only)
237
+ canonry discover promote <project> <session-id> # adopt cited + aspirational queries + recurring competitors
238
+ canonry discover promote <project> <session-id> --bucket aspirational --no-competitors # scope to a bucket subset / skip competitor merge
237
239
  ```
238
240
 
239
- Discovery requires Gemini configured (API key today; Vertex-mode embeddings are deferred). The pipeline writes a `discovery_sessions` row, a `runs` row (kind `aeo-discover-probe`), and one `discovery.basket-divergence` insight when the session completes. Aero wakes unprompted with the bucket-count payload so the operator can act without polling.
241
+ Discovery requires Gemini configured (API key today; Vertex-mode embeddings are deferred). The pipeline writes a `discovery_sessions` row, a `runs` row (kind `aeo-discover-probe`), and one `discovery.basket-divergence` insight when the session completes. Aero wakes unprompted with the bucket-count payload so the operator can act without polling. `discover promote` defaults to cited + aspirational queries and recurring competitor domains; include `--bucket wasted-surface` explicitly for off-ICP competitor gaps. Promotion is add-only and idempotent — queries/domains already tracked are reported as skipped, never inserted twice — and only works on `completed` sessions; promoted rows carry `provenance="discovery:<sessionId>"`.
240
242
 
241
243
  ## Bing Webmaster Tools
242
244