Skip to content

feat(runtime)!: bias root work and persist exact tool turn replay - #302

Merged
lg2m merged 156 commits into
mainfrom
feat/eng-1039-ab2-action-prompt
Oct 14, 2026
Merged

lg2m merged 156 commits into
mainfrom
feat/eng-1039-ab2-action-prompt

Conversation

@lg2m

@lg2m lg2m commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

AB2 gives the root agent an action contract after exploration and guides inspection through its declared tools. Instruction discovery supports ignored scopes, safe links, bounded depth windows and exact cursor continuation; read-only children retain their brief.

Search admission reserves complete pages within the 96 KiB turn cap. Requests that cannot fit return a retry without executing or consuming the execution slice; admitted pages retain every row and cursor. Depth-excluded directories advance a resumable frontier so later instructions remain reachable.

After budgeting and checkpoint annotations, session execution persists the exact ordered model-facing replies and correction notice before the next provider request. Descriptor 15 records the strict projection policy; schema 49 adds bounded projection storage after accepted schema 47. Known descriptor 10–14/pre-20 history retains its original generic projector. Ambiguous history, and any checkpoint-enabled tool turn lacking its exact projection, fail only their reservation with an actionable recovery message; healthy sessions continue. This includes final-only reviewers and uses the recorded descriptor without scanning the workspace event journal. Historical 13/14 canonical digests remain pinned.

Compatibility: AB2 explicitly refuses experimental schema 48, whose root notice codec belongs to AB5. The final AB5 schema 50 reader must migrate both 48 and 49. Retained actual schema-47 and schema-48 binaries refuse a new schema-49 store at open without changing metadata/structure. No wire event is added. Reviewer feedback is bounded to24KiB and complete correction notices to32KiB, including Unicode truncation/framing and combined feedback. The extra bounded write per tool turn requires the named latency measurements.

Spec: ENG-1039, docs/plans/action-bias.md (AB2), ADR-0061. Based on actual main 007adcd after #301 merged.

Verification at immutable source fe8fce2: fresh cargo test --workspace -- --test-threads=1 passed 2,386 tests, zero failures, 14 ignored; cargo fmt --all -- --check, cargo clippy --workspace --all-targets --all-features -- -D warnings, and cargo build --workspace passed. Independent writer/barrier, replay and reservation-failure reviews approve. Regressions cover slice accounting, depth continuation, legacy floor/recall bytes, ownership/order/limits, identical/conflicting retries, worst escaping, migration, reopen, failure before another request, healthy-session isolation, oversize/aggregate RED corrections, final-candidate feedback and checkpoint-before-barrier refusal.

Published3b73f315 adds only the ledger receipt. Fresh hosted CI/Codex review, child propagation and named performance qualification remain open; no performance gate is waived.

lg2m added 30 commits October 13, 2026 15:36
Research from the live session store and the Codex, OpenCode, Pi and fx
sources shows why root runs explore instead of finishing. Shell reads
behind a leading `cd` count as work, so no root got a stall report in 30
days. The prompt has inspection-first rules and a per-directory
instruction walk. Reads come in small slices and are re-read, and direct
and read-only runs describe authority they do not have.

The action-bias plan turns this into slices AB1-AB6 with baselines,
owned paths and acceptance, and reserves ADR-0059 for AB4. Docs only.

Refs: ENG-1037
AB1–AB6: preserve analysis-only scope, declare executable direct tools, classify branch mutation aliases, search ignored instruction scopes, bound default reads honestly, keep root notices authority-neutral, and define reproducible qualification metrics and comparator prerequisites.
…bias-integrated

# Conflicts:
#	docs/plans/README.md
AB1: ab1_shell_read_verdicts_preserve_progress_and_audit and ab1_cd_prefixed_reads_report_on_request_sixty_five fail before the classifier change. Preserve the short-run sed write audit trigger. Baseline evidence is recorded; final performance qualification remains open.
AB1: count leading-cd reads and print-only sed as reads; reject known mutation, execution and dynamic-option shapes. Preserve approval semantics, bound lexical work, and share the exact Git listing predicate. Five focused regressions pass; final workspace and matched performance gates remain open.
AB2: ab2_root_contract_preserves_analysis_scope_and_names_next_action and ab2_header_omits_absent_recall_and_spill_tools fail on prompt 19. Read-child and ignored-worktree behavior pass. Pre-change plan compilation, prefix bytes and tool-schema identity are recorded.
AB2: version the action contract, bound exploration guidance and describe only available tools. Cover ordinary ancestors and ignored instruction scopes.
Address second Codex review: output writers, scoped discovery, rendered-line bounds, declared authority, stable completion cutoff and actual-edit cohorts.
AB2: keep the public JSONL identity regression on prompt version 20.
AB1: cover the exact command from the second plan review. Existing implementation already classifies it as work.
…hell-reads

# Conflicts:
#	docs/plans/action-bias.md
#	docs/plans/progress/action-bias.md
AB2: update prompt-version-derived golden digests and test the new action bullet for delegated roles.
AB2: anchor the names regex at a path-component boundary and exclude NOTAGENTS.md in the ignored-root fixture.
AB1: exact -f and --file commands from plan review already count as work; regression suite5 passes.
Address third Codex review with exact instruction basenames, sed program-file exclusions, granted-external authority and unknown scan-cap counts.
…hell-reads

# Conflicts:
#	docs/plans/action-bias.md
#	docs/plans/progress/action-bias.md
…tion-prompt

# Conflicts:
#	docs/plans/progress/action-bias.md
…tion-prompt

# Conflicts:
#	docs/plans/progress/action-bias.md
AB2: the no-tools profile still instructs read_file and other absent tools; captured-request regression fails before the fix.

@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: e4342a5c56

ℹ️ 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 crates/qq-core/src/runtime/run_loop.rs Resolved
Comment thread crates/qq-core/src/tools/search.rs Resolved
Base automatically changed from fix/eng-1038-ab1-shell-reads to main October 14, 2026 18:08
lg2m added 15 commits October 14, 2026 11:11
# Conflicts:
#	crates/qq-core/src/plan.rs
#	docs/plans/progress/action-bias.md
#	docs/plans/progress/root.md
AB2: commit bounded replies and correction notices before the next request; retain known historical projection and refuse ambiguous history. Descriptor15 and schema49 provide the replay boundary. Experimental notice schema48 is explicitly refused until the AB5 schema50 reader includes its codec.
…ling

AB2: retain the typed historical run identity through reservation, then fail only that reservation before loading or provider polling. Cancellation keeps precedence and other store failures remain fatal.
@lg2m lg2m changed the title feat(runtime): bias root prompts toward requested work feat(runtime)!: bias root work and persist exact tool turn replay Oct 14, 2026

lg2m commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review published e93c4e8 against main007adcda after #301 merged. This head includes qualified fixes for all three fresh findings plus a durable projection barrier, descriptor15/schema49, historical replay compatibility and per-reservation failure isolation. Workspace2,382passed/0failed/14ignored; fmt/Clippy/build pass. Earlier settled findings have fixing commits and regression evidence in their threads. Fresh hosted checks and named performance qualification remain open.

@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: e93c4e8a0c

ℹ️ 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".

lg2m added 4 commits October 14, 2026 12:31
…jection

AB2: cap Unicode feedback and the complete combined notice; missing checkpoint-enabled projections fail only their reservation before provider polling. Exact projections remain authoritative and unchecked partial turns remain recoverable without event archive scans.

lg2m commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review published3b73f315. Both fresh checkpoint findings have qualified repairs: bounded feedback/combined notices and refusal of checkpoint-enabled history without its exact projection, using recorded descriptor presence without journal scans. Public corrective request/reopen/zero-provider continuation tests pass. Immutablefe8fce20 fresh workspace2,386/0/14 plusfmt/Clippy/build pass;42focused AB2 cases and independent review approve. Hosted/named performance qualification remains open.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 3b73f3159a

ℹ️ 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".

@lg2m
lg2m merged commit 8b79977 into main Oct 14, 2026
7 checks passed
@lg2m
lg2m deleted the feat/eng-1039-ab2-action-prompt branch October 14, 2026 20:42
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