20 Commits

Author SHA1 Message Date
Allen 981b92e456 fix(plugins): clamp Codex timeout and filter paired output flags
When the codex-reviewer and ralph-reviewed Stop hooks invoke
`codex exec`, they pass `-o <outputFile>` so the verdict can be parsed
back from a known path, then append the user's `extra_args`. Two latent
bugs surfaced after the docs commit started promoting the shared
~/.claude/codex.json knobs to standalone users:

1. The previous filter dropped `-o` / `--output*` tokens individually
   but not the value that followed a bare flag. With
   extra_args: ["-o", "/tmp/other"], the filter left "/tmp/other" as a
   stray positional that Codex treated as an extra prompt argument.
   The new index-walk filter consumes both halves of paired flags
   (-o, --output, --output-last-message) and drops the inline
   --flag=value variants. Applied to both hooks.

2. ralph-reviewed honored `timeout_seconds` raw. A configured value at
   or above the 1800s Stop hook timeout let Claude kill the hook
   before it could parse Codex's output and surface a verdict. Now
   clamped to [60, 1680] (matching the existing codex-reviewer
   clamp), leaving a 120s buffer below the hook ceiling.

Bumps ralph-reviewed to 3.0.2 and codex-reviewer to 1.6.10 in
lockstep across each plugin.json and the root marketplace.json. The
ralph-reviewed troubleshooting README is updated to describe the new
clamp range rather than telling users to "increase to 1800".
2026-05-21 16:24:01 +00:00
Allen 19c641be24 fix: rl discovery, reject prompt, version bump
- Stop hook: find rl via PATH, then .rl/rl wrapper fallback
- Stop hook: reject prompt says ".rl/rl done" not "<promise>"
- ralph-loop.md: add bunx/npx/command to allowed-tools
- Bump plugin.json to v3.0.0
2026-03-21 15:51:57 -05:00
Allen bb4e12c6e5 feat(ralph-reviewed)!: v2.0.0 — rl CLI, state migration, rl done completion
Major rewrite of the ralph-reviewed plugin:

State migration:
- State moved from .claude/ralph-loop.local.md (YAML) to .rl/state.json (JSON)
- Prompt stored separately in .rl/prompt.md
- Structured event log at .rl/log.jsonl
- .rl/ auto-added to .git/info/exclude on init

rl CLI (new):
- rl init: one-command setup (state, prompt, log, symlink)
- rl done / rl done --blocked: state-flag completion (replaces <promise> tags)
- rl log phase|commit|decision|summary: structured JSONL logging
- rl prompt / rl status / rl clean: state inspection and cleanup
- Creates .rl/rl symlink for short-path access after init
- Git root walks superprojects (matches stop hook behavior)

Stop hook:
- Completion detection via state.json flags (not transcript regex)
- Removed legacy <promise> tag parsing and transcript reading
- Review prompt simplified: correctness-focused, tells Codex to use rl
- Codex review outputs kept in .rl/ (not /tmp/)
- Codex cwd uses gitRoot for reliable .rl/ access
- Slimmed LoopState: removed completion_promise, original_prompt,
  pending_feedback, review_history (all derived from .rl/ files)
- Review feedback is plain text (no structured issue IDs/severity)
- Iteration headers hide denominators from agent

Behavioral improvements:
- Pacing, churn breaker, depth-before-breadth, skill loading, live
  verification sections in skill prompt
- Ralphoff "Done when" guidance: verify behavior not file existence

BREAKING CHANGE: State format changed from YAML frontmatter to JSON.
Completion mechanism changed from <promise> tags to rl done command.
2026-03-21 15:12:05 -05:00
Allen 5247b194cc fix(plugins): remove explicit hooks field to fix duplicate hooks error
Claude Code now auto-loads hooks/hooks.json from plugin directories,
so explicit declaration causes duplicate loading. Also adds enabledPlugins
to settings template.

- ralph-reviewed: 1.8.7 → 1.8.8
- codex-reviewer: 1.6.8 → 1.6.9

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 05:04:12 +00:00
Big Boss 4c38d9347d fix(plugins): harden stop hooks and avoid dedupe 2026-01-08 15:56:39 -06:00
Allen 1fff4fc342 fix(plugins): move hooks to separate hooks.json files
Claude Code auto-loads hooks/hooks.json by convention. Inline hooks
in plugin.json were not being loaded, causing Stop hooks to never
trigger.

- codex-reviewer: 1.6.5 → 1.6.6
- ralph-reviewed: 1.8.4 → 1.8.5

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 20:26:12 +00:00
Big Boss 57f87f638b fix(plugins): stop outputting approve when no active gate
When codex-reviewer has no active review gate, it was outputting
{"decision": "approve"} which could override other plugin hooks'
block decisions. Now it exits silently (no output) to let other
hooks like ralph-reviewed make the decision.

Also bumps versions: codex-reviewer to 1.6.5, ralph-reviewed to 1.8.4
2026-01-07 23:05:52 -06:00
Big Boss 09ffd9c47e fix(plugins): update hooks format for Claude Code 2.1.1
Claude Code 2.1.1 changed the hook schema to require nested structure:
- Stop hooks now need `"hooks": [{ "hooks": [...] }]` wrapper
- Bump versions: codex-reviewer 1.6.3, ralph-reviewed 1.8.2
2026-01-07 20:47:41 -06:00
Big Boss bf18318f00 fix(plugins): add commands field to plugin.json for command discovery
Both codex-reviewer and ralph-reviewed plugins were missing the
"commands" field, preventing their slash commands from appearing
in the /plugin:command format.
2026-01-07 20:45:53 -06:00
Big Boss 56164742f6 fix(ralph-reviewed): remove double-nested hooks structure in plugin.json
The hooks configuration had an extra wrapper object causing Claude Code
to silently ignore the stop hook registration. This prevented the v1.8.0
hook from running entirely.
2026-01-07 17:09:52 -06:00
Big Boss d90637e714 feat(hooks): add systemMessage output on review gate approval
When Codex approves, stop hooks now output a systemMessage that Claude
Code displays to the user. This provides visibility into what happened
(approval status, reviewer notes, iteration counts) instead of silent exit.

Changes:
- codex-reviewer: Show approval summary with review cycle and files
- ralph-reviewed: Show status for APPROVE, BLOCKED, max iterations,
  and max review cycles scenarios
- Added JSDoc with reference to official hooks documentation
- Bumped plugin versions (codex-reviewer 1.4.0, ralph-reviewed 1.6.0)
2026-01-02 14:48:33 -06:00
Big Boss 953ba004c5 chore(ralph-reviewed): bump version to 1.5.0 2026-01-01 09:05:52 -06:00
Big Boss 51e9f1505e chore(ralph-reviewed): bump version to 1.4.0
Release includes:
- BLOCKED escape signal for early termination without Codex review
2025-12-29 17:55:36 -06:00
Big Boss 7466879a5a fix(ralph-reviewed): preserve issue IDs across review cycles
Instruct Codex to continue issue numbering from previous cycles
instead of restarting at ISSUE-1. This prevents confusion when
resolved issues and new issues share the same ID.
2025-12-28 23:22:36 -06:00
Big Boss 5de99c9f87 feat(ralph-reviewed): add user config for Codex CLI arguments
Add ~/.claude/ralphs/config.json for configuring Codex reviewer behavior:
- sandbox: read-only, workspace-write, danger-full-access
- approval_policy: untrusted, on-failure, on-request, never
- bypass_sandbox: skip sandbox entirely for full tooling access
- extra_args: additional CLI args

This allows Codex to run tsc, linters, and tests during reviews instead
of failing with EPERM in read-only sandbox mode.

Also fixes README: review format docs, log paths, extra_args docs.
2025-12-28 22:46:49 -06:00
Big Boss 161561b075 chore(ralph-reviewed): bump default max reviews to 5 2025-12-28 22:09:58 -06:00
Big Boss 966dc39758 fix(ralph-reviewed): robust parsing for Codex review output
- Parse verdict from END of output to avoid matching echoed examples
- Auto-approve with warning when REJECT has no parseable issues
- Add schema normalization for review_history backward compatibility
- Fix multi-line description regex using [\s\S]+? pattern
2025-12-28 21:41:00 -06:00
Big Boss 09b237f644 chore(ralph-reviewed): bump version to 1.1.0
Bump plugin version to force cache invalidation after recent fixes:
- Version tracking (HOOK_BUILD)
- Log location moved to ~/.claude/ralphs/
- Read-only sandbox
- State file cleanup fixes

Claude Code caches plugins by version, so bumping ensures new code is used.
2025-12-28 11:05:10 -06:00
Big Boss 9c5dc70534 fix(ralph-reviewed): add crash reporting and increase hook timeout
- Add session-specific crash logs to /tmp/ralph-reviewed-crash-{session_id}.log
- Log all key execution points: startup, stdin parsing, state file checks, Codex calls
- Add global exception handlers for uncaught errors and unhandled rejections
- Increase plugin hook timeout from 120s to 1800s (30 min) to accommodate Codex reviews
- Update author email
2025-12-27 23:12:00 -06:00
Big Boss 3249b10b1c feat(plugins): add ralph-reviewed plugin with Codex review gates
Fork of ralph-wiggum that adds a review phase using Codex CLI.
When Claude claims completion, Codex reviews the work before
allowing the loop to exit.

Features:
- Review gate at completion claims (APPROVE/REJECT)
- Configurable max review cycles (default: 3)
- Debug logging to session-specific files
- 20 minute timeout for long reviews
- Graceful degradation if Codex unavailable

Commands:
- /ralph-reviewed:ralph-loop - Start reviewed loop
- /ralph-reviewed:cancel-ralph - Cancel active loop
- /ralph-reviewed:help - Show usage

Also adds marketplace.json for plugin distribution.
2025-12-27 22:26:17 -06:00