diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2025-11-04 08:50:29 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2025-11-04 09:23:48 +0000 |
| commit | b3031800cd95601c2d9cd2d24034364d1496b073 (patch) | |
| tree | de91247ecaef26dd59d209ea2d7df3e1772a4c62 /grasp-audit/src/client.rs | |
| parent | 15d3b0f859c2c5bc74ac602159c26fbccf475cb4 (diff) | |
Migrate to standard NIP-01 't' tags for audit events
- Changed from custom single-letter tags (g, r, c) to standard 't' tags
- Tag values now use descriptive prefixes:
- 'grasp-audit-test-event' (marker tag)
- 'audit-{run-id}' (run identification)
- 'audit-cleanup-after-{timestamp}' (cleanup time)
- Updated audit_tags() in src/audit.rs
- Updated query filtering in src/client.rs
- Updated all tests to verify 't' tag usage
- All tests passing: 12/12 unit tests, 1/1 integration test
- CLI verified working with new tag scheme
This follows standard Nostr conventions and avoids potential
conflicts with other uses of single-letter tags. The 't' tag
is specifically designed for categorization/topics per NIP-01.
Diffstat (limited to 'grasp-audit/src/client.rs')
| -rw-r--r-- | grasp-audit/src/client.rs | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/grasp-audit/src/client.rs b/grasp-audit/src/client.rs index d78b33c..4831d3f 100644 --- a/grasp-audit/src/client.rs +++ b/grasp-audit/src/client.rs | |||
| @@ -95,16 +95,11 @@ impl AuditClient { | |||
| 95 | 95 | ||
| 96 | if self.config.mode == AuditMode::CI { | 96 | if self.config.mode == AuditMode::CI { |
| 97 | // In CI mode, only see our own audit events | 97 | // In CI mode, only see our own audit events |
| 98 | // Filter by "g" tag (grasp-audit marker) and "r" tag (run ID) | 98 | // Filter by "t" tags (hashtags) |
| 99 | let t_tag = SingleLetterTag::lowercase(Alphabet::T); | ||
| 99 | filter = filter | 100 | filter = filter |
| 100 | .custom_tag( | 101 | .custom_tag(t_tag, "grasp-audit-test-event") |
| 101 | SingleLetterTag::lowercase(Alphabet::G), | 102 | .custom_tag(t_tag, format!("audit-{}", self.config.run_id)); |
| 102 | "grasp-audit" | ||
| 103 | ) | ||
| 104 | .custom_tag( | ||
| 105 | SingleLetterTag::lowercase(Alphabet::R), | ||
| 106 | &self.config.run_id | ||
| 107 | ); | ||
| 108 | } | 103 | } |
| 109 | // In Production mode, see all events (no filter modification) | 104 | // In Production mode, see all events (no filter modification) |
| 110 | 105 | ||