@boyingliu01/xp-gate 0.27.1 → 0.27.3
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/adapter-common.sh +0 -0
- package/adapters/cpp.sh +0 -0
- package/adapters/dart.sh +0 -0
- package/adapters/flutter.sh +0 -0
- package/adapters/gate-7.sh +22 -4
- package/adapters/go.sh +0 -0
- package/adapters/iac.sh +0 -0
- package/adapters/java.sh +68 -6
- package/adapters/kotlin.sh +0 -0
- package/adapters/objectivec.sh +0 -0
- package/adapters/plugins/book299-20132-python/scripts/install-gradle.sh +0 -0
- package/adapters/plugins/book299-20132-python/scripts/install-maven.sh +0 -0
- package/adapters/plugins/book299-4081-c/scripts/install-gradle.sh +0 -0
- package/adapters/plugins/book299-4081-c/scripts/install-maven.sh +0 -0
- package/adapters/plugins/book299-4083-javascriptes5/scripts/install-gradle.sh +0 -0
- package/adapters/plugins/book299-4083-javascriptes5/scripts/install-maven.sh +0 -0
- package/adapters/powershell.sh +0 -0
- package/adapters/python.sh +0 -0
- package/adapters/shell.sh +0 -0
- package/adapters/swift.sh +0 -0
- package/adapters/typescript.sh +0 -0
- package/bin/xp-gate.js +0 -0
- package/gate-10.sh +0 -0
- package/gate-3.sh +0 -0
- package/gate-4.sh +0 -0
- package/gate-7.sh +22 -4
- package/gate-8.sh +0 -0
- package/gate-9.sh +0 -0
- package/hooks/adapter-common.sh +0 -0
- package/hooks/gate-10.sh +0 -0
- package/hooks/gate-3.sh +0 -0
- package/hooks/gate-4.sh +0 -0
- package/hooks/gate-7.sh +22 -4
- package/hooks/gate-8.sh +0 -0
- package/hooks/gate-9.sh +0 -0
- package/hooks/post-merge +0 -0
- package/hooks/pre-commit +0 -0
- package/hooks/pre-push +0 -0
- package/hooks/sprint-gate.sh +0 -0
- package/lib/__tests__/doctor-delphi.test.js +244 -244
- package/lib/__tests__/sprint-audit.test.js +207 -207
- package/lib/mattpocock-license-verdict.json +1 -1
- package/lib/sprint-audit.js +235 -235
- package/mock-policy/AGENTS.md +3 -3
- package/mutation/AGENTS.md +3 -3
- package/package.json +1 -1
- package/plugins/claude-code/.claude-plugin/plugin.json +1 -1
- package/plugins/claude-code/bin/delphi-review-guard.sh +0 -0
- package/plugins/claude-code/bin/xp-gate-check +0 -0
- package/plugins/claude-code/skills/delphi-review/AGENTS.md +3 -3
- package/plugins/claude-code/skills/grill-with-docs/SKILL.md +1 -2
- package/plugins/claude-code/skills/grilling/SKILL.md +22 -5
- package/plugins/claude-code/skills/sprint-flow/AGENTS.md +3 -3
- package/plugins/claude-code/skills/test-specification-alignment/AGENTS.md +3 -3
- package/plugins/dsh/lib/command.d.ts +32 -0
- package/plugins/dsh/lib/command.d.ts.map +1 -0
- package/plugins/dsh/lib/command.js +81 -0
- package/plugins/dsh/lib/delphi-config.d.ts +75 -0
- package/plugins/dsh/lib/delphi-config.d.ts.map +1 -0
- package/plugins/dsh/lib/delphi-config.js +183 -0
- package/plugins/dsh/lib/delphi-run.d.ts +24 -0
- package/plugins/dsh/lib/delphi-run.d.ts.map +1 -0
- package/plugins/dsh/lib/delphi-run.js +92 -0
- package/plugins/dsh/lib/delphi.d.ts +88 -0
- package/plugins/dsh/lib/delphi.d.ts.map +1 -0
- package/plugins/dsh/lib/delphi.js +161 -0
- package/plugins/dsh/lib/dialect.d.ts +24 -0
- package/plugins/dsh/lib/dialect.d.ts.map +1 -0
- package/plugins/dsh/lib/dialect.js +36 -0
- package/plugins/dsh/lib/gate-runner.d.ts +18 -0
- package/plugins/dsh/lib/gate-runner.d.ts.map +1 -0
- package/plugins/dsh/lib/gate-runner.js +46 -0
- package/plugins/dsh/lib/index.d.ts +5 -0
- package/plugins/dsh/lib/index.d.ts.map +1 -0
- package/plugins/dsh/lib/index.js +162 -0
- package/plugins/dsh/node_modules/.vite/vitest/results.json +1 -0
- package/plugins/dsh/package.json +1 -1
- package/plugins/dsh/skills/delphi-review/AGENTS.md +3 -3
- package/plugins/dsh/skills/grill-with-docs/SKILL.md +1 -2
- package/plugins/dsh/skills/grilling/SKILL.md +22 -5
- package/plugins/dsh/skills/sprint-flow/AGENTS.md +3 -3
- package/plugins/dsh/skills/test-specification-alignment/AGENTS.md +3 -3
- package/plugins/dsh/src/delphi-config-global-fallback.test.ts +87 -0
- package/plugins/dsh/src/delphi-config.ts +67 -28
- package/plugins/opencode/package.json +1 -1
- package/plugins/opencode/skills/delphi-review/AGENTS.md +3 -3
- package/plugins/opencode/skills/grill-with-docs/SKILL.md +1 -2
- package/plugins/opencode/skills/grilling/SKILL.md +22 -5
- package/plugins/opencode/skills/sprint-flow/AGENTS.md +3 -3
- package/plugins/opencode/skills/test-specification-alignment/AGENTS.md +3 -3
- package/plugins/qoder/bin/sprint-flow-guard.sh +0 -0
- package/plugins/qoder/bin/xp-gate-check +0 -0
- package/plugins/qoder/plugin.json +1 -1
- package/plugins/qoder/skills/delphi-review/AGENTS.md +3 -3
- package/plugins/qoder/skills/sprint-flow/AGENTS.md +3 -3
- package/plugins/qoder/skills/test-specification-alignment/AGENTS.md +3 -3
- package/principles/AGENTS.md +3 -3
- package/scripts/delphi-external-review.cjs +26 -0
- package/skills/delphi-review/AGENTS.md +3 -3
- package/skills/grill-with-docs/SKILL.md +1 -2
- package/skills/grilling/SKILL.md +22 -5
- package/skills/sprint-flow/AGENTS.md +3 -3
- package/skills/test-specification-alignment/AGENTS.md +3 -3
- package/sprint-gate.sh +0 -0
package/adapter-common.sh
CHANGED
|
File without changes
|
package/adapters/cpp.sh
CHANGED
|
File without changes
|
package/adapters/dart.sh
CHANGED
|
File without changes
|
package/adapters/flutter.sh
CHANGED
|
File without changes
|
package/adapters/gate-7.sh
CHANGED
|
@@ -14,10 +14,28 @@ if [ -z "$IAC_FILES" ]; then
|
|
|
14
14
|
echo "✅ PASSED - No IaC files detected in changes."
|
|
15
15
|
GATE_7_STATUS="PASS"
|
|
16
16
|
else
|
|
17
|
-
# Run IaC adapter
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
# Run IaC adapter. Resolution follows the documented 3-tier convention
|
|
18
|
+
# (adapter-common.sh): global ~/.config/xp-gate/adapters -> project
|
|
19
|
+
# githooks/adapters -> script dir. The old cwd-only test silently SKIPped
|
|
20
|
+
# IaC security in every consumer repo without an in-repo githooks/ dir,
|
|
21
|
+
# even with the adapter installed globally (e2e sweep 2026-10-17; pinned
|
|
22
|
+
# by __tests__/gate-7-adapter-resolution.test.bats).
|
|
23
|
+
IAC_ADAPTER=""
|
|
24
|
+
for _candidate in \
|
|
25
|
+
"$HOME/.config/xp-gate/adapters/iac.sh" \
|
|
26
|
+
"githooks/adapters/iac.sh" \
|
|
27
|
+
"${SCRIPT_DIR:-}/adapters/iac.sh"; do
|
|
28
|
+
if [ -n "$_candidate" ] && [ -f "$_candidate" ]; then
|
|
29
|
+
IAC_ADAPTER="$_candidate"
|
|
30
|
+
break
|
|
31
|
+
fi
|
|
32
|
+
done
|
|
33
|
+
if [ -n "$IAC_ADAPTER" ]; then
|
|
34
|
+
# Audit trail: which tier won (r14 walkthrough MAJ-02 — a silent tier-order
|
|
35
|
+
# regression must be visible in the gate output, not only in test diffs).
|
|
36
|
+
echo " IaC adapter resolved from: $IAC_ADAPTER"
|
|
37
|
+
# shellcheck source=/dev/null
|
|
38
|
+
source "$IAC_ADAPTER"
|
|
21
39
|
|
|
22
40
|
# Run static analysis for IaC files
|
|
23
41
|
IAC_OUTPUT=$(run_static_analysis "$IAC_FILES" 2>&1)
|
package/adapters/go.sh
CHANGED
|
File without changes
|
package/adapters/iac.sh
CHANGED
|
File without changes
|
package/adapters/java.sh
CHANGED
|
@@ -111,13 +111,23 @@ wc_java_json_violation_count() {
|
|
|
111
111
|
local json_file="$1"
|
|
112
112
|
[ -s "$json_file" ] || return 1
|
|
113
113
|
|
|
114
|
-
#
|
|
115
|
-
#
|
|
116
|
-
|
|
117
|
-
|
|
114
|
+
# Two shapes are accepted, each closed by its own bracket:
|
|
115
|
+
# - bare array `[ ... ]` — the originally pinned contract ([] = clean);
|
|
116
|
+
# - object wrapper `{ ..., "issues": [ ... ] }` — what wc-java-lint 0.4.x
|
|
117
|
+
# actually emits ({summary, issues}). Rejecting it fail-closed every
|
|
118
|
+
# real Java commit on well-formed JSON (e2e sweep 2026-10-17; pinned by
|
|
119
|
+
# __tests__/issue-507-wc-java-object-json.test.bats). A truncated
|
|
120
|
+
# response still fails its closing-bracket test -> BLOCK.
|
|
121
|
+
local head1 tail shape
|
|
122
|
+
head1=$(head -c 1 "$json_file")
|
|
118
123
|
tail=$(tr -d '[:space:]' < "$json_file" | tail -c 1)
|
|
119
|
-
|
|
124
|
+
case "$head1" in
|
|
125
|
+
"[") shape=array; [ "$tail" = "]" ] || return 1 ;;
|
|
126
|
+
"{") shape=object; [ "$tail" = "}" ] || return 1 ;;
|
|
127
|
+
*) return 1 ;;
|
|
128
|
+
esac
|
|
120
129
|
|
|
130
|
+
local structural obj_count file_count rule_count sev_count
|
|
121
131
|
# Strip string VALUE literals (`: "..."` -> `: ""`). Keys must survive
|
|
122
132
|
# (they are the tokens being counted); values must vanish (violation
|
|
123
133
|
# messages routinely contain braces or the words file/rule/severity --
|
|
@@ -131,8 +141,60 @@ wc_java_json_violation_count() {
|
|
|
131
141
|
# variant either fails to strip values (count desync -> BLOCK, annoying but
|
|
132
142
|
# safe) or, worst case, errors to empty counts and disarms the lying-tool
|
|
133
143
|
# BLOCK below (fail-open). Delphi round-2 A-MAJOR-2.
|
|
134
|
-
local structural obj_count file_count rule_count sev_count
|
|
135
144
|
structural=$(sed -E 's/:([[:space:]]*)"([^"\\]|\\.)*"/:\1""/g' "$json_file" 2>/dev/null)
|
|
145
|
+
|
|
146
|
+
if [ "$shape" = "object" ]; then
|
|
147
|
+
# Object wrapper ({summary, issues}). Parse the ISSUES ARRAY exactly with
|
|
148
|
+
# brace-depth tracking (issues are JSON objects, so a record ends exactly
|
|
149
|
+
# where its nesting returns to the array level). For each record: all
|
|
150
|
+
# three keys must be present exactly once. A key outside any record —
|
|
151
|
+
# e.g. split triples in sibling objects, the lying-tool shape of r14
|
|
152
|
+
# CI-02 — makes the per-record key totals disagree with the global
|
|
153
|
+
# stripped counts -> BLOCK. Values were stripped first so braces inside
|
|
154
|
+
# messages cannot skew the depth.
|
|
155
|
+
file_count=$(grep -o '"file"' <<< "$structural" | wc -l | tr -d '[:space:]')
|
|
156
|
+
rule_count=$(grep -o '"rule"' <<< "$structural" | wc -l | tr -d '[:space:]')
|
|
157
|
+
sev_count=$(grep -o '"severity"' <<< "$structural" | wc -l | tr -d '[:space:]')
|
|
158
|
+
[ "$file_count" -eq "$rule_count" ] || return 1
|
|
159
|
+
[ "$file_count" -eq "$sev_count" ] || return 1
|
|
160
|
+
# Everything from the "issues" member onward (the tool emits it last; if
|
|
161
|
+
# a future format moves it, keys before it fall outside record parsing ->
|
|
162
|
+
# sum mismatch -> BLOCK, fail closed). Flatten to one line first: real
|
|
163
|
+
# output is pretty-printed across lines.
|
|
164
|
+
flattened=$(tr '\n' ' ' <<< "$structural")
|
|
165
|
+
tail_from_issues=$(sed -n 's/.*"issues"[[:space:]]*:[[:space:]]*\[/\n/p' <<< "$flattened")
|
|
166
|
+
[ -n "$tail_from_issues" ] || return 1
|
|
167
|
+
records=$(awk '
|
|
168
|
+
{ rest = $0
|
|
169
|
+
depth = 0; rec = ""
|
|
170
|
+
for (i = 1; i <= length(rest); i++) {
|
|
171
|
+
c = substr(rest, i, 1)
|
|
172
|
+
if (depth == 0 && c == "]") break
|
|
173
|
+
if (c == "{") { depth++; if (depth == 1) { rec = ""; continue } }
|
|
174
|
+
if (c == "}") { depth--; if (depth == 0) { print rec; continue } }
|
|
175
|
+
if (depth >= 1) rec = rec c
|
|
176
|
+
}
|
|
177
|
+
}' <<< "$tail_from_issues")
|
|
178
|
+
rec_count=0
|
|
179
|
+
rf=0; rr=0; rs=0
|
|
180
|
+
while IFS= read -r _rec; do
|
|
181
|
+
[ -n "$_rec" ] || continue
|
|
182
|
+
cf=$(grep -o '"file"' <<< "$_rec" | wc -l | tr -d '[:space:]')
|
|
183
|
+
cr=$(grep -o '"rule"' <<< "$_rec" | wc -l | tr -d '[:space:]')
|
|
184
|
+
cs=$(grep -o '"severity"' <<< "$_rec" | wc -l | tr -d '[:space:]')
|
|
185
|
+
[ "$cf" -eq 1 ] || return 1
|
|
186
|
+
[ "$cr" -eq 1 ] || return 1
|
|
187
|
+
[ "$cs" -eq 1 ] || return 1
|
|
188
|
+
rf=$((rf + cf)); rr=$((rr + cr)); rs=$((rs + cs))
|
|
189
|
+
rec_count=$((rec_count + 1))
|
|
190
|
+
done <<< "$records"
|
|
191
|
+
[ "$rf" -eq "$file_count" ] || return 1
|
|
192
|
+
[ "$rr" -eq "$rule_count" ] || return 1
|
|
193
|
+
[ "$rs" -eq "$sev_count" ] || return 1
|
|
194
|
+
echo "$rec_count"
|
|
195
|
+
return 0
|
|
196
|
+
fi
|
|
197
|
+
|
|
136
198
|
obj_count=$(grep -o '{' <<< "$structural" | wc -l | tr -d '[:space:]')
|
|
137
199
|
file_count=$(grep -o '"file"' <<< "$structural" | wc -l | tr -d '[:space:]')
|
|
138
200
|
rule_count=$(grep -o '"rule"' <<< "$structural" | wc -l | tr -d '[:space:]')
|
package/adapters/kotlin.sh
CHANGED
|
File without changes
|
package/adapters/objectivec.sh
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/adapters/powershell.sh
CHANGED
|
File without changes
|
package/adapters/python.sh
CHANGED
|
File without changes
|
package/adapters/shell.sh
CHANGED
|
File without changes
|
package/adapters/swift.sh
CHANGED
|
File without changes
|
package/adapters/typescript.sh
CHANGED
|
File without changes
|
package/bin/xp-gate.js
CHANGED
|
File without changes
|
package/gate-10.sh
CHANGED
|
File without changes
|
package/gate-3.sh
CHANGED
|
File without changes
|
package/gate-4.sh
CHANGED
|
File without changes
|
package/gate-7.sh
CHANGED
|
@@ -14,10 +14,28 @@ if [ -z "$IAC_FILES" ]; then
|
|
|
14
14
|
echo "✅ PASSED - No IaC files detected in changes."
|
|
15
15
|
GATE_7_STATUS="PASS"
|
|
16
16
|
else
|
|
17
|
-
# Run IaC adapter
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
# Run IaC adapter. Resolution follows the documented 3-tier convention
|
|
18
|
+
# (adapter-common.sh): global ~/.config/xp-gate/adapters -> project
|
|
19
|
+
# githooks/adapters -> script dir. The old cwd-only test silently SKIPped
|
|
20
|
+
# IaC security in every consumer repo without an in-repo githooks/ dir,
|
|
21
|
+
# even with the adapter installed globally (e2e sweep 2026-10-17; pinned
|
|
22
|
+
# by __tests__/gate-7-adapter-resolution.test.bats).
|
|
23
|
+
IAC_ADAPTER=""
|
|
24
|
+
for _candidate in \
|
|
25
|
+
"$HOME/.config/xp-gate/adapters/iac.sh" \
|
|
26
|
+
"githooks/adapters/iac.sh" \
|
|
27
|
+
"${SCRIPT_DIR:-}/adapters/iac.sh"; do
|
|
28
|
+
if [ -n "$_candidate" ] && [ -f "$_candidate" ]; then
|
|
29
|
+
IAC_ADAPTER="$_candidate"
|
|
30
|
+
break
|
|
31
|
+
fi
|
|
32
|
+
done
|
|
33
|
+
if [ -n "$IAC_ADAPTER" ]; then
|
|
34
|
+
# Audit trail: which tier won (r14 walkthrough MAJ-02 — a silent tier-order
|
|
35
|
+
# regression must be visible in the gate output, not only in test diffs).
|
|
36
|
+
echo " IaC adapter resolved from: $IAC_ADAPTER"
|
|
37
|
+
# shellcheck source=/dev/null
|
|
38
|
+
source "$IAC_ADAPTER"
|
|
21
39
|
|
|
22
40
|
# Run static analysis for IaC files
|
|
23
41
|
IAC_OUTPUT=$(run_static_analysis "$IAC_FILES" 2>&1)
|
package/gate-8.sh
CHANGED
|
File without changes
|
package/gate-9.sh
CHANGED
|
File without changes
|
package/hooks/adapter-common.sh
CHANGED
|
File without changes
|
package/hooks/gate-10.sh
CHANGED
|
File without changes
|
package/hooks/gate-3.sh
CHANGED
|
File without changes
|
package/hooks/gate-4.sh
CHANGED
|
File without changes
|
package/hooks/gate-7.sh
CHANGED
|
@@ -14,10 +14,28 @@ if [ -z "$IAC_FILES" ]; then
|
|
|
14
14
|
echo "✅ PASSED - No IaC files detected in changes."
|
|
15
15
|
GATE_7_STATUS="PASS"
|
|
16
16
|
else
|
|
17
|
-
# Run IaC adapter
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
# Run IaC adapter. Resolution follows the documented 3-tier convention
|
|
18
|
+
# (adapter-common.sh): global ~/.config/xp-gate/adapters -> project
|
|
19
|
+
# githooks/adapters -> script dir. The old cwd-only test silently SKIPped
|
|
20
|
+
# IaC security in every consumer repo without an in-repo githooks/ dir,
|
|
21
|
+
# even with the adapter installed globally (e2e sweep 2026-10-17; pinned
|
|
22
|
+
# by __tests__/gate-7-adapter-resolution.test.bats).
|
|
23
|
+
IAC_ADAPTER=""
|
|
24
|
+
for _candidate in \
|
|
25
|
+
"$HOME/.config/xp-gate/adapters/iac.sh" \
|
|
26
|
+
"githooks/adapters/iac.sh" \
|
|
27
|
+
"${SCRIPT_DIR:-}/adapters/iac.sh"; do
|
|
28
|
+
if [ -n "$_candidate" ] && [ -f "$_candidate" ]; then
|
|
29
|
+
IAC_ADAPTER="$_candidate"
|
|
30
|
+
break
|
|
31
|
+
fi
|
|
32
|
+
done
|
|
33
|
+
if [ -n "$IAC_ADAPTER" ]; then
|
|
34
|
+
# Audit trail: which tier won (r14 walkthrough MAJ-02 — a silent tier-order
|
|
35
|
+
# regression must be visible in the gate output, not only in test diffs).
|
|
36
|
+
echo " IaC adapter resolved from: $IAC_ADAPTER"
|
|
37
|
+
# shellcheck source=/dev/null
|
|
38
|
+
source "$IAC_ADAPTER"
|
|
21
39
|
|
|
22
40
|
# Run static analysis for IaC files
|
|
23
41
|
IAC_OUTPUT=$(run_static_analysis "$IAC_FILES" 2>&1)
|
package/hooks/gate-8.sh
CHANGED
|
File without changes
|
package/hooks/gate-9.sh
CHANGED
|
File without changes
|
package/hooks/post-merge
CHANGED
|
File without changes
|
package/hooks/pre-commit
CHANGED
|
File without changes
|
package/hooks/pre-push
CHANGED
|
File without changes
|
package/hooks/sprint-gate.sh
CHANGED
|
File without changes
|