securenow 8.9.0 → 8.11.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.
package/NPM_README.md CHANGED
@@ -306,6 +306,36 @@ X-SecureNow-App-Key: <app-uuid>
306
306
 
307
307
  CLI: `npx securenow event send auth.login.failure --user u_1 --ip 1.2.3.4 --attrs reason=bad_token`
308
308
 
309
+ ### Build alert SQL from the installed telemetry contract
310
+
311
+ The NPM package ships the exact ClickHouse table/field contract used for alert-rule authoring.
312
+ Agents should read it instead of guessing SQL columns:
313
+
314
+ ```bash
315
+ # Offline: installed SDK schema, tenant scope, timestamp types, event mappings, and templates
316
+ npx securenow telemetry schema --json
317
+
318
+ # Connected app: names/types/counts observed in real telemetry (never attribute values)
319
+ npx securenow telemetry fields --app <app-key> --env production --since 24h --json
320
+
321
+ # Prove candidate SQL against the backend before creating anything
322
+ npx securenow alerts rules validate --sql @rule.sql --app <app-key>
323
+ ```
324
+
325
+ The same local contract is available programmatically:
326
+
327
+ ```js
328
+ const telemetrySchema = require('securenow/telemetry-schema');
329
+ ```
330
+
331
+ Use the installed schema to draft SQL, live field discovery to verify that optional/custom
332
+ fields are actually emitted, and `alerts rules validate` to prove the query compiles and runs.
333
+ A field absent from the selected live window is **unverified**, not necessarily unsupported.
334
+ Mark detections `NEEDS_INSTRUMENTATION` when the repository must add a `track()` event,
335
+ `NEEDS_BASELINE` when only the threshold remains unknown, and `READY` only after field
336
+ verification plus SQL validation. See `node_modules/securenow/TELEMETRY-SQL.md` for tables,
337
+ timestamp handling, privacy rules, templates, and the full test-to-production lifecycle.
338
+
309
339
  ```bash
310
340
  # Create a custom detection rule from your own SQL (new in 8.1)
311
341
  npx securenow alerts rules create \