Skip to content

dev v1.16.0#51

Open
SihaoLiu wants to merge 48 commits intomainfrom
dev
Open

dev v1.16.0#51
SihaoLiu wants to merge 48 commits intomainfrom
dev

Conversation

@SihaoLiu
Copy link
Copy Markdown
Contributor

@SihaoLiu SihaoLiu commented Mar 28, 2026

Summary

Bug Fixes (post-merge review)

  • Guard --disable codex_hooks behind a feature probe for older Codex builds
  • Widen managed-hook cleanup regex to match any runtime root
  • Make round contract enforcement conditional on drift_status presence for legacy loop compat
  • Replace GNU-only sed /I with portable grep -oEi in verdict extraction
  • Fix upsert_state_fields awk to split on first = only (prevent value truncation)
  • Add STATE_PRIVACY_MODE default to parse_state_file_strict
  • Cache codex --help feature probe per loop to reduce latency
  • Fix path injection in bitlesson-selector shim generation (single-quote escaping)
  • JSON-escape runtime_root before template substitution in hook installer
  • Allow goal-tracker edits on legacy trackers without IMMUTABLE SECTION header
  • Fix legacy compat test for environments with .humanize/ in global gitignore
  • Fix relative path bypass in methodology analysis read/write/edit validators
  • Reject path traversal segments in methodology analysis fallback guards
  • Fix mainline verdict parser picking last keyword instead of first
  • Reject ambiguous multi-keyword verdict lines in mainline progress parser
  • Add Codex flag capability probes in bitlesson selector
  • Reject whitespace-only methodology completion markers
  • Shell-quote hook command paths for runtime roots with spaces
  • Correct Gemini CLI install guidance to @google/gemini-cli

Test Status

  • 1662 tests passed, 0 failed (156 PR-loop tests removed)
  • PR loop feature fully removed: 61 files changed, 13,483 lines deleted

Included PRs

SihaoLiu and others added 26 commits March 12, 2026 21:16
Add a pre-exit analysis phase that spawns an Opus agent to review
development records from a methodology perspective. The agent produces
a sanitized report (no project-specific info) and optionally helps the
user file a GitHub issue with improvement suggestions.

New --privacy flag disables the feature; legacy loops default to
privacy=true (opt-in only for new loops). The phase integrates into
all three non-manual exit paths (complete, stop, maxiter) using the
established Finalize Phase pattern with state file renaming and a
completion artifact gate.
Address Codex review findings:
- Require methodology-analysis-report.md to exist before allowing
  completion (prevents silent no-op when Opus agent does not run)
- Fail closed when .methodology-exit-reason marker is missing or
  invalid instead of defaulting to "complete" (prevents misreporting
  stop/maxiter loops as successful)
…y analysis

The Opus analysis agent needs to read all round-*-summary.md and
round-*-review-result.md files, but the read validator was blocking
access to summaries from non-current rounds. Bypass the round number
check when methodology-analysis-state.md is the active state file,
while still requiring files to be within the active loop directory.
…d allowlist

Address Codex review findings:
- Use realpath to canonicalize paths before prefix check, preventing
  directory traversal attacks (e.g., LOOP_DIR/../sensitive-file)
- Restrict allowed reads to an explicit allowlist of files the analysis
  agent actually needs: round summaries, review results, and its own
  artifacts. This prevents exposing plan.md, prompt files, and other
  project-specific loop metadata that would undercut sanitization.
Add methodology analysis restrictions to all four validators:
- Read validator: restrict loop dir reads to allowlisted artifacts only
- Write validator: block all writes except methodology report/done marker
- Edit validator: block all edits except methodology report/done marker
- Bash validator: block git write commands and in-place file editing tools

This prevents source code modifications after Codex has signed off and
prevents project-specific information from leaking into the analysis report.
All four validators now try unfiltered loop search when session-filtered
search returns empty, so spawned agents (with different session_id) are
also subject to methodology analysis restrictions.

Bash validator now blocks: touch, mv, cp, rm, dd, truncate, chmod, chown,
output redirection to non-/dev/ paths, and all git write commands.
Handle BSD/macOS where realpath fails for non-existent files by resolving
the parent directory and appending the basename. This allows the initial
Write to methodology-analysis-report.md to succeed.

Narrow the bash gh allowlist from all gh commands to only gh issue
subcommands, preventing workspace mutations via gh pr checkout, gh repo
clone, or mutating gh api calls.
Read validator now blocks reads of files within the project root (not just
loop dir) during methodology analysis, while still allowing system files
outside the project (CLAUDE.md, configs). This prevents the analysis agent
from accessing source code that could leak into the report.

Bash validator now blocks common interpreter commands (python, ruby, node,
perl, php) during methodology analysis as defense-in-depth against file
write bypasses.
…ology analysis

Add find_methodology_analysis_loop() that scans all loop directories for
methodology-analysis-state.md instead of using the unfiltered find_active_loop
fallback which only returns the newest active loop. This prevents spawned agents
from binding to a wrong concurrent session during methodology analysis.

Block shell script entry points (bash/sh/zsh, build tools, source/dot commands,
direct script execution) in the bash validator during methodology analysis to
prevent bypassing file modification restrictions via wrapper binaries.
…y exit

Remove the gh issue early exit that short-circuited all subsequent methodology
analysis checks. Commands like 'gh issue create; rm file' were bypassing
blockers. Now all commands go through the full blocklist; pure gh issue commands
pass naturally since they match no blocker.

Add cancel-rlcr-loop.sh to the allowlist so the cancel command works during
the methodology analysis phase.

Document concurrent methodology analysis limitation in find_methodology_analysis_loop.
…bcommands

Only fall back to find_methodology_analysis_loop when NO session-matched loop
was found (spawned agent case). If a session has its own active loop, do NOT
search for another session's methodology analysis state -- that would apply
restrictions to an unrelated concurrent session.

Add git restore, clean, rm, mv to the methodology analysis git command blocklist
to prevent working tree modifications after Codex signoff.
…back

Remove unfiltered find_methodology_analysis_loop fallback from all validators.
The fallback incorrectly applied methodology analysis restrictions to unrelated
sessions opened in the same repo. Now only the originating session (matched by
session_id) gets restricted. Spawned agents rely on their prompt for guidance.

Add raw path fallback when realpath is unavailable (older macOS/BSD) to prevent
deadlock where the originating session cannot write completion artifacts.
…tor status

Add git switch/pull/clone/submodule/worktree and mkdir/rmdir/ln/mktemp to the
methodology analysis bash command blocklist.

Require methodology-analysis-report.md to have content (not just exist) before
allowing the methodology analysis phase to complete.

Add methodology-analysis-state.md to statusline state file resolution and show
"Analyzing" status. Treat methodology-analysis as active phase in monitor color.
…ead code

Require cancel-rlcr-loop.sh to be a standalone command (no shell operators)
to prevent chained commands from bypassing methodology analysis restrictions.

Document that spawned agents are not restricted by hooks due to session_id
mismatch -- their sanitization is enforced by the analysis prompt. This is
an inherent limitation of the hook architecture.

Remove unused find_methodology_analysis_loop function.
Remove round-*-summary.md and round-*-review-result.md from the methodology
analysis Read allowlist. The originating session should only read the sanitized
methodology-analysis-report.md, not raw development records that contain
project-specific information. The spawned agent reads raw records directly
(not restricted by hooks due to different session_id).

Document that read-only bash commands are intentionally not blocked during
methodology analysis -- blocking them would break basic operations. The
analysis prompt is the primary enforcement mechanism for sanitization.
Update blocked-read messages to match actual allowlist (methodology-analysis-*
files only). Previous messages incorrectly listed round-*-summary.md and
round-*-review-result.md which were removed from the allowlist.
The template was referenced in loop-common.sh but never created, causing
the CI template-references test to fail.
The cancel-rlcr-loop.sh allowlist in the bash validator matched when the
script name appeared as an argument to another command (e.g. cp). Anchor
the regex to the start of the command string so only direct invocations
are allowed.

Move the methodology analysis completion handler in the stop hook to run
before the git-clean check. Writing methodology artifacts can make the
working tree appear dirty when .humanize is tracked, which would block
exit before the handler ever ran.
Replace hardcoded #!/bin/bash with #!/usr/bin/env bash for better portability across different Unix systems where bash may be installed in non-standard locations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove spurious blank stderr line from load_template on missing files
- Add awk exit code propagation in render_template to surface failures
- Extract _emit_fallback helper to deduplicate load_and_render_safe
- Prevent append_template from appending empty content on missing templates
- Extend validate_template_dir to check all required subdirs (plan, pr-loop)
- Bump version to 1.14.1

Signed-off-by: Chao Liu <chao.liu.zevorn@gmail.com>
- add native Codex hook config and installer, wire RLCR/PR stop hooks, and document Codex setup and usage
- fix BitLesson selector routing and update related skills/docs
- simplify install-skill target handling and harden RLCR test mock argument parsing
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dbb88bcade

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

# portable-timeout.sh already sourced above

# Disable native hooks for nested Codex reviewer calls to prevent Stop-hook recursion.
CODEX_DISABLE_HOOKS_ARGS=(--disable codex_hooks)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Guard codex_hooks disable flag behind feature support

This new flag is unconditionally added to nested Codex invocations, but the hook only validates that codex exists and never checks whether the installed CLI supports --disable codex_hooks; on older Codex builds, the nested codex call exits with an unknown-argument error, which causes RLCR stop handling to treat review as failed and repeatedly block loop/finalize exits. Add a feature/version probe (or a fallback path without this flag) before injecting it.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shinezyy can you take a look

if not isinstance(stop_groups, list):
raise SystemExit(f"existing hooks config has invalid Stop array: {hooks_file}")

managed_pattern = re.compile(r"(^|/)humanize/hooks/(loop-codex-stop-hook\.sh|pr-loop-stop-hook\.sh)$")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Generalize managed-hook matching for custom runtime roots

The stale-hook cleanup regex hardcodes /humanize/hooks/, so installs that use the supported --runtime-root option with any other path (for example /opt/hz/...) will never match existing managed commands; rerunning the installer then appends duplicate loop/pr Stop hooks instead of replacing them, breaking idempotency for custom layouts.

Useful? React with 👍 / 👎.

Replace #!/bin/bash with #!/usr/bin/env bash for better portability
across different Unix systems (e.g. NixOS) where bash may be installed
in non-standard locations. Also fix remaining shebangs in files added
after the original PR was created.

Includes prepare_runtime_bin() helper for test PATH isolation.
…ation

- Remove spurious blank stderr line from load_template
- Add awk exit code propagation in render_template
- Extract _emit_fallback helper to eliminate duplicated fallback logic
- Guard append_template against appending empty content
- Extend validate_template_dir to check all 5 required subdirectories
Add a pre-exit analysis that runs an independent agent to analyze
development methodology before the RLCR loop fully exits. The analysis
is sanitized of project-specific information and can optionally help
file improvement suggestions.

Feature is enabled by default; disable with --privacy flag on loop start.
Includes validator enforcement during the analysis and monitor/statusline
support for the analyzing status.
# Conflicts:
#	.claude-plugin/marketplace.json
#	.claude-plugin/plugin.json
#	README.md
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d122c82591

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +100 to +101
[[ -z "$_ma_real_path" ]] && _ma_real_path="$FILE_PATH"
[[ -z "$_ma_real_loop" ]] && _ma_real_loop="$_MA_CHECK_DIR"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Canonicalize fallback read paths in methodology phase

When realpath is unavailable, this block falls back to FILE_PATH verbatim, which can remain relative (for example README.md). The later project-root guard only checks absolute prefixes ($PROJECT_ROOT/...), so relative reads from the repo can slip through during methodology analysis and expose project content that this phase is supposed to isolate. This is reachable on environments the code explicitly targets as fallback (older BSD/macOS) and weakens the privacy boundary.

Useful? React with 👍 / 👎.

When realpath is unavailable, the fallback assigned FILE_PATH verbatim
which could remain relative. The project-root prefix check only matched
absolute paths, allowing relative reads to slip through during the
methodology analysis phase. Now normalize relative paths to absolute
by prepending PROJECT_ROOT before the guard checks.
@SihaoLiu
Copy link
Copy Markdown
Contributor Author

@codex review this PR as an entirety

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: febbc00e46

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +189 to +192
"--disable" "codex_hooks"
"--skip-git-repo-check"
"--ephemeral"
"-s" "read-only"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Probe Codex capabilities before passing new exec flags

bitlesson-select.sh now always invokes codex exec with --disable codex_hooks, --skip-git-repo-check, --ephemeral, and -s read-only. If the installed/stubbed Codex CLI does not support any of these flags, the selector exits non-zero before emitting LESSON_IDS/RATIONALE, which blocks BitLesson-gated work whenever bitlesson_model routes to Codex. This is a regression from the prior behavior because there is no compatibility probe/fallback on this path (unlike the stop-hook path).

Useful? React with 👍 / 👎.

Comment on lines +124 to +126
[[ -z "$_ma_real_path" ]] && _ma_real_path="$FILE_PATH"
[[ -z "$_ma_real_loop" ]] && _ma_real_loop="$_MA_LOOP_DIR"
if [[ "$_ma_real_path" == "$_ma_real_loop/"* ]]; then
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Normalize fallback path before methodology write allowlist

When realpath is unavailable, the validator falls back to the raw FILE_PATH string. For relative Write paths, _ma_real_path stays relative while _ma_real_loop is absolute, so the prefix check fails and even allowlisted files (methodology-analysis-report.md / methodology-analysis-done.md) are blocked. On older BSD/macOS environments this can prevent completing the methodology-analysis phase unless users manually switch to absolute paths.

Useful? React with 👍 / 👎.

… in bitlesson selector

Write validator had the same relative-path fallback issue as the read
validator: when realpath is unavailable, relative FILE_PATH bypassed
the absolute prefix guard during methodology analysis.

Bitlesson selector unconditionally passed --disable codex_hooks,
--skip-git-repo-check, and --ephemeral to codex exec without checking
if the CLI supports them. Added capability probes matching the pattern
already used in loop-codex-stop-hook.sh.
@SihaoLiu
Copy link
Copy Markdown
Contributor Author

@codex review this PR as an entirety

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2ab5361b36

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


# Extract the verdict word using grep -oEi (portable) instead of sed /I (GNU-only).
# The preceding grep -Ei already ensures the line contains one of the three verdicts.
verdict_value=$(printf '%s\n' "$verdict_line" | grep -oEi 'ADVANCED|STALLED|REGRESSED' | tail -1)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Parse only one mainline verdict value

extract_mainline_progress_verdict currently takes the last matched token on the verdict line (grep -oEi ... | tail -1). If the reviewer echoes the documented format literally (Mainline Progress Verdict: ADVANCED / STALLED / REGRESSED) or includes multiple verdict keywords in one line, this is interpreted as regressed, which falsely increments drift counters and can trigger replan/stop logic on healthy rounds. The parser should accept exactly one verdict value (or at least select the first explicit value after the label) to avoid false circuit-breaker activations.

Useful? React with 👍 / 👎.

When the verdict line contains multiple keywords (e.g. reviewer echoes
all options), grep -oEi | tail -1 selected the last match which could
be REGRESSED even when ADVANCED was the actual verdict. Changed to
head -1 to pick the first keyword after the label.
@SihaoLiu
Copy link
Copy Markdown
Contributor Author

@codex review this PR as an entirety

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4326860a54

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +101 to +105
if [[ -z "$_ma_real_path" ]]; then
if [[ "$FILE_PATH" == /* ]]; then
_ma_real_path="$FILE_PATH"
else
_ma_real_path="$PROJECT_ROOT/$FILE_PATH"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Canonicalize fallback read path before prefix allowlist check

If realpath is unavailable (common on stock macOS/BSD), this fallback keeps FILE_PATH non-canonical by just prepending PROJECT_ROOT. A traversal path such as .humanize/rlcr/<active>/../../other/methodology-analysis-report.md still satisfies the later $_ma_real_loop/* prefix match as a raw string, and then passes basename allowlisting, which bypasses the methodology-phase read restriction for files outside the active loop. Canonicalize (or reject ..) before running the prefix check.

Useful? React with 👍 / 👎.

Comment on lines +125 to +129
if [[ -z "$_ma_real_path" ]]; then
if [[ "$FILE_PATH" == /* ]]; then
_ma_real_path="$FILE_PATH"
else
_ma_real_path="$PROJECT_ROOT/$FILE_PATH"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Canonicalize fallback write path before methodology whitelist

The write guard has the same non-canonical fallback: when realpath is unavailable, FILE_PATH is only prefixed with PROJECT_ROOT. Paths containing .. can still match the $_ma_real_loop/* string prefix and then hit the basename allowlist (methodology-analysis-report.md/methodology-analysis-done.md), allowing writes outside the active loop during methodology analysis. This undermines the post-signoff write lock and should fail closed on traversal segments or use a canonical resolver.

Useful? React with 👍 / 👎.

Introduce ask-gemini skill that wraps the Gemini CLI in non-interactive
mode with built-in web-search instruction, defaulting to
gemini-3.1-pro-preview.  Supports --gemini-model and --gemini-timeout
flags.

Add tool metadata tagging (tool: codex / tool: gemini) to both
ask-codex and ask-gemini invocations so the monitor can distinguish
them.

Extend humanize monitor with codex and gemini subcommands that filter
skill invocations by tool type.  The existing skill subcommand
continues to show all invocations.

Bump version to 1.17.0.
When realpath is unavailable, paths containing ".." could bypass the
prefix-based allowlist check by matching the loop directory prefix as
a raw string while resolving to a location outside it. Now reject any
path with ".." segments in the fallback code path (fail closed).
@SihaoLiu
Copy link
Copy Markdown
Contributor Author

@codex review this PR as an entirety

Add ask-gemini skill with deep web research
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 916fc5086e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +603 to +606
if [[ "$IS_METHODOLOGY_ANALYSIS_PHASE" == "true" ]]; then
if complete_methodology_analysis; then
# Analysis complete, allow exit
exit 0
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep git-clean enforcement before final methodology exit

When methodology-analysis-state.md is active, a successful complete_methodology_analysis returns immediately and skips the git cleanliness/push gate below, so tracked changes made during this phase can slip through without commit/push verification. This creates a real escape hatch from the loop’s core safety invariant; even if .humanize noise motivated reordering, the final exit path still needs to run a filtered git gate before allowing completion.

Useful? React with 👍 / 👎.

Comment on lines +106 to +109
# Fallback to raw paths when realpath is unavailable (older macOS/BSD)
[[ -z "$_ma_real_path" ]] && _ma_real_path="$FILE_PATH"
[[ -z "$_ma_real_loop" ]] && _ma_real_loop="$_MA_LOOP_DIR"
if [[ "$_ma_real_path" == "$_ma_real_loop/"* ]]; then
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Normalize fallback edit paths during methodology phase

In the realpath fallback path, _ma_real_path is set to raw FILE_PATH while _ma_real_loop is usually absolute, so the prefix check fails for relative edit paths on systems without realpath (notably older macOS/BSD environments). That incorrectly blocks edits to allowed files like methodology-analysis-report.md and can stall the analysis phase.

Useful? React with 👍 / 👎.

Comment on lines +124 to +126
done_content=$(cat "$done_file" 2>/dev/null || echo "")
if [[ -z "$done_content" ]]; then
return 1
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject whitespace-only methodology completion markers

The completion check only tests -z on raw file contents, so a marker containing only whitespace/newlines is treated as valid and allows terminal state transition without a meaningful completion note. This weakens the phase gate and makes accidental empty completions possible; the content should be trimmed before emptiness validation.

Useful? React with 👍 / 👎.

…n markers

Edit validator had the same relative-path and traversal fallback issue
as the read/write validators. Applied the same normalization and ".."
rejection pattern.

Methodology completion checker now trims whitespace before emptiness
validation, preventing whitespace-only done markers or report files
from passing the content gate.
@SihaoLiu
Copy link
Copy Markdown
Contributor Author

@codex review this PR as an entirety

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 95a6b7b3ee

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

local verdict_line
local verdict_value

verdict_line=$(printf '%s\n' "$review_content" | grep -Ei 'Mainline Progress Verdict:[[:space:]]*(ADVANCED|STALLED|REGRESSED)([^A-Za-z]|$)' | tail -1 || true)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Reject placeholder mainline verdict formats

extract_mainline_progress_verdict currently accepts any line containing one of the verdict tokens, so the instructional placeholder Mainline Progress Verdict: ADVANCED / STALLED / REGRESSED is parsed as advanced instead of being treated as invalid. In implementation rounds this can silently reset drift state (mainline_stall_count/drift_status) and bypass the intended replan/circuit-breaker flow whenever the reviewer echoes the format template rather than choosing a single verdict.

Useful? React with 👍 / 👎.

if ! command -v gemini &>/dev/null; then
echo "Error: 'gemini' command is not installed or not in PATH" >&2
echo "" >&2
echo "Please install Gemini CLI: npm install -g @anthropic-ai/gemini-cli or https://github.com/anthropics/gemini-cli" >&2
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Correct Gemini CLI install command in error guidance

When gemini is missing, this message points users to @anthropic-ai/gemini-cli and an anthropics GitHub path, which are not the official Gemini CLI distribution. Users who follow this instruction will still fail the prerequisite check and cannot use /humanize:ask-gemini until they discover the correct package manually.

Useful? React with 👍 / 👎.

…ll path

Mainline verdict parser now rejects lines containing multiple verdict
keywords (e.g. template placeholders listing all options) as unknown,
preventing silent false-positive ADVANCED readings that reset drift
counters.

Fixed Gemini CLI install guidance to point to the correct package
(@google/gemini-cli) and repository (google-gemini/gemini-cli).
@SihaoLiu
Copy link
Copy Markdown
Contributor Author

@codex review this PR as an entirety

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bd506f2233

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

"hooks": [
{
"type": "command",
"command": "{{HUMANIZE_RUNTIME_ROOT}}/hooks/loop-codex-stop-hook.sh",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Quote hook command paths before writing hooks.json

The template emits the hook command as a bare path, so when {{HUMANIZE_RUNTIME_ROOT}} contains spaces (for example a custom CODEX_HOME path like /Users/John Doe/.codex), the command is split at runtime and Codex cannot execute the stop hook script. That breaks RLCR/PR exit gating in those installations; the command value should be shell-quoted or otherwise encoded as a single executable path.

Useful? React with 👍 / 👎.

Comment on lines +1072 to +1076
elif codex --help 2>&1 | grep -q -- '--disable'; then
CODEX_DISABLE_HOOKS_ARGS=(--disable codex_hooks)
echo "yes" > "$_CODEX_FEATURE_CACHE" 2>/dev/null
else
echo "no" > "$_CODEX_FEATURE_CACHE" 2>/dev/null
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Do not cache disable-hook support as "no" on probe failure

The stop hook permanently caches no when codex --help does not contain --disable, which also happens when codex --help fails (wrapper CLIs, constrained test binaries, transient probe errors). In that case nested reviewer calls run without --disable codex_hooks, re-enabling recursive Stop-hook execution for the rest of the loop. Feature detection should avoid negative caching on probe failure (or probe a command path that reliably exposes exec flags).

Useful? React with 👍 / 👎.

Hook installer now shell-quotes command paths via shlex.quote() so
runtime roots containing spaces do not split the command at execution.

Mainline verdict parser rejects lines with multiple verdict keywords
as unknown to prevent template placeholders from being parsed as a
valid verdict.

Corrected Gemini CLI install guidance to the actual package and repo.
@SihaoLiu
Copy link
Copy Markdown
Contributor Author

@codex review this PR as an entirety

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

The PR loop workflow is superseded by the /loop command combined with
GitHub PR review polling. This removes all PR loop implementation,
tests, documentation, templates, and supporting scripts.

Deleted PR-loop-only files: commands (start/cancel-pr-loop), hooks
(pr-loop-stop-hook), scripts (setup/cancel-pr-loop, check-bot-reactions,
check-pr-reviewer-status, fetch-pr-comments, poll-pr-reviews), prompt
templates (pr-loop/), test fixtures (setup-fixture-mock-gh), and all
PR loop test files.

Cleaned PR loop references from mixed files: hook validators, loop
library, template loader, bash validator, humanize.sh monitor,
monitor-common.sh, codex hooks config, install script, RLCR setup
mutual exclusion, SKILL.md, usage docs, and test harnesses.

The install script retains pr-loop-stop-hook.sh in its managed pattern
so upgrading users get stale hooks cleaned from their hooks.json.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants