Skip to content

test: v0.39.0 — frontend test harness + provider-compatibility matrix#125

Merged
hxddh merged 1 commit into
mainfrom
claude/architecture-code-docs-review-k41dn6
Jul 20, 2026
Merged

test: v0.39.0 — frontend test harness + provider-compatibility matrix#125
hxddh merged 1 commit into
mainfrom
claude/architecture-code-docs-review-k41dn6

Conversation

@hxddh

@hxddh hxddh commented Jul 20, 2026

Copy link
Copy Markdown
Owner

What changed

No product code changes — this version is pure test coverage. It closes the two biggest coverage gaps and locks in the v0.37/v0.38 fixes + the S3-compatible (rule 18) contract against regression.

A. Frontend test harness

The frontend had zero tests, despite a substantial turn-runner / store state machine that the v0.38 fixes leaned on (stop-hides-turn, cross-session message loss, reload race). Added:

  • Vitest + Testing-Library (jsdom) harness — npm test, wired into CI between lint and build. Vitest config is separate from vite.config.ts, so the production build/bundle is byte-identical.
  • Initial suite (17 tests):
    • useTurnRunner pure helpers — cleanError (incl. the FE9 guard: a bare "not found"/"404" with no provider context is not rewritten to the model-404 hint) and looksLikeError (no false trigger on "I have 404 objects").
    • the sessionRuns store — patch/merge, functional patches, the failedText round-trip (FE2), and the drop-guard (a deleted session's late writes can't resurrect its entry; abort + cancel fire).
    • a turn-flow test (api mocked) — a turn that fails while another session is visible stashes the message as failedText; a failure on the visible session restores it into the composer.

B. Provider-compatibility matrix (rule 18)

Most S3 tests stub AWS-shaped happy paths; the S3-compatible contract (R2 / MinIO / GCS-XML / B2 / Ceph deviations) had little direct coverage. New test_provider_compat.py (68 cases) pins the degradation contract across the real deviation shapes — coded NotImplemented / MethodNotAllowed / NotSupported / Unsupported, and code-less 501 / 405 gateway rejections:

  • the central detectors (_is_unsupported, config_tools._read) map every gap shape to provider_unsupported, and keep a genuine permission error (AccessDenied/403) distinct — never masked as a capability gap;
  • each object-level read tool (get_object_tagging/_acl/_attributes, list_object_versions/list_multipart_uploads) degrades to a successful probe with the gap flagged — never a raise, never success=false, never a leaked credential;
  • all four review_bucket_* engines, against a provider that implements none of the config surface, return findings — not a crashed run.

The matrix also documents and pins an existing inconsistency it surfaced: object tools express the gap three ways (tagging_status/acl_status/attributes_status strings vs a boolean provider_unsupported). Left as-is (both are documented and agent-read); the tests lock current behavior rather than churn the agent-facing shape.

Checks run

  • cd sidecar && pytest -q710 passed (68 new in test_provider_compat.py).
  • ruff check app — clean.
  • cd frontend && npm run typecheck && npm test && npm run build — tsc clean, 17 tests pass, build clean (bundle byte-identical).

Context

This follows an empirical review of a third-party package-size report: a real build (PyInstaller 6.21) showed its headline "~150 MiB duplicate .so" claim was a measurement artifact (6.x symlink-dedups; one real copy) and that several "unused" Arrow libs (Substrait/dataset/acero) are ELF-NEEDED by the parquet path. Packaging trims were shelved (暂时不删); this test-coverage work was chosen as the next increment instead.

🤖 Generated with Claude Code

https://claude.ai/code/session_01M3YojFPzjkfMj6YYSwvzdx


Generated by Claude Code

No product code changes; this adds coverage that locks in the v0.37/v0.38 fixes
and the S3-compatible (rule 18) degradation contract.

A. Frontend test harness (the frontend had ZERO tests). Vitest + Testing-Library
(jsdom), `npm test` wired into CI between lint and build. Suite: useTurnRunner
helpers (cleanError incl. the FE9 provider-404 guard; looksLikeError no-false-
trigger), the sessionRuns store (patch/merge, failedText round-trip, drop-guard +
abort/cancel), and a turn-flow test (api mocked) for FE2 message preservation
across sessions. Production build unaffected (vitest config separate; bundle
byte-identical).

B. Provider-compatibility matrix (test_provider_compat.py). Pins rule-18
degradation across real S3-compatible deviation shapes (coded NotImplemented/
MethodNotAllowed/NotSupported/Unsupported and code-less 501/405): the central
detectors map gaps to provider_unsupported and keep AccessDenied/403 distinct;
every object read tool degrades to a flagged success (no raise, no success=false,
no credential leak); all four review_bucket_* engines yield findings, not a crash,
on a provider that implements none of the config surface. Also documents/pins the
existing inconsistency in how tools express the gap (status strings vs bool).

Checks: sidecar 710 passed (68 new) + ruff clean; frontend tsc + 17 tests + build
clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M3YojFPzjkfMj6YYSwvzdx
@hxddh
hxddh merged commit b4cd5b0 into main Jul 20, 2026
6 checks passed
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.

2 participants