Skip to content

Add isolated Claude Code and Codex connectors to Review Tutor #63

Description

@ElbertePlinio

Goal

Add honest, isolated Claude Code and Codex harness connectors to Review Tutor after #59 / PR #61 is human-approved.

Review Tutor currently has one real connector: Pi. The browser must continue to show only harnesses that are actually installed, available, and supported. No disabled placeholders or UI-only options.

Status

Deferred / planned. Do not start implementation until PR #61 is finished and human-approved.

This is multi-PR work and must remain dark on main until the complete flow is ready. Proposed feature flag: reviewTutorHarnessConnectors (default off). Label this issue flagged; flag removal is part of completion after the enabled release.

Product contract

  • Keep harness and model as separate concepts.
  • Preserve the local-first, loopback-only Review Tutor security model.
  • Run every question in a new isolated child process; never reuse or attach to the parent coding-agent session.
  • Keep tutor tools read-only and bounded. The browser receives no provider credentials.
  • Show Claude Code or Codex only after connector discovery succeeds; explain unavailable connectors outside the primary flow rather than presenting fake choices.
  • Namespace model identities by harness so equal provider model names cannot collide.
  • Keep Pi behavior unchanged while the flag is off.

Required design work

Before implementation, freeze a connector boundary that owns:

  1. executable and capability discovery;
  2. harness-specific model discovery and thinking/reasoning options;
  3. isolated invocation and prompt transport;
  4. normalized progress, answer, error, and terminal events;
  5. cancellation and process-tree cleanup;
  6. bounded stdout/stderr parsing and actionable failure messages;
  7. credential redaction and an explicit child-environment policy.

Do not add a harness field opportunistically to the existing rt/1 request. Define and test the protocol migration or compatibility strategy first.

Security and process requirements

  • Preserve loopback binding, random bearer token, exact Origin/Host checks, CSP, and no credential exposure to page state or logs.
  • Preserve detached POSIX process groups, bounded output, SIGTERM → SIGKILL escalation, server-shutdown cleanup, and one terminal outcome.
  • Add equivalent proven Windows process-tree cancellation before claiming Windows support.
  • Use a minimal documented environment policy; never print tokens, API keys, auth files, or provider command lines containing secrets.
  • Restrict child tools to the Review Tutor read-only allowlist (read,grep,find,ls) or the closest enforceable provider-native equivalent. If a provider cannot enforce that boundary, mark the connector unavailable rather than weakening it silently.
  • Use immutable input snapshots; do not grant source-editing authority.

Delivery slices

PR 1 — Connector boundary and protocol decision

  • Add a harness connector registry with Pi implemented through the boundary and no behavior change.
  • Freeze the request/state/event compatibility strategy and namespaced model identity.
  • Add fake-executable contract tests for discovery, lifecycle events, malformed output, timeouts, cancellation races, process cleanup, and redaction.
  • Add the default-off reviewTutorHarnessConnectors flag.

PR 2 — Claude Code connector

  • Detect the real executable and supported non-interactive interface.
  • Discover only models/options the local installation can honestly run.
  • Enforce isolated, read-only execution and normalized cancellation.
  • Cover absent binary, auth failure, unsupported version, empty answer, malformed output, timeout, cancellation, and successful answer.
  • Complete one real local provider smoke without recording credentials.

PR 3 — Codex connector

  • Apply the same discovery, isolation, normalization, cancellation, redaction, and test contract.
  • Cover provider-specific auth/version/output failures without leaking provider internals to the browser.
  • Complete one real local provider smoke without recording credentials.

PR 4 — Enabled UI and cross-harness acceptance

  • Populate Harness only from available connectors.
  • Refresh Model and reasoning choices from the selected connector without stale cross-harness state.
  • Keep Pi first/default when it is the active parent harness and available.
  • Preserve draft/selection state when switching harnesses; a running question retains its original harness/model identity.
  • Prove cancel, answer, quiz, Learning Log, export, reload, and error recovery for each connector.
  • Verify desktop, mobile, high zoom, keyboard, focus, and screen-reader behavior.
  • Enable the flag only in the release that ships the completed feature.
  • Remove the flag in the next follow-up PR.

Acceptance criteria

  • Pi remains unchanged with the flag off.
  • No harness appears unless its connector passes discovery.
  • Browser state, JSONL, exported HTML, errors, and command output contain no credentials.
  • Each question runs outside the parent agent session and cannot edit source.
  • Cancellation terminates the full child process tree and reconciles terminal races.
  • Harness/model attribution survives persistence and export.
  • CI uses deterministic fake connectors; real-provider tests are explicit local smoke checks, not credential-dependent CI.
  • Linux behavior is proven; macOS/Windows support is claimed only with platform-specific process and discovery proof.
  • Build Review Tutor learning companion #59 and the Review Tutor docs link this issue once implementation begins.

Metadata

Metadata

Assignees

No one assigned

    Labels

    flaggedFeature merged dark pending release enablement and flag removal

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions