@onlooker-community/ecosystem 0.14.0 → 0.15.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.
Files changed (30) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.release-please-manifest.json +3 -2
  3. package/CHANGELOG.md +7 -0
  4. package/README.md +1 -0
  5. package/docs/architecture.md +28 -22
  6. package/package.json +1 -1
  7. package/plugins/cartographer/.claude-plugin/plugin.json +14 -0
  8. package/plugins/cartographer/CHANGELOG.md +27 -0
  9. package/plugins/cartographer/README.md +113 -0
  10. package/plugins/cartographer/config.json +21 -0
  11. package/plugins/cartographer/docs/adr/001-background-audit-launch.md +28 -0
  12. package/plugins/cartographer/docs/adr/002-flock-pid-file-fallback.md +30 -0
  13. package/plugins/cartographer/docs/adr/003-at-least-once-event-delivery.md +32 -0
  14. package/plugins/cartographer/docs/adr/004-exclude-paths-replace-semantics.md +27 -0
  15. package/plugins/cartographer/hooks/hooks.json +44 -0
  16. package/plugins/cartographer/scripts/hooks/cartographer-post-write.sh +87 -0
  17. package/plugins/cartographer/scripts/hooks/cartographer-session-start.sh +89 -0
  18. package/plugins/cartographer/scripts/lib/cartographer-analyze.sh +286 -0
  19. package/plugins/cartographer/scripts/lib/cartographer-collect.sh +59 -0
  20. package/plugins/cartographer/scripts/lib/cartographer-config.sh +105 -0
  21. package/plugins/cartographer/scripts/lib/cartographer-events.sh +82 -0
  22. package/plugins/cartographer/scripts/lib/cartographer-lock.sh +38 -0
  23. package/plugins/cartographer/scripts/lib/cartographer-project-key.sh +55 -0
  24. package/plugins/cartographer/scripts/lib/cartographer-ulid.sh +47 -0
  25. package/plugins/cartographer/scripts/run-audit.sh +309 -0
  26. package/plugins/cartographer/skills/cartographer/SKILL.md +154 -0
  27. package/release-please-config.json +16 -0
  28. package/test/bats/cartographer-config.bats +107 -0
  29. package/test/bats/cartographer-lock.bats +77 -0
  30. package/test/bats/cartographer-ulid.bats +56 -0
@@ -0,0 +1,56 @@
1
+ #!/usr/bin/env bats
2
+
3
+ setup() {
4
+ source "${BATS_TEST_DIRNAME}/../helpers/setup.bash"
5
+ setup_test_env
6
+ # shellcheck disable=SC1091
7
+ source "${REPO_ROOT}/plugins/cartographer/scripts/lib/cartographer-ulid.sh"
8
+ }
9
+
10
+ @test "cartographer_ulid returns a 26-char Crockford Base32 string" {
11
+ local id
12
+ id=$(cartographer_ulid)
13
+ [ "${#id}" -eq 26 ]
14
+ [[ "$id" =~ ^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$ ]]
15
+ }
16
+
17
+ @test "two ULIDs minted apart are lexicographically ordered" {
18
+ local a b
19
+ a=$(cartographer_ulid)
20
+ sleep 0.01
21
+ b=$(cartographer_ulid)
22
+ [[ "$a" < "$b" ]] || [ "$a" = "$b" ]
23
+ }
24
+
25
+ @test "many ULIDs are unique" {
26
+ local seen="${BATS_TEST_TMPDIR}/ulids.txt"
27
+ : > "$seen"
28
+ local i
29
+ for ((i = 0; i < 50; i++)); do
30
+ printf '%s\n' "$(cartographer_ulid)" >> "$seen"
31
+ done
32
+ local total unique
33
+ total=$(wc -l < "$seen" | tr -d ' ')
34
+ unique=$(sort -u "$seen" | wc -l | tr -d ' ')
35
+ [ "$total" = "$unique" ]
36
+ }
37
+
38
+ @test "random component is 16 chars (full 80-bit coverage)" {
39
+ local id
40
+ id=$(cartographer_ulid)
41
+ # Characters 10-25 (0-indexed) are the random component
42
+ local rand_part="${id:10:16}"
43
+ [ "${#rand_part}" -eq 16 ]
44
+ }
45
+
46
+ @test "timestamp component sorts ULIDs correctly across 10+ calls" {
47
+ local prev=""
48
+ local id
49
+ for _ in 1 2 3 4 5 6 7 8 9 10; do
50
+ id=$(cartographer_ulid)
51
+ if [[ -n "$prev" ]]; then
52
+ [[ "$prev" < "$id" ]] || [ "$prev" = "$id" ]
53
+ fi
54
+ prev="$id"
55
+ done
56
+ }