Skip to content

Fix/agy cesar tooling and codeblock render#177

Merged
cukas merged 6 commits into
mainfrom
fix/agy-cesar-tooling-and-codeblock-render
Jun 8, 2026
Merged

Fix/agy cesar tooling and codeblock render#177
cukas merged 6 commits into
mainfrom
fix/agy-cesar-tooling-and-codeblock-render

Conversation

@cukas

@cukas cukas commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

No description provided.

cukas and others added 6 commits June 8, 2026 11:55
Plan approval was binary (Approve / Reject). When a plan was almost-right,
the user had no in-band way to say 'adjust step 2' — typing into the
composer was silently swallowed by the awaiting-approval keyboard guard,
and Reject was destructive (killed the proposal text).

Add a third slot 'Other — revise the plan':
  - PlanProposalView renders 1) Approve, 3) Other, 2) Reject
  - keyboard.kern cycles 3 values; y/1, n/2, o/3 jump directly
  - Arrows wrap (down: 0→1→2→0; up: 0→2)
  - 'revise' action clears the proposal from the live pane, pre-fills
    the composer with 'Revise the plan: ', and shows a brief hint.
    User finishes typing and presses Enter; the message routes to Cesar
    who (per session.kern RULE 9) re-proposes with the user's changes —
    the old plan is replaced, not killed.
  - planControl.action union widens to 'approve'|'cancel'|'revise'

Tests: 43/43 keyboard tests pass (added one covering the 3-way cycle,
o/3 jumps, and the revise action). 2209/2209 total.
agon resolves the review directory from the active workspace
(resolveWorkingDir), not process.cwd() — so running a review from repo X while
the active workspace is repo Y silently reviews Y. This produced a 6-engine
review of agon's OWN repo instead of the user's code, with no visible signal;
the reviewers never saw the intended changes.

Adds announceReviewTarget(), called in handleReview + handleReviewMany BEFORE
the empty-diff check: prints the repo name/path/branch actually being reviewed,
and warns loudly when process.cwd() is a DIFFERENT git repo than the one being
reviewed (the active-workspace footgun). A wrong-repo review can no longer pass
silently — even "No changes to review" now names the repo it inspected.

(Does not change which dir is used — that's the deliberate active-workspace
model; switch workspace or pass branch:/commit: to review elsewhere. This makes
the mistake impossible to miss.)

review tests: 58/58 pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
`agon review` computed the diff from process.cwd() but called runReviewCore
WITHOUT a cwdOverride, so each engine was dispatched into resolveWorkingDir()
= the active workspace. Running `agon review` from repo X therefore reviewed
X's diff while the reviewers gathered file context from the active-workspace
repo (e.g. agon's own source) — so a multi-engine review "never saw the code"
the diff referenced. This silently invalidated reviews run outside the active
workspace.

Pass cwd (process.cwd()) as runReviewCore's cwdOverride so diff + engine
context stay in one repo, and print a "Repo: <cwd>" header so the target repo
is always visible. Verified: `agon review` from kern-guard now shows
"Repo: .../kern-guard" and dispatches engines there.

Pairs with the handler-side announce/mismatch-warning (REPL path).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The CLI review cwd fix pinned the MAIN engine dispatch to process.cwd(), but
runReviewCore's parse-repair retry (runReviewRepair) still recomputed
resolveWorkingDir() = the active workspace. So when a review's first response
didn't parse, the repair engine ran in the wrong repo — the same split-brain
bug, one layer down. Caught by the panel review of our own branch.

Thread cwdOverride into runReviewRepair and pass runReviewCore's resolved cwd.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…r Cesar's work)

The panel review flagged real bugs in Cesar's 'Other — revise the plan' feature
(104359c):
- Indices were 0=Approve, 1=Reject, 2=Other, but the options render Approve /
  Other / Reject and arrows cycled by index 0→1→2 — so ↓ from Approve jumped to
  Reject (bottom), skipping the middle Other slot; the cursor moved
  top→bottom→middle (felt broken).
- The numbers displayed out of order (1, 3, 2).
- A SECOND rendering (the markdown/pinned plan block) never got the Other option
  at all and still showed the old "✎ type to change" footer.

Renumber everything to one consistent VISUAL order — 0=Approve, 1=Other,
2=Reject:
- keyboard.kern: arrows cycle 0→1→2→0 (Approve→Other→Reject, no skip); keys
  y/1→Approve, o/2→Other, n/3→Reject; Enter maps 1→revise, 2→cancel.
- plan-view.kern: both renderings show 1. Approve / 2. Other / 3. Reject with
  matching colors and the updated footer; the markdown block gains the Other
  slot it was missing.
- keyboard.test.ts: updated the 3-way cycle / jump / revise expectations.

(False positive dismissed: the panel's "sep not imported in review.ts" blocker —
it is imported at review.ts:5 and tsc is clean.)

Full suite: 2000/2000.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The code-block width fix sized rows against the raw terminal width
(contentWidth(8)). When a block is nested inside padded/bordered containers
(the streaming preview pane, plan view, etc.), the box could still be wider
than the actual available Ink width and wrap again — the panel review flagged
this as a residual edge case.

Thread RenderedSegments' wrapWidth (the parent-computed content budget) into
CodeBlockView and cap the body at wrapWidth-8 so the box (body+8 frame cols)
always fits inside it. Falls back to the terminal budget when no wrapWidth is
passed (no behavior change for top-level blocks). Verified: box width ≤
wrapWidth across nested/deeply-nested cases; 2000/2000 tests pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cukas cukas merged commit 0f2ded0 into main Jun 8, 2026
2 checks passed
@cukas cukas deleted the fix/agy-cesar-tooling-and-codeblock-render branch June 8, 2026 11:22
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