Schema

Use this reference to inspect fields, methods, accepted values and failure outcomes. For setup and working examples, start with the API guide.

Definition: abstraction.resource

Service Table [DEF-S1]

Read-only: who holds how much of a scarce resource on this machine, verified by the instrument or claimed by the holder. No row is invented: a holder the instrument cannot attribute to a program is reported under its process image with evidence verified and no account when the platform gives none. The table changes nothing.

Wire identity: abstraction.resource/table@1

Handler error codes, declared by resource_error_codes: internal, invalid_request, caller_refused, unknown_resource, policy_unavailable, forbidden. Generated bindings name each as a ServiceErrorCode member beside the dispatcher's own codes.

Multiple services share this namespace. Generated ServiceName (Go) and service_name (C++/Python) validate the request envelope and version before returning its service identity for routing. The selected generated dispatcher validates the method and typed arguments; the selector does not authorize callers or interpret method payloads.

Frames carry version, service, method and typed arguments. Transport owns framing, associated exchanges, deadlines and connections. Unknown version/service/method and malformed arguments are rejected before invoking a handler. One-way WriteFrame success means local submission, not remote acceptance or persistence.

Request-response methods use ExchangeFrame. Replies carry version, service, method, ok and payload; success payload contains typed value (or an empty object for void). Error payload contains nonempty code and message, which may be empty. ServiceError preserves unknown codes. Unexpected handler failures become handler_error without private details; invalid results become invalid_result. Clients validate reply identity and result before exposing it. A malformed frame or transport failure remains a local error; the transport must associate each response with its exchange. C++ dispatchers are pure protocol bindings, not listening servers.

The resources this machine's instrument and adapters can report.

Resources

request-response ResourcesResult

Who holds resource now. fresh reads the instrument again; otherwise the last sample within its age bound. Gated by abstraction.resource/table.read on resource account; a program always sees its own rows, and capacity, held and observed describe the machine to every caller.

Holders

request-response HoldersResult

Service Leases [DEF-S1]

Leases on a scarce resource, asked back on demand. A holder that predates OA is an attached holder: the service yields on its behalf through the host's own mechanism (LM Studio unload, Ollama keep_alive 0, ComfyUI free) and records the result as if answered. Every ask, yield and refusal is a record with the asker, the holder, the amount and the time. Version 1 kills nothing and boosts nothing.

Wire identity: abstraction.resource/leases@1

Handler error codes, declared by resource_error_codes: internal, invalid_request, caller_refused, unknown_resource, policy_unavailable, forbidden. Generated bindings name each as a ServiceErrorCode member beside the dispatcher's own codes.

Multiple services share this namespace. Generated ServiceName (Go) and service_name (C++/Python) validate the request envelope and version before returning its service identity for routing. The selected generated dispatcher validates the method and typed arguments; the selector does not authorize callers or interpret method payloads.

Frames carry version, service, method and typed arguments. Transport owns framing, associated exchanges, deadlines and connections. Unknown version/service/method and malformed arguments are rejected before invoking a handler. One-way WriteFrame success means local submission, not remote acceptance or persistence.

Request-response methods use ExchangeFrame. Replies carry version, service, method, ok and payload; success payload contains typed value (or an empty object for void). Error payload contains nonempty code and message, which may be empty. ServiceError preserves unknown codes. Unexpected handler failures become handler_error without private details; invalid results become invalid_result. Clients validate reply identity and result before exposing it. A malformed frame or transport failure remains a local error; the transport must associate each response with its exchange. C++ dispatchers are pure protocol bindings, not listening servers.

Ask to reserve amount bytes for admission of the bound caller, waiting up to wait_ms (0..120000) for holders to yield. The reservation is not a physical usage quota. Order: the rights decision for abstraction.resource/hold on resource (not_permitted, or unavailable when the decision point cannot answer), then the table (insufficient when capacity is known and amount exceeds it), then holders are asked in the service's order and the result is acquired or holders_refused. Nothing is killed.

Acquire

request-response AcquireResult

Reserve amount bytes for the bound caller only from what is free now, asking nobody: a request that can take nothing from another holder, such as speculative work (RES-L6). Order: the rights decision for abstraction.resource/hold on resource (not_permitted, or unavailable when the decision point cannot answer), then the table (insufficient when the pool is known and amount exceeds it), then one grant decision under the book's lock: acquired when amount fits what is free, or when the resource has no pool and nothing holds it, otherwise held. asked is always empty: no yield request is ever sent.

AcquireFree

request-response AcquireFreeResult

Extend renew_by of the bound caller's own lease.

Renew

request-response LeaseChangeResult

End the bound caller's own lease now.

Release

request-response LeaseChangeResult

Yield requests addressed to the bound caller since cursor, waiting up to wait_ms (0..30000) for one. Each request names the lease to yield. A holder that never observes is asked through its adapter when the service has one, and is otherwise recorded as unanswered.

Observe

request-response ObserveResult

Record the bound caller's answer to one yield request. yielded is checked against the instrument before the asker is told; a refusal carries its reason into the audit.

Answer

request-response AnswerCallResult

Associate the bound caller's own lease with one directly spawned process when its process start identity, parent relation and account can be verified. A failed or unsupported verification returns unverifiable and keeps conservative reservation accounting. One process may bind to one live lease.

BindProcess

request-response ProcessBindResult

Encoding [DEF-E1]

settingvaluerule
escapeminimal[DEF-E2]
indent2[DEF-E3]
map_keysutf8-bytes[DEF-E4]
numbersinteger-decimal[DEF-E5]
opaqueverbatim[DEF-E6]
terminatornewline[DEF-E7]
duplicate_keysrefuse[DEF-E8]
depth_limit64[DEF-E9]

Types

kindtypes
built inAcquireFreeOutcome AcquireOutcome Evidence ProcessBindOutcome ResourceCallOutcome bool i64 string
declared belowAnswerResult Lease LeaseChange ResourceList ResourceState YieldPage
container [DEF-T3]list<string>
repeated record [DEF-A9]list<Holder> list<YieldRecord> list<YieldRequest>

Named types [DEF-T2]

One spelling is written [DEF-G2] and a wider set is read [DEF-G1]; the width between them is the interoperability guarantee.

nameiswrittenread
timestampstringrfc3339-microsrfc3339-wide

Structs [DEF-T1]

A field is required, or says when it is omitted [DEF-A4]. Each struct says on its own what it does with a field name it has never heard of [DEF-A7]. A wire name never moves; where a language must spell it differently the field says so [DEF-A2].

Holder

unknown fields refuse

idfieldtypepresencenamed elsewhere
1programstringrequired—
2accountstringrequired—
3amounti64required—
4evidenceEvidencerequired—
5leasestringoptional · omitted when zero—
6grantstringoptional · omitted when zero—
7sincetimestampoptional · omitted when zero—
8detailstringoptional · omitted when zero—

ResourceState

the document [DEF-A1] · unknown fields refuse

idfieldtypepresencenamed elsewhere
1resourcestringrequired—
2capacityi64required—
3heldi64required—
4holderslist<Holder>required—
5observedtimestamprequired—
6instrumentstringrequired—

HoldersResult

unknown fields refuse

idfieldtypepresencenamed elsewhere
1outcomeResourceCallOutcomerequired—
2stateResourceStateoptional · omitted when absent—

ResourceList

unknown fields refuse

idfieldtypepresencenamed elsewhere
1resourceslist<string>required—
2observedtimestamprequired—

ResourcesResult

unknown fields refuse

idfieldtypepresencenamed elsewhere
1outcomeResourceCallOutcomerequired—
2listResourceListoptional · omitted when absent—

Lease

unknown fields refuse

idfieldtypepresencenamed elsewhere
1idstringrequired—
2resourcestringrequired—
3amounti64required—
4sincetimestamprequired—
5renew_bytimestamprequired—

YieldRecord

unknown fields refuse

idfieldtypepresencenamed elsewhere
1holderstringrequired—
2amounti64required—
3answerstringrequired—
4took_msi64required—

AcquireResult

unknown fields refuse

idfieldtypepresencenamed elsewhere
1outcomeAcquireOutcomerequired—
2leaseLeaseoptional · omitted when absent—
3askedlist<YieldRecord>required—

AcquireFreeResult

unknown fields refuse

idfieldtypepresencenamed elsewhere
1outcomeAcquireFreeOutcomerequired—
2leaseLeaseoptional · omitted when absent—
3askedlist<YieldRecord>required—

YieldRequest

unknown fields refuse

idfieldtypepresencenamed elsewhere
1idstringrequired—
2resourcestringrequired—
3amounti64required—
4reasonstringrequired—
5attimestamprequired—
6leasestringrequired—

YieldPage

unknown fields refuse

idfieldtypepresencenamed elsewhere
1requestslist<YieldRequest>required—
2nextstringrequired—

ObserveResult

unknown fields refuse

idfieldtypepresencenamed elsewhere
1outcomeResourceCallOutcomerequired—
2pageYieldPageoptional · omitted when absent—

AnswerResult

unknown fields refuse

idfieldtypepresencenamed elsewhere
1recordedboolrequired—

AnswerCallResult

unknown fields refuse

idfieldtypepresencenamed elsewhere
1outcomeResourceCallOutcomerequired—
2answerAnswerResultoptional · omitted when absent—

LeaseChange

unknown fields refuse

idfieldtypepresencenamed elsewhere
1appliedboolrequired—
2leaseLeaseoptional · omitted when absent—

LeaseChangeResult

unknown fields refuse

idfieldtypepresencenamed elsewhere
1outcomeResourceCallOutcomerequired—
2changeLeaseChangeoptional · omitted when absent—

ProcessBindResult

unknown fields refuse

idfieldtypepresencenamed elsewhere
1outcomeProcessBindOutcomerequired—

Enumerations [DEF-T5]

Enum fields carry JSON strings containing exact member wire spellings, never numeric IDs. Unknown names are preserved with grant and refused as bad_enum with refuse on read and write. Optional absent fields preserve presence separately from an empty string.

An enumeration is a closed vocabulary of wire names, and each one says on its own what a reader does with a member it has never heard of [DEF-A5].

Evidence

a member this reader does not know is refuse

idmemberwire
1verifiedverified
2claimedclaimed

ResourceCallOutcome

a member this reader does not know is refuse

idmemberwire
1okok
2forbiddenforbidden
3unavailableunavailable
4invalidinvalid
5unknownunknown

AcquireOutcome

a member this reader does not know is refuse

idmemberwire
1acquiredacquired
2insufficientinsufficient
3holders_refusedholders_refused
4not_permittednot_permitted
5unavailableunavailable
6invalidinvalid
7forbiddenforbidden

AcquireFreeOutcome

a member this reader does not know is refuse

idmemberwire
1acquiredacquired
2insufficientinsufficient
3not_permittednot_permitted
4unavailableunavailable
5invalidinvalid
6forbiddenforbidden
7heldheld

YieldAnswer

a member this reader does not know is refuse

idmemberwire
1yieldedyielded
2refusedrefused

ProcessBindOutcome

a member this reader does not know is refuse

idmemberwire
1boundbound
2unverifiableunverifiable
3refusedrefused
4invalidinvalid
5forbiddenforbidden
6unavailableunavailable

Constants [DEF-A6]

nametypevalue
known_resourceslist<string>card:0, memory, awake
resource_error_codeslist<string>internal, invalid_request, caller_refused, unknown_resource, policy_unavailable, forbidden

Refusal words [DEF-R1]

orderwordstage
1malformedgrammar
2bad_stringgrammar
3number_spellinggrammar
4wrong_typegrammar
5bad_timestampgrammar
6depth_exceededgrammar
7duplicate_keygrammar
8duplicate_fieldstructure
9unknown_fieldstructure
10missing_fieldstructure
11bad_enumstructure
12trailing_bytesdocument