Class ArtifactResponse<R extends Reasoning>
java.lang.Object
ai.redouble.nucleo.harness.schema.ReasonablePojo<R>
ai.redouble.nucleo.harness.artifacts.ArtifactResponse<R>
- Type Parameters:
R- the type of reasoning for this response
- Direct Known Subclasses:
ThinkerOutput
Base class for agent responses that can reference preserved artifacts.
Extends ReasonablePojo to include reasoning capabilities, and adds the artifactRefs field for tracking which artifacts should be propagated to parent contexts.
The refs are canonical by construction: the model's parsed list enters through a
package-private Jackson setter and canonicalizeArtifactRefs(String) replaces it with
the normalized, deduplicated form right after parse, while programmatic additions go
through addArtifactRef(String), which normalizes each ref - so no caller outside this
package can plant a variant spelling.
The artifactRefs field is curated propagation: the responder decides what its parent needs.
- Include ALL artifact references the parent needs to understand the response
- Can filter out irrelevant artifacts from child tools
- Can aggregate artifacts from multiple sources
- Acts as the single source of truth for what propagates upward
Example usage:
public class AnalysisResponse extends ArtifactResponse<ChainOfThoughtReasoning> {
private String analysis;
// artifactRefs inherited - contains refs in canonical format: «artifact:link:cite~a1b2c3»
}
- Since:
- 0.1 (2025-11-13)
- Author:
- Andrey Santrosyan
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new ArtifactResponse with an empty artifactRefs list. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddArtifactRef(String artifactRef) Adds a single artifact reference to the propagation list.voidcanonicalizeArtifactRefs(String answerText) The single canonicalization gate for a parsed response: normalizes every declared reference, unions the«artifact:...»mentions found in the answer's text (ArtifactRegistry.refsMentionedIn(String)), deduplicates across spellings, and replaces the list - declared order first, then first-mention order.Gets the list of artifact references to propagate to the parent context.booleanChecks if this response references any artifacts.Methods inherited from class ReasonablePojo
getReasoning, setReasoning
-
Constructor Details
-
ArtifactResponse
public ArtifactResponse()Creates a new ArtifactResponse with an empty artifactRefs list.
-
-
Method Details
-
getArtifactRefs
-
canonicalizeArtifactRefs
The single canonicalization gate for a parsed response: normalizes every declared reference, unions the«artifact:...»mentions found in the answer's text (ArtifactRegistry.refsMentionedIn(String)), deduplicates across spellings, and replaces the list - declared order first, then first-mention order. The response handler runs it after every parse, so a response leaving the thinking loop carries canonical refs by construction and a text-mentioned artifact can never hide behind a declared duplicate. -
addArtifactRef
Adds a single artifact reference to the propagation list. The reference is normalized to canonical format: «artifact:type~uuid».- Parameters:
artifactRef- the artifact reference in any format
-
hasArtifactRefs
public boolean hasArtifactRefs()Checks if this response references any artifacts.- Returns:
- true if artifactRefs contains at least one reference
-