Directed Evolution vision completion: WorkerRun routing (supersedes #385) + worker completion - #393
Draft
rita-aga wants to merge 10 commits into
Draft
Directed Evolution vision completion: WorkerRun routing (supersedes #385) + worker completion#393rita-aga wants to merge 10 commits into
rita-aga wants to merge 10 commits into
Conversation
…recovery A success-path receipt routing failure previously propagated between SucceedWorkerRun and SucceedWorkItem, stranding the WorkItem in Running (boot backlog only re-claims Queued). Routing is now best-effort on the success path, mirroring the failure path — ResultJson still lands on the WorkItem via SucceedWorkItem. Boot recovery now also fails Running WorkItems claimed by this worker (ClaimedBy-scoped OData filter), failing the attached WorkerRun and routing a failure receipt so the control plane can re-dispatch. Recovery runs only in the pre-loop boot block: in the reconnect loop it would fail work items this process is still executing. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jun 11, 2026
… Codex children The temper kernel (ADR-0041, nerdsane/temper#300) parses the X-Temper-Observe-Metadata header into temper.observation.* span attributes, but the worker sent nothing. Resolve the Directed Evolution join fields from a WorkItem's CorrelationJson once (DirectedEvolutionJoinFields) and reuse them to: - attach the header (producer.work_item_id, producer.worker_run_id, de.role, de.* join fields; kernel limits: 32 keys, 96-byte keys, 1024-byte values) to every worker->Temper action and entity create made on behalf of a DE work item - attach the header to observer runtime OData probes - inject TEMPER_OBSERVE_METADATA and DD_TAGS (de.* datadog tags, appended to any inherited DD_TAGS) into DE Codex child processes mechanically, not just via prompt text The unused create_entity wrapper is removed; all DE creates now go through create_entity_with_observe_metadata. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ompt header directed_evolution_datadog_context previously carried only service/env/work_item/role/target/control_tenant; the episode, direction, generation, variant, stage, stage-result, trial, simulated-user-plan, persona/run index, app_ref, runtime_ref, and runtime_tenant joins were buried in raw CorrelationJson. Resolve them through the shared DirectedEvolutionJoinFields parser (one parse, same source as the ADR-0041 header) and surface them in: - the Datadog context recorded on evidence correlation - a ResolvedCorrelation block (de.* lines) in the DE prompt header Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Simulated-user and evaluator Codex runs previously discovered missing runtime credentials as a confusing 401 inside the Codex child. Before launching a DE Codex role whose correlation carries runtime_base_url, resolve the auth env var names (correlation runtime_auth_env_vars plus the TEMPERPAW_RUNTIME_API_KEY/TEMPER_API_KEY fallbacks, mirroring the observer path) and verify at least one is set. If none is, fail the work item up-front with 'runtime credential missing: none of [names] is set' through the existing FailWorkerRun/receipt/FailWorkItem path. Env var values are never logged. Also assert target types at role dispatch (simulated_user -> Trial, evaluator roles -> StageResult) and fail mismatches with a clear reason; the mechanical evaluator's now-redundant StageResult bail is removed. Worker-side telemetry fail-closed/threshold logic stays out of scope — the genesis router owns it (ADR-0018). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Main gained a repo-health gate capping paw-codex-worker sources at 900 lines; directed_evolution.rs stood at 960 after the merge. Move-only split into directed_evolution/staleness.rs (stage-evaluator targeting, stale stage-result elimination, runtime credential guards; 198 lines) and directed_evolution/receipts.rs (receipt bodies, receipt routing, boot recovery of Running work items; 231 lines), leaving the parent at 542. Worker tests 127/127; the budget gate passes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Single PR for the temperpaw side of the vision-completion effort (one PR per repo by agreement). Supersedes #385 — its two commits are folded in here.
Table of contents
Folded + fixed
fix(de): best-effort success receipt routing + Running WorkItem boot recovery (worker-scoped ClaimedBy filter; recovery only in the pre-loop boot block)Track B worker completion
X-Temper-Observe-Metadata(producer.work_item_id, producer.worker_run_id, de.role + 13 de.* join keys, kernel limits enforced) on every DE action, entity create, observer runtime probe; Codex children getTEMPER_OBSERVE_METADATA+DD_TAGSenv (proven via fake-codex fixture)ResolvedCorrelation:prompt block (one shared CorrelationJson parser)Tests
cargo test -p paw-codex-worker: 127 passed, 0 failed (97 → 127; red→green per phase).cargo clippy --all-targets: clean.Cross-repo dependency / merge order
temper#300 (ADR-0041 + ADR-0138) → arni-labs/genesis#25 (control plane: PawOrchestration WorkerRuns + WorkItemReceipts routing, organism runtime targets) → this PR (+ B10 bump). The deployed genesis runtime must expose the new namespaces before this merges.
🤖 Generated with Claude Code