Replies: 2 comments
RFC 0003 Revision NoteThe original migration, validation, alternatives, and open-question appendix was folded into the Discussion body on 2026-08-26 during an editorial pass. The shorter body preserves the accepted design contracts and is now the complete RFC. This comment remains to preserve existing links. |
0 replies
Not sure why we should move from one format to another, save from some parsing considerations. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
RFC 0003: Agent-Model Runtime Optimization Profiles
Decision requested
NemoClaw should add a public, versioned contract that selects at most one agent-runtime optimization profile, or an explicit no-profile result, for a resolved agent runtime and inference route.
An optimization profile can configure model-specific request behavior, tool exposure, a native harness profile, middleware, or a plugin.
Optimizationdoes not mean performance only. A profile can establish compatibility, prevent an invalid tool call, or improve a measured outcome.Maintainers are asked to accept these decisions:
src/lib/**.Acceptance establishes architecture direction. It does not change current support or qualify a new model, profile, route, agent runtime, serving recipe, or platform.
Why this is needed
NemoClaw already has two versions of this idea.
The first is the agent-scoped registry under
nemoclaw-blueprint/model-specific-setup. It matches OpenClaw or Hermes with model and route fields. OpenClaw records can set compatibility fields, tool behavior, and plugins.The second is the LangChain Deep Agents Code profile plugin under
agents/langchain-deepagents-code/profile-plugin. It maps NemoClaw-managed Nemotron 3 Ultra keys to a reviewed native Deep Agents profile. It also adds a narrow malformed-tool-call guard.These implementations prove that:
The mechanisms do not form one subsystem today:
nemoclaw inference setdoes not.This split permits lifecycle drift. Fresh setup can apply behavior that an inference switch omits. A dependency update can preserve the model string while invalidating the native profile. Status can report a model without reporting the behavior required to use it.
RFC 0002 gives agent-specific behavior a package owner. RFC 0003 defines how NemoClaw selects and qualifies that behavior for a model route.
Ownership
The managed inference catalog answers: Which model server and model configuration should NemoClaw run?
The optimization profile answers: How should this agent runtime use that resolved route?
A profile can require a named serving preset or recipe when behavior depends on a chat template or parser. It cannot patch that recipe. A serving recipe cannot install agent-native behavior.
Contract
Resolved inference identity
Inference resolves before optimization. The inference subsystem provides one secret-free identity with these fields:
The optimization resolver does not reconstruct one identity from another. This matters because OpenClaw maps several upstream providers to its in-sandbox
inferencekey, while Deep Agents Code consumes both the managed provider and upstream provider identities.Version 1 supports only a route resolved to one model. Model Router requires a later contract with an immutable pool digest, declared members, route policy, and qualification for every member.
Optimization profile
An optimization profile is immutable. It names pinned runtime versions, selectors, one package application contract, an acceptance contract, and a removal condition.
This abbreviated example shows the proposed shape:
Each provider selector names its layer. For example,
operatorProviderIds,gatewayProviderIds, andinSandboxProviderKeysare different fields. The generic fieldproviderIdsis invalid.A profile may list several models. The list defines technical applicability, not a qualified Cartesian product. The support catalog binds every admitted model and route context to context-specific evidence.
Profile input is declarative data. It cannot contain executable source, shell fragments, unrestricted commands, command templates, environment expansion, credentials, policy patches, OpenShell operations, or remote artifact selectors. Only the registered package application contract may dispatch reviewed bundled code.
Compilation and resolution
The build compiles package-owned profile YAML into canonical packaged JSON. The compiled envelope records schema and compiler versions, profile and source digests, package release identities, application schemas, and source provenance.
The runtime does not scan URLs, the current directory, home directories, restored state, workspaces, or mutable package registries.
For a new selection, the resolver:
AgentRuntimeOptimizationSelectionV1into the generic RFC 0002 runtime plan.File order, description text, and computed specificity do not affect selection.
No match has three possible results:
Package application contract
Each package declares its application contracts in the RFC 0002 operation registry. RFC 0003 does not add another helper or operation protocol.
Each contract version declares:
Application and reconstruction input remains declarative. The operation registry cannot provide a shell rollback hook or turn profile fields into commands.
The profile supplies the operation-specific input. Core validates and digests the input but does not interpret agent-native fields. The request and result use
AgentRuntimeOperationRequestV1andAgentRuntimeOperationResultV1from RFC 0002.An application can generate package-owned configuration, activate a bundled plugin or native profile, register model aliases, set request fields, narrow a tool mode, or add bounded in-process middleware.
It cannot download code, change provider or credential state, patch a serving recipe, widen policy, call OpenShell directly, own sandbox lifecycle, or modify another agent runtime.
Observation and product state
The helper result is the executor's claim. It does not independently establish product state.
Core and OpenShell own a small generic observer registry. Profiles may declare observable files, process identities, local endpoints, or canonical configuration projections. Profiles cannot add trusted observer code.
A helper, plugin, package command, or agent-runtime command that reports its own state remains an executor claim, even when core invokes it. A trusted postcondition requires direct core or OpenShell observation of an external file, process, endpoint, or canonical projection. Behavioral agent invocations can produce qualification evidence, but they cannot independently establish native configuration state through self-reporting.
A supported automatic profile needs enough independent observations to establish every state claim required by status, rebuild, restore, or recovery. If the supported OpenShell baseline lacks an observer, the profile remains candidate-only unless the support catalog records a reviewed limitation on the claim NemoClaw may make.
The optimization selection is a nested field in the generic RFC 0002 startup, capability, and operation plans. It does not create a new state store.
A plan authorized only for initial qualification carries an
evidence-onlyclassification. It may execute the authorized protected workflow and produce a receipt. It cannot establish support, normal automatic selection, or a normal selectable deployment.Adding an optimization
The public contribution contract includes JSON Schemas, a deterministic compiler, resolver fixtures, package conformance fixtures, an explanation result, and a qualification template.
Every contribution follows this sequence:
candidate,qualification-only, andactivesupport entry that pins the receipt.Publication, conformance, qualification authorization, evidence, candidate admission, and supported promotion are separate results.
After the framework exists:
src/lib/**.agents/<id>/**package.Package-owned source should use this shape:
An external package can use the same contract after RFC 0002 supplies the external release, provenance, and conformance path. NemoClaw still admits only pinned package and profile releases through its repository-owned support catalog.
Versioning
The contract keeps these versions separate:
Any selector, input, objective, lifecycle, or behavior change creates a later profile version. Adding a model also creates a later version because it expands the qualification set.
Rebuild and restore require the recorded application contract and schema digests. If they are unavailable, the workflow can use only a repository-authorized replacement for the same inference identity.
Qualification and support
The RFC 0002 support catalog owns three independent fields:
productStatus: supported | candidateselectionMode: automatic | qualification-onlyeligibility: active | superseded | revokedNormal workflows accept only
supported,automatic, andactive. Protected qualification may acceptcandidate,qualification-only, andactive.Initial qualification cannot require a receipt that does not exist. The protected qualification authority first issues a bounded authorization. The resulting plan is evidence-only and cannot create admitted product state. The run produces the receipt. The catalog can then add a candidate entry that pins it.
Each receipt binds:
One receipt may cover several contexts only when it names and evaluates each context.
For an immutable model or serving revision, receipt validity lasts until catalog supersession or revocation. A revision-opaque hosted route uses a provider contract, endpoint descriptor, observation time, and
validUntil. Resolution rejects expired or drifted evidence. Requalification creates a later receipt and catalog revision.An expired running deployment is reported as ineligible. RFC 0003 does not terminate it automatically.
Lifecycle and recovery
Optimization selection is part of the existing inference workflow, not a best-effort post-step.
AgentRuntimeStartupPlanV1, apply it through the RFC 0002 helper, observe the result, then persist the generic plan identities.nemoclaw inference setCurrent
nemoclaw inference setcommits the OpenShell route and registry before its crash-prone in-sandbox config write. RFC 0003 keeps that recovery direction. It does not require unsafe reverse mutation after the durable commit.RFC 0003 requires the RFC 0002 lifecycle owner to add a generic crash-transition journal to existing product state. This is new shared lifecycle state under the existing authority, not a new authority or optimization-specific store.
Before the first external mutation, that journal records:
Phases are
prepared,route-mutated,registry-persisted,application-completed,process-converged,observed, andcomplete. A classified failure recordsrecovery-requiredand the last completed phase.If the process exits between OpenShell route mutation and local registry persistence, the prepared journal preserves both intended identities. Recovery compares the journal with the live route, registry, package projection, and process state before another mutation.
Supersession and replacement
New selection never chooses a superseded or revoked profile.
A recorded superseded selection may be rematerialized only when its
rematerializationPolicypermits the operation before expiry. A revoked selection cannot be selected or rematerialized.The catalog may name one replacement. The replacement must preserve the complete resolved inference identity and have its own active profile, receipt, and reconstruction contract. A provider, model, endpoint, API, gateway route, or serving change uses the ordinary inference-selection workflow as a separate operator decision.
If no qualified replacement exists for the same inference identity, the operation fails and names the remediation owner.
Security and precedence
Profiles and compiled plans contain no provider credentials. The runtime does not load profile data or code from user-writable or remote sources.
The package contract declares the owned projection it controls. Precedence is:
An optimization may narrow a less restrictive preference only when the support entry declares the safeguard and diagnostics report the effective result. It cannot widen user intent, grant a tool, replace a credential or provider, or write outside its projection.
If required profile behavior conflicts with explicit user intent, resolution fails before configuration effects.
User experience
Supported automatic selection requires no new flag.
Onboarding and status report:
An explicit no-profile result says that the combination was qualified without model-specific behavior. An unqualified custom route says that no qualified optimization was selected.
Version 1 has no public arbitrary profile override. Candidate testing uses protected qualification authority.
Delivery sequence
Hermes does not receive an optimization merely to prove the design. Add one only from Hermes-specific evidence.
Validation
The implementation must test four boundaries.
An optimization claim needs an accepted before-and-after evaluation with the same runtime, route, model, serving identity, task set, and limits. Runtime selection uses the catalog decision, not a live score.
Passing schema or conformance tests does not establish model compatibility or product support.
Non-goals
RFC 0003 does not:
Open questions
AgentQualificationfixture move out of managed inference ownership?All reactions