@ozzylabs/feedradar 0.1.5 → 0.1.7

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.
Files changed (86) hide show
  1. package/README.md +1 -1
  2. package/dist/cli/dismiss.d.ts +2 -1
  3. package/dist/cli/dismiss.d.ts.map +1 -1
  4. package/dist/cli/dismiss.js +4 -1
  5. package/dist/cli/dismiss.js.map +1 -1
  6. package/dist/cli/index.d.ts.map +1 -1
  7. package/dist/cli/index.js +7 -1
  8. package/dist/cli/index.js.map +1 -1
  9. package/dist/cli/items.d.ts +44 -0
  10. package/dist/cli/items.d.ts.map +1 -0
  11. package/dist/cli/items.js +288 -0
  12. package/dist/cli/items.js.map +1 -0
  13. package/dist/cli/research.d.ts +21 -0
  14. package/dist/cli/research.d.ts.map +1 -1
  15. package/dist/cli/research.js +54 -10
  16. package/dist/cli/research.js.map +1 -1
  17. package/dist/cli/review.d.ts +23 -0
  18. package/dist/cli/review.d.ts.map +1 -1
  19. package/dist/cli/review.js +293 -2
  20. package/dist/cli/review.js.map +1 -1
  21. package/dist/cli/source.d.ts.map +1 -1
  22. package/dist/cli/source.js +3 -0
  23. package/dist/cli/source.js.map +1 -1
  24. package/dist/cli/triage.d.ts +136 -0
  25. package/dist/cli/triage.d.ts.map +1 -0
  26. package/dist/cli/triage.js +1110 -0
  27. package/dist/cli/triage.js.map +1 -0
  28. package/dist/cli/undismiss.d.ts +30 -0
  29. package/dist/cli/undismiss.d.ts.map +1 -0
  30. package/dist/cli/undismiss.js +133 -0
  31. package/dist/cli/undismiss.js.map +1 -0
  32. package/dist/cli/watch.d.ts.map +1 -1
  33. package/dist/cli/watch.js +2 -0
  34. package/dist/cli/watch.js.map +1 -1
  35. package/dist/cli/workflow/generate-combined-with-triage.d.ts +115 -0
  36. package/dist/cli/workflow/generate-combined-with-triage.d.ts.map +1 -0
  37. package/dist/cli/workflow/generate-combined-with-triage.js +446 -0
  38. package/dist/cli/workflow/generate-combined-with-triage.js.map +1 -0
  39. package/dist/cli/workflow.d.ts +6 -5
  40. package/dist/cli/workflow.d.ts.map +1 -1
  41. package/dist/cli/workflow.js +13 -8
  42. package/dist/cli/workflow.js.map +1 -1
  43. package/dist/core/feeds/json-api.d.ts +26 -0
  44. package/dist/core/feeds/json-api.d.ts.map +1 -1
  45. package/dist/core/feeds/json-api.js +360 -223
  46. package/dist/core/feeds/json-api.js.map +1 -1
  47. package/dist/core/recipes.d.ts.map +1 -1
  48. package/dist/core/recipes.js +10 -0
  49. package/dist/core/recipes.js.map +1 -1
  50. package/dist/core/transitions.d.ts +30 -0
  51. package/dist/core/transitions.d.ts.map +1 -0
  52. package/dist/core/transitions.js +103 -0
  53. package/dist/core/transitions.js.map +1 -0
  54. package/dist/core/triage/adapter.d.ts +80 -0
  55. package/dist/core/triage/adapter.d.ts.map +1 -0
  56. package/dist/core/triage/adapter.js +128 -0
  57. package/dist/core/triage/adapter.js.map +1 -0
  58. package/dist/core/triage/index.d.ts +105 -0
  59. package/dist/core/triage/index.d.ts.map +1 -0
  60. package/dist/core/triage/index.js +246 -0
  61. package/dist/core/triage/index.js.map +1 -0
  62. package/dist/core/triage/prompt.d.ts +30 -0
  63. package/dist/core/triage/prompt.d.ts.map +1 -0
  64. package/dist/core/triage/prompt.js +157 -0
  65. package/dist/core/triage/prompt.js.map +1 -0
  66. package/dist/core/triage/response.d.ts +114 -0
  67. package/dist/core/triage/response.d.ts.map +1 -0
  68. package/dist/core/triage/response.js +188 -0
  69. package/dist/core/triage/response.js.map +1 -0
  70. package/dist/recipes/aws-whats-new.yaml +62 -7
  71. package/dist/recipes/dev-to.yaml +24 -0
  72. package/dist/schemas/item.d.ts +151 -5
  73. package/dist/schemas/item.d.ts.map +1 -1
  74. package/dist/schemas/item.js +164 -4
  75. package/dist/schemas/item.js.map +1 -1
  76. package/dist/schemas/recipe.d.ts +22 -0
  77. package/dist/schemas/recipe.d.ts.map +1 -1
  78. package/dist/schemas/recipe.js +13 -1
  79. package/dist/schemas/recipe.js.map +1 -1
  80. package/dist/schemas/source.d.ts +135 -0
  81. package/dist/schemas/source.d.ts.map +1 -1
  82. package/dist/schemas/source.js +138 -0
  83. package/dist/schemas/source.js.map +1 -1
  84. package/dist/templates/agents/AGENTS.md +36 -4
  85. package/dist/templates/workflows/combined-with-triage.template.yaml.tmpl +133 -0
  86. package/package.json +1 -1
@@ -1,15 +1,154 @@
1
1
  import { z } from "zod";
2
2
  /**
3
- * Item status state machine (ADR-0008).
3
+ * Item status state machine (ADR-0008 + ADR-0018).
4
+ *
5
+ * Original 4-state machine:
4
6
  *
5
7
  * detected ──► (dismissed | researched) ──► reviewed
6
8
  *
7
- * - `detected`: watch run emitted the item after filter
8
- * - `dismissed`: user decided not to research (terminal)
9
+ * Triage extension (ADR-0018) adds 3 intermediate states. `triaged_dismiss`
10
+ * is intentionally **not** a separate status it is collapsed into existing
11
+ * `dismissed` with the `dismissedBy: "human" | "triage_<agent>"` sub-field
12
+ * recording the origin. Total status count: 4 → 7.
13
+ *
14
+ * detected
15
+ * ├── triage ──► triaged_research ──► researched ──► reviewed
16
+ * ├── triage ──► triaged_digest ──► researched (digest 合流)
17
+ * ├── triage ──► triaged_unsure ──► (human loop) ──► research / dismiss
18
+ * └── triage ──► dismissed (dismissedBy: triage_<agent>)
19
+ *
20
+ * dismissed ──► detected (via `radar undismiss`)
21
+ *
22
+ * Status semantics (per ADR-0018 §W-B):
23
+ *
24
+ * - `detected`: watch run emitted the item after filter, triage not yet run
25
+ * - `triaged_research`: triage classified as research-worthy
26
+ * - `triaged_digest`: triage classified as digest candidate (group key in `triage.group`)
27
+ * - `triaged_unsure`: triage confidence below threshold; human judgment needed
9
28
  * - `researched`: research report written
10
29
  * - `reviewed`: research report reviewed (terminal happy path)
30
+ * - `dismissed`: human or triage agent decided not to research (terminal,
31
+ * reversible via `radar undismiss`; origin in `dismissedBy`)
32
+ */
33
+ export const ItemStatusSchema = z.enum([
34
+ "detected",
35
+ "triaged_research",
36
+ "triaged_digest",
37
+ "triaged_unsure",
38
+ "researched",
39
+ "reviewed",
40
+ "dismissed",
41
+ ]);
42
+ /**
43
+ * Decision values produced by a triage agent (ADR-0018).
44
+ *
45
+ * - `research`: item is research-worthy on its own
46
+ * - `digest`: item belongs to a group worth summarizing as a single digest
47
+ * - `dismiss`: item is not research-worthy; collapse into `dismissed`
48
+ * - `unsure`: triage agent's confidence is below `confidenceThreshold`; defer
49
+ * to human judgment
50
+ */
51
+ export const TriageDecisionValueSchema = z.enum(["research", "digest", "dismiss", "unsure"]);
52
+ /**
53
+ * One feedback datapoint on a prior triage decision (ADR-0018 §W5).
54
+ *
55
+ * `radar triage feedback <item-id> --correct | --wrong [--reason <text>]`
56
+ * appends to the array. Stored as a list so multiple reviewers (or the same
57
+ * reviewer revisiting later) can leave independent verdicts without
58
+ * overwriting each other; downstream stats aggregations decide how to
59
+ * combine them.
60
+ */
61
+ export const TriageFeedbackSchema = z.object({
62
+ /**
63
+ * `true` when the human agrees with the triage decision; `false` when they
64
+ * judge it wrong. Stored as a boolean rather than free-text verdict so the
65
+ * `radar triage stats` aggregation (#242) has a deterministic field to
66
+ * count on.
67
+ */
68
+ correct: z.boolean(),
69
+ /** Optional rationale shown alongside `--wrong` (or `--correct` for nuance). */
70
+ reason: z.string().optional(),
71
+ feedbackAt: z.string().datetime(),
72
+ });
73
+ /**
74
+ * Triage decision attached to an item by a triage agent (ADR-0018 §W2 / §W5).
75
+ *
76
+ * Schema rationale (post-review #238 W-I):
77
+ *
78
+ * - The outer field on `Item` is the **singular** `triage` (not `triages`).
79
+ * This preserves the option of moving to a multi-agent shape (`triage: {
80
+ * decisions: [...], consensus: ... }`) later via a Zod union without
81
+ * renaming the field. PR-1 ships the single-agent inner shape only;
82
+ * multi-agent extension is a future PR and explicitly NOT in scope.
83
+ * - `decision` is a discriminated string, not a nested object, so the same
84
+ * union-extension pattern can reuse the field name on the inner decision
85
+ * list without ambiguity.
86
+ * - `feedback` is an array, not a single object — multiple human reviewers
87
+ * can leave independent verdicts (see `TriageFeedbackSchema` docstring).
11
88
  */
12
- export const ItemStatusSchema = z.enum(["detected", "dismissed", "researched", "reviewed"]);
89
+ export const TriageDecisionSchema = z.object({
90
+ decision: TriageDecisionValueSchema,
91
+ /**
92
+ * Triage agent's self-reported confidence in the decision. Compared against
93
+ * the source's `triagePolicy.confidenceThreshold` (default 0.7) to decide
94
+ * whether to promote `dismiss` / `research` / `digest` outright or
95
+ * downgrade to `unsure` for human review. Stored regardless of outcome so
96
+ * later feedback analysis can correlate confidence with correctness.
97
+ */
98
+ confidence: z.number().min(0).max(1),
99
+ /** Short natural-language rationale from the triage agent. */
100
+ reason: z.string().min(1),
101
+ /**
102
+ * Grouping key used when `decision === "digest"`. Stored as a free-form
103
+ * slug — `radar research --digest --triage-group <group>` collects every
104
+ * `triaged_digest` item sharing this key (ADR-0018 §W-H). Optional because
105
+ * non-digest decisions do not produce a group.
106
+ */
107
+ group: z.string().optional(),
108
+ /**
109
+ * Identifier of the agent that produced the decision. Free-form string
110
+ * rather than `AgentIdSchema` because the triage channel may use a more
111
+ * specific model identifier (e.g. `"gemini-2.5-flash-lite"`) than the
112
+ * coarse adapter id used elsewhere.
113
+ */
114
+ agent: z.string().min(1),
115
+ triagedAt: z.string().datetime(),
116
+ /**
117
+ * Append-only feedback log. Defaults to `[]` so items written before the
118
+ * feedback CLI runs (the common case) deserialize cleanly. Existing items
119
+ * predating ADR-0018 have no `triage` field at all and therefore never
120
+ * need a default for this nested array — the default exists for the
121
+ * `triage` exists, `feedback` not yet populated case.
122
+ */
123
+ feedback: z.array(TriageFeedbackSchema).default([]),
124
+ });
125
+ /**
126
+ * Origin of a `dismissed` decision (ADR-0018 §W2 / §W6).
127
+ *
128
+ * Distinguishes human dismiss from triage-agent dismiss so `radar undismiss`
129
+ * can apply the right safety behavior: triage-origin dismisses are reversible
130
+ * without a flag, human-origin dismisses require `--force` (= confirms the
131
+ * user is overriding their own prior decision, not just an agent's).
132
+ *
133
+ * Defined as a string enum (not a union with `AgentIdSchema`) because the
134
+ * `triage_` prefix lets schema validation reject malformed values like
135
+ * `"claude-code"` (missing prefix) that would silently collide with the
136
+ * `human` case.
137
+ *
138
+ * Maintenance note: this enum mirrors `AgentIdSchema` (`src/schemas/research.ts`)
139
+ * with a `triage_` prefix. When a new agent adapter is added, both enums
140
+ * must be updated in lockstep. A test (`tests/schemas/item.test.ts`)
141
+ * iterates each `AgentIdSchema` value and asserts the corresponding
142
+ * `triage_<agent>` variant parses; that test will fail loudly if the two
143
+ * lists drift out of sync.
144
+ */
145
+ export const DismissedBySchema = z.enum([
146
+ "human",
147
+ "triage_claude-code",
148
+ "triage_codex-cli",
149
+ "triage_gemini-cli",
150
+ "triage_copilot",
151
+ ]);
13
152
  export const ItemSchema = z.object({
14
153
  id: z.string().min(1),
15
154
  sourceId: z.string().min(1),
@@ -30,5 +169,26 @@ export const ItemSchema = z.object({
30
169
  * automatic.
31
170
  */
32
171
  injectionFlags: z.array(z.string()).default([]),
172
+ /**
173
+ * Triage decision attached by `radar triage` (ADR-0018). Optional so:
174
+ *
175
+ * 1. Items written before PR-1 (no `triage:` key in YAML) validate cleanly
176
+ * (W-F migration requirement).
177
+ * 2. Items detected after PR-1 but before triage runs also validate.
178
+ *
179
+ * Field name is intentionally singular even though a future multi-agent
180
+ * triage extension will hold an array of decisions — the migration plan
181
+ * is to widen this field to `z.union([TriageDecisionSchema, MultiAgentTriageSchema])`
182
+ * without renaming, preserving on-disk compat (W-I post-review).
183
+ */
184
+ triage: TriageDecisionSchema.optional(),
185
+ /**
186
+ * Origin of a `dismissed` decision (ADR-0018 §W6). Only meaningful when
187
+ * `status === "dismissed"`; we intentionally do NOT enforce this with a
188
+ * superRefine so legacy `dismissed` items (no `dismissedBy` field, written
189
+ * before ADR-0018) keep validating. Consumers needing origin information
190
+ * should treat `undefined` as "human" for those legacy items.
191
+ */
192
+ dismissedBy: DismissedBySchema.optional(),
33
193
  });
34
194
  //# sourceMappingURL=item.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"item.js","sourceRoot":"","sources":["../../src/schemas/item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC,CAAC;AAG5F,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACrB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;IACrB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC7C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,GAAG,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC3B,eAAe,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IAChD,MAAM,EAAE,gBAAgB,CAAC,OAAO,CAAC,UAAU,CAAC;IAC5C;;;;;;;OAOG;IACH,cAAc,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;CAChD,CAAC,CAAC"}
1
+ {"version":3,"file":"item.js","sourceRoot":"","sources":["../../src/schemas/item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,C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AC,QAAQ,EAAE;IACvC;;;;;;OAMG;IACH,WAAW,EAAE,iBAAiB,CAAC,QAAQ,EAAE;CAC1C,CAAC,CAAC"}
@@ -106,10 +106,32 @@ export declare const RecipeFileSchema: z.ZodObject<{
106
106
  tags: z.ZodOptional<z.ZodString>;
107
107
  linkBase: z.ZodOptional<z.ZodString>;
108
108
  }, z.core.$strip>>;
109
+ facets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
110
+ type: z.ZodLiteral<"range">;
111
+ param: z.ZodString;
112
+ template: z.ZodString;
113
+ range: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
114
+ step: z.ZodDefault<z.ZodNumber>;
115
+ }, z.core.$strip>, z.ZodObject<{
116
+ type: z.ZodLiteral<"enum">;
117
+ param: z.ZodString;
118
+ template: z.ZodString;
119
+ values: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
120
+ }, z.core.$strip>], "type">>>;
109
121
  trustLevel: z.ZodDefault<z.ZodEnum<{
110
122
  trusted: "trusted";
111
123
  untrusted: "untrusted";
112
124
  }>>;
125
+ triagePolicy: z.ZodOptional<z.ZodObject<{
126
+ agent: z.ZodEnum<{
127
+ "claude-code": "claude-code";
128
+ "codex-cli": "codex-cli";
129
+ "gemini-cli": "gemini-cli";
130
+ copilot: "copilot";
131
+ }>;
132
+ confidenceThreshold: z.ZodDefault<z.ZodNumber>;
133
+ rules: z.ZodString;
134
+ }, z.core.$strip>>;
113
135
  }, z.core.$strip>;
114
136
  export type RecipeFile = z.infer<typeof RecipeFileSchema>;
115
137
  //# sourceMappingURL=recipe.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"recipe.d.ts","sourceRoot":"","sources":["../../src/schemas/recipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwB3B,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
1
+ {"version":3,"file":"recipe.d.ts","sourceRoot":"","sources":["../../src/schemas/recipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAcxB;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAoC3B,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { SourceFiltersSchema, SourceHttpOptionsSchema, SourceJsOptionsSchema, SourceJsonApiSelectorsSchema, SourceKindSchema, SourcePaginationSchema, SourceSelectorsSchema, TrustLevelSchema, } from "./source.js";
2
+ import { SourceFacetsSchema, SourceFiltersSchema, SourceHttpOptionsSchema, SourceJsOptionsSchema, SourceJsonApiSelectorsSchema, SourceKindSchema, SourcePaginationSchema, SourceSelectorsSchema, SourceTriagePolicySchema, TrustLevelSchema, } from "./source.js";
3
3
  /**
4
4
  * Schema for a bundled recipe YAML file (ADR-0012 §D3, strategy A —
5
5
  * "リポ同梱").
@@ -49,6 +49,18 @@ export const RecipeFileSchema = z.object({
49
49
  http: SourceHttpOptionsSchema.optional(),
50
50
  pagination: SourcePaginationSchema.optional(),
51
51
  jsonSelectors: SourceJsonApiSelectorsSchema.optional(),
52
+ // Facet sweep recipe extension (ADR-0017). Optional so existing recipes
53
+ // without `facets:` keep working unchanged.
54
+ facets: SourceFacetsSchema.optional(),
52
55
  trustLevel: TrustLevelSchema.default("untrusted"),
56
+ /**
57
+ * Default triage policy bundled with the recipe (ADR-0018 §W3). When
58
+ * `radar source add --recipe <name>` materializes a source from this
59
+ * recipe, the policy propagates onto `sources/<id>.yaml > triagePolicy:`
60
+ * so the user gets a sensible default without authoring rules by hand.
61
+ * Optional: existing bundled recipes (PR #229 / #232) ship without
62
+ * `triagePolicy:` and continue to validate.
63
+ */
64
+ triagePolicy: SourceTriagePolicySchema.optional(),
53
65
  });
54
66
  //# sourceMappingURL=recipe.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"recipe.js","sourceRoot":"","sources":["../../src/schemas/recipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACvB,qBAAqB,EACrB,4BAA4B,EAC5B,gBAAgB,EAChB,sBAAsB,EACtB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,aAAa,CAAC;AAErB;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,sDAAsD;IACtD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B;;;OAGG;IACH,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,IAAI,EAAE,gBAAgB;IACtB,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACtB,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IACrC,OAAO,EAAE,mBAAmB,CAAC,OAAO,CAAC;QACnC,QAAQ,EAAE,EAAE;QACZ,eAAe,EAAE,EAAE;QACnB,SAAS,EAAE,MAAM;QACj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EAAE;QACnB,SAAS,EAAE,MAAM;QACjB,WAAW,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC;QACjC,aAAa,EAAE,KAAK;KACrB,CAAC;IACF,SAAS,EAAE,qBAAqB,CAAC,QAAQ,EAAE;IAC3C,EAAE,EAAE,qBAAqB,CAAC,QAAQ,EAAE;IACpC,IAAI,EAAE,uBAAuB,CAAC,QAAQ,EAAE;IACxC,UAAU,EAAE,sBAAsB,CAAC,QAAQ,EAAE;IAC7C,aAAa,EAAE,4BAA4B,CAAC,QAAQ,EAAE;IACtD,wEAAwE;IACxE,4CAA4C;IAC5C,MAAM,EAAE,kBAAkB,CAAC,QAAQ,EAAE;IACrC,UAAU,EAAE,gBAAgB,CAAC,OAAO,CAAC,WAAW,CAAC;IACjD;;;;;;;OAOG;IACH,YAAY,EAAE,wBAAwB,CAAC,QAAQ,EAAE;CAClD,CAAC,CAAC"}
@@ -49,6 +49,39 @@ export declare const TrustLevelSchema: z.ZodEnum<{
49
49
  untrusted: "untrusted";
50
50
  }>;
51
51
  export type TrustLevel = z.infer<typeof TrustLevelSchema>;
52
+ /**
53
+ * Per-source triage policy (ADR-0018 §W3).
54
+ *
55
+ * Drives `radar triage` for items emitted from this source. Optional on
56
+ * `SourceSchema`: existing source YAMLs (which omit `triagePolicy:` entirely)
57
+ * remain valid and `radar triage` simply skips them.
58
+ *
59
+ * - `agent`: which adapter runs the triage call. Reuses `AgentIdSchema` so
60
+ * the same enum gates both research and triage agents (a workspace can
61
+ * only triage with an adapter it has wired up). The adapter is free to
62
+ * route the triage channel to a cheaper model than the research channel
63
+ * (e.g. `gemini-2.5-flash-lite` vs `gemini-2.5-pro`), but that mapping is
64
+ * adapter-internal and not schema-modeled here.
65
+ * - `confidenceThreshold`: minimum confidence for a non-`unsure` decision to
66
+ * stick. Decisions below the threshold are demoted to `unsure` regardless
67
+ * of what the agent returned. Default `0.7` reflects ADR-0018's
68
+ * recommendation for cheap-model triage.
69
+ * - `rules`: free-form markdown describing how this source should be
70
+ * classified ("AWS GA は research、リージョン拡張は dismiss" 等). Wrapped
71
+ * in a `<policy>` boundary marker at prompt time per ADR-0018 §W-A; never
72
+ * parsed by the schema beyond non-empty.
73
+ */
74
+ export declare const SourceTriagePolicySchema: z.ZodObject<{
75
+ agent: z.ZodEnum<{
76
+ "claude-code": "claude-code";
77
+ "codex-cli": "codex-cli";
78
+ "gemini-cli": "gemini-cli";
79
+ copilot: "copilot";
80
+ }>;
81
+ confidenceThreshold: z.ZodDefault<z.ZodNumber>;
82
+ rules: z.ZodString;
83
+ }, z.core.$strip>;
84
+ export type SourceTriagePolicy = z.infer<typeof SourceTriagePolicySchema>;
52
85
  export declare const SourceFiltersSchema: z.ZodObject<{
53
86
  keywords: z.ZodDefault<z.ZodArray<z.ZodString>>;
54
87
  excludeKeywords: z.ZodDefault<z.ZodArray<z.ZodString>>;
@@ -221,6 +254,86 @@ export declare const SourceJsonApiSelectorsSchema: z.ZodObject<{
221
254
  linkBase: z.ZodOptional<z.ZodString>;
222
255
  }, z.core.$strip>;
223
256
  export type SourceJsonApiSelectors = z.infer<typeof SourceJsonApiSelectorsSchema>;
257
+ /**
258
+ * Facet sweep recipe extension for `kind: json-api` (ADR-0017).
259
+ *
260
+ * `facets` is an outer "data slice" axis that wraps the inner pagination
261
+ * loop. It exists because some APIs cap their offset/page traversal at a
262
+ * fixed total (e.g. AWS dirs API: `(page + 1) * size <= 10000`), making
263
+ * the upper ~half of the catalog unreachable via inner pagination alone.
264
+ * Splitting the request by a facet (year, category, …) keeps every slice
265
+ * comfortably under the cap and recovers full-history coverage.
266
+ *
267
+ * Two facet types are supported in Phase 1:
268
+ *
269
+ * - `range`: a numeric range `[start, end]` (inclusive) walked with `step`.
270
+ * Useful for year sweeps where the API exposes a `year=YYYY` filter.
271
+ * - `enum`: an explicit list of values (string / number). Useful for
272
+ * non-numeric or non-sequential facets (categories, regions, tags).
273
+ *
274
+ * The `template` must contain a literal `{}` placeholder which the
275
+ * adapter substitutes with the current facet value (e.g.
276
+ * `whats-new-v2#year#{}` → `whats-new-v2#year#2024`). The substituted
277
+ * string is injected into the URL as the value of the `param` query
278
+ * parameter.
279
+ *
280
+ * Multi-facet support (e.g. year × category) is explicitly deferred to a
281
+ * future ADR; the adapter throws when more than one facet entry is
282
+ * present. The schema allows a `Record<string, Facet>` purely for
283
+ * forward-compatibility — single entry today, additional entries later
284
+ * without a schema break.
285
+ *
286
+ * See ADR-0017 for the full design rationale (option A vs option D
287
+ * `pagination.type: facet`, lastSeenIds-as-global semantics, conditional
288
+ * GET disablement in facet sweep mode).
289
+ */
290
+ export declare const SourceFacetRangeSchema: z.ZodObject<{
291
+ type: z.ZodLiteral<"range">;
292
+ param: z.ZodString;
293
+ template: z.ZodString;
294
+ range: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
295
+ step: z.ZodDefault<z.ZodNumber>;
296
+ }, z.core.$strip>;
297
+ export type SourceFacetRange = z.infer<typeof SourceFacetRangeSchema>;
298
+ export declare const SourceFacetEnumSchema: z.ZodObject<{
299
+ type: z.ZodLiteral<"enum">;
300
+ param: z.ZodString;
301
+ template: z.ZodString;
302
+ values: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
303
+ }, z.core.$strip>;
304
+ export type SourceFacetEnum = z.infer<typeof SourceFacetEnumSchema>;
305
+ export declare const SourceFacetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
306
+ type: z.ZodLiteral<"range">;
307
+ param: z.ZodString;
308
+ template: z.ZodString;
309
+ range: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
310
+ step: z.ZodDefault<z.ZodNumber>;
311
+ }, z.core.$strip>, z.ZodObject<{
312
+ type: z.ZodLiteral<"enum">;
313
+ param: z.ZodString;
314
+ template: z.ZodString;
315
+ values: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
316
+ }, z.core.$strip>], "type">;
317
+ export type SourceFacet = z.infer<typeof SourceFacetSchema>;
318
+ /**
319
+ * Map of facet-name → facet-spec. In Phase 1 the adapter enforces a
320
+ * single entry at runtime (multi-facet is deferred to a future ADR), but
321
+ * the schema accepts the record shape so future multi-facet support does
322
+ * not require a schema break.
323
+ */
324
+ export declare const SourceFacetsSchema: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
325
+ type: z.ZodLiteral<"range">;
326
+ param: z.ZodString;
327
+ template: z.ZodString;
328
+ range: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
329
+ step: z.ZodDefault<z.ZodNumber>;
330
+ }, z.core.$strip>, z.ZodObject<{
331
+ type: z.ZodLiteral<"enum">;
332
+ param: z.ZodString;
333
+ template: z.ZodString;
334
+ values: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
335
+ }, z.core.$strip>], "type">>;
336
+ export type SourceFacets = z.infer<typeof SourceFacetsSchema>;
224
337
  export declare const SourceSchema: z.ZodObject<{
225
338
  id: z.ZodString;
226
339
  kind: z.ZodEnum<{
@@ -302,10 +415,32 @@ export declare const SourceSchema: z.ZodObject<{
302
415
  tags: z.ZodOptional<z.ZodString>;
303
416
  linkBase: z.ZodOptional<z.ZodString>;
304
417
  }, z.core.$strip>>;
418
+ facets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
419
+ type: z.ZodLiteral<"range">;
420
+ param: z.ZodString;
421
+ template: z.ZodString;
422
+ range: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
423
+ step: z.ZodDefault<z.ZodNumber>;
424
+ }, z.core.$strip>, z.ZodObject<{
425
+ type: z.ZodLiteral<"enum">;
426
+ param: z.ZodString;
427
+ template: z.ZodString;
428
+ values: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
429
+ }, z.core.$strip>], "type">>>;
305
430
  trustLevel: z.ZodDefault<z.ZodEnum<{
306
431
  trusted: "trusted";
307
432
  untrusted: "untrusted";
308
433
  }>>;
434
+ triagePolicy: z.ZodOptional<z.ZodObject<{
435
+ agent: z.ZodEnum<{
436
+ "claude-code": "claude-code";
437
+ "codex-cli": "codex-cli";
438
+ "gemini-cli": "gemini-cli";
439
+ copilot: "copilot";
440
+ }>;
441
+ confidenceThreshold: z.ZodDefault<z.ZodNumber>;
442
+ rules: z.ZodString;
443
+ }, z.core.$strip>>;
309
444
  }, z.core.$strip>;
310
445
  export type Source = z.infer<typeof SourceSchema>;
311
446
  //# sourceMappingURL=source.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../src/schemas/source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,gBAAgB;;;;;;;;EAQ3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe;;;;EAAyC,CAAC;AACtE,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,qGAAqG;AACrG,eAAO,MAAM,gBAAgB;;;;;EAA+C,CAAC;AAC7E,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,gBAAgB;;;EAAmC,CAAC;AACjE,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;iBAM9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;iBAQhC,CAAC;AACH,MAAM,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.enum([
3
4
  "rss",
4
5
  "html",
@@ -33,6 +34,33 @@ export const MatchFieldSchema = z.enum(["title", "summary", "body", "tags"]);
33
34
  * separate sub-issue so the schema change is reviewable in isolation.
34
35
  */
35
36
  export const TrustLevelSchema = z.enum(["trusted", "untrusted"]);
37
+ /**
38
+ * Per-source triage policy (ADR-0018 §W3).
39
+ *
40
+ * Drives `radar triage` for items emitted from this source. Optional on
41
+ * `SourceSchema`: existing source YAMLs (which omit `triagePolicy:` entirely)
42
+ * remain valid and `radar triage` simply skips them.
43
+ *
44
+ * - `agent`: which adapter runs the triage call. Reuses `AgentIdSchema` so
45
+ * the same enum gates both research and triage agents (a workspace can
46
+ * only triage with an adapter it has wired up). The adapter is free to
47
+ * route the triage channel to a cheaper model than the research channel
48
+ * (e.g. `gemini-2.5-flash-lite` vs `gemini-2.5-pro`), but that mapping is
49
+ * adapter-internal and not schema-modeled here.
50
+ * - `confidenceThreshold`: minimum confidence for a non-`unsure` decision to
51
+ * stick. Decisions below the threshold are demoted to `unsure` regardless
52
+ * of what the agent returned. Default `0.7` reflects ADR-0018's
53
+ * recommendation for cheap-model triage.
54
+ * - `rules`: free-form markdown describing how this source should be
55
+ * classified ("AWS GA は research、リージョン拡張は dismiss" 等). Wrapped
56
+ * in a `<policy>` boundary marker at prompt time per ADR-0018 §W-A; never
57
+ * parsed by the schema beyond non-empty.
58
+ */
59
+ export const SourceTriagePolicySchema = z.object({
60
+ agent: AgentIdSchema,
61
+ confidenceThreshold: z.number().min(0).max(1).default(0.7),
62
+ rules: z.string().min(1),
63
+ });
36
64
  export const SourceFiltersSchema = z.object({
37
65
  keywords: z.array(z.string()).default([]),
38
66
  excludeKeywords: z.array(z.string()).default([]),
@@ -203,6 +231,104 @@ export const SourceJsonApiSelectorsSchema = z.object({
203
231
  */
204
232
  linkBase: z.string().url().optional(),
205
233
  });
234
+ /**
235
+ * Facet sweep recipe extension for `kind: json-api` (ADR-0017).
236
+ *
237
+ * `facets` is an outer "data slice" axis that wraps the inner pagination
238
+ * loop. It exists because some APIs cap their offset/page traversal at a
239
+ * fixed total (e.g. AWS dirs API: `(page + 1) * size <= 10000`), making
240
+ * the upper ~half of the catalog unreachable via inner pagination alone.
241
+ * Splitting the request by a facet (year, category, …) keeps every slice
242
+ * comfortably under the cap and recovers full-history coverage.
243
+ *
244
+ * Two facet types are supported in Phase 1:
245
+ *
246
+ * - `range`: a numeric range `[start, end]` (inclusive) walked with `step`.
247
+ * Useful for year sweeps where the API exposes a `year=YYYY` filter.
248
+ * - `enum`: an explicit list of values (string / number). Useful for
249
+ * non-numeric or non-sequential facets (categories, regions, tags).
250
+ *
251
+ * The `template` must contain a literal `{}` placeholder which the
252
+ * adapter substitutes with the current facet value (e.g.
253
+ * `whats-new-v2#year#{}` → `whats-new-v2#year#2024`). The substituted
254
+ * string is injected into the URL as the value of the `param` query
255
+ * parameter.
256
+ *
257
+ * Multi-facet support (e.g. year × category) is explicitly deferred to a
258
+ * future ADR; the adapter throws when more than one facet entry is
259
+ * present. The schema allows a `Record<string, Facet>` purely for
260
+ * forward-compatibility — single entry today, additional entries later
261
+ * without a schema break.
262
+ *
263
+ * See ADR-0017 for the full design rationale (option A vs option D
264
+ * `pagination.type: facet`, lastSeenIds-as-global semantics, conditional
265
+ * GET disablement in facet sweep mode).
266
+ */
267
+ export const SourceFacetRangeSchema = z
268
+ .object({
269
+ type: z.literal("range"),
270
+ /** Query parameter name to inject (e.g. `tags.id`). */
271
+ param: z.string().min(1),
272
+ /**
273
+ * Template string with a literal `{}` placeholder for the facet value.
274
+ * E.g. `whats-new-v2#year#{}` → injected as `whats-new-v2#year#2024`.
275
+ */
276
+ template: z.string().min(1),
277
+ /** Inclusive `[start, end]` range — both endpoints are visited. */
278
+ range: z.tuple([z.number(), z.number()]),
279
+ /** Step size (default 1). Must be a positive integer. */
280
+ step: z.number().int().positive().default(1),
281
+ })
282
+ .superRefine((value, ctx) => {
283
+ if (!value.template.includes("{}")) {
284
+ ctx.addIssue({
285
+ code: "custom",
286
+ path: ["template"],
287
+ message: "template must contain '{}' placeholder",
288
+ });
289
+ }
290
+ if (value.range[0] > value.range[1]) {
291
+ ctx.addIssue({
292
+ code: "custom",
293
+ path: ["range"],
294
+ message: "range start must be <= end",
295
+ });
296
+ }
297
+ });
298
+ export const SourceFacetEnumSchema = z
299
+ .object({
300
+ type: z.literal("enum"),
301
+ /** Query parameter name to inject (e.g. `category`). */
302
+ param: z.string().min(1),
303
+ /**
304
+ * Template string with a literal `{}` placeholder for the facet value.
305
+ * The adapter coerces non-string values via `String(value)` before
306
+ * substitution.
307
+ */
308
+ template: z.string().min(1),
309
+ /** Explicit list of facet values to sweep. */
310
+ values: z.array(z.union([z.string(), z.number()])).min(1),
311
+ })
312
+ .superRefine((value, ctx) => {
313
+ if (!value.template.includes("{}")) {
314
+ ctx.addIssue({
315
+ code: "custom",
316
+ path: ["template"],
317
+ message: "template must contain '{}' placeholder",
318
+ });
319
+ }
320
+ });
321
+ export const SourceFacetSchema = z.discriminatedUnion("type", [
322
+ SourceFacetRangeSchema,
323
+ SourceFacetEnumSchema,
324
+ ]);
325
+ /**
326
+ * Map of facet-name → facet-spec. In Phase 1 the adapter enforces a
327
+ * single entry at runtime (multi-facet is deferred to a future ADR), but
328
+ * the schema accepts the record shape so future multi-facet support does
329
+ * not require a schema break.
330
+ */
331
+ export const SourceFacetsSchema = z.record(z.string().min(1), SourceFacetSchema);
206
332
  /**
207
333
  * Validate `Source.url` per kind.
208
334
  *
@@ -254,11 +380,23 @@ export const SourceSchema = z
254
380
  http: SourceHttpOptionsSchema.optional(),
255
381
  pagination: SourcePaginationSchema.optional(),
256
382
  jsonSelectors: SourceJsonApiSelectorsSchema.optional(),
383
+ // Facet sweep recipe extension (ADR-0017). Independent of
384
+ // `pagination`: `facets` is the outer "data slice" axis, `pagination`
385
+ // is the inner per-request page traversal. Only consulted by the
386
+ // `json-api` adapter. Single-facet only in Phase 1 — multi-facet is
387
+ // schema-allowed for forward-compat but the adapter throws at runtime.
388
+ facets: SourceFacetsSchema.optional(),
257
389
  // `trustLevel` defaults to `"untrusted"` so existing source YAMLs (which
258
390
  // omit the field entirely) keep their current treatment. Per ADR-0009 M4
259
391
  // this is schema-only; policy branches that read `trustLevel` arrive in a
260
392
  // separate sub-issue.
261
393
  trustLevel: TrustLevelSchema.default("untrusted"),
394
+ // `triagePolicy` is the per-source triage configuration introduced by
395
+ // ADR-0018. Optional: existing source YAMLs without the block remain
396
+ // valid and `radar triage` (PR-3) skips sources missing a policy. PR-1
397
+ // is schema-only — the adapter (PR-2) and CLI (PR-3) consume this in
398
+ // later PRs.
399
+ triagePolicy: SourceTriagePolicySchema.optional(),
262
400
  })
263
401
  .superRefine((value, ctx) => {
264
402
  if (value.kind !== "npm-registry" && !isValidHttpUrl(value.url)) {
@@ -1 +1 @@
1
- {"version":3,"file":"source.js","sourceRoot":"","sources":["../../src/schemas/source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,IAAI,CAAC;IACrC,KAAK;IACL,MAAM;IACN,SAAS;IACT,iBAAiB;IACjB,cAAc;IACd,WAAW;IACX,UAAU;CACX,CAAC,CAAC;AAGH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;AAGtE,qGAAqG;AACrG,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAG7E;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC;AAGjE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAA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