Skip to content

Sync the portable Claude and Codex workflow practice with the deployed lean agent routing - #57

Merged
seathatflowsinourveins merged 7 commits into
mainfrom
claude/ultracode-token-routing-20260921
Sep 22, 2026
Merged

seathatflowsinourveins merged 7 commits into
mainfrom
claude/ultracode-token-routing-20260921

Conversation

@seathatflowsinourveins

@seathatflowsinourveins seathatflowsinourveins commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

What changes

  • examples/claude-native/ is a byte-identical copy of the deployed agent-lab practice (agents and workflows at agent-lab 549515a plus the 2026-09-22 acceptance-output rule): three agents (source-scout Sonnet/medium for extraction and acceptance commands, run raw through rtk proxy where installed; evidence-reviewer Opus/high and isolated-builder Sonnet/medium with named MCP tools behind ToolSearch), review-changes with an independent recheck stage, readiness-audit, child-usage.mjs, the Codex bridge and the local suites driven by a sibling contract.config.json. ultracode.settings.json moves from small/3 to unrestricted, CLAUDE_CODE_WORKFLOW_MAX_CONCURRENT_AGENTS=8 (per-host rule: start at 8 under the client's default ceiling of 16, raise only after a clean child-usage.mjs --latest run) and CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH=1.
  • The workflows README carries the workflow contract with the 2026-09-22 bullets (opt-in and limits, failure and replay, agent allowlists and skill preloads, profile invariants, version gates) and an Adopt step for the permission source a headless workflow launch needs.
  • examples/codex-native/ adds the matching Codex agent definitions, the [agents] snippet with role registration (marked unverified on an installed CLI) and lanes A–D in recipes/claude-codex-cooperation-lanes.md; recipes/claude-native-ultracode.md updates the model table (Haiku not routed) and the settings text; observability/native-data/README.md documents the per-model PromQL as a follow-up.
  • Two dated records: docs/harness-rules-convergence-20260922.md (manifest of every instruction and harness layer, 49 + 67 verified rules with statuses, placements and overturns) and docs/new-workstation-runtime-profile-20260922.md (planned Threadripper PRO 5975WX / RTX 4090 / 128 GB workstation: sizing, services, corrected clean-install sequence, Codex configuration rules, north-star gates), with evidence/artifacts/harness-rules-convergence-20260922/ (run usage rows and the official-doc excerpts the research children returned).
  • Two 2026-09-21 receipts with sanitized artifacts, the lean-workflow-child-routing decision record, manifest and saturation-audit rows, and the regenerated ecosystem page.

Evidence, both angles

  • Upstream commands. The portable set was adopted into a scratch project and run on Claude Code 2.1.278: test-envelope.mjs 169, test-contract-mutations.mjs 23, test-child-usage.mjs 16, test-usage-receipts.mjs 18, test-codex-envelope.mjs PASS, syntax and claude plugin validate clean, from two working directories. Three headless review-changes runs under the full host profile returned valid envelopes with children on Sonnet/Opus/Sonnet; one readiness-audit completed. A Codex lane C review of the copied files completed with eight findings, all resolved.
  • Observational layer. Runs tagged with OTEL_RESOURCE_ATTRIBUTES=ecosystem.client.scope=<run> show Sonnet and Opus under query_source="subagent"; the two Sonnet children reconcile exactly with child-usage.mjs on all four counters. The Opus child's exported counters cover 10–43 % of its provider-returned usage in two runs, recorded as a finding.
  • Rules research (2026-09-22). Four Ultracode runs on the deploying host (3 + 5 + 1 + 7 agents; 1.35 M child tokens): official docs fetched that day, ECC @dd6ee538, CCBP @15969ed2, claude-code-templates @c840d6f6, awesome-claude-code @1abbc780, VoltAgent @ca7a50b7, anthropics/skills, and the catalog's dated records; every rule carries an independent Opus verdict, and the verifiers' status corrections are applied in the records.
  • The first-prompt figures (42,396 → 12,164 → 8,048; 15,059 for a skill-carrying reviewer) bound a fixed spawn cost on one task and one host; nothing here is a savings rate.

Limitations

  • The review workflow's strict accepted status was not returned during qualification: every native reviewer found defects that were fixed and re-run; fixes after the closing native run are covered by the local suites only.
  • The project-only settings profile is not qualified (provider errors, then a permission-layer refusal because that profile has no rule for the Workflow tool).
  • Codex agent examples inherit model and effort and have no end-to-end run of their own; the [agents."<name>"] registration shape is verified against the openai/codex source at tag rust-v0.155.1 (role files are also discovered from the agents directory; the file's description wins) but not yet exercised in a Codex session.
  • The workstation profile is a projection: nothing was measured on that machine; the runtime ceiling formula is a local convention; no run has completed above eight concurrent agents on any host.
  • Codex Lane C review of the records completed on the fourth attempt (codex-cli 0.155.1, 365 s, 4 findings, 0 high, all resolved: config_file path relative to the config folder, default-cap wording, .wslconfig processor topology, the "mirrors" wording); the earlier attempts failed on a usage limit and then on a stale companion broker token after re-login, a boundary now recorded in the cooperation recipe.
  • Pending rebase: Finalize portable grand catalog with independent Codex and Claude convergence #55 adds examples/claude-native/agents/semantic-evidence-reviewer.md without model/effort, which the agent contract fails; the rebase after Finalize portable grand catalog with independent Codex and Claude convergence #55 and Publish live Claude per-repository evidence for every selected component and record the workflow review #56 merge adds model: opus / effort: high there and re-hashes the manifests.

Checks run on this branch

scripts/validate.py (68 components, 1,475 hashed files, 4 profiles, 130 receipts), scripts/validate_catalogs.py, scripts/validate_foundation.py --root . --json (ok), scripts/validate_convergence.py --all-recorded --root . --json, scripts/build_ecosystem.py --check, python3 -m unittest (OK, 41 skipped), the token-report suite, zizmor on the workflows, git diff --check; the portable suites in the catalog layout; byte-identity cmp against agent-lab for every copied agent and workflow file; an independent Opus read-only review of the branch (14 findings, all resolved: unverified Codex shape labelled, formula labelled a convention, agent-lab paths prefixed, no private content, manifest rows match).

🤖 Generated with Claude Code

…d lean agent routing

examples/claude-native now carries byte-identical copies of the deployed agent-lab
files: three agents (source-scout Sonnet/medium for extraction and acceptance
commands; evidence-reviewer Opus/high and isolated-builder Sonnet/medium with named
MCP tools behind ToolSearch), the review-changes workflow with an independent
recheck stage, readiness-audit, child-usage.mjs for per-child requested/resolved
model and provider usage, the Codex bridge, and the local suites (static contract,
mutation harness, synthetic usage rows, receipt bindings) driven by a sibling
contract.config.json. ultracode.settings.json moves from the small to the
unrestricted size guideline with a task sizing rule. examples/codex-native adds
the matching Codex agent definitions and the [agents] config snippet.

Evidence: receipt ultracode-token-routing-20260921 (first prompt 42,396 -> 12,164
-> 8,048 tokens on one identical task; eight native reviews, a readiness audit, a
builder run and a Codex cross-family review as sanitized usage receipts; Haiku
not routed after an Opus-verified 9/14 vs 14/14 trial) and receipt
portable-claude-native-qualification-20260921 (the portable set adopted into a
scratch project and run natively under the full host profile with a client-scoped
observation that reconciles the Sonnet children exactly; the project-only profile
is recorded as unqualified: provider errors and a permission-layer refusal of the
Workflow tool). Decision lean-workflow-child-routing records the routing, the
sizing rule and the comparisons that would overturn them; recipes gain the
cooperation lanes and the observability README the per-model query.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Codex reviewed 73f4334 against fb04bf7 (five findings, stored as
codex-pr-review.json in the qualification bundle): the two new receipts and
artifact bundles now publish at the current revision instead of the immutable
base; the decision record keeps the project-only boundary in its scope and
lifecycle; the observability README scopes a run by the client_scope label rather
than the instance label; the recipe states inventory and recheck coverage
separately; the Codex agent documents say that sandbox_mode is not set and the
reviewer's no-edit rule is a prompt instruction.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
The portable review-changes workflow reviewed 73f4334 headlessly inside this
checkout with its agents supplied inline (stored as claude-pr-review.json in the
qualification bundle): the guide is regenerated from the current deployed record
so its checks, owned files and the sync sentence match the shipped copies; the
decision limitations carry the project-only boundary; the recipe names both
readiness audits; the exporter coverage figure reads 10% in the guide and the
receipt alike.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
The convergence overview said 44 while catalogs/foundation/decisions.json held 46 at the base and 47 with lean-workflow-child-routing.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…ation profile into the portable practice

The twin moves from three fixed concurrent agents to the per-host rule
(start at 8 under the client's default ceiling of 16; the min(16, CPUs - 2)
formula is a local convention) and sets CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH=1.
The workflows README adds the Adopt step for a permission source covering the
Workflow tool and the contract bullets for opt-in and limits, failure and
replay, agent allowlists and skill preloads, profile invariants and version
gates, with the official-doc excerpts retained as an artifact. source-scout
and review-changes run acceptance commands raw through `rtk proxy` where
installed (byte-identical to agent-lab). The Codex example registers each role
under [agents."<name>"] with config_file and description, labelled unverified
on an installed CLI. The routing guide's cache key name is corrected.

New dated records: docs/harness-rules-convergence-20260922.md (layer
manifest, 49 + 67 verified rules with statuses, placements and overturns) and
docs/new-workstation-runtime-profile-20260922.md (Threadripper PRO 5975WX /
RTX 4090 / 128 GB projection: sizing, services, verifier-corrected
clean-install sequence, Codex configuration rules, sim-paper-live gates),
with evidence/artifacts/harness-rules-convergence-20260922/ (run usage rows,
the blocked Codex Lane C attempt, official-doc excerpts).

Checks: validate.py (68 components, 1,475 files, 4 profiles, 130 receipts),
validate_catalogs, validate_foundation ok, validate_convergence, build --check,
unittest OK (41 skipped), token-report suite, zizmor, git diff --check, the
portable suites (169/23/16/18/PASS); an independent Opus read-only review
returned 14 findings, all resolved. No private content; manifest rows match.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…source

codex-rs/agent-roles/src/{agent_role_config,loader,discovery}.rs at tag
rust-v0.155.1, read through the GitHub contents API and retained in
evidence/artifacts/harness-rules-convergence-20260922/codex-agent-roles-source.json:
[agents.<name>] entries carry description, config_file and nickname_candidates;
role files hold name, description, nickname_candidates and config keys such as
developer_instructions with unknown keys rejected; every .toml under the agents
directory is discovered without a table entry; a declared config_file is not
loaded twice; the file's description wins over the table's; duplicate names in
one layer warn; a description is required. The Codex example, its README and
the workstation profile now say so instead of "unverified"; the registration is
still not exercised in a session. The second Lane C attempt failed on the same
Codex usage limit and is recorded in runs.json.

Checks: validate.py, validate_catalogs, validate_foundation ok, build --check,
unittest OK, zizmor, git diff --check.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Fourth tracked job on codex-cli 0.155.1 (365 s, four findings, none high; the
first two attempts failed on a Codex usage limit and the third on a stale
companion-broker token after re-login): config_file in the Codex example is
relative to the config folder (agents/<name>.toml, not .codex/agents/...);
min(16, CPUs - 2) is the client's default cap per the bundled
/workflow-authoring reference and the setting accepts 1-256, so the twin
CLAUDE.md and recipe say so; .wslconfig processors counts logical processors
(5975WX: 32 cores / 64 threads, plan moved to 60 with a topology check); the
Codex thread cap is a separate client limit, not a mirror of the Claude
setting. runs.json records all four attempts; the cooperation recipe records
the broker-restart boundary after codex login.

Checks: validate.py, validate_catalogs, validate_foundation ok, build --check,
unittest OK, zizmor, git diff --check, portable suites.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
seathatflowsinourveins added a commit that referenced this pull request Sep 22, 2026
… union

The union kept #57's corrected count in docs/full-stack-convergence.md but #55's stale 46 in catalogs/foundation/README.md; decisions.json holds 47 at every parent. Explorer regenerated and rehashed. Found by the independent evidence review of the integration.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
seathatflowsinourveins added a commit that referenced this pull request Sep 22, 2026
…e corrected default/override explanation

PR #55's paragraph called min(16, CPUs − 2) the runtime ceiling; PR #57 had corrected it to the client default that the setting overrides (1–256). Found by the bounded Codex cross-family review of the integration.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@seathatflowsinourveins
seathatflowsinourveins merged commit 38625bb into main Sep 22, 2026
5 checks passed
seathatflowsinourveins added a commit that referenced this pull request Sep 22, 2026
Merges the four open PRs (#55 with #56, #57, #58) into main with unioned shared indexes; validators, unit tests, CI, an Opus evidence review and a bounded Codex cross-family review passed on the branch. Co-Authored-By: Claude Fable 5.1 <[email protected]>
@seathatflowsinourveins
seathatflowsinourveins deleted the claude/ultracode-token-routing-20260921 branch September 25, 2026 18:47
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