Skip to content

Reconcile corrective S016 branch content - #231

Open
dbowm91 wants to merge 224 commits into
mainfrom
feat/auto-20261109-f8abad0d-artifact-safe
Open

dbowm91 wants to merge 224 commits into
mainfrom
feat/auto-20261109-f8abad0d-artifact-safe

Conversation

@dbowm91

@dbowm91 dbowm91 commented Nov 17, 2026

Copy link
Copy Markdown
Owner

This separate PR carries the artifact-safe reconciliation at 1d2e6ee976c5d53c6ed7c2e40b6f8d28346c1469 from feat/auto-20261109-f8abad0d-artifact-safe to main, leaving the existing PR branch untouched and excluding the upstream-only monitor-summary history.

Validation:

  • cargo build --bin codegg passed.
  • scripts/verify.sh quick ran with CODEGG_H006_CODEGG_BINARY configured and exited 1; output was suppressed, so the failing step is unknown.
  • Focused formatting, Rust tests, harness tests, Python compilation, assertion-quality, and duplication checks passed earlier.
  • Hosted CI is expected to run for this PR; no CI outcome is claimed yet.

…stones

A second read-only audit of the TUI render path found five recurring cost
shapes, all paid 12.5-62 times per second because the event loop redraws on
every pump tick while streaming, Working, or showing a toast. This registers
the workstream and its six mutually independent milestones; the registry
rows read ready for handoff and close as each lands.
The retained frame buffer was deep-cloned on every frame for a reader that
returns early unless a selection is live; the sidebar's projection was
re-materialized once per occupied panel; its line model was built four
times; an open subagent tab was cloned; the composer hint was built twice;
the tasks overlay's rows were built twice with an allocating lookup; and the
watermark scan allocated on every frame.

Measured before -> after: buffer clones 1 -> 0 with no selection; sidebar
populations 2 -> 1 with two panels and 1 -> 0 unchanged; line builds 3 -> 1;
tab clones 1 -> 0; hint builds 2 -> 1; task-list builds 2 -> 1; watermark
scans 2 -> 0 unchanged.

render_cost.rs lands whole here rather than accumulating one counter group
per milestone: the counters are one registry, and splitting the registry
across six commits would make five of them carry unused producers. The
status-bar summary cache is deferred under the plan's own stop condition.
rows() was two full clones (a tree walk cloning two strings per node, then
filter_rows cloning the vector again), and /files called it three to four
times per frame. It now returns a borrow from a RowCache keyed on
(revision, filter) and rebuilt inside bump(), the single mutation choke
point.

The stale-path proof is the milestone: removed, renamed, collapsed,
re-scoped, replaced-listing, project-switch and teardown each have a test,
and dropping revision from the key fails 38 of 62 state tests and 5 of 12
family tests. This discharges the finding C006's closure carried over.

Measured unchanged-frame: pane 1 build + 1 pass -> 0/0; /files modal 4
passes -> 0; /files panel 3 -> 0.
…view's hunks

The chat surface had no cache anywhere: every draw flattened the whole
retained window into fresh rows, and the 500-byte display cap is applied
only on the command-line projection, so bodies were wrapped in full at
panel width. The change review deep-cloned the parsed patch per frame.

ChatBrowser now caches the row model against (sequence, unread, channel,
width, cursor, theme); the two surfaces keep separate caches; the unread
count is memoized; and DiffViewer gained a borrowed render path.

Measured unchanged-frame: panel 1 build + N wraps + 1 scan -> 0/0/0 at 1,
10 and 100 messages; box N wraps -> 0; review 237 hunk copies -> 0.
Dropping sequence from the key fails the redaction and edit tests.

MAX_CHAT_BODY_DISPLAY_LEN on the render path is deferred: it is a
product-visible truncation, and the record says so.
…yload parse

The streaming tail's fast path re-assembled and therefore re-cloned every
block's rows on the branch whose comment says they are already rendered; a
part cache hit returned an owned clone the caller copied again; a collapsed
tool call parsed its JSON before the expanded gate, so the disclosure
default was the expensive case; and the code-block wrapper emitted one span
and one heap string per character.

Measured: tail copies 1 -> 0 unchanged; part copies 6 -> 3 (7 -> 3 under
search); collapsed body builds 1 -> 0; code-block spans 8000 -> 100 for a
100x80 block.

render_md_line_wrapped is deferred: routing it through the styled wrap would
keep styling the current path drops, which is a rendered-output change.
…check

A visible row was read whole and walked past the column window with no early
exit; the viewport resolver read the same window a second time for the
horizontal clamp; the semantic-token scan was linear over all tokens per
row; the style lookup restarted from index 0 per segment; and
first_changed_line re-read and re-hashed the whole scanned prefix per
keystroke.

Measured warm frame: row reads 80 -> 40; row bytes 320000 -> 19520 over long
lines and 40000 -> 492 over a minified line; token scan steps 40000 -> 480;
highlight prefix 4900 -> 0 for an edit below the scan.

ADR-0011 holds: no second buffer, no materialized rows, and the clamp memo
holds one integer. All five editor guards are green with no allowlist edit.
codegg-document gains two additive read accessors; read_bytes is unchanged.
The span lookup rescanned its span list from the front for every word, so
the cost was words x spans and it allocated a Vec per word; every word was
also measured twice. A monotone SpanCursor replaces both, and the plain
engine chunks a word by byte range instead of allocating per word.

Measured: span rescans 10000 -> 298 for 100 spans; width measures 2 per word
-> 1, and 4 -> 1 for a hard-broken word.

The contract is unchanged - no signature, no visibility, no output, no
escape rule - and a boundary perturbation is shown making the comparison
fail. The plain engine's recorded escape-atomicity defect is neither fixed
nor moved.
A block's meaning can depend on the block before it: a table's delimiter row
reinterprets the paragraph above it as the header, and a setext underline
reinterprets the paragraph above it as a heading. Both arrive as a block of
their own first, so re-parsing only the last block left the earlier one
committed to the wrong shape and a streamed table never formed.

reparse_start_line now backs up one block, which costs one extra block
re-parse per tick - bounded by a block, not by the response. The defect test
became a positive test and the table joined INCREMENTAL_FIXTURES, so the
every-three-character-prefix comparison covers it.
chunk_word added every character's width as it walked, then added the run's
width again at the flush. A word spanning two or more spans therefore
measured wider than it draws and broke earlier than its true width, which is
why such a word broke differently from the plain engine.

This changes where rows break, so it could not ride on a cost milestone.
The reference model is corrected with it - a reference that reproduced the
defect would have asserted it - and the comparison tests are renamed off the
pre-M006 framing. a_word_split_across_spans_breaks_at_its_true_width derives
the expectation from the width arithmetic and cross-checks both widths
against the plain engine, which never had the bug: 13 columns fits a
13-column word, 12 hard-breaks it.
prev_was_reasoning was reset inside `if matched.is_none()`, so a text part
that was the searched part left the flag set and the reasoning block after
it drew no header - one row fewer than the same transcript without a search.

The reset is now unconditional: a search recolours rows, it never adds or
drops one. The test pins that invariant three ways rather than flipping an
assertion - the plain transcript draws both headers, the searched one draws
both, and the two total row counts are equal.
The (rN) marker is appended to a message's last row, and that row was
already padded to the full width for the selection bar, so the marker landed
past the drawn columns and ratatui clipped it - an edited message looked
unedited in the side panel.

Two halves: the body wraps at the width minus the marker, and the selection
padding reserves the marker's columns on the row it lands on. The trade-off
is the owner's choice - every row of a revised message is narrower than the
same message unrevised - and only a revised message pays it.
FileTreeState's row inputs stay pub, but a direct write through
file_tree_state. from outside the authority bypasses bump and serves the
previous listing - the one defect M002 exists to prevent. The new
file-tree-row-input-write check rejects an assignment or an in-place mutator
and walks src/tui and tests/tui_render rather than a fixed file list. The
retargeted tasks-whole-list-clone injection is a genuine deep clone again.

a_message_parts_markdown_is_parsed_once now really builds five parts - the
tag form yielded one - and the composer-hint test covers resize mode.

The guard, the architecture rows, the comment-budget bank and the line's
records land here because they are properties of the tree rather than of one
milestone. The bank is a single snapshot, so it can only land once: the
earlier commits do not individually satisfy check_comment_budget.py.
TUI modularity (M001-M010 plus the Halloy mapping and hint-convergence
correctives), Helix capability parity (M001-M009), harness practice
adoption (M001-M007), the sandbox containment audit (C001-C006) and the
advertised-keys corrective (C001-C002) - each milestone implemented and
each with a closure record, plus the cross-line corrective that makes
those records' remaining conditions true.

The load-bearing changes:

- the render-invariant harness (I1-I6) and its ratchets: `[contrast]` is
  0 across the 50 bundled themes, reached by fixing the Halloy
  *projection* (five legibility gates) rather than the third-party
  palettes, which are byte-identical to before. ADR-0062 was accepted
  and then amended: the authority rule is "translated vs named".
- one hint vocabulary. Every advertised key is read from the producer's
  structured items; the I4 residue is 4 reasoned rows; the footers that
  painted no advertisement row at all now paint, and the tasks overlay
  reserves the row its painter draws.
- one dialog frame (`Section`), one panel chrome, content-sized modals,
  a pure `plan_frame`, `ListCursor`, and the slash dispatch split into
  45 family modules - with the guards that went vacuous during that
  split re-pointed and proved non-vacuous.
- the sandbox audit's evidence integrity: the helper reports the ABI its
  own `apply_process_scopes()` returned before `exec`, and the parent
  names it.
- `Diff`'s `End` no longer blanks a two-hunk pane: five per-hunk offset
  applications became one continuous walk, with two mutation-proven
  tests.
- keybind's dead 131-line `Widget` impl is deleted; its comment ceiling
  moved deliberately in the same diff.
- Export's `Esc` gains the app-level dispatch test it was missing.

What this commit does NOT contain, and why: the sandbox Linux narrowing
(`/proc`, `/var/run`) and the CI qualification marker are WP B and WP C
of `five-line-closure-corrective/001`, which the plan gates on this
commit - `#[cfg(target_os = "linux")]` code cannot be observed on the
authoring host. They follow in their own commit, verified by a hosted
run.

Verified on this tree: `scripts/verify.sh full` - 17,380 workspace tests
and 8,444 feature-pass tests, 0 failures; `cargo fmt --all --check`
clean; clippy `-D warnings` clean; render corpus 1237/0.

Plans: 83 files under `plans/`, including ADR-0062 and its amendment,
five closure records sets, and the cross-line corrective's plan and
closure record.
C002's two open items, the residue the closure corrective called a live
control gap rather than evidence debt.

A tree grant on `/proc` made `/proc/<other-pid>/environ` readable for a
same-uid process, and a tree grant on `/var/run` exposed whatever a
distribution keeps under `/run` - including secrets mounted there.
Landlock cannot subtract from a granted tree, so both are now named
narrowly: the self-scoped `/proc` entries, the kernel's informational
files, the read-only sysctl view, and the resolver file that exists.

`/proc/self` resolves to this process's pid directory when the rule is
added and `exec` keeps the pid, so the command keeps its own
`/proc/self/exe`. A *child* of the command has its own pid and does not
inherit it - recorded as a residue, not implied as a guarantee.

Evidence, on real launches:

- `the_default_grant_set_denies_another_processes_proc_entry`: another
  process's `/proc/<pid>/stat` and `/proc/<pid>/environ` are out of
  reach, the command's own `/proc/self/exe` still reads, and the same
  entry reads once the `/proc` tree is restored - so the denial is the
  grant, not the kernel.
- `the_narrowed_grant_set_runs_the_toolchain_and_its_proc_entries_are_load_bearing`:
  the committed matrix. Shell, git, python, resolver and self-proc
  probes pass under the production grant set, and removing the narrow
  `/proc` entries breaks at least one of them, so they are load-bearing
  rather than decorative. Reduced from the plan's three arms to two:
  `/var/run` is no longer granted at all, so a third arm has nothing
  left to remove.
- `the_qualification_lane_obtains_landlock_abi_six`: `ci.yml` sets
  `CODEGG_SANDBOX_QUALIFICATION=1` on the workspace sweep, so a runner
  without a Landlock backend fails instead of skipping and a pre-6.12
  kernel fails the ABI-6 probe instead of passing silently. The marker's
  own spelling is asserted on every host, so a typo cannot disable it.

A unit test pins the grant set itself: no `/proc`, `/var/run` or `/run`
tree, the self-scoped entry present, and nothing naming `environ`.

Verified locally: `scripts/verify.sh quick` (QUICK_RC=0), the policy
suite 22/22, `cargo fmt --all --check`. The Linux fixtures cannot run on
the authoring host; the hosted run is their evidence.
… lane

The first CI run and its A/B baseline agree on one thing and disagree on
another, and both matter.

The narrowing's `/proc/self` entry was wrong as written. The parent
canonicalizes every read root, so `/proc/self` became the *daemon's* pid
directory and was sent to the helper - granting the wrong process and
leaving the command without its own. The per-process aliases now travel
unresolved and the helper resolves them at the pid `exec` preserves,
which is the target's own.

`ci.yml` is red on this branch for a reason that predates the narrowing:
`test_h006_real_background_job_is_observed_by_exact_id_while_work_continues`
fails on Linux on both `a976f7f3c` and its A/B baseline `fe98d86ef`,
identically, before the workspace sweep runs. The sweep's evidence
therefore cannot come from that job until H006 is fixed, so the grants
get a lane of their own: `linux-sandbox-grants-native.yml` builds the
helper and runs only the sandbox fixtures, with the qualification marker
set. That is also the more honest home for the matrix - a failure there
names the grant instead of hiding inside a sweep.

The fixture's self-probe is an *open* by the shell now, not a `stat`:
Landlock does not gate `stat`, so `[ -e ... ]` proved nothing, and a
child's `/proc/self` names the child. `read ... < /proc/self/stat` is
opened at the pid the helper exec'd into.

The descriptor's `/proc` limit is corrected with it: it said the default
grant includes `/proc` and a same-uid environment can be read. That was
true before this change and is false after it; it now states the residue
- a child of the command cannot read its own `/proc/self`.

Also adds `plans/closure/five-line-closure-corrective/002-owner-decisions.md`:
the seven open decisions with their options, costs and recommendations.

Verified locally: `scripts/verify.sh quick` (QUICK_RC=0), fmt, the policy
and sandbox suites, and the comment ratchet with its ceilings moved.
The grant lane builds only the helper, so `target/debug/deps` does not
exist yet and the belt-and-braces copy fails the step before any fixture
runs. `test_helper_path` resolves the helper beside the profile
directory, so the copy is redundant for the plain `cargo test` path -
but it is what the workspace sweep does, and keeping the two lanes
identical is worth one `mkdir`.
… snapshot

The protected mount view snapshots every read root's device and inode and
re-checks them before it builds mounts. A per-process alias cannot pass
that check by construction: canonicalizing `/proc/self` yields
`/proc/<pid>`, so the snapshot would either reject the symlink or report
"sandbox grant path changed its canonical identity" - which is exactly
what the C006 lane reported on the alias-fixed head.

They are names, not replaceable objects, so they are skipped there. The
grant itself is unaffected: the helper still resolves them at the pid
`exec` preserves.
`check_test_filter_execution.py` refuses an unregistered filtered
security run, because a filter that matches nothing is a green step that
qualified nothing. The lane's three tests are named in the entry, so the
guard now asserts they were actually executed and that no self-skip
marker was emitted - which is also what makes the qualification marker
load-bearing rather than decorative.
The registry is an input to the lane - an unregistered step is refused
and a drifted entry is a failure - so a change to it must re-run the
lane that depends on it.
Five fixtures failed on the lane with a bare `Os { code: 2 }` from
`Command::output()`, which says a sidecar is missing without saying
which path was tried. The panic names it now, and the lane prints what
it built. That is a diagnostic for the lane, not a change to any
assertion.
Two errors from the diagnostic run, both real:

- the binding was inserted after its use, which is a compile error the
  Linux-only path hid from the local check - the hosted compiler is the
  oracle for this file, which is exactly why the lane exists;
- the step ran the fixtures multi-threaded. Every other security filter
  in `docs/security-test-filters.toml` runs `--test-threads=1`: these
  fixtures fork a helper and pass it a status pipe, and a concurrently
  forked child inherits another test's descriptors.
…ayout

The hosted grant lane resolved the helper to
`target/debug/build/codegg/<hash>/codegg-sandbox-helper`, which does not
exist, while `target/debug/codegg-sandbox-helper` did. A fixture that
asserts a launch must not depend on where cargo decided to put the test
executable, so the path is now the first existing candidate: the profile
directory, the deps directory, then the workspace target directory. A
missing sidecar still fails the test, and the panic lists what it tried.
The previous commit recorded the measured ratio rather than its
ceiling-rounded value, so the guard read 0.1327 against 0.1327 and
failed. Recorded as 0.1328, which is what `--bank` would write.
Both new fixtures failed on the same thing and it was not the narrowing:
`> /dev/null` was denied because the fixture built a read-only spec from
the read allowances alone. Device nodes are writable under every profile
- `/dev/null` is how a shell discards output - so the spec now carries
`device_write_allowances()` exactly as the product does. The failures
that remain, if any, are about `/proc`.
…CI red

WP B and WP C are done and the property is proved by hosted run
43532152355: 6/6 grant fixtures, including the /proc denial with its
positive control, the toolchain matrix under the narrowed set, and the
ABI-6 assertion. The closure record's criteria 5, 6 and 7 move to met,
and the security section states the two residues the mechanism leaves -
a child's own /proc/self, and pathname AF_UNIX sockets.

The record also carries the finding the A/B produced: ci.yml is red on
this branch on Linux because test_h006 fails identically on a976f7f
and on its pre-narrowing baseline fe98d86, before the sweep runs. That
is the harness line's, not the narrowing's.
Each decision is recorded in the record that needed it, with the options
weighed in `plans/closure/five-line-closure-corrective/002-owner-decisions.md`.

- **001 -> closed.** Criterion 6 accepted structurally and amended to "no
  production rendering file changed as a consequence of M001": no M001-only
  diff ever existed and the tree is one commit, so the original wording
  cannot be read.
- **008 -> closed.** Criterion 4 accepted at 8 of 10 and amended in the plan
  and the roadmap; `dialog_area` and `sidebar_area` are a registered
  follow-up, not a condition. The characterisation matrix's before/after
  claim is accepted on the same structural ground.
- **003 -> closed.** Criterion 1 amended for the `permission.rs` title-badge
  exception, with a `Section` title adjunct registered as a follow-up; the
  corpus diff-note substitute accepted in writing.
- **002 stays conditionally closed**, and that is the decision working: the
  substitute's third leg was accepted in prose, and implementing it -
  `the_minimum_hosted_size_keeps_a_readable_content_row` - showed that
  `HelpDialog::render_into` reserves 3+3+Min(1)+3 rows and paints no content
  at a 20x6 host rect. The assertion is committed `#[ignore]`d with the
  record named, because it measures a defect rather than passing over one.
- **helix 001 and 002 -> closed.** The `space ?` box now reads
  `d / Alt-d / y` and carries `_ - trim the selection to whole lines`, so the
  two verbs a Helix user reaches for are discoverable where they look.
- **helix 009 -> closed.** The single-chain prune is ratified as implemented,
  and it is now disclosed: `history_trimmed` paints
  `- history trimmed at its bound` while the last edit pruned. Derived, not
  latched - an edit that does not prune clears it, and `clear_history` clears
  it with the fallback flag.

Three follow-ups registered in the registry's deferred section: the last two
frame-geometry fields, a `Section` title adjunct, and Help's degradation at
small hosted sizes.

Verified: `scripts/verify.sh quick` (QUICK_RC=0), the editor and help suites
423 passed / 1 ignored, and the render corpus 1237/0 - the keymap edit moved
no recorded frame.
FULL_RC=0 on the decision tree: 17,382 workspace tests (11 skipped) and
8,446 feature-pass tests (6 skipped), 0 failures. The two extra tests are
the ones the decisions added, one of them the ignored Help 20x6
measurement that keeps tui-modularity/002's condition honest.
The helper can stay in server-starting for the whole 60-second
readiness bound with empty stderr. That is not a product assertion.
Routine pull requests and main pushes still run the workspace sweep,
minus that binary. Dispatch with run_live_eggwork to include it.
A status lookup for another session's job returns the same unsuccessful structured result as a missing id. Expecting a tool error made those cases distinguishable and failed the workspace sweep.
The owner check stays an unsuccessful structured not-found result. The extra comment lines crossed the recorded ceiling for this file.
ubuntu sh is dash, which rejects <& above 9 before the probe can observe the descriptor. The control and the contained child now hand that read to bash.
Landlock cannot subtract a deny from a writable ancestor and refuses the launch. The credential stays unread and unwritten; Seatbelt still has to run the child and deny the write.
The broker now maps Execution to a terminal Error and BackendUnavailable to InfrastructureError. A disabled or missing eggsearch service was still returned as Execution, so programmatic repo_search reported the wrong status. The refusal messages are unchanged.
The trim assertion rebuilt and serialized the tree once per added node until it crossed 512KiB. That search is what the hosted run spent 83s on. One measured probe still forces a real over-budget response, and the prefix and reason assertions stay.
The harness starts no worker, so waiting for completion always sat on the tool's timeout plus 30s grace and accepted any non-Disabled error. A queued Python job is the wiring proof. The unwired Disabled control stays.
The project maintainer accepted the compile-unit decision. Milestones 001 and 002 are active. This does not discharge the deferred binary-topology item.
Capture status frames, the constructor-built launch spec, the process-scope ABI record, and the version and cap constants from the unmoved encoder. The equality test compares against these files and cannot regenerate them.
The helper package no longer compiles package codegg, and the frozen fixtures were not regenerated. Root maps SandboxError to ToolError explicitly because the orphan rule forbids From across codegg-core and codegg-sandbox.
Captured from the unmoved encoder at 3b3c75c. The equality test has no capture path, so the fixture cannot be regenerated from the moved projection. Scanner count is 4596 functions under src/tui, tests/tui_render, and the named reverse-edge modules.
Local metadata and the transition guard show the helper package no longer compiles package codegg. Hosted helper-step run id is the remaining condition. A null effect on the cfg(test) compile is not a failure of this milestone.
Move the TUI into codegg-tui and the product bin into codegg-cli so the root library no longer compiles the TUI. The direction guard is in quick and CI. Comment-line ceilings do not rise above the predecessor files; global ceilings fell. Ratio ceilings that rose did so only where code lines left and comment lines did not.
The root library check did not build codegg-tui. The required link, tui_render family, quick, and hosted before/after run ids remain outstanding. A null compile effect does not open a further split.
The product bin left the root package, and codegg-cli was not a default member, so the workspace bin command no longer resolved. Adding that member restores it. cargo build -p codegg --bin codegg still fails, and no root shim was added.

The scoped-selection self-test still named deleted src/tui/app/mod.rs and selected zero targets. It now uses src/server/mod.rs, which selects one root target.
Local helper build, family runs, bin resolution, and quick passed. Both milestones stay conditionally closed: hosted helper-step and cfg(test) run ids are still absent. Not pushed.
The after-move comment-budget self-test failed before the helper build
because a clean checkout has no src/tui. Point the parity module at
crates/codegg-tui and record the synthetic fixture path the file-tree
comments still narrate.
Hosted run 44937196668 compiled the helper without package codegg and
compiled codegg and codegg-tui as separate test-profile units, then
failed because callHierarchy still opened src/main.rs. Record that
observation and point the checkout path checks at src/lib.rs.
Run 44940955257 passed the retargeted LSP path check, so milestone 002 is closed. The compile pair stays an observation, not a precise effect size, and the deferred binary-topology item stays deferred.
Terminal: selecting the panel starts a shell when none is live, and a

panel-route attach focuses the PTY only while the panel holds the keyboard.

A create refused before dispatch clears the in-flight bit, so the next

select or i can retry. i after Esc returns to input without opening the box.

Diff: a completion for a waiting panel adopts the daemon answer into that

panel instead of opening a modal, and every arm ends Loading with the diff,

an explicit Empty state, or the daemon's own Failed reason.

Subagents: SubagentRow::is_running now delegates to is_live_state, so

created, preparing, waiting, and cancelling no longer hide a live child;

interrupted is terminal. Ctrl+T falls back to the adopted rows when no

projection snapshot is available.

Tests: the delegated transcript row-bound fixture uses long lines so path

redaction cannot shrink the capped result below the row bound; the layered

truncation markers now engage deterministically.

Harness: scoped verification replaces its SIGPIPE-prone pipes with

here-strings, so a large selection reaches the widened workspace pass.

Plans: M001-M003 implemented and conditionally closed, with closure records

and registry/roadmap updates.
C001 keeps the check_limits reason, publishes it instead of the previous
provider finish (an interrupt still wins), mirrors provider usage into
total_tokens so the token cap can fire, spends at most one tool-stripped
summary call before the stop, and stops a goal continuation from relaunching
the same capped loop. The daemon now announces a budget stop as awaiting
input rather than an ordinary completion.

C002 puts the follow-up drain inside the same budget and cancellation checks,
propagates a tool-executor error instead of returning Ok(()), reports an
unqueued continuation prompt on the turn result, and closes live-turn intake
before the final drain.

C003 fails the turn on an exhausted unparseable stop_reason=tool_calls in
both the main loop and the follow-up drain, keeping the bounded 600-character
diagnostic and persisting the transcript before the failure path returns.

C004 reads the MCP isError flag through call_tool_structured instead of
marking a failed tools/call result successful.

C005 keeps one receiver per question call, resolves answers concurrently
under the existing 300-second bound, and cleans up with unregister_scoped.

Also carries the completed editor IDE-presence line already present in this
worktree (ADR-0065 and its TUI/desktop/LSP implementation), so the re-banked
docs/comment-budget.toml is consistent with the tree it measures.

Verification: scripts/verify.sh quick, cargo clippy -p codegg --lib -D warnings,
538 agent lib tests, 76 agent_loop harness tests, and the per-module focused
suites recorded in plans/closure/agent-loop-completion-reliability-corrective/.
- alias the scripted provider response type in the three recording
  providers (clippy::type_complexity)
- drop the question-registry test lock; both tests now assert against
  their own session or ids, so no cross-test serialization is needed
  (clippy::await_holding_lock)
- initialize EditorState and EditorLspState with struct update syntax
  (clippy::field_reassign_with_default)
- move the viewport assertion into a const block
  (clippy::assertions_on_constants)

Re-bank docs/comment-budget.toml for the net comment change.
M005 moved the bundled grammar and theme set load off the render thread, so
an integration test that asserts on spans has to wait for the load. The
editor cost fixture already does; the local-edit cache test is the one test
in the render family that still read spans before the load landed, which
made it fail on the hosted runner.

Bank the comment budget for the added test comment.
A resolved reasoning selection was judged with the kernel's fail-closed
policy while only three of the seven adapter families publish a capability
record. On google, local, laguna and generic every dimension is Unknown, so
a persisted Off or any effort selection refused the turn before provider
resolution; MiniMax's declared "disable unsupported" refused it too. No
model call could start.

The shipped policy is now unknown -> Allow (no contract is not evidence of
unsupported), unsupported -> WarnDrop (drop the selection with a notice and
run the turn) and mixed -> WarnDrop. A declared Unsupported dimension is
applied per dimension, ahead of the kernel's overall-status read, so an
operator override keeps its declared fact.

ADR-0050 is amended in place, architecture/model-adapters.md states the
shipped table, and the corrective addendum, implementation plan, closure
record and registry row are added.
The directional walk changed only the slot, so it landed on "Nothing loaded.
Open it from the panel manager" for hosted panels. It now goes through
select_panel, the loader the manager, saved hotkeys, dock and reveal already
use, so Terminal starts its shell, Chat binds and loads its channel, and the
file tree and Files open.

Chat bound only from the active tab, which a fresh session has not populated,
and binding was not loading: nothing asked for the channel list. It now falls
back to the session's own daemon-resolved project and requests the channel when
nothing is loaded (skipped while the Workspace view owns the route, whose
requests are workspace-scoped). A viewless Chat passes keys through instead of
consuming the composer.

with_placement repointed the selected edge without moving the frame, so with
panel_placement "left" the drawn column and the selected edge differed and the
first panel opened in a second column. It now moves the visible edge.

The daemon applied the stored sandbox profile to the human PTY, and the
constrained PTY owner is Linux-only, so every spawn failed on macOS. The human
PTY now runs with the operator's own authority where no constrained backend
exists; Linux keeps the stored profile. Agent shells are unaffected: they run
through bash/terminal on ManagedProcessService, never this route.

Command effects dispatched by family skipped the pre-routers, so
terminal_attach (an InteractiveProcessAttach) returned unimplemented and a
created shell never attached. Pre-routed families now re-enter the one dispatch
path that runs them, and the unhandled-variant warning names the variant.
The interactive PTY is the operator's own shell: an IDE terminal, not an agent
effect. It now carries no sandbox profile and its keystrokes are never filtered,
and stepping onto the Terminal panel focuses it, so the shell opens INS with its
prompt awaiting input rather than demanding "i". Esc still leaves INS for NOR and
"i" returns; agent shells stay on bash/terminal with their resolved profile.

Stepping onto Chat does the same, which fixes a verb it could not receive: the
panel said "press i to write", but without host focus that key fell through to
the app's insert verb and armed the agent composer ([build][LLM]) instead of the
chat channel ([CHAT]).

Opening a document from the /files box never closed the modal it came from, so
the box stayed mounted on top of the editor it had just opened. The tree's
editor handoff now closes it.

Also documents the rule and records the findings: only the two input surfaces
take the keyboard from a step, and a programmatic selection (the Workspace view
showing chat) still never seizes the composer.
F11 replayed error boxes in a fresh session, F12 the shell a walk spawns at
Terminal, and F13 the /editor dead end when nothing was edited recently. None
is fixed here; each is evidence-backed so the next corrective starts from it.
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