Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Diagnostic codes

Compiler diagnostics use TGnnnn; Postman import uses PMxxx, HAR import uses HRxxx, structural contract inference uses TCxxx, and the Go emitter uses GOxxx. tungsten explain <code> explains one code. This page uses both shared compiler diagnostic registries; each subsystem has its own section. Importer prose uses 'input' for structural samples; tungsten explain retains the canonical wording.

AreaCodes
Go emitter (GOxxx)GO001, GO002, GO003, GO004, GO005, GO006
HAR import (HRxxx)HR001, HR002, HR003, HR006
Postman import (PMxxx)PM001, PM002, PM003, PM004, PM005, PM006, PM007, PM008
Request-contract checks (TCxxx)TC001, TC002, TC003, TC004, TC005, TC006, TC007
Parsing and input limits (TG01xx)TG0101, TG0102, TG0103, TG0104, TG0105, TG0110, TG0111, TG0112, TG0120, TG0121, TG0122, TG0123, TG0130, TG0131, TG0132, TG0133, TG0134
References and cycles (TG02xx)TG0201, TG0202, TG0203, TG0204, TG0205, TG0206, TG0207
Type normalization (TG03xx)TG0301, TG0302, TG0303, TG0304, TG0305, TG0306, TG0307, TG0308
Naming (TG04xx)TG0401, TG0402, TG0403
Operations, pagination and auth inference (TG05xx)TG0501, TG0502, TG0503, TG0504, TG0505, TG0506, TG0507, TG0508, TG0509, TG0510, TG0530, TG0531, TG0570, TG0571, TG0572, TG0573, TG0574
Manifests (TG06xx)TG0601, TG0602, TG0603, TG0604, TG0605, TG0606, TG0607, TG0608, TG0609, TG0610, TG0611, TG0612, TG0613, TG0614, TG0615, TG0616
Emitter limits (TG07xx)TG0701, TG0702, TG0703, TG0704, TG0705, TG0710, TG0711, TG0712, TG0713, TG0720, TG0721, TG0722, TG0723, TG0724, TG0725, TG0726, TG0727, TG0730, TG0731, TG0732, TG0733, TG0740, TG0741, TG0742, TG0743, TG0744, TG0745, TG0746, TG0750, TG0751, TG0752, TG0753, TG0760, TG0790, TG0791, TG0792, TG0793
External emitters (TG08xx)TG0801, TG0802, TG0803, TG0804, TG0805, TG0806, TG0807, TG0808, TG0809, TG0810, TG0811
Staleness and CI (TG09xx)TG0901, TG0902, TG0920, TG0921, TG0930, TG0931, TG0932
SDK emitters: Java, C#, Kotlin, Swift, PHP, Ruby, Dart, F# (TG10xx)TG1010, TG1011, TG1012, TG1013, TG1014, TG1015, TG1020, TG1021, TG1022, TG1023, TG1024, TG1025, TG1030, TG1031, TG1032, TG1033, TG1034, TG1035, TG1060, TG1061, TG1062, TG1063, TG1064, TG1065, TG1070, TG1071, TG1072, TG1073, TG1074, TG1075, TG1080, TG1081, TG1082, TG1083, TG1084, TG1085
Request import: saved cURL and .http (TG12xx)TG1201

Go emitter (GOxxx)

GO001

macro is not emitted by the Go SDK

Meaning. A macro of agent.yml is not in the canonical form the SDKs run (an unknown step kind or operation, a reference to no earlier step, an invalid as, until or budget). The Go SDK leaves it out; the other operations are generated as usual. The Go emitter reports it through TG0806.

Fix. Fix the macro in agent.yml; the message names the offending member.

GO002

OpenID Connect scheme is sent as a bearer token by the Go SDK

Meaning. The API declares an OpenID Connect security scheme. The Go SDK sends the configured credential as a bearer token and does not run discovery or obtain tokens itself.

Fix. Obtain the token yourself and pass it to the client under the scheme's name.

GO003

different success bodies by status: the Go typed result is json.RawMessage

Meaning. An operation answers different JSON bodies depending on the status. The Go SDK's typed result for it is json.RawMessage; the decoded body also stays in Response.Raw.

Fix. Nothing to fix; decode the raw message according to the status that arrived.

GO004

invalid go target option

Meaning. An option of the go target in tungsten.yml is unknown or has the wrong type, so the Go emitter refused the target and wrote nothing.

Fix. Fix or remove the option under targets.go in tungsten.yml; the message names it and the type it must have.

GO005

the generated Go source is invalid

Meaning. The Go source the emitter generated does not parse, so nothing was written. This is a fault in the emitter or in a name taken from the API description.

Fix. Check the API description for names that cannot become Go identifiers and report the diagnostic with the offending schema if it persists.

GO006

pagination items path does not resolve to an array in the success schema

Meaning. The pagination items path of an operation (from the spec or inferred) does not resolve to an array in the success schema, so the Go SDK cannot type the page items.

Fix. Correct the pagination items path of the operation to name an array field of the success response, or remove the pagination declaration.

HAR import (HRxxx)

HR001

HAR capture exceeds the byte, nesting or node limit

Meaning. The HAR capture is larger than the import limits: its byte size, nesting depth or node count is over the budget. Nothing was imported.

Fix. Export a smaller capture, or narrow it with --include-prefix and --exclude-prefix.

HR002

HAR capture is malformed or unsupported

Meaning. The input is not a HAR 1.2 capture tungsten can read: invalid JSON, a missing log, entries, request, method, header name or query parameter name, an unsupported HAR version, or a response without a completed HTTP status.

Fix. Export the capture again as HAR 1.2 and exclude failed or pending requests.

HR003

selected HAR origin is absent or noncanonical

Meaning. The origin given with --har-origin is not one of the origins in the capture, or is not written in canonical form (scheme, host and port only).

Fix. Pass exactly one HTTP(S) origin that occurs in the capture, for example https://api.example.com.

HR006

reviewed HAR route templates are ambiguous or not whole-segment

Meaning. Reviewed route templates (--route or --har-paths) are ambiguous or malformed: a captured path matches several equally specific templates, or a template replaces part of a segment instead of a whole parameter segment.

Fix. Make the templates unambiguous and let each replace whole segments only, such as /items/{id}; keep literal routing segments unchanged.

Postman import (PMxxx)

PM001

Postman collection exceeds an import budget or nesting limit

Meaning. The Postman collection is over an import limit: variable expansion and parsed samples exceed the import-wide byte or node budget, or folders nest deeper than the limit.

Fix. Reduce large or repeated variables and examples, or flatten the folder nesting.

PM002

not a Postman Collection v2.1 item tree

Meaning. The input is not a Postman Collection v2.1 item tree: the item array is missing or not an array.

Fix. Export the collection as Postman Collection v2.1 JSON and import that file.

PM003

Postman API key authentication lacks an explicit name or location

Meaning. A request uses API key authentication without an explicit key name, or with a location other than header or query.

Fix. Give the API key an explicit name and set its location to header or query in the collection.

PM004

Postman dynamic variable cannot be resolved offline

Meaning. A request uses a Postman dynamic variable ({{$...}}). tungsten never runs scripts or generates dynamic values, so the request shape cannot be known.

Fix. Replace the dynamic variable with an explicit example value or a declared parameter.

PM005

Postman request URL or variable cannot be resolved to a fixed shape

Meaning. A request URL is not HTTP(S) with an explicit path, or a variable that decides the request shape (host, path or query) cannot be resolved from the collection.

Fix. Provide the variable in the collection or an environment override, or replace it with a declared path parameter; use an absolute HTTP(S) URL.

PM006

Postman body or response example is not JSON

Meaning. A raw request body is not valid JSON after variable resolution, or a saved response body is not JSON, so no schema can be inferred from it.

Fix. Provide explicit JSON examples, remove the unsupported example, or supply a reviewed media schema.

PM007

duplicate Postman operations mix unknown and explicit authentication

Meaning. Several requests describe the same operation, and some declare authentication while others leave it unknown.

Fix. Declare one consistent authentication policy for the duplicated requests.

PM008

every Postman request was omitted as unsupported

Meaning. Every request in the Postman collection was omitted as unsupported, so nothing could be imported.

Fix. Remove or fix the unsupported constructs, or supply a reviewed contract.

Request-contract checks (TCxxx)

TC001

request input exceeds the byte limit

Meaning. The structural request input is larger than the import byte limit.

Fix. Split the import into smaller captures or collections.

TC002

request input is not valid JSON

Meaning. The structural request input is not valid JSON, or is nested too deeply.

Fix. Fix the JSON syntax and nesting of the input file.

TC003

request input or reviewed overrides are invalid

Meaning. The input model or the reviewed overrides do not match the input schema.

Fix. Regenerate the input with tungsten, or correct the overrides to match the documented shape.

TC004

request input has an unsupported method or duplicate path placeholders

Meaning. An operation in the input cannot become an OpenAPI operation: its HTTP method is not supported, or its path template repeats a placeholder name.

Fix. Use an OpenAPI HTTP method and make the path placeholder names unique.

TC005

input source id is not an opaque identifier

Meaning. An input source id is not an opaque identifier; it looks like a file name or a URL.

Fix. Use an opaque alphanumeric source id, never a file name or URL.

TC006

unsupported schema keyword in structural input

Meaning. A structural schema in the input uses a keyword the import does not support. References and value-bearing annotations are not imported.

Fix. Use structural fields only, or keep the declaration in the original OpenAPI document.

TC007

reviewed override uses an unstable parameter index pointer

Meaning. A reviewed override points into a body schema or parameter with a numeric parameter index, which changes when parameters are added or reordered.

Fix. Use /paths/ body schema pointers or stable parameter_schema_pointer keys.

Parsing and input limits (TG01xx)

TG0101

input file could not be read

Meaning. An input named in tungsten.yml or on the command line could not be read: the file does not exist, is a directory, or is not readable by the current user.

Fix. Check the path. Paths in tungsten.yml are relative to the directory of tungsten.yml, not to the working directory.

TG0102

input is not valid JSON or YAML

Meaning. The input is neither valid JSON nor valid YAML, so no OpenAPI document could be read from it. The message names the first syntax error.

Fix. Fix the syntax error at the reported position. Run the file through a JSON or YAML linter if the position is not obvious.

TG0103

unsupported OpenAPI version (convert Swagger 2.0 to OpenAPI 3 first)

Meaning. The document's openapi field is missing or names a version tungsten does not compile. tungsten reads OpenAPI 3.0.x and 3.1.x; Swagger 2.0 documents declare swagger: "2.0" instead.

Fix. Set openapi to the version the document follows, or convert a Swagger 2.0 document to OpenAPI 3 (for example with swagger2openapi) before compiling.

TG0104

document is missing a required OpenAPI field

Meaning. A field the OpenAPI specification requires is absent (for example info, info.title, info.version, or a parameter's name or in).

Fix. Add the field at the reported pointer.

TG0105

input exceeds a size or nesting limit

Meaning. The input is larger than the configured byte limit or nests deeper than the depth limit. The limits protect the compiler from pathological or hostile inputs.

Fix. Split very large documents into files joined by $ref, or flatten deeply nested inline schemas into named components.

TG0110

document has no info.version; version 0.0.0 is used

Meaning. The document has no info.version. OpenAPI requires it, but published specs sometimes omit it. tungsten records version 0.0.0 and continues; the diagnostic is a warning, and the document is still refused when something else required is missing.

Fix. Add info.version to the document, or supply it with an overlay.

TG0111

path key carries a query string; its pairs are sent on every call

Meaning. A key of paths carries a query string, such as /v1/messages?beta=true. OpenAPI forbids it, but some APIs use it to select a variant of an operation. tungsten names the operation and places it in resources from the path alone, keeps the query pairs as constant query parameters of the path template (path.query in the IR), sends them on every call (they are not arguments), and the mock routes a request only to the operation whose constants it carries.

Fix. No change is needed. To make the document valid OpenAPI, declare the pair as a query parameter with a const or enum schema.

TG0112

apiKey header scheme inferred from a credential header parameter

Meaning. The document defines no security scheme and no security, but declares a header that carries an API key (x-api-key, api-key or apikey) as a parameter. tungsten inferred an apiKey header scheme named apiKey and required it by every operation, so the credential is configured once on the client and the header is no longer an argument of each call.

Fix. Define the scheme under components/securitySchemes and list it in security (an overlay can add both) to make the intent explicit and silence the diagnostic.

TG0120

invalid remote input URL or acquisition policy

Meaning. A remote input URL contains credentials, a query or fragment, or its acquisition policy is invalid. Authentication belongs in headers, never source identifiers.

Fix. Supply an HTTP(S) document URL and --input-header or newline-separated TUNGSTEN_INPUT_HEADERS. Choose either --offline or --refresh-inputs.

TG0121

remote input fetch failed or exceeded its limits

Meaning. Fetching an input failed, returned a non-success HTTP status, exceeded 8 MiB or did not finish within 30 seconds. Redirects are refused so credentials cannot cross origins.

Fix. Check network access, trusted TLS certificates and authentication. Pass the final document URL explicitly. Use --offline to reuse a verified pin.

TG0122

remote input SHA256 differs from its pin or conversion

Meaning. Downloaded or cached bytes differ from their SHA256 pin, or a converted import no longer matches its original remote source.

Fix. Review upstream changes before --refresh-inputs. Converted inputs require re-import into a fresh project and renewed review. Use --offline for the existing pin; restore corrupted cache bytes from a trusted copy.

TG0123

remote input cache is missing, invalid or unsafe

Meaning. The .tungsten-inputs cache has no usable pin, contains a symlink or invalid file, or cannot be written safely.

Fix. Fetch once online and retain both source.lock.json and its content file for offline use. Inspect permissions and unexpected cache entries before retrying. Partial *.pending writes from an interrupted fetch are discarded by the next online run; a held acquire.lock means another run is fetching the same source.

TG0130

invalid Git input reference

Meaning. The Git input reference has an unsupported transport, URL credentials, query, invalid ref or unsafe subpath. Git authentication stays in the credential helper or environment.

Fix. Use git+https://example.com/owner/repository@ref#path. Local hermetic inputs may use git+file:///absolute/repository@ref#path. Do not put secrets in the reference.

TG0131

Git acquisition or ref resolution failed

Meaning. Git could not start, acquire the repository or resolve the ref to one commit. Raw Git stderr is discarded so credential helpers and servers cannot leak credentials into diagnostics.

Fix. Install Git, verify access and credentials, and use a full refs/heads/... or refs/tags/... name when branch/tag names conflict. Use --offline with a previously verified pin.

TG0132

Git input exceeds its acquisition safety budget

Meaning. Git acquisition exceeded its time, file, byte or process-output budget, or encountered a symlink, submodule or unsafe repository path. Only regular files are materialized and nothing is checked out or executed.

Fix. Narrow #subpath to the contract directory, select a smaller repository, or acquire a single document over HTTP(S).

TG0133

Git input pin or cache is missing, invalid or unsafe

Meaning. The Git source lock or its materialized files are missing, invalid, modified, symlinked or not writable. Every reused content file is SHA256-verified.

Fix. Restore the pinned cache from a trusted copy or re-import into a fresh project. Retain .tungsten-inputs with the same access controls as the original source for offline use. Partial *.pending entries from an interrupted fetch are discarded by the next online run; a held acquire.lock means another run is fetching the same source.

TG0134

Git discovery requires exactly one input document

Meaning. Discovery found zero or multiple supported documents under the selected repository subpath. Tungsten lists candidates and does not choose one implicitly.

Fix. Append #path to select exactly one OpenAPI, Swagger, Postman, HAR, saved request or JSON Schema endpoint manifest document.

References and cycles (TG02xx)

TG0201

unresolvable $ref

Meaning. A $ref points at a location that does not exist: the JSON Pointer names a missing member, or the referenced file has no such path.

Fix. Correct the pointer (pointers are case-sensitive and escape / as ~1 and ~ as ~0), or add the missing definition.

TG0202

remote $ref blocked (remote fetching is not available)

Meaning. A $ref names a remote URL. This version of tungsten does not fetch remote references, so that compiling never depends on, or leaks to, other hosts.

Fix. Vendor the remote document next to the spec and reference it by relative path.

TG0203

circular $ref through named types (recursion preserved)

Meaning. Named schemas reference each other in a cycle. This is legal; the cycle is kept and the participating types are marked recursive so emitters box or lazily evaluate the recursive edges.

Fix. Nothing to fix. The note exists so recursive types are visible in review.

TG0204

$ref to an external file outside the input root

Meaning. A $ref points at a file outside the directory tree of the input, which tungsten refuses to read.

Fix. Move the referenced file under the input root, or point the manifest at a common parent directory.

TG0205

circular $ref without a named type to break the cycle

Meaning. A reference cycle runs through inline schemas only, so there is no named type at which generated code could break the recursion.

Fix. Move the recursive schema under components/schemas and reference it by name, or list the edge in tungsten.yml types.break_cycles (for example Node.children).

TG0206

overlay target matched nothing

Meaning. An overlay action's target JSONPath matched no node in the document, so the action had no effect.

Fix. Fix the JSONPath expression, or remove the action if the spec no longer contains the node it was written for.

TG0207

overlay document or action is invalid

Meaning. An overlay file is not an OpenAPI Overlay 1.x document, has no actions array, or contains an action without a valid target JSONPath, so it could not be applied.

Fix. Start the file with overlay: 1.0.0 and an info block, list the changes under actions, and give each action a target JSONPath plus update or remove.

Type normalization (TG03xx)

TG0301

untagged union: runtime will sniff candidates in order

Meaning. A oneOf or anyOf has no discriminator, so a value's variant can only be found by trying the candidates in order at runtime. The order is deterministic (most constrained first), but sniffing is slower and can pick the wrong variant when candidates overlap. A union of exactly two candidates where one is a plain string, array or map (X or its id, X or a list of X) is reported as info instead of a warning: the two are told apart by JSON kind, so --strict does not fail on it.

Fix. Add a discriminator with a property every variant declares as a const or single enum value. tungsten check prints a repeated code a few times and then a count; --all-warnings prints all of them and --json always lists every one.

TG0302

allOf members conflict and could not be flattened

Meaning. The members of an allOf declare the same property with incompatible types, or mix records with non-records, so they cannot be merged into one record. The type is kept as an intersection, which some targets express poorly.

Fix. Make the overlapping property types agree, or restructure the schema so allOf only combines compatible records.

TG0303

unsupported or unknown schema keyword ignored

Meaning. A schema uses a keyword tungsten does not model (for example not, if/then/else or patternProperties). The keyword is ignored, so generated validation is looser than the spec.

Fix. Nothing is required. If the constraint matters to clients, express it with supported keywords or document it in the description.

TG0304

unknown string format treated as plain string

Meaning. A string schema uses a format tungsten does not recognize. The value is treated as a plain string and the format name is preserved in the IR.

Fix. Use a standard format (uuid, date-time, email, ...) if one fits; otherwise the warning can be accepted.

TG0305

schema type could not be determined; treated as any

Meaning. A schema has no type and nothing else (enum, const, properties, items, composition) from which a type could be inferred, so it accepts any value.

Fix. Add a type, or an explicit empty schema {} if any value really is allowed.

TG0306

discriminator could not be applied as written

Meaning. A discriminator next to oneOf/anyOf could not be used as written: it has no propertyName, a variant is not an object schema, a mapping entry does not resolve or names a schema that is not one of the variants, or a variant has no tag value. Unusable mapping entries are dropped; an unusable discriminator is ignored and the union is classified as if it had none.

Fix. Point every mapping value at one of the union's variants (#/components/schemas/X or the bare name X), and make every variant an object schema with the property.

TG0307

schema admits no value (empty enum or union)

Meaning. A schema admits no value at all: an empty enum, or a oneOf/anyOf with no members. Its type is never, so no generated client can send or accept it.

Fix. List the allowed values, or remove the schema if it is unused.

TG0308

types.break_cycles entry names no component property

Meaning. An entry of tungsten.yml types.break_cycles does not name a property of a schema under components/schemas (entries have the form Type.field), so it has no effect.

Fix. Fix the entry to Type.field with the component key and property name as written in the spec, or remove it.

Naming (TG04xx)

TG0401

identifier collision disambiguated

Meaning. Two names in one scope (fields of a record, operations of a resource, types of a namespace) map to the same identifier in some target language. The later one in sorted order was renamed deterministically.

Fix. Rename one of them in the spec, or give an explicit name in tungsten.yml naming, so the generated name is chosen rather than derived.

TG0402

identifier escaped (reserved keyword or invalid start)

Meaning. A name is a reserved word in a target language or does not start with a letter, so it was escaped (for example type becomes type_ in Python and Rust). The wire name is unchanged.

Fix. Nothing is required. Rename in tungsten.yml naming if the escaped form reads badly.

TG0403

operation has no operationId; name synthesized

Meaning. An operation has no operationId, so its id and method name were synthesized from the HTTP method and path. Synthesized names change when the path changes.

Fix. Add an operationId to the operation so its id stays stable.

Operations, pagination and auth inference (TG05xx)

TG0501

pagination inferred by heuristic

Meaning. No explicit pagination was configured and the operation matched a heuristic: cursor (a closed response record with one array field and one nullable next_* field, and a query parameter of the same name), or offset/page (offset and limit, or page and a page size, with an array of items). Generated SDKs will iterate pages.

Fix. Confirm the inference, or declare the operation under tungsten.yml pagination (use none: true to switch inference off for it).

TG0502

security scheme referenced but not defined

Meaning. An operation's security requirement names a scheme that is not defined under components/securitySchemes, so tungsten cannot tell how to authenticate it.

Fix. Define the scheme under components/securitySchemes, or fix the name in the requirement.

TG0503

composite auth profile satisfies an undefined security scheme

Meaning. A composite auth profile in tungsten.yml lists under satisfies a name that is not a security scheme of any input, so the profile cannot stand in for it.

Fix. List the scheme names the operations' security requirements use (from components/securitySchemes), and add parts that supply them.

TG0504

operation excluded by include predicate (planned)

Meaning. The operation does not match the input's include predicate, so it is not callable. When it matches planned_from it is recorded as planned for documentation.

Fix. Nothing is required. Change the predicate or the operation's extension value if the operation should be callable.

TG0505

runtime gate recorded from x-runtime-gate

Meaning. The operation carries x-runtime-gate, so it only works when the server enables the named gate. Generated clients report the gate instead of a bare 404.

Fix. Nothing is required. Describe the gate under agent.yml gates so agents get a useful explanation.

TG0506

rpc_unflatten target not found or not a const-discriminated oneOf

Meaning. The input's rpc_unflatten names a path and method that do not exist, or whose request body is not a oneOf discriminated by a const method field, so it cannot be split into one operation per method.

Fix. Check rpc_unflatten.path, method, discriminator and params against the spec.

TG0507

path template parameter without a definition; assumed a required string

Meaning. A path template names a {param} that no path-level or operation-level parameter declares. The SDK treats it as a required string so the operation stays callable.

Fix. Declare the parameter with in: path, required: true and a schema.

TG0508

malformed operation element ignored

Meaning. Part of an operation does not have the shape OpenAPI requires and was skipped: a parameter without name or in, a path parameter missing from the template, a response key that is not a status code, NXX range or default, or a member that must be an object or array but is not.

Fix. Fix the element at the reported pointer; the message names what is wrong.

TG0509

unsupported security scheme ignored

Meaning. A security scheme uses a type tungsten cannot generate authentication for (for example mutualTLS or an HTTP scheme other than bearer and basic), or lacks a field its type requires. Requirements naming it stay in the IR without a scheme.

Fix. Describe the credential with a supported scheme, or authenticate those operations through a custom transport.

TG0510

path item field defined both beside its $ref and in the target

Meaning. A Path Item combines $ref with fields written beside it, and the referenced item defines the same field: an operation, summary, description, servers, or a parameter with the same name and in. Fields only one side defines are merged. OpenAPI leaves the conflicting ones undefined; tungsten lets the field beside the $ref win, and the message names both pointers.

Fix. Define the field on one side only, or drop it from the shared item.

TG0530

event stream declares no schema; events decoded as any JSON value

Meaning. A success response declares the text/event-stream media type without a schema, so the SDK cannot type or check the events of the stream. Each event's data is still decoded as JSON and handed to the caller as an untyped value.

Fix. Declare the schema of one event under the media type. Use a discriminator only if it exists inside the JSON data; the SSE event name is separate. A raw data sentinel can be declared with x-tungsten-stream-done. See the typed Python SSE recipe at https://github.com/pboachie/tungsten/tree/release/0.1.3/examples/typed-sse.

TG0531

event stream declared for more than one success status; the first is streamed

Meaning. More than one success status of an operation declares text/event-stream. The SDK streams the lowest status; the others are read as plain responses.

Fix. Declare the stream under one status, normally 200.

TG0570

invalid MCP embedding index configuration (search.embeddings); the index is off

Meaning. targets.mcp.search.embeddings in tungsten.yml is not valid: an unknown key, a provider that is not command or http, a missing command, url or model, a dimensions, batch_size or timeout_ms out of range, or an api_key_env that is not an environment variable name. The embedding index is off and the MCP server searches with BM25 only; with required: true this is an error instead.

Fix. Fix the option: search: { embeddings: { provider: command, command: "node embed.mjs", model: my-model } } or provider: http with url. See the MCP server guide for embedding provider examples.

TG0571

embedding provider could not be run or did not answer in time; BM25 only

Meaning. The embedding provider of the MCP target could not be used: the command was not found, could not be started, exited with a failure, or neither it nor the HTTP endpoint answered within timeout_ms. Generation went on without index.embeddings.bin and index.embeddings.json, so the server searches with BM25 only. With required: true this is an error and nothing is written.

Fix. Run the command by hand with a request on standard input ({"protocol":1,"kind":"document","model":"m","dimensions":null,"inputs":["x"]}), raise timeout_ms, or lower batch_size.

TG0572

embedding provider returned an invalid response; BM25 only

Meaning. The embedding provider answered, but not with what the protocol says: not JSON, no embeddings array (command) or data array (HTTP), a different number of vectors than inputs, vectors of different or unexpected lengths, or values that are not finite numbers. Generation went on with BM25 only (an error with required: true).

Fix. Return one vector per input, in order, all of the length the model produces; set dimensions to that length so a mismatch is caught.

TG0573

embedding endpoint refused the request, needs a missing API key or uses https; BM25 only

Meaning. The HTTP embedding provider could not be called: the endpoint answered with an error status, the environment variable named by api_key_env is not set, or the URL is https://, which the compiler cannot call (it links no TLS stack). Generation went on with BM25 only (an error with required: true). The key is only ever read from the environment and never written to the output.

Fix. Export the API key, check the URL and model, or use provider: command with a program that calls the endpoint (for example curl) or a local http:// gateway.

TG0574

embedding index written next to the MCP manifest

Meaning. The MCP target wrote the embedding index: index.embeddings.json (model, dimensions, tool names and content hashes, checksum) and index.embeddings.bin (normalized little-endian f32 vectors). Vectors of tools whose text did not change since the previous run are reused, so only new or edited tools reach the provider.

Fix. Nothing to fix. Serve the index with search.embeddings in the server options (the generated server.ts sets it from tungsten.yml).

Manifests (TG06xx)

TG0601

manifest is not valid YAML

Meaning. A manifest (tungsten.yml or agent.yml) is not valid YAML.

Fix. Fix the YAML syntax at the reported position. Indentation must use spaces.

TG0602

manifest does not match its schema

Meaning. A manifest is valid YAML but does not match its schema: a key is unknown, a required key is missing, or a value has the wrong type. The pointer names the offending node.

Fix. Correct the value at the pointer. Editors with the YAML language server validate against the schema named in the file's first-line comment (tungsten schema tungsten prints it).

TG0603

manifest references an unknown operation

Meaning. A manifest refers to an operation id that does not exist in the compiled API.

Fix. Use namespace.operationId; tungsten explain <id> shows whether an id exists.

TG0604

manifest references an unknown namespace or path

Meaning. A manifest refers to a namespace, resource or path that does not exist in the inputs.

Fix. Check the name against inputs[].namespace in tungsten.yml and the paths of the spec.

TG0605

agent rule targets an operation that cannot serve it

Meaning. An agent rule points at an operation that cannot do what the rule needs: a verification hook or a macro poll step names an operation that is not read_only (the runtime would repeat its side effect), a paginate step names an operation without pagination, or an endpoint preview names the operation itself. The rule (or the macro) is dropped.

Fix. Point the rule at a read_only operation (for a poll or a verification hook), at a paginated one (for paginate), or declare the operation's safety or pagination if the inferred one is wrong.

TG0606

remediation names an unknown error code

Meaning. A remediation entry in agent.yml (errors.codes or a tool's remediation) or in x-agent-remediation is keyed by an error code that the error model of the operation's namespace (or of any namespace, for errors.codes) does not list. The entry is kept but may never match a response.

Fix. Use a code from the error schema's code enum (tungsten ir dump shows namespaces[].errors.codes), or fix the spelling.

TG0607

agent rule names a field the operation does not have

Meaning. An agent rule names a field that does not exist: a confirmation summary field or message placeholder that is not a request parameter or body field, a sensitive field that is not in the success response, a verification argument or predicate path, a macro reference such as $accepted.message_id into a step's response, or the code field of errors.envelope.

Fix. Use the wire names of the spec (dotted for nested fields, for example key.action_id); tungsten explain <operation> lists an operation's parameters and body.

TG0608

gate names no runtime gate or conflicts with the spec

Meaning. A tool's gate names neither an x-runtime-gate environment variable of the spec nor a gates entry, or the operation is already gated by a different variable, or a gates entry's disabled_status disagrees with the spec's gate. The spec wins.

Fix. Declare the gate under gates (with text and disabled_status) or use the spec's variable name.

TG0609

macro dropped or its safety tier raised

Meaning. A macro could not be compiled as written: its name is also an operation id (the macro is dropped), or it declares a safety tier weaker than its strictest step (the macro gets the step's tier, because a macro can never be safer than what it calls).

Fix. Rename the macro, or declare a tier at least as strict as every call step.

TG0610

unknown x-agent- extension ignored*

Meaning. The spec uses an x-agent-* extension tungsten does not know, often a misspelling. It is ignored.

Fix. Fix the extension name (for example x-agent-safety), or rename it outside the x-agent- prefix if it is meant for another tool.

TG0611

x-agent- extension value is malformed; ignored*

Meaning. An x-agent-* extension of an operation has the wrong shape (for example x-agent-safety: dangerous or an x-agent-idempotency object without policy). The extension is ignored and the operation keeps its defaults or agent.yml rules.

Fix. Give the extension the shape of the matching agent.yml tools key (specs/agent-manifest.schema.json, ToolConfig).

TG0612

targets share or nest their output directories

Meaning. Two targets in tungsten.yml write to the same output directory, or one target's out is inside another's. Each target records its files in its own .tungsten/manifest.json and removes files it no longer generates, so targets sharing a directory delete each other's output on every run.

Fix. Give every target its own directory that is not inside another target's, for example typescript: { out: generated/typescript } and docs: { out: generated/docs }.

TG0613

agent.yml option not applied by this version; ignored

Meaning. agent.yml sets an option the schema accepts but this version of tungsten does not apply yet (disclosure.prune.drop_fields, disclosure.prune.keep_examples). Agent tool schemas describe exactly the arguments the SDK takes, so nothing is hidden and no examples are added; the rest of the manifest applies.

Fix. Remove the option, or keep it for a later version that applies it. To make a tool smaller now, shorten descriptions or raise defaults.disclosure.schema_budget_tokens.

TG0614

gates entry no operation is gated by

Meaning. A gates entry of agent.yml is used by no operation: the spec carries no x-runtime-gate for that environment variable and no tools entry names it in gate. The entry's text is never shown and a 404 from the routes it was written for is reported as NOT_FOUND ("check the identifiers") instead of GATE_DISABLED. Live runs against ZROtext showed it: SEALED_ADMISSION_ENABLED was declared but none of the sealed operations named it.

Fix. Add gate: <ENV_VAR> to the tools entry of every operation the deployment setting switches off (one entry per operation), or delete the gates entry.

TG0615

spec safety is below the HTTP-method default without a tools override

Meaning. An ordinary OpenAPI operation's x-agent-safety is less cautious than its built-in HTTP-method tier. The compiler uses the method tier and reports a warning, which fails check and generate under --strict.

Fix. Review the operation's behavior. Remove or raise the spec annotation, or explicitly set safety in that operation's agent.yml tools entry to authorize a lower tier. Imported operations retain their separate reviewed-policy floor.

TG0616

spec removes preview from an operation with side effects without a tools override

Meaning. An operation with side effects sets x-agent-preview: none in the spec. The compiler keeps a configured safe preview or uses local preview instead. This warning fails check and generate under --strict.

Fix. Keep a preview, or explicitly set preview: none in that operation's agent.yml tools entry after reviewing its behavior. A safety override that still has side effects does not also approve removing preview.

Emitter limits (TG07xx)

TG0701

generated output could not be written

Meaning. A generated file could not be written to the target's output directory, for example because the directory is read-only or a path component is a file.

Fix. Check the target's out path and its permissions, then run tungsten generate again.

TG0702

target has no emitter in this version; skipped

Meaning. tungsten.yml configures a target (such as mock) for which this version of tungsten has no emitter yet. tungsten generate skips it and check --ci does not compare its output.

Fix. Nothing to fix. Remove the target from tungsten.yml to silence the notice, or generate it once a tungsten release ships its emitter.

TG0703

output directory was not generated by tungsten; refusing to write

Meaning. The target's output directory is not empty and has no .tungsten/manifest.json (or an unreadable one), so tungsten cannot tell its own files from yours. Writing would mix generated files into a directory it does not own, so nothing was written.

Fix. Point the target's out at a new or empty directory, or pass --force to write into it anyway; files tungsten did not generate are then left alone.

TG0704

output path leaves the output directory or is reserved

Meaning. A generated file would be written outside the target's output directory: a directory on its path is a symlink leading elsewhere, the file itself is a symlink, or the path is inside the reserved .tungsten/ directory. Nothing was written.

Fix. Remove the symlink from the output directory. If the path is under .tungsten/, the emitter is at fault: report it.

TG0705

target does not declare enforced imported-operation policy support; not generated

Meaning. The project was imported from a Postman collection or another source whose operations carry an enforced import policy (the runtime must apply it to every call), and a configured target cannot apply it. Only the typescript, python, rust, mcp, webmcp and docs targets declare that support, and an external emitter declares it with import_policy in its --describe response; generating any other target would discard the policy. During input conversion, init refuses unsupported built-in targets before saving the converted input or project manifests. During generation of an existing project, tungsten refuses that target alone; other targets are still written, unless --strict asks for all or none.

Fix. Generate only supported targets: remove the unsupported target from tungsten.yml, or add a supported one with tungsten init --resume --add-targets typescript,python (any of typescript, python, rust, mcp, webmcp, docs), then run tungsten generate again.

TG0710

macro not emitted by the TypeScript SDK (not in the canonical form)

Meaning. A macro in the IR does not fit the canonical form the TypeScript SDK compiles: a step names an operation that is not callable, a reference names a later or unknown step, or an {expr} is not <ref> in [..], <ref> == x or <ref> != x. The SDK is generated without that macro.

Fix. Fix the macro in agent.yml so every step calls a callable operation and every reference names $input or an earlier step's as.

TG0711

invalid TypeScript target option or custom dependency

Meaning. An option of the typescript target is not valid (for example a package that is not an npm package name or a version that is not a semantic version). Invalid scalar options use their defaults. Invalid dependencies entries fail generation: package names must be valid npm names and version specifiers must be non-empty strings. Emitter-managed runtime, zod and typescript packages cannot be replaced.

Fix. Fix the option under targets.typescript in tungsten.yml. Configure the runtime with runtime or runtime_path; remove zod and typescript from dependencies.

TG0712

OpenID Connect scheme sent as a bearer token by the TypeScript SDK

Meaning. The API declares an OpenID Connect security scheme. The TypeScript SDK sends the configured credential as a bearer token and does not run discovery or obtain tokens itself.

Fix. Obtain the token with your OpenID Connect client and pass it in auth under the scheme's name.

TG0713

tool schema over the agent schema token budget

Meaning. A tool of tools.json (its name, description and parameters, measured as characters / 4 after repeated sub-schemas were moved to $defs) is larger than the per-tool schema budget of agent.yml (defaults.disclosure.schema_budget_tokens, 600 by default). Agents pay this cost every time the tool is listed.

Fix. Shorten the operation's and its fields' descriptions (disclosure.prune for the operation, the spec for fields), split the operation, or raise the budget.

TG0720

invalid MCP target option; default used

Meaning. An option of the mcp target is not valid (a package that is not an npm package name, a version that is not a semantic version, an sdk that is not <package> or <package>@<range>, an empty path or range, a sandbox that is not a boolean), so its default is used.

Fix. Fix the option under targets.mcp in tungsten.yml.

TG0721

MCP tool schema over the agent schema token budget

Meaning. An MCP tool (its description and input schema, measured with the tungsten-tokens estimate after repeated sub-schemas were moved to $defs) is larger than the per-tool schema budget of agent.yml (defaults.disclosure.schema_budget_tokens, 600 by default). Agents pay this cost whenever the tool is listed or described.

Fix. Shorten the operation's and its fields' descriptions (disclosure.prune for the operation, the spec for fields), split the operation, or raise the budget.

TG0722

progressive MCP tool list and index summary over the 2,000-token budget

Meaning. In progressive mode an MCP client first receives the meta tools (search_tools, describe_tool, invoke, preview, list_clusters) and the instructions with the cluster index. Together they exceed the 2,000-token budget of the progressive index, usually because of many clusters or long cluster summaries.

Fix. Shorten the cluster summaries in agent.yml (only their first sentence is used) or merge clusters.

TG0723

macro not exposed as an MCP tool (not emitted by the TypeScript SDK)

Meaning. A macro of the IR is not served by the MCP server because the generated TypeScript SDK, which runs it, does not emit it (see TG0710 of the typescript target).

Fix. Fix the macro in agent.yml so every step calls a callable operation and every reference names $input or an earlier step's as.

TG0724

MCP tool names collide; each is named with a digest of its operation

Meaning. Two or more operations or macros give the same MCP tool name once their namespace, resource path and method are reduced to [a-z0-9_] (/a-b/c and /a/b-c both become ..._a_b_c_get). Numbering them in IR order would hand a name to another operation when one of them is added or removed, so each is named with the first eight hex digits of the digest of its operation id or macro name instead (..._a_b_c_get_1f3e9a0c): stable, but not descriptive.

Fix. Give the operations distinct method names with naming.operations in tungsten.yml.

TG0725

disclosure.mode auto chose the MCP disclosure mode from the measured token size of the discrete tool list

Meaning. defaults.disclosure.mode: auto in agent.yml chooses between the discrete MCP tool list (every tool with its schema) and progressive disclosure (search_tools, describe_tool, invoke) by measuring the discrete tools/list plus its instructions with the tungsten token estimate. Progressive is chosen when that is above defaults.disclosure.list_budget_tokens (default 10000), whatever the number of tools. This note states the measured tokens, the budget and the decision.

Fix. Set defaults.disclosure.mode to discrete or progressive to decide yourself, or change defaults.disclosure.list_budget_tokens.

TG0726

the MCP server's SDK dependency defaults to the typescript target's package

Meaning. The mcp target has no sdk option, so the server depends on the package the typescript target of the same tungsten.yml generates (its package and version) instead of the default <api>-sdk.

Fix. Set targets.mcp.sdk (<package> or <package>@<range>) or targets.mcp.sdk_path to depend on something else.

TG0727

MCP tool output schema over the output token budget even without the types it references

Meaning. The output schema of an MCP tool is larger than four times the per-tool schema budget even though every reference to another type was already replaced by {} (the emitter keeps only the types one reference away from the response body, and none when that is still over the limit). The response type itself is large: many fields or long descriptions.

Fix. Shorten the descriptions in the spec, or raise defaults.disclosure.schema_budget_tokens in agent.yml.

TG0730

macro not emitted by the Python SDK (not in the canonical form)

Meaning. A macro in the IR does not fit the canonical form the Python SDK compiles: a step names an operation that is not callable, a reference names a later or unknown step, an {expr} is not <ref> in [..], <ref> == x or <ref> != x, or a field the macro adds to its input is not a free Python keyword argument name (not an identifier, a keyword, or an argument the extended operation already takes). The SDK is generated without that macro.

Fix. Fix the macro in agent.yml so every step calls a callable operation, every reference names $input or an earlier step's as, and added input fields have identifier names.

TG0731

invalid Python target option; default used

Meaning. An option of the python target is not valid (for example a package that is not a PEP 508 distribution name, a module that is not a lowercase identifier, a version that is not a PEP 440 version, or a models that is neither pydantic nor dataclasses), so its default is used.

Fix. Fix the option under targets.python in tungsten.yml.

TG0732

OpenID Connect scheme sent as a bearer token by the Python SDK

Meaning. The API declares an OpenID Connect security scheme. The Python SDK sends the configured credential as a bearer token and does not run discovery or obtain tokens itself.

Fix. Obtain the token with your OpenID Connect client and pass it in auth under the scheme's name.

TG0733

inline record typed as a plain mapping by the Python SDK

Meaning. A record schema without a name (inline, not a component) has fixed fields. The Python SDK declares a model class per named record only, so this one is typed dict[str, Any] and its fields are not validated client-side.

Fix. Move the schema to components/schemas (or name it with an overlay) so it gets a model.

TG0740

invalid Rust target option; default used

Meaning. An option of the rust target is not valid (for example a crate that is not a crate name, a version that is not semver, or a cli that is neither a boolean nor an object), so its default is used.

Fix. Fix the option under targets.rust in tungsten.yml.

TG0741

type or schema typed as serde_json::Value by the Rust SDK

Meaning. A schema has no Rust type of its own: a union without variants, an allOf that could not be merged into one record, a schema no value satisfies, or an inline enum, union or record without a name. The Rust SDK types it serde_json::Value (the generated type says so in its documentation) and checks its constraints (enum membership, allOf members) when the request or response is validated. Enums of booleans, of numbers with fractions and of integers above i64 are not in this group: they are untagged enums with one variant per JSON type, and enums of several types are unions of constants.

Fix. Move the schema to components/schemas (or name it with an overlay) so it gets a Rust type; for an allOf, make the members compatible so that they merge.

TG0742

macro not emitted by the Rust SDK (not in the canonical form)

Meaning. A macro in the IR does not fit the canonical form the Rust SDK compiles: a step names an operation that is not callable, a reference names a later or unknown step, an {expr} is not <ref> in [..], <ref> == x or <ref> != x, or the input extends an operation that is not callable. The SDK is generated without that macro.

Fix. Fix the macro in agent.yml so every step calls a callable operation and every reference names $input or an earlier step's as.

TG0743

OpenID Connect scheme sent as a bearer token by the Rust SDK

Meaning. The API declares an OpenID Connect security scheme. The Rust SDK sends the configured credential as a bearer token and does not run discovery or obtain tokens itself.

Fix. Obtain the token with your OpenID Connect client and pass it in auth under the scheme's name.

TG0744

operation with different non-JSON or ranged success bodies returns serde_json::Value in the Rust SDK

Meaning. An operation's success responses have different bodies, and they are not all JSON bodies under exact statuses (a body is text, binary or a form, or a status is a range such as 2XX). The Rust SDK types an operation whose exact statuses answer with different JSON bodies as a response enum; for the shapes it cannot represent it returns serde_json::Value and does not validate the response.

Fix. Declare each success status exactly and describe its body as JSON, or call the operation through Dispatch::invoke, which returns JSON.

TG0745

tagged union emitted by the Rust SDK as an untagged one

Meaning. A union has a discriminator, but a variant has no tag value: the mapping does not name it and it is not a component with a name or a constant to take the tag from. A union whose variants all have tags is decoded by the tag, whatever the variants are (records, other unions, maps), like the TypeScript and Python SDKs; this one cannot be, so the Rust SDK tries its variants in order like an untagged union.

Fix. Name every variant under the discriminator's mapping, or give every variant a component of its own.

TG0746

macro output typed as serde_json::Value by the Rust SDK

Meaning. The output of a macro is not an object or a reference whose members the Rust SDK can type: a member is a null, a list, a nested object or a reference into a step the API description gives no single JSON response type for. The macro's method returns serde_json::Value, the output expression evaluated by the runtime.

Fix. Read the members you need from the value, or flatten the output expression to references into steps with a documented response ($step.field) and boolean expressions.

TG0750

argument given as JSON text on the command line of the generated CLI

Meaning. An argument of an operation has no plain flag form in the generated CLI: a parameter whose type is an object, a map, a union or a list of those, or a multipart body whose parts are files. An object, map or union takes JSON text (--filter '{"a":1}', --filter @filter.json or - for standard input) or its members one at a time (--filter.a 1, --filter.created.after 5; a value is typed by the operation's schema, and both forms can be mixed, the members applied on top of the JSON text). A list of those repeats the flag, one JSON value each. A multipart file cannot be given from the command line at all.

Fix. Use the JSON or dotted form, or the SDK for multipart uploads. Nested fields of a request body are JSON-text flags by design and are not reported.

TG0751

resource named like a command of the generated CLI; renamed

Meaning. A resource, or a namespace, has the name of a command the generated CLI provides itself (auth, help, operations, schema). Its commands are under <name>-resource so that both exist.

Fix. Rename the resource under resources in tungsten.yml.

TG0752

flag renamed in the generated CLI because its name is taken

Meaning. The flag derived from an argument has the name of a flag the CLI adds to every command (--json, --body, --yes, --dry-run, --idempotency-key, --timeout, ...) or of another flag of the same command. The argument keeps its name in the SDK; its flag gets the suffix -arg.

Fix. Use the renamed flag, or rename the parameter in the spec or an overlay.

TG0753

two commands of the generated CLI share a path; the later one is numbered

Meaning. Two operations or macros end up with the same command path in the generated CLI (an operation and a macro with the same name, or a resource renamed onto another). The later one gets a numeric suffix so that both stay reachable.

Fix. Give the operations distinct names with naming.operations in tungsten.yml.

TG0760

types no operation reaches were not generated (types.prune_unreferenced)

Meaning. Some components/schemas entries are not reachable from any operation (typically the schemas only the operations excluded by an include predicate use), so they were not generated: no type, no validator, and none of the warnings their schemas would have raised. The note counts them and lists the first names. Operations that are only planned (planned_from) and the error envelope still keep the types they use.

Fix. Nothing to fix. To generate every schema anyway, set types.prune_unreferenced: false in tungsten.yml.

TG0790

invalid WebMCP target option; default used

Meaning. An option of the webmcp target is invalid, such as a malformed npm package, SDK dependency, runtime dependency or version. The emitter uses its documented default for that option.

Fix. Fix the option under targets.webmcp in tungsten.yml.

TG0791

WebMCP generated file could not be added

Meaning. The WebMCP emitter could not add a generated file to its output. The diagnostic identifies the file and the reason.

Fix. Check the target configuration. If the generated path is invalid or duplicated, report an emitter bug.

TG0792

WebMCP SDK dependency defaults to the TypeScript target package

Meaning. The webmcp target has no explicit SDK dependency, so the browser adapter depends on the package and version the typescript target generates.

Fix. Generate and make that TypeScript package available, or set targets.webmcp.sdk (<package> or <package>@<range>) or targets.webmcp.sdk_path.

TG0793

WebMCP preview tool name collides with an invocation tool

Meaning. A confirmation-bearing WebMCP tool's generated __preview name is already used by another invocation tool. The browser runtime rejects a registration whose selected tools contain that collision.

Fix. Rename the colliding operation or macro so invocation and preview tool names are distinct.

External emitters (TG08xx)

TG0801

external emitter not found or cannot be started

Meaning. A target in tungsten.yml declares external, but its emitter could not be run: with external: true there is no executable tungsten-emit-<name> on PATH; with a command, its program does not exist, is not executable, or the operating system refused to start it. Nothing is generated for the target.

Fix. Install the emitter and put it on PATH, or point external at it (a path with a slash is relative to tungsten.yml, a bare name is looked up on PATH). tungsten emitters lists what tungsten finds.

TG0802

external emitter speaks a different protocol version

Meaning. The external emitter answered with a protocol version other than 1, the only version this tungsten speaks. The response is not read.

Fix. Use an emitter release built for protocol 1, or a tungsten release that speaks the emitter's protocol. tungsten emitters shows the protocol each emitter reports.

TG0803

external emitter failed: non-zero exit, timeout or output over the cap

Meaning. The external emitter ran but did not finish normally: it exited with a non-zero status or was killed by a signal (the end of its standard error is quoted), it did not finish within timeout_ms (default 60 s), or it wrote more than max_output_bytes (default 64 MiB) to standard output. Nothing is generated for the target.

Fix. Run the emitter by hand with a request on its standard input to see why it fails. Raise timeout_ms or max_output_bytes on the target if the limit is too tight for a large API.

TG0804

external emitter returned an invalid response

Meaning. The external emitter's standard output is not a valid response of protocol 1: it is not JSON, a field has the wrong type, a file has both or neither of content and content_base64, a base64 value is malformed, a path is listed twice, or there are more than 10000 files. The same code reports a --describe document that is not valid. Nothing is generated for the target.

Fix. Check the emitter against the schema printed by tungsten schema external-emitter (validate the response against #/$defs/EmitResponse).

TG0805

external emitter returned a path outside the output directory

Meaning. The external emitter named a file path that is absolute, has a .., . or empty segment, a backslash, a NUL byte or a drive prefix, or starts with .tungsten/. Generated files are written only inside the target's out directory, so the whole response is refused and nothing is written.

Fix. Make the emitter return paths relative to the output directory with / separators. It never needs the absolute output path.

TG0806

diagnostic reported by an external emitter

Meaning. A diagnostic reported by an external emitter, kept with its severity. The message reads external emitter <name>: <code>: <text>, where <code> is the emitter's own code. An error fails the target; under --strict a warning does too.

Fix. Fix the cause the emitter describes; tungsten explain knows only tungsten's own codes, so look the emitter's code up in the emitter's documentation.

TG0807

external target not run: external emitters are off (--no-external)

Meaning. A target in tungsten.yml declares external, and tungsten was told not to start external emitters (--no-external or TUNGSTEN_NO_EXTERNAL=1), so its command was not run and the target is skipped. Nothing is generated, compared or reported for it; the diagnostic is informational and does not fail the run. emitters discovery is also disabled, including descriptor probes of programs on PATH; an empty inspection result does not mean no emitters are installed.

Fix. This is the intended result for CI that validates a manifest it does not trust. Run without the option, on a manifest you trust, to emit or check the target.

TG0808

external emitter does not declare imported-operation policy enforcement

Meaning. An external target was selected for a project with imported-operation policy, but its protocol-1 --describe response omitted import_policy or set it to false. The emitter is not run and no files are written for that target. Other supported targets are still processed. Built-in targets without this capability use TG0705.

Fix. Use an emitter that declares import_policy: true and enforces the imported metadata, or select a supported TypeScript, Python, Rust, MCP, WebMCP or docs target. Do not remove policy metadata merely to bypass this check. Protocol-1 emitters remain compatible with projects that have no imported-operation policy.

TG0809

selected host policy is invalid or does not match its digest

Meaning. A deliberately selected host policy could not be captured, exceeded the strict byte/document/nesting bounds, was not valid strict JSON, or did not match its exact lowercase BLAKE3 pin. Physical paths and authored values are omitted. No external emitter is started.

Fix. Use a regular local non-symlink policy and separately review tungsten policy digest PATH. Execution never updates the pin automatically. Policy limits do not grant executable approval or isolation.

TG0810

external target constraints exceed a protected ceiling or are invalid

Meaning. An explicit external target timeout/output value exceeds a protected ceiling, or cannot be represented on this platform. Missing/null target values keep existing defaults and are clamped. All tying protected sources remain in provenance.

Fix. Lower the project declaration to the host ceiling. A project/profile cannot weaken host restrictions. Descriptor negotiation is subject to the same preflight.

TG0811

external execution is denied by the selected host policy

Meaning. The invocation's selected host policy denies external emitter execution. Runs, imported-policy descriptor negotiation and PATH descriptor discovery are refused before execution. This is a failure, distinct from the unconditional informational --no-external skip.

Fix. Select built-in targets or obtain a deliberately reviewed host policy. A permissive policy is not executable approval, environment isolation or a sandbox.

Staleness and CI (TG09xx)

TG0901

generated output is stale relative to its inputs

Meaning. A target's output directory differs from what tungsten generate would write now: a generated file is missing or has other content, a file of the previous generation would be removed, or .tungsten/manifest.json is missing. Usually the spec or a manifest changed after the last generation, or a generated file was edited by hand.

Fix. Run tungsten generate and commit the result. Put hand-written code in the target's custom/ files, which generation never overwrites.

TG0902

API surface snapshot of the last generation is missing or unreadable; the change is not classified

Meaning. tungsten diff --semver and tungsten report compare the API surface recorded by the last generation (.tungsten/surface.json in the target's output directory) with the current one. The target has no snapshot (it was never generated, or generated by a tungsten that did not record one), or the snapshot cannot be read or parsed, so the change since that generation is not classified as major, minor or patch.

Fix. Run tungsten generate to record a snapshot; later runs of tungsten diff --semver classify the changes made after it. Do not edit files under .tungsten/.

TG0920

overlay suggest: a diagnostic has an overlay fix but its value cannot be derived; skipped

Meaning. tungsten overlay suggest found a diagnostic that an overlay action could fix, but the value the action needs cannot be derived without guessing: the operation has no single id in the IR (its document is shared by several namespaces, or the operation is expanded from an rpc envelope), or its position cannot be written as an Overlay target. The overlay suggestion leaves it out; it never writes placeholder text.

Fix. Fix the diagnostic by hand in the spec (add or change the operationId), or in the overlay you maintain yourself.

TG0921

overlay suggest: no overlay action can fix this diagnostic code

Meaning. tungsten overlay suggest only writes actions whose fix the compiler has already decided: the id of an operation without operationId, and the unique id of an operation whose operationId is used more than once. Warnings of any other code, such as an inferred pagination (TG0501) or a renamed field or type (TG0401), need a decision or live in tungsten.yml; the count is reported once per code.

Fix. Use tungsten explain on the code for its usual fix, for example declare the pagination under pagination in tungsten.yml.

TG0930

response-contract audit: a success response declares a JSON media type without a schema; the value is typed as any

Meaning. tungsten check --audit-contracts found a success response whose JSON media type declares no schema, so any JSON value is accepted and the generated SDK types the value as any. The message names the operation, the status and the media type; the second location is the operation that answers it. Default runs are unchanged: the audit runs only with the flag or --require-contracts, which fails on audit findings alone. --strict fails on these and every other warning.

Fix. Declare a schema for the media type, in the spec or in a reviewed overlay listed under overlays in tungsten.yml, or acknowledge the gap with x-tungsten-reviewed-contract on the media-type entry when any value really is accepted.

TG0931

response-contract audit: a success response schema is a free-form object (no properties, unconstrained additionalProperties); typed as a mapping of any values

Meaning. tungsten check --audit-contracts found a success response schema that is a free-form object: type: object with no properties and an open or unconstrained additionalProperties, so the generated type is a plain mapping of any values (a dict[str, Any]). A typed map, a record with properties, a response without a JSON body and a non-JSON media type are not findings; a schema marked x-tungsten-reviewed-contract counts as reviewed. See TG0930 for how the audit is run and enforced.

Fix. Declare the properties the server really answers with, named response models or their union, in the spec or a reviewed overlay, or acknowledge the free-form shape with x-tungsten-reviewed-contract when it is intentional.

TG0932

response-contract audit: traversal budget exhausted; audit is incomplete

Meaning. The opt-in response-contract audit reached its schema traversal budget. Its findings are incomplete. This warning fails --require-contracts or --strict, so an incomplete audit cannot silently satisfy that quality gate.

Fix. Split the input into smaller projects and audit each one. Reuse named schemas for shared contracts. The audit follows references and nested shapes iteratively and reports each weak source node only once.

SDK emitters: Java, C#, Kotlin, Swift, PHP, Ruby, Dart, F# (TG10xx)

TG1010

invalid java target option; the default is used

Meaning. An option of the java target in tungsten.yml is not valid: group_id and package must be dotted Java package names (no keywords), artifact_id a Maven artifactId, version and runtime versions such as 1.2.3, runtime_path a non-empty path. The generator uses the option's default instead.

Fix. Fix the option under targets.java in tungsten.yml, or remove it to keep the default.

TG1011

schema has no Java type in the java target; the runtime's JSON value is used

Meaning. The Java SDK has no native type for this schema (an allOf whose members cannot be merged into one record, or an enum whose values mix JSON types), so the typed value is the runtime's JSON value (Object: JsonObject, List, String, Long, Double, Boolean or null). The runtime still validates it against the schema.

Fix. Merge the allOf members into one object, or give the enum values a single type, if a typed Java model is wanted.

TG1012

macro is not in the canonical form; the java target leaves it out

Meaning. A macro of the agent manifest is not in the canonical form the SDK runtimes run (steps over callable operations, references to $input or earlier steps, a known step kind), so the Java SDK does not include it; the TypeScript SDK reports the same macro as TG0710.

Fix. Fix the macro in agent.yml at the pointer the diagnostic names.

TG1013

OpenID Connect scheme is sent as a bearer token by the java target

Meaning. The Java runtime sends an OpenID Connect scheme as a bearer token. It does not run discovery or obtain tokens itself.

Fix. Configure the scheme with AuthCredential.secret(token) holding an access token you obtained from the provider.

TG1014

different success bodies by status: the java typed result is the JSON value

Meaning. The operation answers different JSON bodies depending on the exact status, so the typed method's result is the runtime's JSON value; the result's metadata carries the status that tells them apart.

Fix. Read meta().status() of the result and decode the body with the matching model's fromJson.

TG1015

discriminated union variant without a tag value: the java target tries variants in order

Meaning. The union declares a discriminator, but at least one variant has no tag value or is not a named type, so the Java SDK cannot pick the variant by its tag: it decodes the variants in the plan's order and takes the first that fits.

Fix. Give every variant a named schema and a discriminator mapping value.

TG1020

invalid csharp target option; the default is used

Meaning. An option of the csharp target in tungsten.yml is not valid: package_id must be a NuGet package id, namespace a dotted C# namespace (no keywords), version and runtime versions such as 1.2.3, runtime_path a non-empty path. The generator uses the option's default instead.

Fix. Fix the option under targets.csharp in tungsten.yml, or remove it to keep the default.

TG1021

allOf without members has no C# type in the csharp target; the runtime's JsonNode is used

Meaning. The C# SDK has no native type for this schema: an allOf without members has nothing to type, so its typed value is the runtime's JsonNode?, which the runtime still validates against the schema. Two shapes that used to fall back to JsonNode? are typed since 0.2.0: an allOf whose members cannot be merged into one record (a member is not a record, has typed extra members, or two members share a wire name) is a sealed record with one typed property per member (each decodes the whole value, and ToJson() merges the properties' JSON), and an enum of mixed JSON types (booleans, fractional numbers, integers beyond 64 bits) is a readonly record struct of its known JSON values (Value is the wire value, compared as JSON).

Fix. Give the allOf at least one member, or use the JsonNode? value.

TG1022

macro is not in the canonical form; the csharp target leaves it out

Meaning. A macro of the agent manifest is not in the canonical form the SDK runtimes run (steps over callable operations, references to $input or earlier steps, a known step kind), so the C# SDK does not include it; the TypeScript SDK reports the same macro as TG0710.

Fix. Fix the macro in agent.yml at the pointer the diagnostic names.

TG1023

OpenID Connect scheme is sent as a bearer token by the csharp target

Meaning. The .NET runtime sends an OpenID Connect scheme as a bearer token. It does not run discovery or obtain tokens itself.

Fix. Configure the scheme with Credential.Secret(token) holding an access token you obtained from the provider.

TG1024

reserved: different success bodies by status are a record of answers in the csharp target

Meaning. Reserved; not reported since 0.2.0. An operation that answers different JSON bodies depending on the exact status returns a nested abstract record of its answers (<Operation>Response, one Status<code> record per status holding the typed body, or none for an empty one). Status is the HTTP status of the response; a success with a status the operation does not declare fails as an unexpected response.

Fix. Match on the answer's Status<code> records (or read Status).

TG1025

discriminated union variant without a tag value: the csharp target tries variants in order

Meaning. The union declares a discriminator, but at least one variant has no tag value or is not a named type, so the C# SDK cannot pick the variant by its tag: it decodes the variants in the plan's order and takes the first that fits.

Fix. Give every variant a named schema and a discriminator mapping value.

TG1030

invalid kotlin target option; the default is used

Meaning. An option of the kotlin target in tungsten.yml is not valid: group and package must be dotted package names usable in Kotlin and Java (no keywords), artifact an artifact name, version and runtime versions such as 1.2.3, runtime_path and java_runtime_path and coroutines_runtime_path non-empty paths, coroutines true or false. The generator uses the option's default instead.

Fix. Fix the option under targets.kotlin in tungsten.yml, or remove it to keep the default.

TG1031

schema has no Kotlin type in the kotlin target; the runtime's JSON value is used

Meaning. The Kotlin SDK has no native type for this schema (an allOf whose members cannot be merged into one data class, or an enum whose values mix JSON types), so the typed value is the Java runtime's JSON value (Any?: JsonObject, List, String, Long, Double, Boolean or null). The runtime still validates it against the schema.

Fix. Merge the allOf members into one object, or give the enum values a single type, if a typed Kotlin model is wanted.

TG1032

macro is not in the canonical form; the kotlin target leaves it out

Meaning. A macro of the agent manifest is not in the canonical form the SDK runtimes run (steps over callable operations, references to $input or earlier steps, a known step kind), so the Kotlin SDK does not include it; the TypeScript SDK reports the same macro as TG0710.

Fix. Fix the macro in agent.yml at the pointer the diagnostic names.

TG1033

OpenID Connect scheme is sent as a bearer token by the kotlin target

Meaning. The Kotlin SDK runs on the Java runtime, which sends an OpenID Connect scheme as a bearer token. It does not run discovery or obtain tokens itself.

Fix. Configure the scheme with AuthCredential.secret(token) holding an access token you obtained from the provider.

TG1034

different success bodies by status: the kotlin typed result is the JSON value

Meaning. The operation answers different JSON bodies depending on the exact status, so the typed function's result is the runtime's JSON value; the result's metadata carries the status that tells them apart.

Fix. Read meta().status() of the result and decode the body with the matching model's fromJson.

TG1035

discriminated union variant without a tag value: the kotlin target tries variants in order

Meaning. The union declares a discriminator, but at least one variant has no tag value or is not a named type, so the Kotlin SDK cannot pick the variant by its tag: it decodes the variants in the plan's order and takes the first that fits.

Fix. Give every variant a named schema and a discriminator mapping value.

TG1060

invalid Ruby target option; default used

Meaning. An option of the ruby target is not valid (a gem that is not a lowercase gem name, a module that is not a Ruby constant path or names a core class or the runtime's Tungsten, a version that is not a gem version, a runtime that is not a gem requirement, or an empty runtime_path), so its default is used.

Fix. Fix the option under targets.ruby in tungsten.yml.

TG1061

allOf type that cannot be merged is a JSON value in the Ruby SDK

Meaning. An allOf could not be merged into one record (a member is not a record, has typed extra members, or two members share a wire name). The Ruby SDK has no model for it: its typed value is the JSON value, which the runtime still validates against every member.

Fix. Restructure the schema so its members are records with distinct properties, or accept the JSON value.

TG1062

macro not in the canonical form; left out of the Ruby SDK

Meaning. A macro of agent.yml is not in the canonical form the SDKs run (an unknown step kind or operation, a reference to no earlier step, an invalid as, until or budget). The Ruby SDK leaves it out; the other operations are generated as usual.

Fix. Fix the macro in agent.yml; the message names the offending member.

TG1063

OpenID Connect scheme sent as a bearer token by the Ruby SDK

Meaning. The API declares an OpenID Connect security scheme. The Ruby SDK sends the configured credential as a bearer token and does not run discovery or obtain tokens itself.

Fix. Obtain the token yourself and pass it in auth: under the scheme's name.

TG1064

different success bodies by status; the Ruby SDK's typed result is the JSON value

Meaning. An operation answers different JSON bodies depending on the status. The Ruby SDK's typed result for it is the decoded JSON value; the runtime validates it against the body of the status that arrived.

Fix. Nothing to fix; read result.meta.status to tell the bodies apart.

TG1065

discriminated union variant without a tag value; the Ruby SDK tries the variants in order

Meaning. A union has a discriminator, but one of its variants has no tag value or is not a named type, so the Ruby SDK cannot pick the variant by the tag. It tries the variants in order and decodes the first that accepts the value.

Fix. Give every variant a discriminator.mapping entry or a const tag property.

TG1070

invalid dart target option; the default is used

Meaning. An option of the dart target is not valid (a package that is not a pub package name or is a Dart keyword or tungsten_runtime, a version that is not a semantic version, a runtime that is not a pub version constraint, or an empty runtime_path), so its default is used.

Fix. Fix the option under targets.dart in tungsten.yml.

TG1071

schema has no Dart type in the dart target (allOf without members, enum beyond 64 bits); the JSON value (Object?) is used

Meaning. A schema has no Dart type: an allOf without members has nothing to type, and an enum with an integer beyond 64 bits has no Dart constant (a Dart int is 64 bits, and a double would send another number). The Dart SDK types it as its JSON value (Object?), which the runtime still validates against the schema. Two shapes that used to fall back to Object? are typed since 0.2.0: an allOf whose members cannot be merged into one record (a member is not a record, has typed extra members, or two members share a wire name) is a final class with one typed part per member (each decodes the whole value, and toJson() merges the parts' JSON), and an enum of mixed JSON types (booleans, fractional numbers) is an enhanced enum whose wire is the JSON value, compared as JSON.

Fix. Give the allOf at least one member, keep the integers of the enum within 64 bits, or accept the JSON value.

TG1072

macro is not in the canonical form; the dart target leaves it out

Meaning. A macro of agent.yml is not in the canonical form the SDKs run (an unknown step kind or operation, a reference to no earlier step, an invalid as, until or budget). The Dart SDK leaves it out; the other operations are generated as usual.

Fix. Fix the macro in agent.yml; the message names the offending member.

TG1073

OpenID Connect scheme is sent as a bearer token by the dart target

Meaning. The API declares an OpenID Connect security scheme. The Dart SDK sends the configured credential as a bearer token and does not run discovery or obtain tokens itself.

Fix. Obtain the token yourself and pass it in ClientOptions.auth under the scheme's name.

TG1074

reserved: different success bodies by status are a sealed class of answers in the dart target

Meaning. Reserved; not reported since 0.2.0. An operation that answers different JSON bodies depending on the exact status returns a sealed class of its answers (<Resource><Operation>Response, one ...Status<code> subclass per status; value is the typed body, absent for an empty one, and status the HTTP status). A success with a status the operation does not declare fails as an unexpected response.

Fix. Switch over the answer's subclasses (or read status).

TG1075

discriminated union variant without a tag value: the dart target tries variants in order

Meaning. A union has a discriminator, but one of its variants has no tag value or is not a named type, so the Dart SDK cannot pick the variant by the tag. It tries the variants in order and decodes the first that accepts the value.

Fix. Give every variant a discriminator.mapping entry or a const tag property.

TG1080

invalid fsharp target option; the default is used

Meaning. An option of the fsharp target in tungsten.yml is not valid: package_id must be a NuGet package id, namespace a dotted F# namespace (no F# or C# keywords), version and runtime versions such as 1.2.3, runtime_path and csharp_runtime_path non-empty paths. The generator uses the option's default instead.

Fix. Fix the option under targets.fsharp in tungsten.yml, or remove it to keep the default.

TG1081

allOf without members has no F# type in the fsharp target; the runtime's JsonNode is used

Meaning. The F# SDK has no native type for this schema: an allOf without members has nothing to type, so its typed value is the .NET runtime's JsonNode, which the runtime still validates against the schema. Two shapes that used to fall back to JsonNode are typed since 0.2.0: an allOf whose members cannot be merged into one record (a member is not a record, has typed extra members, or two members share a wire name) is a record with one typed field per member (each decodes the whole value, and ToJson() merges the fields' JSON), and an enum of mixed JSON types (booleans, fractional numbers, integers beyond 64 bits) is a union of its known JSON values plus Unknown of JsonNode (Value is the wire value, compared as JSON).

Fix. Give the allOf at least one member, or use the JsonNode value.

TG1082

macro is not in the canonical form; the fsharp target leaves it out

Meaning. A macro of the agent manifest is not in the canonical form the SDK runtimes run (steps over callable operations, references to $input or earlier steps, a known step kind), so the F# SDK does not include it; the TypeScript SDK reports the same macro as TG0710.

Fix. Fix the macro in agent.yml at the pointer the diagnostic names.

TG1083

OpenID Connect scheme is sent as a bearer token by the fsharp target

Meaning. The F# SDK runs on the .NET runtime, which sends an OpenID Connect scheme as a bearer token. It does not run discovery or obtain tokens itself.

Fix. Configure the scheme with Credential.Secret(token) holding an access token you obtained from the provider.

TG1084

reserved: different success bodies by status are a union of answers in the fsharp target

Meaning. Reserved; not reported since 0.2.0. An operation that answers different JSON bodies depending on the exact status returns a union of its answers (<Class><Member>Response, one Status<code> case per status holding the typed body, none for an empty one). Status is the HTTP status of the response; a success with a status the operation does not declare fails as an unexpected response.

Fix. Match on the answer's Status<code> cases (or read Status).

TG1085

discriminated union variant without a tag value: the fsharp target tries variants in order

Meaning. The union declares a discriminator, but at least one variant has no tag value or is not a named type, so the F# SDK cannot pick the variant by its tag: it decodes the variants in the plan's order and takes the first that fits.

Fix. Give every variant a named schema and a discriminator mapping value.

Request import: saved cURL and .http (TG12xx)

TG1201

saved cURL or .http request could not be imported

Meaning. A saved cURL command or .http request given to tungsten init cannot be imported. Requests are parsed as data and never executed, so anything that needs a shell, a file or an environment is refused: compound commands, expansions, unsupported flags, file bodies or headers, unbound {{variables}}, credentials in the URL, headers or query, a non-JSON body, an input over the size limit, or a missing or mismatched --route template. The message names the first problem.

Fix. Save exactly one request. For cURL use curl (or curl.exe in PowerShell) with --request, --header, --url and inline JSON data only, and pass the trusted path template with --route. Bind every {{variable}} of a .http file explicitly and describe authentication in an endpoint manifest instead of the request.