Skip to content

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

  1. Read public circuit boundary docs.
  2. Confirm that payload exchange uses rqm-circuits schema target 0.2.
  3. Confirm separation between public payload boundary and internal u1q compiler IR.

  4. Prepare public circuit payload.

  5. Build payload from documented boundary expectations.
  6. Attach correlation/request metadata for traceability.
  7. If field-level schema detail is not present in docs, confirm exact route/schema in Swagger UI before implementation.

  8. Validate payload.

  9. Use documented validate route (POST /v1/circuits/validate).
  10. Expect the standard response envelope (status, data or error, meta).

  11. Only if valid, call analyze/optimize route from documented API/Swagger.

  12. Use documented routes (POST /v1/circuits/analyze, POST /v1/circuits/optimize).
  13. Do not call optimize for invalid payloads.
  14. Do not invent extra endpoints, inferred sub-routes, or undocumented request fields.

  15. Preserve request/response JSON artifacts.

  16. Save: validate request, validate response, analyze/optimize request, analyze/optimize response.
  17. Include timestamp and request ID metadata when available.

  18. Surface verification/trust metadata.

  19. Present optimization outputs as verification-sensitive and fail-closed by posture.
  20. Include any before/after metrics and proof/report references returned by documented APIs.

Failure path (validation errors)

If validation fails:

  1. Stop optimize/execution steps.
  2. Persist the failing request and error envelope.
  3. Classify failure type (schema mismatch, unsupported field, malformed value, unknown).
  4. Repair payload against documented/public schema guidance.
  5. Re-run validation.
  6. Continue only after validation succeeds.

Conservative example payload guidance

Exact field-level request bodies for circuits endpoints are not fully specified in repository docs.

Before coding a concrete payload model, confirm exact route/schema in Swagger UI before implementation.