Skip to content

fix: rebuild bounced versions with recorded feedback answers - #472

Merged
firejune merged 2 commits into
mainfrom
naru/454-after-a-human-bounce-next-names-no-agent
Nov 12, 2026
Merged

firejune merged 2 commits into
mainfrom
naru/454-after-a-human-bounce-next-names-no-agent

Conversation

@firejune

Copy link
Copy Markdown
Contributor

After a human bounce, next now names the agent rebuild and the feedback references it must answer. rig-version, direction write, and direction patch accept repeatable --answers <version>:<verdict> and validate before writing through the shared feedback validator. Historical records and review --answers-feedback retain their earlier target rules.

Synthetic tests cover complete rig and direction rebuild loops, missing answers, six invalid-reference cases with byte-identical refusal controls, and unchanged no-bounce records and output compared against main. No contract dates or stage behavior changed.

Validation:

  • Nova: typecheck and lint passed with registry and pinned-source dependencies.
  • Mechanically derived referencing suite: 57 files, 1347 pass, 2 skip, 0 fail. The source-only skipped route also passed in the pinned-source sample (28 pass).
  • Immutable-main comparison: three matching record/output snapshot controls.
  • Consumer clone: check and direction check passed; four invalid-reference CLI controls preserved record bytes. The clone has no finalized bounce, so the real owner page/rebuild/sign-off route remains pending the tower's browser verification.

Closes #454

firejune and others added 2 commits November 13, 2026 00:57
Co-Authored-By: Naru <342599188+fj-naru[bot]@users.noreply.github.com>
Share feedback reference validation across checks and writers, and route open bounce findings to agent rebuild moves.

Co-Authored-By: Naru <342599188+fj-naru[bot]@users.noreply.github.com>
@firejune firejune added the by:codex Written by a Codex (Naru) worker; Claude side judges the review label Nov 12, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T16:15:24.896665Z 0d5fa1f PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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

Copy link
Copy Markdown

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: 0d5fa1f34e

ℹ️ 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 thread src/next.ts
for (const [kind, refs] of groups) {
const field = `versions[n=${n}]`;
addAwait(field);
const writer = kind === 'rig' ? `rig-version ${n}` : `direction write ${n}`;

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 Account for earlier acceptance before recommending a direction rebuild

When a human accepts a direction version and subsequently bounces it, this branch recommends direction write as the sole next move, but that writer immediately refuses with DIRECTION_REVIEW_CLOSED: openReview() in src/direction-writers.ts:24–26 treats any live historical acceptance as closing authoring, even when followed by a bounce. This is precisely the accepted-then-bounced scenario covered by the changed test in tests/next.test.ts, but that test never executes the recommended rebuild. Either make the writer recognize the withdrawn acceptance or surface the required reopen before recommending the rebuild; otherwise the advertised recovery path cannot proceed.

Useful? React with 👍 / 👎.

Comment thread src/next.ts
command: `rig-create ${writer} ${inputs} ${refs.map(r => `--answers ${r.version}:${r.verdict}`).join(' ')}`,
act: `build the next ${kind} version with ${writer}, recording answers_feedback ${JSON.stringify(refs)}` });
}
if (moves.length > 0) return { schema: NEXT_SCHEMA, project_id: String(project.name ?? ''), stage, effective_stage: effectiveStage, accepted: false, refusals, awaits: awaitsList, moves };

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 Preserve the human resume move for paused projects

If a human pauses a project after bouncing its latest rig or direction version, the bounce still produces FEEDBACK_OPEN, so this early return emits only an agent rebuild and skips the existing stage === PAUSED_STAGE branch that requests a human resume. Consequently, next instructs the agent to continue building while the project is explicitly paused and no longer exposes the act needed to restart work. Handle paused projects before returning feedback rebuild moves, or exclude them from this branch until the human resumes.

Useful? React with 👍 / 👎.

@firejune

Copy link
Copy Markdown
Contributor Author

Claude review (cross-family)

Reviewer: Claude (create tower). Read at head 0d5fa1f34eae93882a006a199c3a843b13e6fbd9: src/feedback.ts (feedbackReferenceFinding, parseFeedbackAnswers, checkFeedback, writeVerdict), src/next.ts (FEEDBACK_OPEN moves), src/rig-version.ts, src/direction-writers.ts, docs/CHECKS.md, docs/PROJECT.md, tests/feedback-loop.test.ts, tests/next.test.ts, tests/rig-version.test.ts, tests/feedback.test.ts.

Verdict: approve. The change follows the issue as corrected by its comment.

  • One reference validator now serves check, review --answers-feedback and the new --answers writers. Historical refs keep their old target rule; only the new writer input requires a human bounce.
  • next builds its moves from check's FEEDBACK_OPEN findings instead of recomputing them.
  • The writer refusals (FEEDBACK_UNANSWERED, FEEDBACK_REF_UNKNOWN, FEEDBACK_REF_DUPLICATE) are asserted by code with byte-identical project.json, and the no-bounce paths are pinned by snapshot.

Findings:

  • P2 src/next.ts:605: when FEEDBACK_OPEN is present, next returns only the rebuild moves and skips every later move. That is right for the walk, since nothing else should proceed before the rebuild. A future case with an open bounce plus an unrelated required human act would hide that act until the rebuild lands. No change requested.

No other findings. The tower runs the page route (bounce through the Review page, ingest, direction write --answers, v17 verdict, sign-off, advance) on a pilot clone before merge.

@firejune
firejune merged commit a9ef988 into main Nov 12, 2026
2 of 4 checks passed
@firejune
firejune deleted the naru/454-after-a-human-bounce-next-names-no-agent branch November 12, 2026 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

by:codex Written by a Codex (Naru) worker; Claude side judges the review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

After a human bounce, next names no agent move and no writer records answers_feedback (walk blocker)

1 participant