Skip to content

feat(phase2): 'claude' provider — measurement-grounded interpreter via local Claude Code CLI (no Gemini credits) - #153

Merged
slittycode merged 7 commits into
mainfrom
claude/strange-sammet-3969e9
Jun 10, 2026
Merged

feat(phase2): 'claude' provider — measurement-grounded interpreter via local Claude Code CLI (no Gemini credits)#153
slittycode merged 7 commits into
mainfrom
claude/strange-sammet-3969e9

Conversation

@slittycode

Copy link
Copy Markdown
Owner

Why

Gemini API credits ran out, blocking Phase 2 interpretation entirely. This adds a third
selectable provider (mirroring the MOSS pattern, default-off): `ASA_PHASE2_PROVIDER=claude`
runs the operator's local Claude Code CLI headless as a text-only interpreter — it
grounds on the prompt's embedded Phase 1 JSON and never receives the audio, needs no
`GEMINI_API_KEY`, and rides the operator's existing Claude Code login.

What

  1. `apps/backend/phase2_provider.py`: `ClaudeCliProvider` — subprocess `claude -p
    --output-format json --safe-mode --tools "" --no-session-persistence`, prompt via stdin,
    profile `responseSchema` converted from Gemini dialect to JSON Schema and enforced via
    `--json-schema`; prefers the CLI's validated `structured_output`, falls back to
    fence-stripped text. Typed errors (`CLAUDE_CLI_UNAVAILABLE/FAILED/TIMEOUT/BAD_OUTPUT`);
    non-zero exits surface the CLI's stdout error event. 600 s default timeout (a full
    producer_summary prompt measures ~6 min on the CLI default model).
  2. Zero `server.py` changes — the existing provider seam already isolates all Gemini
    concerns behind `external_provider is None`.
  3. Tests: `tests/test_phase2_provider.py` +17 (resolver, sandbox flags, schema conversion
    incl. the real PHASE2_RESPONSE_SCHEMA, subprocess failure modes, and an integration test
    proving the claude branch flows through the shared parse/citation/catalogue/
    recommendations.v1 tail with no GEMINI_API_KEY set).
  4. Docs: CLAUDE.md env block, PHASE2_PROVIDER.md addendum, plus
    `audits/owner-assessment-2026-06-10.md` (whole-project audit write-up).

Live verification (real track, no Gemini key)

`VTSS – Can't Catch Me` end-to-end through the staged API: 26/26 device cards cited,
0 invented citation paths
(Gemini's documented bar on this track: 22/22), 26-entry
`recommendations.v1` envelope, full-surface coverage, authoritative BPM/key echoed exactly;
6 warn-and-keep catalogue annotations (working as designed). The same output also produced
asa-ableton's first real Gate α receipt (11/11 fidelity, skip-rate 60.7%).

Verification

  • `tests.test_phase2_provider` 42/42
  • `tests.test_server` 224/224 (Gemini default path behavior-preserved)
  • full backend `unittest discover` green (1199 tests)

🤖 Generated with Claude Code

slittycode and others added 7 commits June 8, 2026 03:20
- Fix unittest slash-path form → dotted module form in apps/backend/AGENTS.md
- Add UPDATE_PHASE1_GOLDEN re-baseline command to CLAUDE.md Tripwire #4
- Add first-time Playwright install line to CLAUDE.md frontend commands
- Add record_artifact pointer to analysis_runtime.py entry in CLAUDE.md
- Add --source/--output invocation to build_live12_catalogue.py entry
- Reconcile Node version in apps/ui/AGENTS.md against package.json (no engines field)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… Claude Code CLI

ASA_PHASE2_PROVIDER=claude routes producer_summary interpretation to
ClaudeCliProvider: runs the operator's local Claude Code CLI headless
(--safe-mode, --tools "", --no-session-persistence), prompt via stdin,
profile responseSchema converted from Gemini dialect and enforced via
--json-schema. Text-only by design — grounds on the prompt's embedded
Phase 1 JSON; audio is never sent; no GEMINI_API_KEY needed. Output flows
through the identical parse/citation/catalogue/recommendations.v1 tail.
Default-off; gemini stays the product default (mirrors the MOSS pattern).

Live verification on a real track (no Gemini key): 26/26 cards cited,
0 invented citation paths, recommendations.v1 envelope 26 entries,
full-surface coverage; 6 warn-and-keep catalogue annotations. Also adds
audits/owner-assessment-2026-06-10.md (whole-project audit write-up).

Tests: tests.test_phase2_provider 42/42; tests.test_server 224/224
(Gemini path behavior-preserved); full backend discover green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…is unset

The advisory review action has failed every PR since 2026-06-09 in ~25s
because the repo secret resolves empty. Gate the steps on secret presence
so a missing credential yields a passing job with skipped steps instead of
a red check. Re-add the secret in Settings → Secrets → Actions to restore
actual reviews.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…eal tracks

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The claude-code-action token exchange validates that the workflow file on
a PR branch matches the default branch exactly; any divergence (or the
file's absence on pre-workflow branches — the actual cause of the
2026-06-09+ failures) yields 401 'Workflow validation failed'. The skip
guard added in f6d61e5 therefore could never help and itself tripped the
validation; reverting to main's exact content lets the review run.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…clusive, no fallback/ensemble; Gemini stays default; claude is local-CLI-only

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@slittycode
slittycode merged commit f9b9a7f into main Jun 10, 2026
4 of 5 checks passed
@slittycode
slittycode deleted the claude/strange-sammet-3969e9 branch June 10, 2026 10:42
slittycode added a commit that referenced this pull request Jun 10, 2026
Summarizes current state (PR #153 merged, Claude provider live-verified),
lists required owner steps (Ableton renders, asa-ableton Gate β), and
documents the Gemini→Claude provider context for the recommendation-proof campaign.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant