@codevena/reviewgate-darwin-arm64 0.1.0-alpha.2
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/bin-templates/gate.sh +29 -0
- package/bin-templates/pre-push.sh +19 -0
- package/bin-templates/reset.sh +13 -0
- package/bin-templates/trigger.sh +14 -0
- package/grammars/tree-sitter-python.wasm +0 -0
- package/grammars/tree-sitter-tsx.wasm +0 -0
- package/grammars/tree-sitter-typescript.wasm +0 -0
- package/grammars/web-tree-sitter.wasm +0 -0
- package/package.json +23 -0
- package/reviewgate +0 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Reviewgate Stop hook driver — keep this script tiny.
|
|
3
|
+
# Reviewgate-managed; do not edit by hand.
|
|
4
|
+
set -u
|
|
5
|
+
|
|
6
|
+
# Resolve the reviewgate binary: the absolute path `init` baked in (the binary
|
|
7
|
+
# that ran init), else PATH. If NEITHER resolves, FAIL CLOSED — emit a block
|
|
8
|
+
# decision rather than exiting 127 with empty stdout, which Claude Code reads as
|
|
9
|
+
# "allow stop", silently turning the Stop gate into a no-op on every turn.
|
|
10
|
+
RG_BIN='__REVIEWGATE_BIN__'
|
|
11
|
+
if [ -z "$RG_BIN" ] || [ ! -x "$RG_BIN" ]; then
|
|
12
|
+
RG_BIN="$(command -v reviewgate 2>/dev/null || true)"
|
|
13
|
+
fi
|
|
14
|
+
if [ -z "$RG_BIN" ]; then
|
|
15
|
+
printf '%s\n' '{"decision":"block","reason":"Reviewgate could not run the Stop gate: the reviewgate binary is not on PATH and no baked path resolved. Failing CLOSED so unreviewed changes are not silently allowed. Fix: put the reviewgate binary on PATH (or re-run `reviewgate init` with it installed), then run `reviewgate doctor`."}'
|
|
16
|
+
exit 0
|
|
17
|
+
fi
|
|
18
|
+
# Run the gate (NOT `exec`): if RG_BIN resolves to a file that can't actually run on
|
|
19
|
+
# this host (wrong arch → ENOEXEC → exit 126, bad interpreter, or vanished → 127),
|
|
20
|
+
# `exec` would replace bash and die with EMPTY stdout — which Claude Code reads as
|
|
21
|
+
# "allow stop", a silent fail-OPEN. Running it as a child lets us catch 126/127 and
|
|
22
|
+
# emit a fail-CLOSED block instead. Normal runs pass the gate's stdout + exit code through.
|
|
23
|
+
"$RG_BIN" gate --hook stop
|
|
24
|
+
rc=$?
|
|
25
|
+
if [ "$rc" -eq 126 ] || [ "$rc" -eq 127 ]; then
|
|
26
|
+
printf '%s\n' '{"decision":"block","reason":"Reviewgate resolved a binary but could not run it on this host (wrong architecture / bad interpreter / not executable). Failing CLOSED so unreviewed changes are not silently allowed. Re-run `reviewgate init` with the correct binary for this machine, then `reviewgate doctor`."}'
|
|
27
|
+
exit 0
|
|
28
|
+
fi
|
|
29
|
+
exit "$rc"
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Reviewgate git pre-push driver — WARN-ONLY, never blocks the push. Keep this tiny.
|
|
3
|
+
# Reviewgate-managed; do not edit by hand.
|
|
4
|
+
set -u
|
|
5
|
+
|
|
6
|
+
# Resolve the reviewgate binary: the absolute path `init` baked in, else PATH.
|
|
7
|
+
RG_BIN='__REVIEWGATE_BIN__'
|
|
8
|
+
if [ -z "$RG_BIN" ] || [ ! -x "$RG_BIN" ]; then
|
|
9
|
+
RG_BIN="$(command -v reviewgate 2>/dev/null || true)"
|
|
10
|
+
fi
|
|
11
|
+
# Warn-only contract: if the binary can't be resolved we must NOT block the push.
|
|
12
|
+
# Exit 0 silently (the push proceeds; the Stop-hook gate is the primary safety net).
|
|
13
|
+
if [ -z "$RG_BIN" ]; then
|
|
14
|
+
exit 0
|
|
15
|
+
fi
|
|
16
|
+
# Forward git's pre-push stdin (the "<local ref> <local oid> <remote ref> <remote oid>"
|
|
17
|
+
# lines) and args. `|| true` + explicit exit 0 guarantee we never fail the push.
|
|
18
|
+
"$RG_BIN" pre-push "$@" || true
|
|
19
|
+
exit 0
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Reviewgate SessionStart hook driver — keep this script tiny.
|
|
3
|
+
# Reviewgate-managed; do not edit by hand.
|
|
4
|
+
set -u
|
|
5
|
+
|
|
6
|
+
# Resolve the reviewgate binary (baked path → PATH). Best-effort: a missing
|
|
7
|
+
# binary at session start is non-fatal (no state to clear), so never block.
|
|
8
|
+
RG_BIN='__REVIEWGATE_BIN__'
|
|
9
|
+
if [ -z "$RG_BIN" ] || [ ! -x "$RG_BIN" ]; then
|
|
10
|
+
RG_BIN="$(command -v reviewgate 2>/dev/null || true)"
|
|
11
|
+
fi
|
|
12
|
+
[ -z "$RG_BIN" ] && exit 0
|
|
13
|
+
exec "$RG_BIN" gate --hook reset
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Reviewgate PostToolUse hook driver — keep this script tiny.
|
|
3
|
+
# Reviewgate-managed; do not edit by hand.
|
|
4
|
+
set -u
|
|
5
|
+
|
|
6
|
+
# Resolve the reviewgate binary (baked path → PATH). Best-effort: a missing
|
|
7
|
+
# binary here only means dirty.flag isn't set; the Stop gate fails closed on its
|
|
8
|
+
# own, so never block a tool call on a missing trigger.
|
|
9
|
+
RG_BIN='__REVIEWGATE_BIN__'
|
|
10
|
+
if [ -z "$RG_BIN" ] || [ ! -x "$RG_BIN" ]; then
|
|
11
|
+
RG_BIN="$(command -v reviewgate 2>/dev/null || true)"
|
|
12
|
+
fi
|
|
13
|
+
[ -z "$RG_BIN" ] && exit 0
|
|
14
|
+
exec "$RG_BIN" gate --hook trigger
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@codevena/reviewgate-darwin-arm64",
|
|
3
|
+
"version": "0.1.0-alpha.2",
|
|
4
|
+
"description": "Reviewgate prebuilt binary for darwin-arm64.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Markus Wiesecke (https://github.com/Codevena)",
|
|
7
|
+
"homepage": "https://github.com/Codevena/reviewgate#readme",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/Codevena/reviewgate.git"
|
|
11
|
+
},
|
|
12
|
+
"os": [
|
|
13
|
+
"darwin"
|
|
14
|
+
],
|
|
15
|
+
"cpu": [
|
|
16
|
+
"arm64"
|
|
17
|
+
],
|
|
18
|
+
"files": [
|
|
19
|
+
"reviewgate",
|
|
20
|
+
"grammars",
|
|
21
|
+
"bin-templates"
|
|
22
|
+
]
|
|
23
|
+
}
|
package/reviewgate
ADDED
|
Binary file
|