Repository navigation
Fix managed Codex supervision and prepare Foreman 0.5.1 - #56
Merged
Merged
Conversation
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.
Codex model rejections previously looked like ordinary worker failures, and managed sessions could run a second Foreman supervisor through native hooks. Completion evidence also lost implementation and documentation details when compaction cut a small Git diff before repeated worker output.
This change makes model-access failures escalate with configuration guidance and no model fallback, adds explicit
FOREMAN_CODEX_EXECUTABLE/FOREMAN_CODEX_MODELoptions while retaining native defaults, and bypasses native Foreman hooks inside factory-owned children. It normalizes completed App Server output, adds verification lifecycle evidence, and reduces bulky transcripts before source/test evidence. Decision thresholds remain unchanged. The package version and release notes are prepared for 0.5.1.Validation:
twine checkpass.jev-1.13.0) and OpenAI (gpt-6-luna) full managed runs each reached FINISHED on fresh isolated copies offoreman-test-app, with one coding worker, one independent verifier, and 33 passing tests. Both used Codex 0.162.1 with the same nativegpt-6.1-solworker configuration; no worker-model override or global configuration change.Prepared release notes
Review before merge. No 0.5.1 tag, GitHub release, or PyPI publication has been created. After approval and merge, publish
v0.5.1through the existing Trusted Publisher workflow.Detailed validation evidence is retained here for review; the one-off report and its links have been removed from the repository. Reusable configuration and troubleshooting guidance remain in the normal docs.
Detailed validation evidence and intermediate results
Decision-model adapter validation
Validation performed on 2026-10-13 for the decision-model adapter changes. This records actual
results from both live decision providers; it does not establish general model accuracy.
Offline and package validation
3.12 environment. The clean environment used TypeSafe SDK 0.7.4 and OpenAI SDK 2.54.0.
git diff --checkpassed.httpx.MockTransport. They exercise theDecisions URL and payload, evidence grouping, responsibility/group routing, refusals, malformed
answers, HTTP errors, cancellation, client ownership, credentials, and both CLI supervision paths.
These tests do not make live OpenAI API requests.
Live Jev comparison
The existing
foreman-test-appcalculator was copied into isolated directories. Its original fivesource/configuration files were hashed before testing and matched afterward; its pre-existing
working-tree changes were preserved. The test copies replace the repository's old smoke-test
instructions with instructions authorizing this isolated test.
The job adds
Calculator.square_root, negative-input errors, parametrized tests, and READMEexamples, with independent verification. Actual pytest executions supply the evidence:
The adapter requested
jev-latest; the API returnedjev-1.13.0. Live routing activated theconditional documentation responsibility with a score of 0.99. These are observations from one
small repository, not assertions of calibrated probabilities.
A separate full managed run used a real Codex App Server coding worker and independent verifier.
Both workers completed, and the verifier passed all 33 tests. The factory nevertheless ended in
ESCALATEDat its two-worker limit because its final completion judgments did not meet policythresholds. Native Foreman hooks were also active inside the worker sessions. This run validates
live routing, assessments, worker integration, and verification transport; it does not validate a
successful end-to-end
FINISHEDoutcome. No thresholds or policy were changed to force completion.The coding worker used
gpt-5.5, independently of Jev. Earlier worker connection attempts wererejected by the local Codex CLI/account and produced no calculator changes.
Live OpenAI comparison
The OpenAI adapter made real requests to
POST /v1/decisionsusing the same frozen calculatorobservations and the same six completion, verification, and documentation predicates as Jev.
The requested and returned model was
gpt-6-luna. No worker was launched or worker model selectedfor this comparison. A key from the user-authorized sibling repository was loaded only into the
test process; no credentials were copied into Foreman's repository or committed.
Live OpenAI routing activated the conditional documentation responsibility with a score of 1.00.
The original calculator files still match the recorded hashes. Both providers scored the incomplete
and regressed states below the configured completion minimums and the verified state above them
in this controlled comparison. This validates the router/check adapters on this example, not a
successful full managed OpenAI worker lifecycle or calibrated model accuracy across repositories.
Worker-model scope
FOREMAN_DECISION_PROVIDERandFOREMAN_DECISION_MODELconfigure only routing and checks.Worker-model fields and worker selection in the runtime are unchanged. The temporary worker
model overrides used in the separate managed experiment were local test-harness files outside
this repository and have been removed. Regression tests verify that central decision configuration
cannot change a managed worker's backend, model, existing OpenAI key, or existing OpenAI endpoint.
PR #54 merged on 2026-10-15 as
cfe4ad51aa85b2dd814322661b8931f94a4b904e. Its merge receipt was stored in ThruWire Devand read back. The historical results above describe the adapter PR before the follow-up worker fixes.
Managed-worker follow-up validation: 2026-10-15
The 0.5.1 candidate addresses two distinct problems: Codex worker model-access failures, and
incomplete or conflicting completion evidence. The worker model remains separate from the
Jev/OpenAI decision provider.
The original saved Jev managed run ended with
ready_to_finish=0.74, below the unchanged 0.75minimum, despite both workers exiting successfully. Its output also contained a native Foreman
hookPromptasking for more implementation work inside the factory-owned verifier. Managedworkers now bypass that duplicate attached supervisor. Completed Codex App Server items expose
actual command output and agent text rather than escaped protocol objects and repeated patches.
Verification evidence includes explicit started/completed lifecycle flags.
A new Jev run exposed another evidence loss: compaction reduced a 2,758-character Git diff to
1,406 characters and omitted the new square-root implementation and negative-value documentation
in the middle. Its documentation score stayed below the minimum, and two coding workers exhausted
the test's worker budget without a verifier. Compaction now reduces bulky transcripts first.
Replaying that saved observation retains the complete small diff within the existing request
limits. Regression tests cover both Jev and OpenAI budget profiles. No decision thresholds changed.
A live connection probe reproduced the installed Codex 0.154.0 failure for the native
gpt-6.1-solsetting: Codex rejected it with a ChatGPT-account model error. Foreman classifiedthat response as a worker configuration error and retained the configured model. The complete
0.162.1 CLI succeeded with the same account and native model. This fixes neither account
entitlements nor an old CLI in place: deployments must select an installed compatible Codex
version using
PATHorFOREMAN_CODEX_EXECUTABLE.Full managed runs
Both decision providers then supervised the same square-root job on fresh isolated copies of
foreman-test-app, starting with 25 passing tests. Both used the complete official Codex CLI0.162.1 package and the same native
gpt-6.1-solworker configuration, without a model override.No global Codex executable, authentication, or model configuration was changed. A command-execution
probe verified the temporary installation before the successful runs. An earlier probe with only
the CLI binary could connect but lacked
codex-code-mode-host; those failed startup attemptsare excluded from the successful results below.
The harness allowed two workers, 40 assessments, a 300-second worker deadline, and a 480-second
factory deadline. Check definitions and minimum thresholds used the repository defaults. Test-copy
instructions directed workers to use the test Python environment and leave independent verification
to Foreman's separate verifier. User-authorized credentials were loaded only into the supervisor
process. The original test-repository files still matched their recorded hashes afterward.
jev-1.13.09bcb6231232fFINISHEDgpt-6-luna5fc31764bca7FINISHEDEach run launched exactly one coding worker and one verifier; both workers completed with exit
code zero. Neither worker transcript contained a duplicate native Foreman completion prompt.
Live documentation routing scored 0.99 for Jev and 1.00 for OpenAI. Final check scores were:
Intentional regression and offline checks
A further copy of the completed calculator replaced
return math.sqrt(value)withreturn value.Actual pytest execution returned exit code one with 3 failed, 30 passed. That same failed
verification evidence was assessed through both live adapters using the built-in checks and
policy. This was an evidence replay, not another autonomous worker lifecycle. Jev scored
requirements/ready/tests at 0.02/0.02/0.02; OpenAI scored them at 0.00/0.00/0.00. Both selected
START_WORKER, and neither selectedFINISH.The candidate passes 483 Python tests from source and from its wheel installed into the clean
Python 3.12 environment, all 27 Pi/Pi Durable tests, Ruff, local documentation-link checks,
git diff --check, distribution builds, andtwine check. Offline tests cover explicit workermodel/executable settings, provider model-error classification, escalation without a semantic API
call, duplicate-hook bypass, completed-item output, pytest parsing, and evidence compaction.
These live results validate this small repository and configuration; they do not establish general
model accuracy or guarantee completion on other jobs.