mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-06 12:52:26 +00:00
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:
1 parent
870df0482a
commit
e282cf5a29
3 files changed
+364
-1
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user