[K6] Add bounded Codex app-server Runtime adapter #26
No reviewers
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Creatidy/creatidy-kernel!26
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "issue-8-runtime-codex"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #8 after owner integration; keep issue open during review.
Implements an opt-in Codex app-server stdio transport and Runtime adapter using native thread/start, turn/start, thread/read and turn/interrupt. The trusted controller supplies pinned Attempt input resolution, a durable Operation claim, schema method inventory for the installed binary, and trusted candidate collection. Unknown effects are not redelivered; known accepted handles can be restored and reconciled. Generated-turn identity remains unknown where unattested; turn completion is not acceptance. No live credentials, custom wire protocol, OS isolation claim, or Program scheduler.
Validation:
uv run --locked pytest tests/test_codex_runtime.py tests/test_codex_stdio.py(19 passed),make check(509 passed; all gates),make package-check(passed). No dependency/tooling change; audit not applicable.Risk: the native initialize handshake does not supply a method inventory, so the caller must provide a matching generated-schema inventory; no live Codex integration was exercised.
PR Review: [K6] Add bounded Codex app-server Runtime adapter (#26)
Repository: Creatidy/creatidy-kernel
Branch: issue-8-runtime-codex -> develop
Frozen head:
f80e61c78fLinked issue: #8 ([K6] Runtime port and Codex app-server adapter)
Summary
Adds
src/creatidy_kernel/adapters/codex_stdio.py(opt-in JSON-RPC stdio transport for the Codex app-server: pinned--versionprecheck,initialize/initializedhandshake, correlated request/response, bounded buffers, fail-closed on malformed/uncorrelated/server-initiated messages, no retry after uncertain delivery) andsrc/creatidy_kernel/adapters/codex_runtime.py(Runtime adapter over nativethread/start,turn/start,thread/read,turn/interruptwith trusted-controller input resolution, durable-claim authorization, unknown-on-uncertain semantics, requested/resolved/observed identity separation, and terminal-replay protection). README updated honestly, including that the native handshake advertises no method inventory. 5 files, +929/−3.Intent / Acceptance Evidence
Independent verification at the frozen head (clean local checkout of
issue-8-runtime-codexatf80e61c):uv run --locked pytest tests/test_codex_runtime.py tests/test_codex_stdio.py— 19 passed.make check— 509 passed;uv lock --check, ruff format/check, basedpyright (strict), lint-imports, secret scan,git diff --checkall passed.make package-check— wheel metadata/license, sdist rebuild, isolated install passed.grep -ri codex src/creatidy_kernel/core/ src/creatidy_kernel/ports/— no matches;tests/test_boundaries.pypasses unchanged.tests/test_codex_runtime.pyassertsrequested=="model-one",resolved=="model-one",observed is None; suite is Codex-specific (see gaps)test_lost_replies_are_uncertain_and_never_duplicate_turns,test_native_start_duplicate_and_terminal_replay,test_quiet_healthy_work_and_cancel_race,test_restart_requires_durable_handle_and_missing_session_stays_unknownreconcilereturns UNKNOWN (never invented ABSENT);CodexRejectedraised on resolved-model mismatch after successful transport;observedforced to Nonetest_capability_and_version_mismatch_fail_before_deliveryassertsconnection.calls == []; constructor checks version, required native methods, trust mode, network/mount policy, sandbox/approval policyArchitecture / Information Flow
adaptersand import onlyports/core/sibling adapter (codex_runtime→codex_stdio, same-layer precedent asforgejo→forgejo_transport);lint-importslayers contract passes.uncertainin_by_keybefore any RPC, so a lostthread/start/turn/startreply permanently blocks redelivery (ExecutionConflict) andreconcilereturns UNKNOWN — matching the crash matrix ("effect uncertain regardless of whether bytes were sent") and ADR 0004 recovery semantics.inProgresscannot regress TERMINAL; candidate replay change raises.observedis always None (app-server does not attest generated-turn identity); requests that arrive with a non-Noneobservedare refused; restored runs reportresolved=Nonerather than inventing attestation.Blocking Issues
None.
Non-blocking Suggestions
candidate()silently returnsNonewhen a turn previously read asfailed/interruptedlater readscompleted(post-terminal status change), whileobserve()raisesExecutionConflictfor the same transition. Consider making the two consistent.restore()does not invoke theauthorizedurable-claim callback thatstart()enforces. If the externally durable accepted receipt is itself the evidence of the prior claim (as the docstring implies), one explicit sentence saying so would prevent future confusion._by_key/_by_handlegrow without pruning for the process lifetime (same shape asFakeRuntime; acceptable for a controller prototype, worth a note if long-lived processes are planned).cancel()returnsobserved_at=0, fresh_until=0; the semantics are conservative (immediately stale) but undocumented relative toobserve()'s freshness contract.Questions for the Author
start(e.g. resolved-model mismatch, RPCerrorresponse) leaves the effect key permanently uncertain in this adapter instance even though the thread may exist unused. Is the intended recovery path strictly "controller records rejection, quarantines, starts a new Attempt" per ADR 0004? If yes, a comment instart()stating that would forestall future "safe retry" refactors.Security / Privacy Notes
start_new_sessionprocess-group termination, byte/line limits on every read path, strict JSON-RPC correlation, server-initiated requests refused (approval_policy isnever), stderr discarded, no credentials or secrets handled, no new dependencies (dependencies = []unchanged — audit correctly not applicable).Test / Documentation Gaps
docs/architecture/contracts.md). The new tests cover the contract's required conformance cases for Codex specifically; AC1's "the Runtime suite" is met only in that Codex-specific sense.Activity.WAITINGis never produced by this adapter (RUNNING/TERMINAL/UNKNOWN only); unmapped native statuses fall through to UNKNOWN, which is safe but undocumented.Follow-Up Candidates
/create-follow-up-issue).Overall Recommendation
APPROVE (substantive independent verdict for frozen head
f80e61c): no blocking defects; scope, boundaries, fail-closed behavior, tests, and honest documentation satisfy issue #8's acceptance criteria.Identity limitation: this review was submitted by the same shared
kiloaccount that authored the PR, so it is persisted as aCOMMENT-state review rather than a formalAPPROVEDreview to avoid self-approval. A formal approving review from a distinct identity is still required for integration evidence.