@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.
- package/.claude-plugin/plugin.json +1 -1
- package/.release-please-manifest.json +3 -2
- package/CHANGELOG.md +7 -0
- package/README.md +1 -0
- package/docs/architecture.md +28 -22
- package/package.json +1 -1
- package/plugins/cartographer/.claude-plugin/plugin.json +14 -0
- package/plugins/cartographer/CHANGELOG.md +27 -0
- package/plugins/cartographer/README.md +113 -0
- package/plugins/cartographer/config.json +21 -0
- package/plugins/cartographer/docs/adr/001-background-audit-launch.md +28 -0
- package/plugins/cartographer/docs/adr/002-flock-pid-file-fallback.md +30 -0
- package/plugins/cartographer/docs/adr/003-at-least-once-event-delivery.md +32 -0
- package/plugins/cartographer/docs/adr/004-exclude-paths-replace-semantics.md +27 -0
- package/plugins/cartographer/hooks/hooks.json +44 -0
- package/plugins/cartographer/scripts/hooks/cartographer-post-write.sh +87 -0
- package/plugins/cartographer/scripts/hooks/cartographer-session-start.sh +89 -0
- package/plugins/cartographer/scripts/lib/cartographer-analyze.sh +286 -0
- package/plugins/cartographer/scripts/lib/cartographer-collect.sh +59 -0
- package/plugins/cartographer/scripts/lib/cartographer-config.sh +105 -0
- package/plugins/cartographer/scripts/lib/cartographer-events.sh +82 -0
- package/plugins/cartographer/scripts/lib/cartographer-lock.sh +38 -0
- package/plugins/cartographer/scripts/lib/cartographer-project-key.sh +55 -0
- package/plugins/cartographer/scripts/lib/cartographer-ulid.sh +47 -0
- package/plugins/cartographer/scripts/run-audit.sh +309 -0
- package/plugins/cartographer/skills/cartographer/SKILL.md +154 -0
- package/release-please-config.json +16 -0
- package/test/bats/cartographer-config.bats +107 -0
- package/test/bats/cartographer-lock.bats +77 -0
- 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
|
+
}
|