Validate → Optimize Workflow¶
Agent instruction block¶
Implement a validate-before-optimize pipeline using documented RQM API behavior.
Use the public rqm-circuits boundary first, preserve request/response artifacts,
and treat optimization outputs as trust-sensitive candidates with verification metadata.
If route or schema detail is missing from docs, confirm exact route/schema in Swagger UI before implementation.
Step-by-step flow¶
- Read public circuit boundary docs.
- Confirm that payload exchange uses
rqm-circuitsschema target0.2. -
Confirm separation between public payload boundary and internal
u1qcompiler IR. -
Prepare public circuit payload.
- Build payload from documented boundary expectations.
- Attach correlation/request metadata for traceability.
-
If field-level schema detail is not present in docs, confirm exact route/schema in Swagger UI before implementation.
-
Validate payload.
- Use documented validate route (
POST /v1/circuits/validate). -
Expect the standard response envelope (
status,dataorerror,meta). -
Only if valid, call analyze/optimize route from documented API/Swagger.
- Use documented routes (
POST /v1/circuits/analyze,POST /v1/circuits/optimize). - Do not call optimize for invalid payloads.
-
Do not invent extra endpoints, inferred sub-routes, or undocumented request fields.
-
Preserve request/response JSON artifacts.
- Save: validate request, validate response, analyze/optimize request, analyze/optimize response.
-
Include timestamp and request ID metadata when available.
-
Surface verification/trust metadata.
- Present optimization outputs as verification-sensitive and fail-closed by posture.
- Include any before/after metrics and proof/report references returned by documented APIs.
Failure path (validation errors)¶
If validation fails:
- Stop optimize/execution steps.
- Persist the failing request and error envelope.
- Classify failure type (schema mismatch, unsupported field, malformed value, unknown).
- Repair payload against documented/public schema guidance.
- Re-run validation.
- Continue only after validation succeeds.
Conservative example payload guidance¶
Exact field-level request bodies for circuits endpoints are not fully specified in repository docs.
- Use this fixture entrypoint:
/examples/agent-circuit-validation.placeholder.json - For optimize request scaffolding, use:
/examples/agent-optimization-request.placeholder.json
Before coding a concrete payload model, confirm exact route/schema in Swagger UI before implementation.