fix: review mode works with prompts, anti-self-work contract, EN docs

- codex-run.sh review: CLI forbids scope flags + prompt (stdin '-' counts
  as [PROMPT]); translate scope into prompt text, native review only when
  prompt.md is empty. Add --skip-git-repo-check for consistency.
- agents/codex.md: marker contract (=== TASK FOR CODEX === / === END TASK ===,
  legacy RU markers accepted) so wrapper instructions never leak into the
  codex prompt and the wrapper never mistakes the task for its own job;
  self-check against doing the task itself; preamble now states codex is a
  subagent executor and process flows belong to the orchestrator; scope
  flags as separate args; no nohup; Read before rewriting prompt.md.
- skills: wrapper framing line + marker block in prompt templates.
- All instructions and README translated to English (RU trigger phrases
  kept in skill descriptions).
- tests: 3 new review-mode cases, ALL PASS.
- bump 0.1.2.
This commit is contained in:
admin committed 2026-07-28 19:12:19 +05:00
1 parent 0c355c4b9d
commit 54aabcab23
8 files changed
+292 -180

No files matched your search

+23
View File
@@ -31,4 +31,27 @@ CODEX_BIN=$HERE/stub-ok/codex "$RUN" "$TMP/flags" exec -s read-only
[[ $(cat "$TMP/flags/status") == ok ]]
[[ $(cat "$TMP/flags/last.md") == "stub answer|args="*"-s read-only -|prompt with flags" ]]
# 5. review + scope + prompt.md -> scope translated into prompt text, no scope flag in args
mkdir -p "$TMP/rev"; echo "focus: correctness" > "$TMP/rev/prompt.md"
CODEX_BIN=$HERE/stub-ok/codex "$RUN" "$TMP/rev" review --base main
[[ $(cat "$TMP/rev/status") == ok ]]
LAST5=$(cat "$TMP/rev/last.md")
[[ $LAST5 == "stub answer|args=exec review"* ]]
[[ $LAST5 != *"--base"* ]]
[[ $LAST5 == *"against base ref 'main'"* ]]
[[ $LAST5 == *"git diff main...HEAD"* ]]
[[ $LAST5 == *"focus: correctness" ]]
# 6. review + scope, no prompt.md -> native path keeps the scope flag
mkdir -p "$TMP/rev-native"
CODEX_BIN=$HERE/stub-ok/codex "$RUN" "$TMP/rev-native" review --uncommitted
[[ $(cat "$TMP/rev-native/status") == ok ]]
[[ $(cat "$TMP/rev-native/last.md") == "stub answer|args=exec review"*"--uncommitted|" ]]
# 7. review + prompt.md, no scope -> custom instructions pass through untouched
mkdir -p "$TMP/rev-custom"; echo "review whatever you find" > "$TMP/rev-custom/prompt.md"
CODEX_BIN=$HERE/stub-ok/codex "$RUN" "$TMP/rev-custom" review
[[ $(cat "$TMP/rev-custom/status") == ok ]]
[[ $(cat "$TMP/rev-custom/last.md") == "stub answer|args=exec review"*"-|review whatever you find" ]]
echo "ALL PASS"