Skip to content

Preserve Worker selector and effective binding validation for external delegation #161

Closed

Description

@NOirBRight

Split from #156. This Issue owns only the CodexHub adapter contract for Worker selector preservation and supported effective-binding validation.

Problem

spawn_agent.agent_type=worker is advertised at the adapter boundary but can be removed or weakened during normalization/history processing. The adapter also lacks a fail-closed contract for supported effective agent type, model, and reasoning readback, so requested settings can be mistaken for effective execution evidence.

Outcome

CodexHub preserves the explicit Worker selector across every adapter stage, or rejects it before child execution, and consumes supported effective binding readback to prove the selected agent type, model, and reasoning. Missing, unknown, contradictory, rejected, or GPT-substituted results fail closed before edits.

Scope — CodexHub adapter only

  • Preserve spawn_agent.agent_type=worker across tool declaration, argument normalization, call execution, response normalization, and history replay.
  • Reject unsupported agent_type values before child execution; do not delete, coerce, or silently substitute them.
  • Consume the Host/runtime's supported effective agent type, model, and reasoning readback.
  • Require effective readback to agree with the requested Worker selector, third-party model, and reasoning before edits begin.
  • Fail closed for missing, unknown, contradictory, rejected, unsupported, or GPT-substituted readback/results.
  • Emit sanitized, machine-classifiable telemetry for selector preservation/rejection and effective-binding validation outcomes.
  • Add deterministic tests and a focused sanitized fixture derived only from shapes, enums, and synthetic values.

Non-goals

Acceptance criteria

  • agent_type=worker survives declaration, normalization, call execution, result normalization, and history replay unchanged.
  • An unsupported selector is rejected with a sanitized terminal classification before child execution.
  • Supported readback proves the effective agent type, model, and reasoning and matches the request before edits.
  • Missing, unknown, contradictory, rejected, unsupported, or GPT-substituted readback/result stops before edits.
  • Existing supported non-Worker collaboration behavior remains unchanged.
  • Telemetry contains no credentials, prompts, private Task/callback identifiers, rollout data, or local paths.

Minimal deterministic tests

  1. Worker selector survives declaration, normalization, execution, response normalization, and history replay.
  2. Missing and unsupported selector values reject before child execution.
  3. Effective readback matching the requested Worker/model/reasoning passes.
  4. Missing, unknown, contradictory, rejected, unsupported, and GPT-substituted readbacks each fail closed before edits.
  5. Sanitized telemetry records only stable classification fields and synthetic fixture values.

Verification

python -m pytest -q tests/test_codex_semantic_adapter.py
python -m pytest -q tests/test_routing.py -k "agent_type or binding"
python -m pytest -q
git diff --check
python scripts/report_quality_gates.py

Run the full Python suite once at the candidate commit. python scripts/report_quality_gates.py is report-only.

Expected hotset

  • src-python/codex_semantic_adapter.py
  • src-python/codex_proxy.py only where the selector/effective-binding result crosses the adapter boundary
  • tests/test_codex_semantic_adapter.py
  • focused routing tests for agent_type/binding
  • one focused sanitized fixture under tests/fixtures/ if required

Relationships

Execution contract

Execution-Contract: v2
Verification-Class: strict
Verification-Commands: targeted tests/test_codex_semantic_adapter.py; targeted routing tests for agent_type/binding; full Python suite once; git diff --check; python scripts/report_quality_gates.py report-only
Manual-Evidence: none; consume only supported effective readback supplied by the Host/runtime contract in #156
Architecture-Decision: resolved
Review-Owner: orchestrator

Activity

  1. added
    bugSomething isn't working
    ready-for-agentFully specified, ready for an AFK agent
    wayfinder:taskWayfinder implementation task
    on Jul 16, 2026
  2. self-assigned this
    on Jul 16, 2026
  3. NOirBRight commented on Jul 17, 2026

    @NOirBRight
    OwnerAuthor

    Implemented and merged to dev via PR #165 (#165).

    Evidence:

    • merge commit: 4bb1acb0de2cc1980c6282dbe7b78b4e343f78ef
    • final local Python suite: 1209 passed, 1 skipped, 320 subtests
    • final routing module: 461 passed, 124 subtests; semantic adapter 35 passed; dedicated signing 2 passed
    • independent review: Spec PASS; Task Quality APPROVED; 0 Critical/Important/Minor findings
    • GitHub CI run 29544329286: Python, frontend/UI contract, Rust normal/debug, clippy, and release flavor jobs all passed

    The CodexHub adapter now preserves Worker/general selectors across body, native SSE, converted Chat SSE, semantic repair, and replay; missing/unsupported/generated selector failures stop before executable emission; original Worker/model/reasoning bindings are signed and call-correlated; supported effective readback is validated fail-closed. Live sidebar Worker materialization and Host readback production remain owned by parent gate #156.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingwayfinder:taskWayfinder implementation task

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions