* feat: add QCA delegation integration * fix: keep delegation JSON arrays non-null
QCA Forward integration
This integration runs Open Code Review in delegation mode inside a QCA Forward session. OCR performs deterministic file selection and rule resolution; the QCA host model performs the review. No OCR LLM endpoint or API key is required.
Assets
template.example.jsonis a Forward Template example. Replace the skill and environment placeholders before publishing.system-prompt.mdis the canonical system prompt for the template.../../../skills/open-code-review-delegate/SKILL.mdis the Skill package to publish and bind to the template.
Runtime requirements
The environment referenced by the template must provide:
- Git 2.41 or later.
- A compatible
ocrbinary onPATH. - A checked-out repository as the session workspace.
For production, preinstall and pin OCR in the runtime image. Installing the latest NPM package during every session adds network, startup, and compatibility risk.
Publish flow
- Package and publish
skills/open-code-review-delegateas a QCA Skill. - Build or select an environment with Git and OCR preinstalled.
- Replace
skill_open_code_review_delegate,env_code_review, andPIN_AT_PUBLISH_TIMEin the template example with real resource IDs and pinned Skill/OCR versions. - Create the Forward Template and bind a repository through the Template or Identity configuration.
- Create a new session and send a workspace, range, or commit review request.
Template updates affect new sessions only. Keep the template metadata aligned with the pinned OCR, Skill, and delegation schema versions.
Supported requests
Review the current workspace changes.
Review feature/order-refactor against main. The change must preserve order
state transition idempotency. Report medium-severity and higher findings.
Review commit abc123.
Execution contract
The QCA agent must:
- Run
ocr delegate preview --format jsonwith the requested target. - Put every
reviewable_filesentry into an explicit checklist. - Run
ocr delegate rule --format jsonfor those files. - Review bounded batches grouped by rule and diff size.
- Mark every file reviewed or skipped with a reason.
- Report findings plus total, reviewed, skipped, and coverage counts.
Use (path, status) as the checklist identity. In workspace mode, a staged
deletion followed by an untracked recreation can legitimately produce two
entries with the same path and different statuses.
The agent must not run ocr review, ocr llm test, or request OCR model
credentials.
Validation
ocr delegate preview --format jsonreturnsschema_version: "1".- All previewed files are accounted for in the final response.
- Write and Edit are disabled. Bash read-only behavior is prompt-enforced unless the QCA runtime applies a stricter command policy.
- The session completes without
OCR_LLM_*variables. - Workspace, branch range, and single-commit reviews all work.