chore(ai): event schema validation tool + fixes

- Added `scripts/agent/validate-events.mjs` to verify builder output against schemas.
- Updated `js/nostrEventSchemas.js` to enforce relay hints in `buildRepostEvent` (fixes `tests/nostr-boost-actions.test.mjs`).
- Documented usage in `docs/nostr-event-schemas.md`.
- Verified 25 event builder scenarios pass validation.
This commit is contained in:
google-labs-jules[bot] committed 2026-01-22 05:31:40 +00:00
1 parent 870df0482a
commit e282cf5a29
3 files changed
+364 -1

No files matched your search

+13
View File
@@ -7,6 +7,19 @@ no longer requires hunting through the codebase. It also exposes helpers for
building events and for overriding the schema at runtime when you need to
experiment.
## Validation
To verify that event builders produce spec-compliant events, run the validation script:
```bash
node scripts/agent/validate-events.mjs
```
This script generates example events for all defined builders and checks them against their schemas, ensuring:
- Correct kind
- Presence of required tags (topic, identifier, etc.)
- Correct content format (JSON vs text vs empty)
## Runtime helpers
```js