@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 +42 -0
- package/dist/chunk-WXCFWUCN.mjs +678 -0
- package/dist/glassbox/index.d.mts +3 -3
- package/dist/glassbox/index.d.ts +3 -3
- package/dist/glassbox-routes/index.d.mts +117 -6
- package/dist/glassbox-routes/index.d.ts +117 -6
- package/dist/glassbox-routes/index.js +1859 -8
- package/dist/glassbox-routes/index.mjs +359 -8
- package/dist/index.d.mts +473 -13
- package/dist/index.d.ts +473 -13
- package/dist/index.js +543 -10
- package/dist/index.mjs +484 -585
- package/dist/{ir-B_XX2LAO.d.ts → ir-BIAT9gJk.d.ts} +195 -1
- package/dist/{ir-B9zqlwjH.d.mts → ir-De2AQtlr.d.mts} +195 -1
- package/dist/profiles.d.mts +1 -1
- package/dist/profiles.d.ts +1 -1
- package/dist/{types-o9etg93a.d.mts → types-BjrIFPGe.d.mts} +1 -1
- package/dist/{types-bt0aVJb8.d.ts → types-D_JAhCv4.d.ts} +1 -1
- package/package.json +1 -1
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
|
```
|