Component construction checks
This page provides the copyable Markdown source for the component-construction.md reference used by the Codex skill.
Copyable Markdown source
Copy the following block into references/component-construction.md.
# Component construction checks
Use these checks while constructing an Agent Spec. Confirm field names, component support, defaults, and type compatibility against the target database release. This checklist is not a complete schema or database validator.
## Graph structure and contracts
- A `Flow` describes a graph; use its declared `start_node`, node collection, control-flow connections, and data-flow connections. For a minimal smoke case, use StartNode -> EndNode and explicitly carry a string input to the terminal output.
- Control-flow edges determine execution order. Data-flow edges bind a producer output to a consumer input. A control edge alone does not transfer a value.
- Resolve `$component_ref` using the document's `$referenced_components` representation and supported scoping. Check IDs, reference targets, edge endpoints, and declared port titles. Do not paste Markdown-escaped field names such as `component\_type` into JSON.
- Check Flow inputs against the entry contract, and Flow outputs against the reachable terminal contracts. Every required downstream input needs an upstream binding or a documented default. Check each terminal path, not only the happy path.
- Use `FlowNode` to invoke a child Flow and `AgentNode` to invoke an Agent within a Flow. Do not place a bare nested Flow in the node list as a substitute for its wrapper. Verify wrapper inputs/outputs against the delegated executable.
- For branching, check outgoing branch labels, edge selection, and data availability on every reachable path. For loops, make the termination condition explicit.
- For Map and parallel components, check the element/collection contracts and child executable separately. A collection type does not automatically match the per-item input. Confirm concurrency and conversational restrictions for the target release before choosing a parallel design.
## Type boundaries
Distinguish declared schema compatibility from runtime value validity. A parse-valid object can still lack a required property at runtime. Test null, missing fields, empty collections, and nested structures when relevant.
Do not infer compatibility from JSON syntax or assume every type converts to every other type. Check array element types, object required fields, union alternatives, and direction of assignment using the released rules. Compatibility across a DataFlowEdge and compatibility with a PL/SQL procedure are separate checks.
## PL/SQL-backed tools
Obtain the actual callable signature, including owner, package where applicable, procedure, overload, parameter spelling, direction, and database types. Use the target release's documented `BuiltinTool` / `plsql_exec` configuration. Do not concatenate a qualified procedure name into a field if the interface expects separate fields.
Declare the `BuiltinTool` inputs and outputs explicitly in the tool definition. When a `ToolNode` invokes it, check the node's input and output declarations against the tool's declarations using the target release's matching rules.
Then check the tool against the PL/SQL signature. Match each parameter name and use a compatible Agent Spec type. Declare an `IN` parameter as a tool input, an `OUT` parameter as a tool output, and an `IN OUT` parameter in both lists under the same parameter name.
Caller-facing names can differ. For example, map the caller's `question` to the `ToolNode` input `P_TEXT` and retain `P_TEXT` in the tool definition to match the procedure parameter.
Check procedure binding and ordinary execution privileges with the intended execution principal. A test run as a privileged account does not establish that an application user can call it. Do not recommend elevated privileges as a generic workaround.
For a read-only procedure accepting text and returning text, use a string schema only after confirming that mapping is supported. For structured CLOB payloads, verify serialization and the documented mapping; do not treat CLOB as an unrestricted replacement for every Agent Spec type.
## Useful smoke checks
1. A deterministic string passthrough tests Flow wiring without a model or tool.
2. A known read-only tool tests procedure binding and input/output propagation.
3. A deterministic model fixture, if available in the test environment, tests orchestration without comparing variable prose. Do not make an internal fixture server a user prerequisite.
4. A representative real-provider call tests credentials, network access, supported model configuration, and output behavior separately.
For each test, assert the returned value and shape, not merely successful PL/SQL completion. Preserve exact errors and identify whether failure occurred during parsing, binding, tool execution, or model execution.
## Public documentation
- [Agent Building Blocks](https://docs.oracle.com/en/database/oracle/oracle-database/26/odbae/agent-building-blocks.html)
- [Agent architecture and components](https://docs.oracle.com/en/database/oracle/oracle-database/26/odbae/oracle-ai-database-agent-engine/agent-architecture-and-components.html)
- [Define Tools and Built-In Tool Types](https://docs.oracle.com/en/database/oracle/oracle-database/26/odbae/agent-building-blocks/define-tools-and-built-in-tool-types.html)
## Procedure parameter compatibility
| PL/SQL | Agent Spec |
|---|---|
| VARCHAR2 | string |
| NUMBER | number, integer, boolean |
| CLOB | string, object, array |
| BOOLEAN | boolean |
A nullable anyOf may combine one compatible type with null. Multiple non-null alternatives cannot bind to a single parameter. Resolve references by component ID, unique in its documented scope. Display names describe components. The stored agent name identifies the registered executable in the database.