Class NucleoSchemaKeywords
java.lang.Object
ai.redouble.nucleo.harness.schema.NucleoSchemaKeywords
The
x-nucleo-* JSON Schema vocabulary: keywords that carry a field's Nucleo
annotations to a consumer that cannot read the annotations themselves.
A schema has two audiences. The standard keywords - type, description,
required, enum, examples - are what a model reads in a tool
definition. These keywords are what a consuming HARNESS reads: whether a field can be
summarized and how, whether it belongs in a model's context at all, what an
artifact-typed field points at. In process a harness reads the annotations off the class;
across an MCP boundary, where the concrete class may not resolve, the schema is the only
source. JSON Schema ignores unknown keywords, so they are inert for anyone else.
stripFrom(String) removes them again on the path to a model, which is why the prefix
has to be stable: it is what the strip keys on.
- Since:
- 0.1 (2026-09-04)
- Author:
- Andrey Santrosyan
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String@LLMContextIgnore: present in the payload, kept out of a model's context.static final StringThe prefix every harness-facing keyword carries, and whatstripFrom(String)keys on.static final String@LLMSummarizable, as declared: hint, size, threshold, llmSafe, preSummarized, staticSummary.static final StringThe@TypeAliasof an artifact-typed field, which is also what its refs carry. -
Method Summary
-
Field Details
-
PREFIX
The prefix every harness-facing keyword carries, and whatstripFrom(String)keys on.- See Also:
-
SUMMARIZABLE
@LLMSummarizable, as declared: hint, size, threshold, llmSafe, preSummarized, staticSummary.- See Also:
-
CONTEXT_IGNORE
@LLMContextIgnore: present in the payload, kept out of a model's context.- See Also:
-
TYPE_ALIAS
The@TypeAliasof an artifact-typed field, which is also what its refs carry.- See Also:
-
-
Method Details
-
stripFrom
Returns the schema with everyx-nucleo-*keyword removed, at every depth.- Parameters:
schemaJson- a JSON Schema document, or null or empty- Returns:
- the stripped schema; null for a null input and empty for an empty one
- Throws:
IOException- if the input is not JSON
-
forModel
Returns the schema as a model is offered it: every artifact-typed field reduced to its reference, then everyx-nucleo-*keyword removed. A model never authors an artifact, so it is never asked for one's content: where an input takes an artifact, the model writes the reference of one the registry lists.- Parameters:
schemaJson- a JSON Schema document, or null or empty- Returns:
- the model-facing schema; null for a null input and empty for an empty one
- Throws:
IOException- if the input is not JSON
-