@alexcodeplace/slopgate 0.3.1 → 0.3.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/README.md CHANGED
@@ -93,6 +93,28 @@ slopgate baseline --prune --config .slopgate/config.toml
93
93
  slopgate --self-test --config "$(npm root -g)/slopgate/rules/baseline/selftest.config.toml"
94
94
  ```
95
95
 
96
+ ### Run immutable full-repository CI gate:
97
+ ```bash
98
+ slopgate scan --scope repo --tier commit --format github --config .slopgate/config.toml
99
+ ```
100
+
101
+ ### Record reviewer defects and enforce rule harvesting:
102
+ ```bash
103
+ slopgate defect record --class missing-button-type --file src/app.tsx --line 42 --source code-review --config .slopgate/config.toml
104
+ slopgate harvest --check --config .slopgate/config.toml
105
+ ```
106
+
107
+ Second distinct occurrence requires `.slopgate/rules/ast/<class>.yml` plus `.slopgate/fixtures/<class>.invalid.ts[x]` and `<class>.valid.ts[x]`. `--self-test` proves rule fires on configured fixtures.
108
+
109
+ ### Reusable GitHub gate:
110
+ ```yaml
111
+ jobs:
112
+ slopgate:
113
+ uses: alexcodeplace/slopgate/.github/workflows/slopgate.yml@v1
114
+ ```
115
+
116
+ Self-hosted jobs reject fork pull requests before checkout. Use repository-owned branches or isolated disposable runners for untrusted forks.
117
+
96
118
  ### Install or reinstall hooks:
97
119
  ```bash
98
120
  slopgate install-hooks --config .slopgate/config.toml
@@ -701,12 +723,10 @@ Tool crash / timeout → `⚠ skipped: <id> (<reason>)` warning, gate continues
701
723
 
702
724
  - **Git-only** — no other VCS support
703
725
  - **No auto-fix** — violations are reported, not automatically corrected
704
- - **No CI integration yet** — hooks are local and Claude Code only; CI layer is future work
705
726
  - **`slopgate audit` command** — planned for v2 (non-gating architecture-health report: hotspots, module shape, co-change coupling, ratchet progress tracking)
706
727
  - **Embeddings-based semantic duplicate detection** — planned, not in v1
707
728
  - **API-surface diff gate** — track breaking changes to public exports (future)
708
729
  - **LLM-judge skill** — on-demand deep review of architectural debt (separate sub-project)
709
- - **Rule harvesting** — auto-generate rules from repeated violations (separate sub-project)
710
730
 
711
731
  ---
712
732
 
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env bash
2
2
  # Slopgate PreToolUse hook — runs --staged before a git commit. Exit 1 → commit blocked.
3
3
  TOOL_JSON=$(cat)
4
- CMD=$(node -e "
4
+ CMD=$(/usr/bin/bun -e "
5
5
  let d='';process.stdin.on('data',c=>d+=c).on('end',()=>{try{process.stdout.write(JSON.parse(d).tool_input?.command||'')}catch{process.stdout.write('')}});" <<< "$TOOL_JSON" 2>/dev/null)
6
6
  echo "$CMD" | grep -qE 'git[[:space:]]+commit' || exit 0
7
7
 
@@ -9,4 +9,4 @@ ROOT=$(git rev-parse --show-toplevel 2>/dev/null) || exit 0
9
9
  CONFIG="$ROOT/.slopgate/config.toml"
10
10
  [ -f "$CONFIG" ] || exit 0
11
11
  HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
12
- exec node "$HERE/../bin/slopgate" --staged --config "$CONFIG"
12
+ exec /usr/bin/bun "$HERE/../bin/slopgate" --staged --config "$CONFIG"
@@ -2,7 +2,7 @@
2
2
  # Slopgate PostToolUse hook — single-file scan after Edit/Write.
3
3
  # Exit 2 → stderr feeds back into the agent turn. FAIL-OPEN: any error/timeout → exit 0.
4
4
  TOOL_JSON=$(cat)
5
- FILE=$(node -e "
5
+ FILE=$(/usr/bin/bun -e "
6
6
  let d='';process.stdin.on('data',c=>d+=c).on('end',()=>{try{process.stdout.write(JSON.parse(d).tool_input?.file_path||'')}catch{process.stdout.write('')}});" <<< "$TOOL_JSON" 2>/dev/null) || exit 0
7
7
  [ -n "$FILE" ] || exit 0
8
8
  case "$FILE" in *.test.ts|*.test.tsx) exit 0 ;; *.ts|*.tsx|*.astro) ;; *) exit 0 ;; esac
@@ -14,6 +14,6 @@ CONFIG="$ROOT/.slopgate/config.toml"
14
14
  [ -f "$CONFIG" ] || exit 0
15
15
 
16
16
  HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
17
- OUT=$(timeout 5 node "$HERE/../bin/slopgate" --file "$FILE" --config "$CONFIG" 2>&1)
17
+ OUT=$(timeout 5 /usr/bin/bun "$HERE/../bin/slopgate" --file "$FILE" --config "$CONFIG" 2>&1)
18
18
  [ "$?" -eq 1 ] && { echo "$OUT" >&2; exit 2; }
19
19
  exit 0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexcodeplace/slopgate",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "type": "module",
5
5
  "description": "Global code-quality / anti-slop gate — engine shared, rules per-project.",
6
6
  "license": "MIT",
Binary file
Binary file
Binary file
Binary file
Binary file