Skip to content

Transition analysis API to asynchronous inference orchestrator#323

Merged
seonghobae merged 6 commits into
developfrom
codex/update-analysis-api-for-asynchronous-inference
Jun 18, 2026
Merged

Transition analysis API to asynchronous inference orchestrator#323
seonghobae merged 6 commits into
developfrom
codex/update-analysis-api-for-asynchronous-inference

Conversation

@Codex

@Codex Codex AI commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds push-style analysis job progress updates from the Tauri analysis worker to the React workspace via the allowlisted analysis-job-updated event, while keeping polling as a fallback.
  • Persists reusable local-audio analysis results plus stem feature arrays under the app-provided cache root to avoid recomputing stems on repeated analysis.
  • Hardens local ML orchestration with process-enforced stem-separation timeouts, typed fallback progress, and safe cache-miss behavior for malformed cache files.
  • Updates the workspace loading UI/tests so multi-stage progress labels and percentages are visible during longer local inference.

Closes #109.

Verification

  • ./scripts/harness/quickcheck.sh
  • cargo check --manifest-path apps/desktop/src-tauri/Cargo.toml
  • npm run typecheck --workspaces --if-present
  • npm run test --workspace @bandscope/desktop
  • uv run pytest --cov=src/bandscope_analysis --cov-report=term-missing --cov-fail-under=100 from services/analysis-engine
  • uv run mypy src from services/analysis-engine

Security Notes

  • Attack surface: local audio paths, app-owned cache/temp roots, Python subprocess orchestration, Tauri event payloads, and persisted stem feature cache files.
  • Trust boundary touched: desktop UI -> Tauri IPC -> allowlisted Python subprocess over stdin/stdout JSONL -> app-owned storage cache.
  • Realistic threats: malformed IPC payloads, hostile or stale cache contents, runaway local ML inference, accidental full-path disclosure in persisted cache metadata, and malformed progress events.
  • Mitigations: existing strict request/status parsers remain in place; local-audio cache/temp roots are supplied by the Tauri bootstrap source rather than user-entered fields; cache filenames are digest-derived; cache metadata omits full original source paths; .npz cache loading uses allow_pickle=False; malformed cache data degrades to a miss; stem separation runs in a child process that is terminated on timeout; frontend event payloads are parsed before state updates and polling remains the fallback.
  • Remaining risk: terminating a child process can discard in-flight stem work, so the result falls back to lower-confidence rehearsal cues for that run rather than blocking the UI.
  • Test points: request validation rejects unknown fields, malformed cache files are cache misses, cache write failures do not block analysis, timeout/runtime ML failures continue with fallback cues, Tauri push events are filtered by job id, and the full quickcheck plus Rust cargo check pass.

…ermediate feature caching, and graceful ML timeout degradation

Agent-Logs-Url: https://github.com/Seongho-Bae/bandscope/sessions/fc6369da-4450-472d-99ea-67bd12afcf8f

Co-authored-by: seonghobae <8172694+seonghobae@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 16, 2026 15:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@Codex Codex AI requested a review from seonghobae June 16, 2026 15:00
@seonghobae seonghobae changed the title [WIP] Transition analysis API to asynchronous inference orchestrator Transition analysis API to asynchronous inference orchestrator Jun 18, 2026
@seonghobae seonghobae marked this pull request as ready for review June 18, 2026 12:53
Copilot AI review requested due to automatic review settings June 18, 2026 12:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Comment thread services/analysis-engine/src/bandscope_analysis/api.py Outdated
Comment thread services/analysis-engine/src/bandscope_analysis/api.py
Comment thread services/analysis-engine/src/bandscope_analysis/api.py Outdated
Comment thread apps/desktop/src/App.tsx Outdated
@opencode-agent

opencode-agent Bot commented Jun 18, 2026

Copy link
Copy Markdown

OpenCode Review Overview

  • Head SHA: e1ccdd6088ed6fa11aff0dd1f54bb3400d2e78fe
  • Workflow run: 27763078236
  • Workflow attempt: 1
  • Gate result: APPROVE (approval step)

Pull request overview

The changes in PR #323 were reviewed with a focus on structural dependencies, callers, callees, and side effects. No critical issues or regressions were identified. The changes appear to be well-tested and maintain existing contracts.

Findings

No blocking findings from OpenCode's independent review.

Verification

  • Review source: independent OpenCode review of the current checkout, focused changed hunks, and current-head GitHub Check evidence.
  • Structural exploration: completed before approval; if structural exploration, changed-file inspection, or evidence completeness is missing, OpenCode must not approve.
  • Result: APPROVE
  • Reason: Structural exploration completed with no critical issues found

Gate evidence

  • Head SHA: e1ccdd6088ed6fa11aff0dd1f54bb3400d2e78fe
  • Workflow run: 27763078236
  • Workflow attempt: 1

opencode-agent[bot]
opencode-agent Bot previously approved these changes Jun 18, 2026

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Reviewed changes in 6 files. No obvious bugs, security issues, or broken contracts found. Structural exploration via CodeGraph did not reveal any breakage.

Findings

No blocking findings from OpenCode's independent review.

Verification

  • Review source: independent OpenCode review of the current checkout, focused changed hunks, and current-head GitHub Check evidence.
  • Structural exploration: completed before approval; if structural exploration, changed-file inspection, or evidence completeness is missing, OpenCode must not approve.
  • Result: APPROVE
  • Reason: No issues found in the reviewed changes

Gate evidence

  • Head SHA: 35f52c5b521c966992f61857b2c36f1b08f6d6fd
  • Workflow run: 27760985342
  • Workflow attempt: 1

Copilot AI review requested due to automatic review settings June 18, 2026 13:16
@seonghobae seonghobae force-pushed the codex/update-analysis-api-for-asynchronous-inference branch from 35f52c5 to 92136ae Compare June 18, 2026 13:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Comment thread services/analysis-engine/src/bandscope_analysis/api.py Outdated
Comment thread services/analysis-engine/src/bandscope_analysis/api.py
Comment thread services/analysis-engine/src/bandscope_analysis/api.py Outdated
Comment thread apps/desktop/src-tauri/src/main.rs
opencode-agent[bot]
opencode-agent Bot previously approved these changes Jun 18, 2026

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Reviewed changes across Rust, TypeScript, and Python files. No critical issues found. Tests and contracts are maintained.

Findings

No blocking findings from OpenCode's independent review.

Verification

  • Review source: independent OpenCode review of the current checkout, focused changed hunks, and current-head GitHub Check evidence.
  • Structural exploration: completed before approval; if structural exploration, changed-file inspection, or evidence completeness is missing, OpenCode must not approve.
  • Result: APPROVE
  • Reason: Structural exploration completed with no source-backed blockers. Changes are well-contained and tested.

Gate evidence

  • Head SHA: 92136ae165873c613a4c6f34eac3419c33020b76
  • Workflow run: 27762169410
  • Workflow attempt: 1

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

The changes in PR #323 were reviewed with a focus on structural dependencies, callers, callees, and side effects. No critical issues or regressions were identified. The changes appear to be well-tested and maintain existing contracts.

Findings

No blocking findings from OpenCode's independent review.

Verification

  • Review source: independent OpenCode review of the current checkout, focused changed hunks, and current-head GitHub Check evidence.
  • Structural exploration: completed before approval; if structural exploration, changed-file inspection, or evidence completeness is missing, OpenCode must not approve.
  • Result: APPROVE
  • Reason: Structural exploration completed with no critical issues found

Gate evidence

  • Head SHA: e1ccdd6088ed6fa11aff0dd1f54bb3400d2e78fe
  • Workflow run: 27763078236
  • Workflow attempt: 1

@seonghobae seonghobae merged commit d89b239 into develop Jun 18, 2026
25 checks passed
@seonghobae seonghobae deleted the codex/update-analysis-api-for-asynchronous-inference branch June 18, 2026 13:44
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.

Epic: ML Orchestration & Resource Management

3 participants