@onlooker-community/ecosystem 0.27.0 → 0.28.1
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/marketplace.json +13 -0
- package/.claude-plugin/plugin.json +1 -1
- package/.release-please-manifest.json +4 -3
- package/CHANGELOG.md +14 -0
- package/CLAUDE.md +2 -0
- package/docs/architecture.md +4 -0
- package/package.json +3 -3
- package/plugins/compass/.claude-plugin/plugin.json +1 -1
- package/plugins/compass/CHANGELOG.md +7 -0
- package/plugins/compass/scripts/hooks/compass-pre-tool-use.sh +9 -4
- package/plugins/lineage/.claude-plugin/plugin.json +14 -0
- package/plugins/lineage/CHANGELOG.md +9 -0
- package/plugins/lineage/README.md +133 -0
- package/plugins/lineage/config.json +11 -0
- package/plugins/lineage/hooks/hooks.json +33 -0
- package/plugins/lineage/scripts/hooks/lineage-post-tool-use.sh +132 -0
- package/plugins/lineage/scripts/lib/lineage-config.sh +100 -0
- package/plugins/lineage/scripts/lib/lineage-events.sh +81 -0
- package/plugins/lineage/scripts/lib/lineage-project-key.sh +85 -0
- package/plugins/lineage/scripts/lib/lineage-query.sh +88 -0
- package/plugins/lineage/scripts/lib/lineage-record.sh +132 -0
- package/plugins/lineage/scripts/lib/lineage-redact.sh +51 -0
- package/plugins/lineage/scripts/lib/lineage-ulid.sh +53 -0
- package/plugins/lineage/scripts/lib/portable-lock.sh +59 -0
- package/plugins/lineage/skills/lineage/SKILL.md +165 -0
- package/release-please-config.json +16 -0
- package/test/bats/lineage-config.bats +73 -0
- package/test/bats/lineage-events.bats +81 -0
- package/test/bats/lineage-post-tool-use.bats +115 -0
- package/test/bats/lineage-project-key.bats +51 -0
- package/test/bats/lineage-query.bats +85 -0
- package/test/bats/lineage-record.bats +79 -0
- package/test/bats/lineage-redact.bats +63 -0
- package/test/bats/lineage-ulid.bats +28 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
#!/usr/bin/env bats
|
|
2
|
+
|
|
3
|
+
setup() {
|
|
4
|
+
source "${BATS_TEST_DIRNAME}/../helpers/setup.bash"
|
|
5
|
+
setup_test_env
|
|
6
|
+
PLUGIN_ROOT="${REPO_ROOT}/plugins/lineage"
|
|
7
|
+
# shellcheck disable=SC1091
|
|
8
|
+
source "${PLUGIN_ROOT}/scripts/lib/portable-lock.sh"
|
|
9
|
+
# shellcheck disable=SC1091
|
|
10
|
+
source "${PLUGIN_ROOT}/scripts/lib/lineage-redact.sh"
|
|
11
|
+
# shellcheck disable=SC1091
|
|
12
|
+
source "${PLUGIN_ROOT}/scripts/lib/lineage-record.sh"
|
|
13
|
+
KEY="proj0123abcd"
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@test "Edit record captures operation, line counts, snippet, and digest" {
|
|
17
|
+
local ti rec
|
|
18
|
+
ti=$(jq -nc '{file_path:"src/a.py", old_string:"a\nb", new_string:"a\nb\nc"}')
|
|
19
|
+
rec=$(lineage_build_record "CID1" "2026-06-12T00:00:00Z" 1781280000 "sess1" "5" "Edit" "src/a.py" "$ti" 4000 true "")
|
|
20
|
+
[ "$(jq -r '.tool' <<<"$rec")" = "Edit" ]
|
|
21
|
+
[ "$(jq -r '.operation' <<<"$rec")" = "edit" ]
|
|
22
|
+
[ "$(jq -r '.lines_added' <<<"$rec")" = "3" ]
|
|
23
|
+
[ "$(jq -r '.lines_removed' <<<"$rec")" = "2" ]
|
|
24
|
+
[ "$(jq -r '.turn' <<<"$rec")" = "5" ]
|
|
25
|
+
[ "$(jq -r '.added_snippets[0]' <<<"$rec")" = "a
|
|
26
|
+
b
|
|
27
|
+
c" ]
|
|
28
|
+
[ -n "$(jq -r '.content_sha256' <<<"$rec")" ]
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@test "Write record is operation=create with no removed lines" {
|
|
32
|
+
local ti rec
|
|
33
|
+
ti=$(jq -nc '{file_path:"README.md", content:"line1\nline2"}')
|
|
34
|
+
rec=$(lineage_build_record "CID2" "2026-06-12T00:00:00Z" 1781280000 "sess1" "" "Write" "README.md" "$ti" 4000 true "")
|
|
35
|
+
[ "$(jq -r '.tool' <<<"$rec")" = "Write" ]
|
|
36
|
+
[ "$(jq -r '.operation' <<<"$rec")" = "create" ]
|
|
37
|
+
[ "$(jq -r '.lines_added' <<<"$rec")" = "2" ]
|
|
38
|
+
[ "$(jq -r '.lines_removed' <<<"$rec")" = "0" ]
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@test "turn is omitted when empty" {
|
|
42
|
+
local ti rec
|
|
43
|
+
ti=$(jq -nc '{file_path:"README.md", content:"x"}')
|
|
44
|
+
rec=$(lineage_build_record "CID3" "2026-06-12T00:00:00Z" 1781280000 "sess1" "" "Write" "README.md" "$ti" 4000 true "")
|
|
45
|
+
[ "$(jq -r 'has("turn")' <<<"$rec")" = "false" ]
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@test "MultiEdit record reports edit_count and joins added content" {
|
|
49
|
+
local ti rec
|
|
50
|
+
ti=$(jq -nc '{file_path:"src/b.py", edits:[{old_string:"x", new_string:"x1"},{old_string:"y", new_string:"y1\ny2"}]}')
|
|
51
|
+
rec=$(lineage_build_record "CID4" "2026-06-12T00:00:00Z" 1781280000 "sess1" "2" "MultiEdit" "src/b.py" "$ti" 4000 true "")
|
|
52
|
+
[ "$(jq -r '.tool' <<<"$rec")" = "MultiEdit" ]
|
|
53
|
+
[ "$(jq -r '.operation' <<<"$rec")" = "multi_edit" ]
|
|
54
|
+
[ "$(jq -r '.edit_count' <<<"$rec")" = "2" ]
|
|
55
|
+
[ "$(jq -r '.lines_added' <<<"$rec")" = "3" ]
|
|
56
|
+
[[ "$(jq -r '.added_snippets[0]' <<<"$rec")" == *"y2"* ]]
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@test "append writes one line per record (append-only)" {
|
|
60
|
+
local ti r1 r2
|
|
61
|
+
ti=$(jq -nc '{file_path:"src/a.py", content:"a"}')
|
|
62
|
+
r1=$(lineage_build_record "CID-A" "2026-06-12T00:00:00Z" 1781280000 "s" "1" "Write" "src/a.py" "$ti" 4000 true "")
|
|
63
|
+
r2=$(lineage_build_record "CID-B" "2026-06-12T00:00:01Z" 1781280001 "s" "2" "Write" "src/a.py" "$ti" 4000 true "")
|
|
64
|
+
lineage_append "$KEY" "$r1"
|
|
65
|
+
lineage_append "$KEY" "$r2"
|
|
66
|
+
local path
|
|
67
|
+
path=$(lineage_record_path "$KEY")
|
|
68
|
+
[ -f "$path" ]
|
|
69
|
+
[ "$(wc -l < "$path")" -eq 2 ]
|
|
70
|
+
[ "$(jq -rs '.[0].change_id' "$path")" = "CID-A" ]
|
|
71
|
+
[ "$(jq -rs '.[1].change_id' "$path")" = "CID-B" ]
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@test "redaction disabled keeps the raw snippet" {
|
|
75
|
+
local ti rec
|
|
76
|
+
ti=$(jq -nc '{file_path:"x", content:"plain text body"}')
|
|
77
|
+
rec=$(lineage_build_record "CID5" "2026-06-12T00:00:00Z" 1781280000 "s" "1" "Write" "x" "$ti" 4000 false "")
|
|
78
|
+
[ "$(jq -r '.added_snippets[0]' <<<"$rec")" = "plain text body" ]
|
|
79
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
#!/usr/bin/env bats
|
|
2
|
+
|
|
3
|
+
# Secret-shaped strings are assembled at runtime (prefix + filler) so this test
|
|
4
|
+
# file itself contains no literal secret token a scanner would flag.
|
|
5
|
+
|
|
6
|
+
setup() {
|
|
7
|
+
source "${BATS_TEST_DIRNAME}/../helpers/setup.bash"
|
|
8
|
+
setup_test_env
|
|
9
|
+
PLUGIN_ROOT="${REPO_ROOT}/plugins/lineage"
|
|
10
|
+
# shellcheck disable=SC1091
|
|
11
|
+
source "${PLUGIN_ROOT}/scripts/lib/lineage-redact.sh"
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@test "ordinary code passes through unchanged" {
|
|
15
|
+
local out
|
|
16
|
+
out=$(printf '%s' "x = 2 # bumped" | lineage_redact 4000 true)
|
|
17
|
+
[ "$out" = "x = 2 # bumped" ]
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@test "an Anthropic-style API key is redacted" {
|
|
21
|
+
local tok out
|
|
22
|
+
tok="sk-ant-$(printf 'a%.0s' $(seq 1 28))"
|
|
23
|
+
out=$(printf '%s' "key=\"${tok}\"" | lineage_redact 4000 true)
|
|
24
|
+
[[ "$out" == *"[REDACTED:secret]"* ]]
|
|
25
|
+
[[ "$out" != *"$tok"* ]]
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@test "a GitHub-style token is redacted" {
|
|
29
|
+
local tok out
|
|
30
|
+
tok="ghp_$(printf '0%.0s' $(seq 1 36))"
|
|
31
|
+
out=$(printf '%s' "$tok" | lineage_redact 4000 true)
|
|
32
|
+
[[ "$out" == *"[REDACTED:secret]"* ]]
|
|
33
|
+
[[ "$out" != *"$tok"* ]]
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@test "a KEY=value secret keeps the key but redacts the value" {
|
|
37
|
+
local val out
|
|
38
|
+
val=$(printf 'x%.0s' $(seq 1 24))
|
|
39
|
+
out=$(printf '%s' "API_TOKEN=${val}" | lineage_redact 4000 true)
|
|
40
|
+
[[ "$out" == *"API_TOKEN="* ]]
|
|
41
|
+
[[ "$out" == *"[REDACTED:secret]"* ]]
|
|
42
|
+
[[ "$out" != *"$val"* ]]
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@test "redaction is skipped when disabled" {
|
|
46
|
+
local tok out
|
|
47
|
+
tok="ghp_$(printf '0%.0s' $(seq 1 36))"
|
|
48
|
+
out=$(printf '%s' "$tok" | lineage_redact 4000 false)
|
|
49
|
+
[ "$out" = "$tok" ]
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@test "content longer than the cap is truncated with a marker" {
|
|
53
|
+
local out
|
|
54
|
+
out=$(printf '%s' "abcdefghij" | lineage_redact 4 true)
|
|
55
|
+
[[ "$out" == "abcd"* ]]
|
|
56
|
+
[[ "$out" == *"truncated 6 chars"* ]]
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@test "content within the cap is not truncated" {
|
|
60
|
+
local out
|
|
61
|
+
out=$(printf '%s' "abcd" | lineage_redact 4 true)
|
|
62
|
+
[ "$out" = "abcd" ]
|
|
63
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/usr/bin/env bats
|
|
2
|
+
|
|
3
|
+
setup() {
|
|
4
|
+
source "${BATS_TEST_DIRNAME}/../helpers/setup.bash"
|
|
5
|
+
setup_test_env
|
|
6
|
+
|
|
7
|
+
PLUGIN_ROOT="${REPO_ROOT}/plugins/lineage"
|
|
8
|
+
# shellcheck disable=SC1091
|
|
9
|
+
source "${PLUGIN_ROOT}/scripts/lib/lineage-ulid.sh"
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@test "lineage_ulid is 26 characters" {
|
|
13
|
+
run lineage_ulid
|
|
14
|
+
[ "$status" -eq 0 ]
|
|
15
|
+
[ "${#output}" -eq 26 ]
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@test "lineage_ulid uses only Crockford base32 (no I, L, O, U)" {
|
|
19
|
+
run lineage_ulid
|
|
20
|
+
[[ "$output" =~ ^[0-9A-HJKMNP-TV-Z]+$ ]]
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@test "two ulids differ" {
|
|
24
|
+
local a b
|
|
25
|
+
a=$(lineage_ulid)
|
|
26
|
+
b=$(lineage_ulid)
|
|
27
|
+
[ "$a" != "$b" ]
|
|
28
|
+
}
|