feat(agent-interface): give the improvement surfaces and the native reasoning control one owner - #243
Merged
Conversation
…easoning control one owner `AgentImprovementSurface` is now derived from an exported `AGENT_IMPROVEMENT_SURFACES` list that the promotion schema's enum also reads. The two copies could disagree; one owner cannot. The list gains `rollout-policy`, so a rollout-policy improvement can be named in a proposal. agent-runtime `improve()` produces that surface today and no proposal could report it. `nativeReasoningControl(harness, effort)` returns the exact control token a harness process receives, which is the value a materialization receipt carries as `reasoningEffort.applied`. The adapter that builds harness argv and the caller that verifies the receipt hand-rolled one copy each, and the copies had drifted: cli-bridge sends codex `none`, `xhigh` and `ultra` where agent-runtime expects `minimal`, `high` and `high`. A harness with no native control answers `null`, so a harness whose runner drops the effort is never asserted to have applied one. Refs: tangle-network/agent-runtime#954 (items 3 and 4)
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.
Two vocabularies in this package were each owned in two places. Both had already drifted; one of the drifts refuses live runs today.
1. Improvement surfaces
AgentImprovementSurfaceand the promotion schema'simprovementSurfaceSchemaenum were two hand-written copies of the same list. They are now one exportedAGENT_IMPROVEMENT_SURFACES, with the type derived from it and the enum reading it.The list gains
rollout-policy. agent-runtime'sImproveSurfacecarriesrollout-policyand implements it end to end (profile-surface.ts:78reads it,:260applies it,agent/surfaces.ts:201resolves its path), butAgentImprovementSurfacehad no such member — so a rollout-policy improvement could be produced and never named in a proposal, which is what carries it to a review or a gate.2. Native reasoning control
nativeReasoningControl(harness, effort)returns the exact control token a harness process receives. That is the value a materialization receipt carries asreasoningEffort.applied, so both sides of the receipt check now read one table:--effortvalue;none/minimalclamp tolow,ultracode→maxclaudeEffortmodel_reasoning_effortvalue;ultracode→ultra, the rest canonicalcodexReasoningEffort--thinkingvalue;none→off,ultracodeclamps toxhighthinkingFlagForEffort--thinkingvalue;none→off,ultracode→maxPRIME_THINKING_BY_EFFORT--thinking/--no-thinking;mediumpasses nonethinkingFlagForEffortopencodeVariantForEffortnull— no thinking flag is plumbedprofile-support.ts:128The drift this closes
agent-runtime's private copy (
expectedBridgeAppliedReasoning) expects codex to applyminimalfornone, andhighfor bothxhighandultracode. cli-bridge 0.3.0 appliesnone,xhighandultra. The comparison throwsValidationError, so three of the seven rungs refuse a legitimate codex run today.Its
defaultarm also asserts that every unlisted harness applied the canonical rung. Eleven harnesses fall in that arm and none of them plumbs a thinking flag — five are already named in this file's ownharnessIgnoresEffortset — so each receipt reportsapplied: nullagainst an expectation of the request, and the run is refused.The interface docstring for
pialso claimed amaxrung. The pi line's allowlist stops atxhigh; corrected here.Tests
Four cases in
harness-capabilities.test.ts: the pinned per-harness ladder mapping,nullfor every harness with no native control,nullfor an unrequested effort, and a cross-check that no harness inharnessIgnoresEffortis ever claimed to have applied one.pnpm check-types,pnpm test(91 files),pnpm build,pnpm check:package-artifactsandpnpm check:control-artifactsall pass.Consumers
agent-runtime deletes its private switch and calls this function (tangle-network/agent-runtime#954 items 3 and 4). A follow-up in cli-bridge replaces its per-backend copies with the same call.