Skip to main content

Claimed-run definition proposals

This source contract extends POST /api/cli/claim/{leaseId}/definition-proposal with server-owned generation. Deployment and packaged-client availability must be verified against the installed release; this document is not live-release evidence.

Authority and input​

The caller must be the authenticated workload holder of the active mission lease. The route and consequence boundaries recheck the existing holder, company, feature, lease expiry, source access, and cognition policy. Possessing a document or naming a feature does not grant authority. This operation proposes a definition; it never ratifies a target, approves a release, or completes a mission.

The existing executor-authored content request remains supported. For Cortex generation, use the shared runDefinitionGenerationSchema from @vagarylabs/shared:

{
"mode": "generate",
"runId": "<current run UUID>",
"leaseSignature": "<current lease proof; never log>",
"featureId": "feature:example",
"documents": [{
"key": "requirements",
"revisionId": "<attached document revision UUID>",
"contentHash": "<64-character lowercase SHA-256 of the exact revision body>"
}],
"requiredPaths": ["product.outcome"]
}

nodeId is optional where the existing holder contract permits it. Documents must be attached to this mission and pinned to their exact revision and body digest. Selection is limited to 16 documents and 128 requested paths; the snapshot also limits document and total bytes. Invalid, inaccessible, stale or oversized sources are refused. The caller cannot provide a company, author, provider, processing policy, classification downgrade, model completion, or ratification flag.

The effective organization classification is a minimum: narrower policy layers and individual requests cannot downgrade it. Malformed policy sources are refused. Region, retention, private-cell and customer-managed requirements are also refused before inference until this execution path can enforce them; their presence must not silently fall back to ordinary hosted processing.

Gateway inference resolves the canonical product organization from the company binding immediately before dispatch. A supplied organization is checked against that binding, never used as a fallback. The operation records the same product organization in tenant-scoped cognition evidence, and proposal replay rejects evidence from a different organization.

Results​

Clients should parse runDefinitionGenerationResultSchema and inspect status. HTTP success alone does not mean a definition was recorded.

StatusHTTPMeaning
recorded201A definition version and proposal event were committed atomically.
reused200The existing version was joined to its validated source and cognition evidence.
abstained200The operator declined to propose; input limitations are returned.
pending202A protected attempt already exists; do not dispatch another inference.
unknown202Invocation or commit outcome is uncertain; do not assume failure or retry inference.
refused409Current admission, inputs or evidence do not permit the operation.

Authentication, request-validation and feature-binding failures can return their existing route errors before generation begins. recorded and reused include the definition version, input/content hashes and cognition event ID. ratified: false describes this operation, not the feature's existing standing.

Durability and retry​

A server-owned reservation is scoped to company, mission and feature, with a distinct attempt ID. A disconnect or uncertain provider response does not authorize a second inference. Automatic retry is allowed only when the shared cognition operation positively reports that dispatch never started and the server durably settles that exact attempt. A retry must pass fresh authority, source and policy checks. Delayed settlement cannot overwrite a newer attempt.

Current implementation refuses unresolved cross-attempt reservations; it does not claim automatic adoption or recovery of an unknown provider result. Reconciliation must establish the prior outcome before another consequential execution.

Snapshot receipts retain references and hashes rather than copies of mission or document text. Replay validates the actual definition author, proposal event, native cognition output digest and cost row. It neither invents provider billing facts nor treats a model's confidence as permission. Immutable definitions remain read-only under the tenant role.

Verification boundary​

Pure/operator composition tests cover bounded selection, result parsing, retries, uncertain outcomes and evidence refusal. They do not replace PostgreSQL tests of the actual tenant role, cross-tenant denial, locks, rollback and immutable-row replay. Release acceptance additionally requires the deployed exact candidate and the declared client to exercise this route under genuine workload authority.