Skip to content

docs: reinforce loop-goal block discipline and local dev authority - #1643

Draft
seonghobae wants to merge 6 commits into
codex/remove-repo-opencode-configfrom
docs/loop-goal-block-discipline
Draft

docs: reinforce loop-goal block discipline and local dev authority#1643
seonghobae wants to merge 6 commits into
codex/remove-repo-opencode-configfrom
docs/loop-goal-block-discipline

Conversation

@seonghobae

@seonghobae seonghobae commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Current authority — 2026-09-10

  • canonical governance/review-consumer parent: #1625@7bfc7cae2c12b00e59688230e0057a64e3d6dc0e
  • generated direct-develop predecessor: 05af4d05716d54318f49ff4bada03567d2281389
  • owner-preserving integration: 2024287eaeda38268e95915c127d9dea4d59657d via merged temporary chore(stack): integrate current governance owner into loop-discipline docs #1644
  • initial source-governance test: 46f7a3ad2bf464cca1332ca54fadbbec2be96f25
  • review RED: CodeRabbit comment 5615017984 found CLAUDE omitted the explicit single-writer/read-only/server-permission/rejection limits that AGENTS preserved
  • RED test child: 15c2a0881435ea390fd40a625a2418563ff6452f
  • minimal docs fix: d6f527bf6e358416137d04b3a0261b2683068f0b
  • test-harness wrap-safe child / exact head: 323607859a36c544f2a7750763c2d314a3a40762
  • lifecycle: Draft / CodeRabbit exact-head APPROVED / exact-head executable evidence absent / do not merge
  • effective delta over test(review): consume canonical central OpenCode configuration #1625: exactly 3 files, ahead-only (behind_by=0) — AGENTS.md, CLAUDE.md, and backend/tests/test_loop_goal_block_discipline_docs.py.

The original docs-only proposal was based directly on protected develop and therefore crossed active AGENTS/CLAUDE authority in the #1528#1549#1625 governance stack. Temporary integration PR #1644 normally merged current #1625 into this branch; #1643 was then retargeted to codex/remove-repo-opencode-config. No force-push, destructive rebase, source copy or gate weakening was used.

The retained guidance distinguishes remote-head/CI/review waits from true top-level blockers, preserves explicit policy/permission denials as higher authority, forbids trial-running prohibited actions, requires blocker candidates to be validated against node/head/policy/dependency state, and forbids fake progress/infinite polling. It does not authorize bypassing single-writer scopes, secrets, paid resources, operations or effective ask/deny rules.

CodeRabbit independently verified the first three-file range and found one valid governance gap: CLAUDE's shorter copy allowed independent branch/worktree creation without explicitly restating AGENTS' read-only, single-writer, prior-rejection and server-permission-denial boundaries. 15c2a088... first made those missing limits executable RED assertions. d6f527bf... then added the minimal equivalent CLAUDE boundary: a read-only scope, another writer's single-writer boundary, an explicit server permission denial or prior rejection remains binding and cannot be bypassed by a replacement branch/worktree. 32360785... only makes the prose assertion robust to Markdown line wrapping; it does not weaken the semantic checks.

The source-governance test also proves inherited #1625 boundaries remain present: repository-local opencode.json[c] stays forbidden and provider/model routing remains owned by contextual-orchestrator.

Exact-head evidence boundary

Fresh #1625#1643 compare is ahead-only/behind 0 and exactly three files. CodeRabbit submitted formal APPROVED review PRR_kwDOSNjZ2s8AAAABM9Cj4Q at 2026-09-10T07:52:34Z, after exact 323607859... was created at 07:48:31Z; this satisfies the independent current-head review lane for the unchanged head.

Executable evidence is still missing. Fresh lookup for 323607859... returns zero PR-triggered workflow runs. Feature-base stacked PR execution remains owned by .github#2073; predecessor direct-develop receipts do not transfer after owner adoption or source/test children. Do not retarget this PR to develop, push a dummy commit, copy central workflow source, synthesize a status or treat review approval as test execution.

Codex review was unavailable on the previous attempt because the connector reported its code-review usage limit; that does not invalidate the independent CodeRabbit approval and does not authorize a bypass.

Keep Draft until the canonical stacked-PR exact-head executable path exists, the prerequisite stack is protected-integrated in order, and then-live required contexts are terminal-success. No direct-provider/model workaround, second governance owner or premature merge/release claim.

Summary by CodeRabbit

  • Documentation

    • Clarified when autonomous local development can continue without repeated approval.
    • Documented permission boundaries, approval-dependent work, protected scopes, and conditions that require stopping.
    • Added guidance for validating blocked-work signals and preventing false progress or indefinite waiting.
  • Tests

    • Added coverage to verify that the documented loop-goal and permission rules remain present and consistent across the project guidance files.

@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: e6626a15-6e84-40ff-93d6-5cb298c4df62

📥 Commits

Reviewing files that changed from the base of the PR and between 7bfc7ca and 3236078.

📒 Files selected for processing (3)
  • AGENTS.md
  • CLAUDE.md
  • backend/tests/test_loop_goal_block_discipline_docs.py

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The change adds loop-goal discipline guidance to AGENTS.md and CLAUDE.md. It defines local development authority, permission precedence, blocking rules, and validation requirements for opencode_loop_goal_blocked. Tests verify required documentation phrases.

Changes

Loop-goal discipline

Layer / File(s) Summary
Local development authority
AGENTS.md, CLAUDE.md
Documents autonomous local development, permission boundaries, protected scopes, and non-blocking wait states.
Blocked-goal validation
AGENTS.md, backend/tests/test_loop_goal_block_discipline_docs.py
Defines validation requirements for opencode_loop_goal_blocked and tests the required guidance in both documents.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: claude

Merge Risk: ⚪ Minimal · up to 32360

This change documents local development and loop-goal blocking boundaries and adds checks that preserve the guidance. No concrete current-head merge risk remains.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main changes: strengthening loop-goal blocking guidance and local development authority in the repository documentation.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/loop-goal-block-discipline

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

… docs

Normal owner-preserving integration: retain #1643 loop-goal guidance while inheriting #1625 AGENTS/CLAUDE and central review-consumer authority without source copying or force-push.
@seonghobae
seonghobae changed the base branch from develop to codex/remove-repo-opencode-config September 10, 2026 07:42

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review only current base 7bfc7cae2c12b00e59688230e0057a64e3d6dc0e → exact head 46f7a3ad2bf464cca1332ca54fadbbec2be96f25. Focus on whether the loop-goal blocking guidance preserves higher-authority policy/permission/single-writer boundaries and whether backend/tests/test_loop_goal_block_discipline_docs.py is a non-vacuous source-governance contract. Do not transfer predecessor direct-develop evidence.

Copy link
Copy Markdown
Contributor Author

@codex review

Review current exact head 46f7a3ad2bf464cca1332ca54fadbbec2be96f25 against base 7bfc7cae2c12b00e59688230e0057a64e3d6dc0e. Check the three effective files only for contradictory stop authority, single-writer/policy bypass language, test vacuity, and loss of inherited CO/OpenCode ownership semantics.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

base='7bfc7cae2c12b00e59688230e0057a64e3d6dc0e'
head='46f7a3ad2bf464cca1332ca54fadbbec2be96f25'

printf '%s\n' '== Exact range status =='
git rev-parse --verify "${base}^{commit}"
git rev-parse --verify "${head}^{commit}"
git merge-base --is-ancestor "$base" "$head"
git rev-list --left-right --count "${base}...${head}"
git diff --name-status "${base}..${head}"

printf '%s\n' '== Exact diff =='
git diff --no-ext-diff --unified=80 "${base}..${head}" -- \
  AGENTS.md CLAUDE.md backend/tests/test_loop_goal_block_discipline_docs.py

printf '%s\n' '== Test file outline =='
ast-grep outline backend/tests/test_loop_goal_block_discipline_docs.py --items all || true

printf '%s\n' '== Related source-governance tests and helper conventions =='
fd -t f -a . backend/tests | rg 'loop_goal|discipline|agents|claude|governance' || true
rg -n -C 5 --glob 'backend/tests/**/*.py' \
  '(AGENTS\.md|CLAUDE\.md|read_text|assert .* in|assert .*not in|source-governance)' \
  backend/tests || true

Length of output: 197320


🏁 Script executed:

#!/bin/bash
set -euo pipefail

base='7bfc7cae2c12b00e59688230e0057a64e3d6dc0e'
head='46f7a3ad2bf464cca1332ca54fadbbec2be96f25'

printf '%s\n' '== Exact range =='
printf 'left-right count: '
git rev-list --left-right --count "${base}...${head}"
printf '%s\n' 'changed files:'
git diff --name-status "${base}..${head}"

printf '%s\n' '== Exact diff: AGENTS.md =='
git diff --no-ext-diff --unified=12 "${base}..${head}" -- AGENTS.md
printf '%s\n' '== Exact diff: CLAUDE.md =='
git diff --no-ext-diff --unified=12 "${base}..${head}" -- CLAUDE.md
printf '%s\n' '== Exact diff: contract test =='
git diff --no-ext-diff --unified=20 "${base}..${head}" -- backend/tests/test_loop_goal_block_discipline_docs.py

printf '%s\n' '== Complete contract test at head =='
git show "${head}:backend/tests/test_loop_goal_block_discipline_docs.py" | nl -ba

printf '%s\n' '== Relevant loop-goal sections at head =='
git show "${head}:AGENTS.md" | nl -ba | grep -A140 -B5 -F '## Loop-goal block discipline and local development authority'
git show "${head}:CLAUDE.md" | nl -ba | grep -A140 -B5 -F '## Loop-goal block discipline and local development authority'

printf '%s\n' '== Existing owner-boundary wording at head =='
for file in AGENTS.md CLAUDE.md; do
  printf '%s\n' "--- ${file} ---"
  git show "${head}:${file}" | nl -ba | grep -i -E -C 3 \
    'single.writer|single-writer|permission|forbidden|ask|deny|opencode\.json|contextual-orchestrator|provider/model'
done

Length of output: 35488


🏁 Script executed:

#!/bin/bash
set -euo pipefail

head='46f7a3ad2bf464cca1332ca54fadbbec2be96f25'

printf '%s\n' '== CLAUDE.md boundary-term occurrences at the exact head =='
git show "${head}:CLAUDE.md" | nl -ba | grep -i -E -C 2 \
  'single.writer|single-writer|another writer|active.writer|permission denial|server permission|read.only scope|read-only scope|rejection|ask.*deny|deny.*ask'

printf '%s\n' '== New CLAUDE.md section and its source-contract assertions =='
git show "${head}:CLAUDE.md" | nl -ba | sed -n '201,218p'
git show "${head}:backend/tests/test_loop_goal_block_discipline_docs.py" | nl -ba | sed -n '11,39p'

Length of output: 4217


@seonghobae I reviewed only 7bfc7cae2c12b00e59688230e0057a64e3d6dc0e → 46f7a3ad2bf464cca1332ca54fadbbec2be96f25. The range is ahead-only by three commits. I did not use predecessor direct-develop evidence.

Finding — CLAUDE.md does not preserve, or test, the single-writer and explicit permission-denial boundaries.
AGENTS.md correctly states that server permission denials take precedence and that an agent must not bypass a single-writer scope or rejection with another branch. CLAUDE.md Lines 207-212 permits independent branch/worktree creation but omits those limits. Its contract test at Lines 24-31 checks only the ask/deny phrase. Therefore, an edit can retain the tested phrases while weakening the required higher-authority boundary.

Add the equivalent single-writer, rejection, read-only-scope, and permission-denial limits to CLAUDE.md. Add source assertions for those limits in test_claude_documents_same_high_level_blocking_contract().

The test is non-vacuous because it reads the actual repository documents. It is incomplete for the stated cross-document governance contract.

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Re-review only current base 7bfc7cae2c12b00e59688230e0057a64e3d6dc0e → exact head 323607859a36c544f2a7750763c2d314a3a40762. The prior finding is intentionally RED→fix: test commit 15c2a088... requires CLAUDE read-only/single-writer/server-permission/rejection limits, docs fix d6f527bf... adds them, and 32360785... only makes the Markdown-wrap assertion non-brittle. Verify the repaired boundary and the three-file effective scope; do not transfer the previous review conclusion as approval.

@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

base='7bfc7cae2c12b00e59688230e0057a64e3d6dc0e'
head='323607859a36c544f2a7750763c2d314a3a40762'

printf '%s\n' '== Exact range identity and topology =='
git rev-parse --verify "${base}^{commit}"
git rev-parse --verify "${head}^{commit}"
git merge-base --is-ancestor "$base" "$head"
printf 'left-right count: '
git rev-list --left-right --count "${base}...${head}"
printf '%s\n' 'changed files:'
git diff --name-status "${base}..${head}"

printf '%s\n' '== Exact diff: AGENTS.md =='
git diff --no-ext-diff --unified=24 "${base}..${head}" -- AGENTS.md
printf '%s\n' '== Exact diff: CLAUDE.md =='
git diff --no-ext-diff --unified=24 "${base}..${head}" -- CLAUDE.md
printf '%s\n' '== Exact diff: source-governance contract =='
git diff --no-ext-diff --unified=36 "${base}..${head}" -- backend/tests/test_loop_goal_block_discipline_docs.py

printf '%s\n' '== Complete source-governance contract at exact head =='
git show "${head}:backend/tests/test_loop_goal_block_discipline_docs.py" | nl -ba

printf '%s\n' '== Loop-goal sections at exact head =='
for file in AGENTS.md CLAUDE.md; do
  printf '%s\n' "--- ${file} ---"
  git show "${head}:${file}" | nl -ba | grep -F -A100 -B4 \
    '## Loop-goal block discipline and local development authority'
done

printf '%s\n' '== Required inherited ownership terms at exact head =='
for file in AGENTS.md CLAUDE.md; do
  printf '%s\n' "--- ${file} ---"
  git show "${head}:${file}" | nl -ba | grep -i -E -C2 \
    'opencode\.json|contextual-orchestrator|provider/model|provider.*model|model.*provider'
done

Length of output: 25100


@seonghobae I reviewed only 7bfc7cae2c12b00e59688230e0057a64e3d6dc0e → 323607859a36c544f2a7750763c2d314a3a40762.

The range is ahead-only (0 6). It changes exactly three files: AGENTS.md, CLAUDE.md, and backend/tests/test_loop_goal_block_discipline_docs.py.

The prior boundary finding is repaired. CLAUDE.md now preserves the read-only-scope, single-writer, explicit server-permission-denial, and prior-rejection limits. It also prohibits bypass through a replacement branch or worktree for the protected path.

The source-governance test is non-vacuous. It reads the checked-in repository documents. It asserts each repaired CLAUDE.md boundary term. The split assertions avoid dependence on Markdown line wrapping.

The test also preserves the inherited OpenCode and contextual-orchestrator ownership checks.

I found no new issues in the requested exact range. This re-review does not transfer predecessor evidence or constitute approval.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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.

1 participant