@warmdrift/kgauto-compiler 2.0.0-alpha.27 → 2.0.0-alpha.29

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.
package/README.md CHANGED
@@ -89,6 +89,48 @@ await record({
89
89
  });
90
90
  ```
91
91
 
92
+ ## Structured advisories API (alpha.29+)
93
+
94
+ kgauto's compile-time advisories (`caching-off-on-claude`, `tool-bloat`,
95
+ `archetype-perf-floor-breach`, etc.) used to vanish after the consumer read
96
+ the compile result. alpha.29 ships a structured query + resolution surface
97
+ so Admin UIs can render "what's open right now?" without log-scraping.
98
+
99
+ ```ts
100
+ import {
101
+ getActionableAdvisories,
102
+ markAdvisoryResolved,
103
+ } from '@warmdrift/kgauto-compiler';
104
+
105
+ // Query open advisories for this app
106
+ const open = await getActionableAdvisories({
107
+ appId: 'playbacksam',
108
+ brainEndpoint: process.env.KGAUTO_BRAIN_ENDPOINT!,
109
+ brainJwt: process.env.KGAUTO_BRAIN_JWT!,
110
+ brainAnonKey: process.env.KGAUTO_BRAIN_ANON_KEY!,
111
+ });
112
+
113
+ for (const a of open) {
114
+ console.log(`[${a.severity}] ${a.rule} — ${a.observationCount} firings since ${a.openedAt}`);
115
+ console.log(` ${a.message}`);
116
+ if (a.suggestedFix?.docsLink) console.log(` ↳ ${a.suggestedFix.docsLink}`);
117
+ }
118
+
119
+ // After the operator fixes the issue, mark it resolved:
120
+ const r = await markAdvisoryResolved({
121
+ id: open[0].id,
122
+ resolutionNote: 'wired historyCachePolicy in compile() — PR #99',
123
+ brainEndpoint: process.env.KGAUTO_BRAIN_ENDPOINT!,
124
+ brainJwt: process.env.KGAUTO_BRAIN_JWT!,
125
+ brainAnonKey: process.env.KGAUTO_BRAIN_ANON_KEY!,
126
+ });
127
+ if (!r.ok) console.error(r.reason);
128
+ ```
129
+
130
+ The view enforces server-side auto-resolution: advisories with no firing
131
+ in the last 14 days flip to `status='resolved'` automatically; the next
132
+ firing reopens the rule with a fresh stable `id`.
133
+
92
134
  ## Architecture
93
135
 
94
136
  ```