Repository navigation
fix: never report a verified edit as failed, and make focus legible - #389
Conversation
Two independent defects made Forge claim work had failed when it had actually landed on disk. 1. `push_file_edit_evidence` matched only `write_file`/`apply_patch`, while `pre_edit_snapshot` and `classify_turn` both handled `edit`. Every `edit` call therefore produced a FileEdit expectation with no evidence to verify it against, so a successful edit reported "No file modifications were successfully applied" and Failed. 2. The cross-category evidence gate downgraded any Completed turn to Failed if *any* evidence entry carried an error — including steps the turn's expectation never required. A missing `pytest` erased a verified edit. The gate now distinguishes required from ancillary operations. A failed required operation still fails the turn, loudly and unchanged. An ancillary step that didn't finish is carried in a new `EvidenceSummary::incomplete` and surfaced next to a Completed turn in muted styling, so the turn stays honest without overstating the damage. Pre-existing compaction_tests failures on main are unrelated and untouched.
… pane The terminal panel signalled focus only by swapping the border style on a one-cell top rule, so a focused terminal was visually identical to an unfocused one — the only way to find out where keystrokes were going was to type and see what happened. It now takes the composer's structural cue: a thick rule and a marked title, legible without color. Separately, `type_to_compose` was the universal fallback for any printable key the focused block didn't consume. The footer has no Char handler, so letters typed there silently moved focus to the composer and inserted — a shell command typed after one Tab became a chat draft, and the Enter meant to run it submitted it to the model. Control surfaces (Footer, BottomPanel) now keep their keystrokes instead of handing them to the composer; navigational blocks keep type-to-chat, where a keystroke has no local meaning anyway. Also widens ancillary-step detection to non-zero exit codes: `bash` dispatching fine while the command inside it fails (a missing binary exits 127 with `is_error` unset) is exactly the step worth reporting.
…s model
The completion evaluator carried unfinished ancillary steps and the status
model formatted them, but the footer took only a bare TurnLifecycle enum,
so the detail never reached the one row the user actually reads. An
end-to-end test through tool execution -> completion evaluation -> turn
event -> snapshot -> status model -> rendered footer caught it: the model
said "Completed · exit 127 didn't finish" while the screen said only
"Completed".
The footer now takes a lifecycle_detail rendered as dim secondary text —
the lifecycle glyph alone carries severity, so a reported check never
borrows failure styling.
Long command names degrade to "1 check didn't finish": the detail shares
its row with the model/effort/mode identity, and a long invocation pushed
that identity out entirely ("OpenAI/gpt-5.6-luna │ Max │ Auto" collapsed
to "Op"), trading one piece of needed state for another.
- /terminal (plus /term, /shell) reaches the terminal panel. Ctrl+` is the
fast path but an unusual chord that appears only in the help overlay, so
the palette had no route to it at all. A new test asserts every command
the palette advertises actually parses.
- The model picker promotes the active route to the top of its group.
Selection resets to row 0 on every keystroke, so typing a name two
providers offer confirmed whichever sorted first and silently moved the
session to a different provider and account. Every route stays listed
and selectable.
- Ctrl+E on a terminal narrower than the explorer's layout threshold now
says so instead of toggling an invisible flag and parking focus in a
pane that is never rendered. layout::files_fit shares the threshold with
split_areas_ex so the explanation cannot drift from the behaviour.
- The footer names the token unit ("0 tokens · —"). It drops back to the
bare count only when the row cannot afford the label — the mode chip
says whether Forge asks before acting and is never traded for it.
All 16 compaction tests were failing on main, and not on anything about compaction: #388 raised CompactionPolicy::default() from a 200K to a 500K window, which moved the trigger from 170K to 425K. The fixture grows 70 turns to ~182K tokens, so it stopped crossing the boundary and tripped its own "must actually be under context pressure" guard. These tests exercise behaviour at the boundary, so they now set the boundary themselves instead of inheriting whatever the product default happens to be. Growing the fixture to suit a 500K window would have made the suite ~2.5x slower and left it just as fragile the next time the default moves.
This comment has been minimized.
This comment has been minimized.
Unrelated to this PR's changes, but it blocks its audit gate: the advisory (h2 unbounded empty DATA frames) was published 2026-08-17 and fails on main too. h2 is transitive via hyper and reqwest, so this is a lockfile-only single-package bump. cargo test --workspace stays at 2132 passed, 0 failed.
|
Pushed Unrelated to this PR's changes but it was blocking the audit gate — the advisory was published 2026-08-17 and fails on
|
…exist "Test and format" has been failing on main for at least five commits, and not on Rust code: install/test-installer.sh ran every case with /bin:/usr/bin on PATH, so on any host where bubblewrap and socat are really installed, `command -v bwrap` succeeded, the installer short-circuited, and ten "dependency is missing" cases asserted against a branch that never ran. CI is exactly that host — the workflow installs both in the step before this suite — which is why it reported 18/18 on a developer machine and 8/18 there. The suite was green where it tested nothing and red where it mattered. Absence is now something the harness controls: cases run against a sanitized mirror of the system path with these two binaries excluded, so a case that wants them present supplies them through its own stub dir. Verified 18/18 both with and without them installed; reproducing the old PATH locally gave CI's exact 8 passed, 10 failed.
|
Pushed Not a Rust failure — it's the CI is exactly that host — the workflow installs both in the step immediately before this suite. Hence 18/18 on a dev machine and 8/18 in CI: green where it tested nothing, red where it mattered. Cases now run against a sanitized mirror of the system path with those two binaries excluded, so a case that wants them present supplies them via its own stub dir. Verified locally at 18/18 both with and without them installed; reproducing the old Note |
…ATH too The first pass took Test and format from 8/18 to 15/18. The remaining three were the same bug one layer down: `command -v apt-get` succeeds on any Debian-family host, so the pacman, apk, and no-package-manager cases silently took the apt branch instead of the one they assert on. apt-get, pacman, and apk join bwrap and socat in the exclusion list. Every case that wants a package manager present already stubs it into its own bin dir, which precedes the sanitized mirror on PATH. Verified 18/18 both on a clean host and with all five binaries installed.
|
Status: this PR's own work is green; one pre-existing failure remains and I've stopped rather than mask it.
The remaining failure is not from this PR: The identical two tests, same file, same The assertion is a real security signal, not a flaky test:
I'm not skipping, weakening, or Suggest tracking the sandbox confinement failure as its own issue and deciding separately whether to merge this PR ahead of it. For the record, everything this PR controls passes: |
|
Merging with an admin override, on the explicit understanding that the one remaining red check is pre-existing and unrelated. The sandbox confinement failure is now tracked as #390. It is red on Nothing in that suite was skipped or weakened to get here. |
…n-and-focus fix: never report a verified edit as failed, and make focus legible
…n-and-focus fix: never report a verified edit as failed, and make focus legible
…n-and-focus fix: never report a verified edit as failed, and make focus legible
Fixes the highest-severity findings from a hands-on usability run of
0.1.0-beta.5, driven live in a PTY against a disposable repo.Critical: a verified edit reported as a failed turn
Two independent defects made Forge claim work had failed when it had landed on disk.
1. The
edittool produced no evidence at all.pre_edit_snapshotandclassify_turnboth handlededit, butpush_file_edit_evidencematched onlywrite_file/apply_patch—editfell through_ => {}. Everyeditcall therefore created aFileEditexpectation with nothing to verify it against, so a successful edit reported "No file modifications were successfully applied" andFailed.editis the canonical editing tool (search_replace/edit_filenormalize to it), so this fired constantly.2. The cross-category evidence gate was too blunt. It downgraded any
Completedturn toFailedif any evidence entry carried an error — including steps the turn's expectation never required. A missingpytesterased a verified edit.The gate now distinguishes required from ancillary operations:
EvidenceSummary::incompleteand reported next to aCompletedturn in muted styling.Detection covers non-zero exits, not just
is_error—bashdispatches fine while the command inside it fails (a missing binary exits 127 withis_errorunset), which is exactly the step worth reporting.Guardrails are unchanged and still pass:
two_edits_one_fails_is_partial_failure_not_completed(both ops required) still fails loudly, as doesfile_edit_with_no_matching_evidence_failsandassistant_text_alone_cannot_complete_file_edit.write_then_failing_validation_in_same_turn_never_completeswas rewritten — it encoded exactly the old contract. That behaviour change is deliberate and documented in the test.High: keystrokes landing in the wrong pane
The terminal had no visible focus indicator. It signalled focus only by swapping the border style on a one-cell top rule, so a focused terminal was indistinguishable from an unfocused one — the only way to find out where keystrokes were going was to type and see what happened. It now takes the composer's structural cue.
Printable keys fell through to the composer.
type_to_composewas the universal fallback for any key the focused block didn't consume. The footer has noCharhandler, so letters typed there silently moved focus and inserted — a shell command typed after one Tab became a chat draft, and the Enter meant to run it submitted it to the model. Control surfaces (Footer, BottomPanel) now keep their keystrokes; navigational blocks keep type-to-chat, where a keystroke has no local meaning anyway.Discoverability
/terminal(plus/term,/shell) and a palette entry. `Ctrl+`` is an unusual chord that appears only in the help overlay, so the palette had no route to the terminal at all. A new test asserts every command the palette advertises actually parses.Ctrl+Eon a narrow terminal explains itself instead of toggling an invisible flag and parking focus in a pane that is never rendered.layout::files_fitshares the threshold withsplit_areas_exso the message cannot drift from the behaviour.0 tokens · —). It falls back to the bare count only when the row cannot afford the label — the mode chip says whether Forge asks before acting and is never traded for it.Test fixture
All 16
compaction_testswere already failing onmainbefore this branch. Not a compaction bug: #388 raisedCompactionPolicy::default()from a 200K to a 500K window, moving the trigger from 170K to 425K. The fixture grows 70 turns to ~182K tokens, so it stopped crossing the boundary and tripped its ownmust actually be under context pressureguard.These tests exercise behaviour at the boundary, so they now set the boundary themselves rather than inheriting the product default. Growing the fixture instead would have made the suite ~2.5x slower and left it equally fragile the next time the default moves.
Verification
Every fix was also driven live in a real PTY, not just unit-tested:
● Completed · 1 check didn't finish, withgit statusconfirming the edit on diskgit statustyped at the footer → composer stays empty, focus stays putCtrl+Eat 80x24 →Files needs a wider terminal (116 columns; this one is 80)/term→ resolves to/terminalBoth regression tests for the focus fixes were confirmed to fail without their fix.