Repository navigation
Description
Overview
Make Codex delegation selective and reduce repeated context/coordination while retaining Brain/Mind gates and preserving Claude delegation. Add a read-only completed-task usage report and comparison protocol.
This task is explicitly authorized to use a separate PyAutoBrain/PyAutoMind worktree concurrently with codex-hook-parity; it must preserve that task's branches, claims, and changes.
Plan
- Split provider policy: preserve Anthropic delegation semantics exactly, while making OpenAI execution direct by default with bounded delegation exceptions.
- Retain Brain/Mind routing, approval and health gates, registries, conflict-aware worktrees, and independent review while reducing repeated ceremony.
- Slim auto-loaded instructions through task-specific linked references, concise skill descriptions, and authoritative generated blocks.
- Bound delegated context, coordination, responses, repeated checks, and chat-visible logging.
- Add a privacy-conscious, read-only completed-task usage meter and a documented 3–5-task comparison protocol without inventing billing or savings.
Detailed implementation plan
Affected Repositories
- PyAutoMind (primary)
- PyAutoBrain
Branch Survey
| Repository | Current Branch | Dirty? |
|---|---|---|
| ./PyAutoMind | main | clean except this task's approved draft prompt |
| ./PyAutoBrain | main | clean |
codex-hook-parity actively claims both repositories. The user explicitly authorized an isolated concurrent worktree for this task. Its worktree, branches, claims, and changes must not be modified.
Suggested branch: feature/codex-token-efficiency
Implementation Steps
- Split delegation policy by provider in the workspace-root
AGENTS.md,PyAutoBrain/skills/WORKFLOW.md, and dependent start/ship documentation. Preserve Anthropic's Fable → Opus, Opus → Opus, Sonnet mechanical-floor, and tutorial-prose behavior exactly. For OpenAI, make direct execution the default and delegate selectively for independent parallel work, noisy or long-running execution, and independent review. - Retain Brain/Mind routing, planning and approval gates, task registries, conflict-aware worktrees, Heart gates, and independent review. Reduce overhead without bypassing these controls.
- Slim auto-loaded instructions and workflow prose by moving task-specific detail behind links, keeping skill descriptions short and unambiguous, and preserving generated blocks as authoritative rather than duplicating them.
- Bound coordination: delegate with minimal relevant context, require concise structured returns, reuse a worker for coherent follow-ups, avoid repeating unchanged checks, and keep full execution logs outside chat while returning only decision-relevant excerpts.
- Add a read-only, standard-library usage meter, tentatively
PyAutoBrain/bin/codex_usage.py, with meaningful parser fixtures. It must read only explicitly selected rollout files, extract and report metadata only, use the last cumulative counters, cache results separately, treat cached input as included in input and reasoning as included in output, summarize every observed model/effort value, document explicit parent/child de-duplication and inherited-event uncertainty, avoid raw conversation content and secrets in output, keep missing usage unknown/incomplete, and report duration and coordination counts without claiming causality or inventing billing. Document a comparison protocol across 3–5 completed tasks including outcome, corrections, and total parent/children where aggregation is reliable; no new expensive runs are required. Astra Medium is already configured; do not add an unnecessary local configuration edit.
Validation
- Run the relevant existing skill, installer, and documentation checks.
- Run focused fixture tests for the usage-meter parser, cumulative-counter handling, parent/child de-duplication and aggregation uncertainty, privacy boundary, model/effort changes, and malformed or missing input.
- Keep any workspace-root
AGENTS.mdupdate reproducible through an appropriate tracked PyAutoBrain documentation/install step rather than relying on an unexplained local-only patch. - Snapshot before/after byte counts for commonly loaded instructions and skill metadata.
Key Files
PyAutoBrain/skills/WORKFLOW.md— concise shared workflow and provider routing.PyAutoBrain/skills/— dependent start/ship references and concise discovery metadata.PyAutoBrain/bin/codex_usage.py— explicit-file read-only usage reporter.PyAutoBrain/tests/— meter and workflow-policy fixtures.PyAutoBrain/AGENTS.md,PyAutoMind/AGENTS.md— slim auto-loaded guidance without damaging generated sections.- Tracked PyAutoBrain install/template documentation — reproducible workspace-root policy update.
Original Prompt
Click to expand starting prompt
ok do all 5, but delegation works very well on claude so ensure we dont lose the delegation policy there.
Follow-up authorization:
Allow a separate worktree
Activity
prompt: file Codex token efficiency issue (#409)
prompt: record Codex efficiency PR and RED override (#409)
Jammy2211 commentedon Sep 18, 2026
Development RED override exercised — PR open
The live human authorized task #409 contemporaneously:
Exact current Heart reasons at shipping:
install verification FAILED (testpypi; checks F)release validation FAILED (stage integrate)manifest drift: remote-session blocks (generated) — 2 mismatch(es) vs PyAutoMind/repos.yamlPassed branch gates: PyAutoBrain full suite 915 passed; focused suite 41 passed; four changed skills validated; live usage smoke matched the audited counters and all 80 collaboration calls; independent working-tree review CLEAN.
The authorized development actions are complete: commit
a7d8fce, normal push, and pending-release PR PyAutoLabs/PyAutoBrain#387. Heart remains RED. This authorization does not permit merge, release, release rehearsal, required-check bypass, branch-protection bypass, or any claim that the branch repairs Heart.Jammy2211 commentedon Sep 18, 2026
Shipped
Merged PyAutoLabs/PyAutoBrain#387 at reviewed head
a7d8fce(merge commit0a21749). Codex now uses direct execution for routine sequential work with bounded delegation, while Claude's Fable/Opus/Sonnet policy is preserved. The workflow core is smaller, the explicit-file usage meter and comparison protocol are included, and workspace-root activation is reproducible through the installer.Validation: 915 full Brain tests, 41 focused tests, four skill validations, live counter/80-call smoke, independent review CLEAN, and all PR checks green. The development RED override remains a historical shipping fact; this merge did not resolve Heart's install/release failures.
complete: codex-token-efficiency (#409)
complete: timing-noise-audit-p6 (autolens_profiling#408) + p7 (#409) …