Skip to content

feat(wave3): inlineParallelCapable detection threading + capability badge (#127, #128) - #131

Merged
AndresL230 merged 5 commits into
mainfrom
feat/wave3-followups
May 29, 2026
Merged

feat(wave3): inlineParallelCapable detection threading + capability badge (#127, #128)#131
AndresL230 merged 5 commits into
mainfrom
feat/wave3-followups

Conversation

@AndresL230

@AndresL230 AndresL230 commented May 29, 2026

Copy link
Copy Markdown
Contributor

Closes #127, closes #128. Wave 3 follow-ups from PR #126 (#116).

#127 — thread inlineParallelCapable through the detection layer

The flag was wired through the AST detector + core-scanner in #116 but not the detection-layer consumers that already handle batchCapable. Each gap parallels an existing batchCapable site:

  • Regex pattern pathopenai-compatible.ts now emits reg?.inlineParallelCapable (registry-only; no hint-regex fallback, since there's no reliable lexical hint). local-waste-detector.ts gains an inline-parallel finding that produces the n/count suggestion on the regex-only (RECOST_DISABLE_AST=1) path, using a distinct inline_parallel id so it never collapses with a batch finding.
  • Pattern dedup keypatterns/utils.ts includes inlineParallelCapable so distinct match shapes aren't collapsed.
  • Intelligence graphApiCallNode (intelligence/types.ts) + builder.ts coerce the flag so AI-review context can distinguish batch from inline-parallel shapes.

#128 — surface inlineParallelCapable as a capability badge

Since #116 reclassified images.generate off batchCapable, DALL·E endpoints lost their old "batch" chip and showed nothing. This restores a correct indicator.

  • EndpointRecord in dashboard/src/lib/types.ts + webview/src/types.ts now carry inlineParallelCapable.
  • Endpoints.tsx pushes an inline-parallel capability chip when the flag is set.
  • scan-results.ts populates endpoint.inlineParallelCapable at all three endpoint-construction sites (aggregate, fresh, synthetic) so the webview badge has data.

Caveat: the web dashboard reads endpoints from the API, whose schema has no inline_parallel column yet — the dashboard chip only lights up once an API migration persists/serves the field. The VS Code webview badge works now.

Tests / gates

Also reconciles PROGRESS.md: Waves 5 (#118/#119) and 1 (#84/#85/#112) marked shipped.

Summary by CodeRabbit

  • New Features

    • Inline-parallel capability is now surfaced for API endpoints and shown in endpoint UI badges.
    • New detection flags mark calls as inline-parallel-capable.
  • Bug Fixes / Behavior

    • Findings now avoid being collapsed across detectors by using detector-specific IDs when present.
  • Tests

    • Added tests covering inline-parallel detection and propagation.
  • Documentation

    • Roadmap progress updated (2026-05-29).

Review Change Stack

…ey, intelligence graph (#127)

Follow-up to PR #126 (#116). The inlineParallelCapable fingerprint flag was
wired through the AST detector + core-scanner but not the detection-layer
consumers that already handle batchCapable. Each gap parallels an existing
batchCapable site:

- Regex pattern path: openai-compatible.ts now emits reg?.inlineParallelCapable
  (registry-only, no hint-regex fallback); local-waste-detector.ts gains an
  inline-parallel finding producing the n/count suggestion on the regex-only
  (RECOST_DISABLE_AST=1) path, using a distinct inline_parallel id so it never
  collapses with a batch finding.
- Pattern dedup key: patterns/utils.ts includes inlineParallelCapable so
  distinct match shapes aren't collapsed.
- Intelligence graph: ApiCallNode + builder.ts coerce the flag so AI-review
  context distinguishes batch from inline-parallel shapes.

Also reconciles PROGRESS.md: Waves 5 (#118/#119) and 1 (#84/#85/#112) marked
shipped; remaining accuracy work is Wave 2 -> 4.

Tests: scanner-patterns (emit + absence), local-waste-detector (regex-only
fanout finding), builder (coercion true/false). Full test:scanner green,
build:ext clean, benchmark Δ +0.00pp on all 5 metrics.
…badge (#128)

Follow-up to PR #126 (#116). The inlineParallelCapable flag was absent from the
UI layer, so since #116 reclassified images.generate off batchCapable, DALL·E
endpoints lost their old "batch" chip and showed no capability indicator. This
restores a correct one.

- EndpointRecord in dashboard/src/lib/types.ts + webview/src/types.ts now carry
  inlineParallelCapable (parallels batchCapable).
- Endpoints.tsx pushes an "inline-parallel" capability chip when the flag is set.
- scan-results.ts populates endpoint.inlineParallelCapable at all three
  endpoint-construction sites (aggregate, fresh, synthetic) so the webview badge
  has data — mirrors the existing batchCapable mapping.

Note: the web dashboard reads endpoints from the API, whose schema has no
inline_parallel column yet, so the dashboard chip only lights up once an API
migration persists/serves the field. The VS Code webview badge works now.

Build: build:webview + build:ext clean; test:scanner green (typechecks
scan-results.ts). Dashboard deps not installed in this env — change is an
additive optional field + conditional chip (type-safe by construction).
@coderabbitai

coderabbitai Bot commented May 29, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 0139523b-dd51-44f9-993e-fa29912996d9

📥 Commits

Reviewing files that changed from the base of the PR and between 0ffd951 and 057d66a.

📒 Files selected for processing (8)
  • docs/superpowers/plans/PROGRESS.md
  • src/intelligence/__tests__/builder.test.ts
  • src/intelligence/builder.ts
  • src/intelligence/types.ts
  • src/scan-results.ts
  • src/scanner/local-waste-detector.ts
  • src/test/local-waste-detector.test.ts
  • webview/src/types.ts

📝 Walkthrough

Walkthrough

This PR implements two follow-up issues (#127 and #128) from Wave 3: threading the inlineParallelCapable capability flag through pattern detection (OpenAI registry path), waste detection, intelligence graph building, and dashboard UI rendering. The signal now flows from regex-based OpenAI pattern matching through scan results merging into EndpointRecord, enabling dashboard presentation of inline-parallel endpoints.

Changes

inlineParallelCapable capability signal

Layer / File(s) Summary
Type system for inlineParallelCapable capability
src/scanner/patterns/types.ts, src/intelligence/types.ts, dashboard/src/lib/types.ts, webview/src/types.ts
Add inlineParallelCapable?: boolean field to ApiCallMatch, ApiCallNode, and EndpointRecord interfaces across scanner, intelligence, and UI layers.
OpenAI pattern detection from registry
src/scanner/patterns/openai-compatible.ts, src/test/scanner-patterns.test.ts
Extract inlineParallelCapable from OpenAI registry entry (default false) and emit in match results alongside streaming, batch, and cache capability flags. Tests verify images.generate marks inline-parallel capable and chat.completions.create does not.
Match deduplication by capability
src/scanner/patterns/utils.ts
Include inlineParallelCapable in the dedup key so matches differing only in this capability flag are not collapsed into duplicates.
Inline parallel waste detection
src/scanner/local-waste-detector.ts, src/test/local-waste-detector.test.ts
Implement detectInlineParallelFinding to flag inline-parallel endpoints invoked in loops or fan-out constructs without batch guards. Integrate into the detection pipeline after batch detection. Test verifies detection of images.generate in Promise.all-based thumbnail generation.
Intelligence snapshot graph threading
src/intelligence/builder.ts, src/intelligence/__tests__/builder.test.ts
Populate ApiCallNode.inlineParallelCapable from input when building snapshots. Tests verify the flag is preserved from OpenAI inputs and defaults to false for missing inputs (e.g., Stripe).
Endpoint record capability propagation
src/scan-results.ts
Propagate inlineParallelCapable from ApiCallInput into merged EndpointRecord for remote endpoint matches and synthetic endpoint creation/updates.
Dashboard endpoint capability badge
dashboard/src/pages/Endpoints.tsx
Render inline-parallel badge in EndpointCard when ep.inlineParallelCapable is true, appearing alongside stream, batch, cache, and middleware badges.
Wave 3 follow-ups progress tracking
docs/superpowers/plans/PROGRESS.md
Update roadmap dated 2026-05-29 to mark Wave 3 follow-ups (#127/#128) and tracker reconciliation complete; Waves 5, 3, 1 marked shipped (🟢).

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs:

"I'm a rabbit with a tiny dev hat,
I threaded flags where they once were flat,
From patterns to graphs and a dashboard glow,
Inline n-counts now hop in a row—
Hop on, the detections all grow!" 🐇✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes: adding inlineParallelCapable detection threading and a capability badge, with clear references to Wave 3 follow-ups #127 and #128.
Linked Issues check ✅ Passed All coding requirements from #127 (regex pattern path, dedup key, intelligence graph) and #128 (EndpointRecord types, UI badge, scan-results population) are implemented across the changed files.
Out of Scope Changes check ✅ Passed All changes directly support the stated objectives: inlineParallelCapable is threaded through detection, intelligence, and UI layers with corresponding tests and documentation updates only.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/wave3-followups

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/scanner/local-waste-detector.ts`:
- Around line 319-330: The deduplication logic in dedupeFindings currently
builds keys from `${finding.type}:${finding.affectedFile}:${finding.line ?? 0}`,
which collapses distinct detector results (e.g., local-inline_parallel-…) that
intentionally set unique finding.id; update dedupeFindings to key on
`finding.id` (with a fallback to the old
`${finding.type}:${finding.affectedFile}:${finding.line ?? 0}` key if
`finding.id` is missing) so detector-specific ids (like
`local-inline_parallel-…`, `local-batch-…`, `local-cache-…`) are respected while
preserving behavior for any findings that lack an id.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9a876c0a-0f60-4737-87ae-5e0477b8cf8c

📥 Commits

Reviewing files that changed from the base of the PR and between 60a5efc and 0ffd951.

📒 Files selected for processing (14)
  • dashboard/src/lib/types.ts
  • dashboard/src/pages/Endpoints.tsx
  • docs/superpowers/plans/PROGRESS.md
  • src/intelligence/__tests__/builder.test.ts
  • src/intelligence/builder.ts
  • src/intelligence/types.ts
  • src/scan-results.ts
  • src/scanner/local-waste-detector.ts
  • src/scanner/patterns/openai-compatible.ts
  • src/scanner/patterns/types.ts
  • src/scanner/patterns/utils.ts
  • src/test/local-waste-detector.test.ts
  • src/test/scanner-patterns.test.ts
  • webview/src/types.ts

Comment thread src/scanner/local-waste-detector.ts
# Conflicts:
#	docs/superpowers/plans/PROGRESS.md
#	src/test/local-waste-detector.test.ts
dedupeFindings keyed on `type:file:line`, which would collapse two distinct
detectors that share a SuggestionType at the same site — specifically the new
inline-parallel finding (type "batch", id `local-inline_parallel-…`) and a batch
finding (id `local-batch-…`). Key on the detector-specific `finding.id` instead,
falling back to type:file:line when absent, so genuine duplicates still collapse
while distinct detectors are preserved. No registry method is currently both
batchCapable and inlineParallelCapable, so this is defensive; benchmark Δ +0.00pp.
@AndresL230

Copy link
Copy Markdown
Contributor Author

Addressed in 057d66a. Confirmed: dedupeFindings keyed on type:file:line, which would collapse the inline-parallel finding (type "batch", id local-inline_parallel-…) with a local-batch-… finding at the same site — defeating the distinct id. Now keys on finding.id with a fallback to type:file:line, so genuine duplicates still collapse while distinct detectors are preserved.

Note: no fingerprint is currently both batchCapable and inlineParallelCapable, so this is defensive rather than a live bug; the AST path (ast/waste/batch-detector.ts) has the same type:file:line dedup and the same (theoretical) collision — left as-is since it's out of this PR's scope and shipped in #126. test:scanner green, benchmark Δ +0.00pp.

@AndresL230
AndresL230 merged commit 229ee8d into main May 29, 2026
2 of 3 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

1 participant