Skip to content

rebase: port harness-tier support, wheel hardening and bridge host env to main - #432

Merged
tzhouam merged 1 commit into
mainfrom
fix/port-rebase-harness-tier-and-wheel-hardening
Oct 27, 2026
Merged

tzhouam merged 1 commit into
mainfrom
fix/port-rebase-harness-tier-and-wheel-hardening

Conversation

@tzhouam

@tzhouam tzhouam commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

Why

Reviewing the v0.33 → main rebase campaign runs surfaced six engine defects (two runs blocked before the first module; the module loop could not have succeeded past them). This PR ports the operative rebase work from the local feat/rebase-main-v0320 branch to main and fixes all six.

Fixes

  1. Harness tiers as rebase backends — _tier_client / _harness_completion_client route a kind="harness" tier (cursor / zcode / claude-code) straight to the session transport; previously an OpenAI-compatible client was built with an empty api_key. Reviewer routing and the CI debug attempt use the same path and own completion signal (signals/module.<m>.done).
  2. Consistent module budgets — adapter declares module_timeout_sec == module_max_timeout_sec (the cap can no longer silently truncate the planned budget); the live prompt carries the real TEST_TIMEOUT_SEC and keeps bridge polls under the client-side deadline (pinned by test).
  3. Bridge host env from explicit facts — the MCP bridge rebuilds _agent_shell_env from spec host_env (CUDA_VISIBLE_DEVICES, HF_HOME) instead of relying on values the transport's sanitized_env() had already dropped. No os.environ mutation; test_env_guardrail stays green.
  4. Read audit ≠ refusal — upstream / target-venv roots are declared via AgentSessionRequest.read_roots; reads outside the roots are traced (harness_read_audit) rather than vetoing an otherwise completed module.
  5. Honest cursor-agent session failures — a session that ends without a result event reports exit code + stderr tail as a failure (stop_reason="error"), not an empty success.
  6. Wheel / lifecycle hardening — packaging declared in pyproject; baseline venv for main-tracking campaigns; upstream scratch kept on non-done exits (blocked/crashed runs are resumable); the manifest's parent knowledge-store block that blocked prelude on a fresh host is removed.

Also

  • test/fixtures/** excluded from pytest collection (its conftest.py shadowed the suite's, breaking test_chat/test_cli/test_phase_b).
  • Repo-vocabulary ceilings raised only for identifier-level parity names (vllm_path, vllm_paths, omni_files); new prose was neutralized instead.
  • SPEC pages re-verified against 2026-10-27.

Verification

Full pytest -q test green locally; tools/check_spec_freshness.py --strict → 0 stale; check_doc_links.py / check_doc_citations.py OK; knowledge/tools/check_knowledge_tree.py / check_wiki_lint.py OK.

…v to main

Ports the operative rebase work from feat/rebase-main-v0320 and fixes the
six engine defects found while reviewing the v0.33 → main campaign runs:

1. Harness tiers (cursor/zcode/claude-code) are first-class rebase
   backends: `_tier_client` / `_harness_completion_client` route a
   `kind="harness"` tier straight to the session transport instead of an
   OpenAI-compatible client with an empty api_key; reviewer routing and the
   CI debug attempt follow the same path and carry their own completion
   signal.
2. Module attempt budgets are consistent end to end: the adapter declares
   `module_timeout_sec == module_max_timeout_sec`, the live prompt tells the
   agent the real `TEST_TIMEOUT_SEC`, and bridge polls stay below the
   client-side deadline (test pins the invariant).
3. The MCP tool bridge rebuilds the agent shell env from explicit spec facts
   (`host_env`: CUDA_VISIBLE_DEVICES / HF_HOME) rather than from whatever
   survived the transport's sanitized environment — no `os.environ`
   mutation, so the env guardrail stays intact.
4. Session read audit distinguishes reads outside the declared roots from
   refusals: upstream/venv roots are declared via `read_roots`, and an audit
   note is traced (`harness_read_audit`) instead of vetoing a completed
   module.
5. cursor-agent sessions that exit without a result event are reported as
   failures (exit code + stderr tail) rather than as empty successes.
6. Wheel step: `packaging` dependency declared, baseline venv for
   main-tracking campaigns, scratch kept on non-done exits so a blocked or
   crashed run is resumable; the knowledge parent-store block that blocked
   prelude on a fresh host is gone.

Also: fixture trees under test/fixtures are excluded from collection (their
conftest shadowed the suite's), repo-vocabulary ceilings updated for the
identifier-level parity names only (prose neutralized), SPEC pages
re-verified against 2026-10-27.
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-27T11:12:23.176543Z
We couldn’t complete this review. Comment @codex review to try again.
b0c54c0 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

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@tzhouam
tzhouam merged commit 672810e into main Oct 27, 2026
10 checks passed
@tzhouam
tzhouam deleted the fix/port-rebase-harness-tier-and-wheel-hardening branch October 27, 2026 11:25
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