Skip to content

feat(requests): pluginize request fulfillment behind request_router.v1 - #104

Merged
Quick104 merged 86 commits into
Silo-Server:mainfrom
fluxis:feat/requests-pluginization
Jun 9, 2026
Merged

Quick104 merged 86 commits into
Silo-Server:mainfrom
fluxis:feat/requests-pluginization

Conversation

@fluxis

@fluxis fluxis commented Jun 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Pluginizes request fulfillment so the host no longer talks to Sonarr/Radarr (or any backend) directly. The host now computes governance (which qualities a requester is allowed) and delegates whole-request fulfillment to a request_router.v1 plugin over gRPC, persisting the targets the plugin reports back.

  • Two-tier connection model — request_integrations is generalized into generic host columns (base_url, api_key_ref, enabled, capability_id, installation_id, supported_media_types) plus a plugin_config JSON blob. Legacy per-backend columns dropped; plugin_config is the sole source of truth.
  • Host seam — new RequestRouterProvider + typed pluginhost RequestRouter capability client/resolver. In-host Sonarr/Radarr fulfillment code removed. Fulfillment is pure-plugin (no in-host fallback; no plugin ⇒ approve fails "no fulfillment backend configured").
  • Schema-driven admin form — one generic SchemaForm renderer drives any plugin's admin_form descriptor (sections, show_when, dynamic options, validation, multi-select, exclusive groups). The bespoke arr form is gone; PluginConfigForm was refactored onto SchemaForm.
  • Host owns the 4K-tier fact — FulfillRequest.qualities carries typed RequestedQuality{id, is4k}; the host stamps is4k, plugins shed all tier-string literals.
  • At-rest credential cipher (feat(security): encrypt server-owned credentials at rest (#45) #95 adoption) — plugin API keys are encrypted via the new secret.Cipher (enc:v1: at rest in request_integrations.api_key_ref, decrypted on the read path); the old SecretResolver indirection is removed. Requires SECRET_KEY at boot.
  • Autoscan compatibility preserved — autoscan still reuses the same request_integrations rows via request_integration_id (locked by a regression test + compile guard in internal/api/autoscan_wiring_test.go).

Pairs with the published silo-plugin-sdk v0.6.0 (request_router capability) and the first-party silo-plugins-requests-arr / -seerr plugin repos.

Spec: docs/superpowers/specs/2026-06-07-requests-pluginization-design.md
Plan: docs/superpowers/plans/2026-06-07-requests-pluginization.md
(plus follow-on specs/plans for the schema-driven form, typed 4K signal, SDK helpers, single-default enforcement, and the host-rebase + #95 credential adoption)

Test Plan

  • go test ./internal/requests/... passes (in golang:1.26 + libvips-dev, built against published SDK v0.6.0)
  • Frontend pnpm lint — 0 errors; prettier --check clean on all branch-touched files
  • make verify-local-paths passes; no machine-local replace in go.mod (SDK pinned at v0.6.0)
  • Live e2e on a deployed instance: install arr + seerr plugins → add connections via the schema-driven form → options load from Radarr/Sonarr → save → approve request → targets queued → reconcile advances → "no backend" block when uninstalled → autoscan reuse still polls
  • Reviewer: confirm migrations 20260607131954, 20260607211831, 20260608131649 apply cleanly on a fresh DB and against a populated pre-pluginization DB

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Plugin-driven request routing system replaces built-in fulfillment adapters.
    • Enhanced admin forms support sectioned layouts, conditional field visibility, and dynamic option loading.
    • Request integrations now support plugin-based configuration and validation.
  • Improvements

    • Structured validation errors for request integrations with per-field error reporting.
    • Dynamic quality and configuration options for request fulfillment.

fluxis and others added 30 commits June 8, 2026 23:44
Pluginize the requests fulfillment backend behind an agnostic
request_router.v1 capability (high seam: whole-request fulfiller).
Host keeps lifecycle/quota/policy/quality-governance and a generic
two-tier connection registry; plugins own routing+submission+status.
First plugin extracts multi-instance Sonarr/Radarr; Seerr follows in
a separate spec. Preserves autoscan reuse of arr connection rows.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Three-phase plan: (1) request_router.v1 SDK capability, (2) new
silo-plugin-requests-arr plugin extracting multi-instance Sonarr/Radarr,
(3) host refactor routing fulfillment through the plugin while keeping
quality governance, target records, and autoscan connection reuse host-side.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
… keeps quality governance

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…alization

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…ation, dedupe targets

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…n bad connections, media-type routing)

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…on, propagate config-encode error, drop itoa wrapper, test status/options translation

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…ile cycle

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…installation default, drop redundant options write

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Extends AdminFormDescriptor into a full form-description language (dynamic
options, multi-select, conditional visibility, sections, validation) + a
plugin Validate RPC, rendered by one reusable SchemaForm engine. Retires the
bespoke arr connection form and integrationOptionsFromRouter so any
request_router backend renders its config UI from manifest data with zero
host changes. Addresses code-review finding Silo-Server#9.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Six phases: SDK AdminFormDescriptor extensions + Validate RPC; reusable
SchemaForm renderer (refactor PluginConfigForm onto it); host Validate
plumbing + generic options + legacy-column derivation + retire
integrationOptionsFromRouter; requests admin page swap to SchemaForm with
per-plugin grouping; arr manifest enrichment + Validate impl; verification.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…c options, errors)

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…cy columns from plugin_config

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…ion field_errors

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…ping; retire bespoke arr form

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…(no toast spam)

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
fluxis and others added 6 commits June 8, 2026 23:59
…po arity

Post-rebase conflict fixups: take-ours on internal/plugins/service.go dropped
origin's ScanSourceClientByPluginID (independent upstream capability) — restored.
mediarequests.NewRepository temporarily 1-arg to match our pre-Silo-Server#95 repo; Task 2
restores the cipher arg when adopting Silo-Server#95's at-rest credential model.
…oval (code-review)

Max-effort code review of the Silo-Server#95 credential integration. Fixes the actionable
findings:
- TestEncryptAPIKeyRoundTripAndAAD: pins encryptAPIKey<->DecryptIfEncrypted
  inversion, the id-bound apiKeyAAD == secret.RowAAD(...) match (so Silo-Server#95's backfill
  rows decrypt), the blank-key "" sentinel, and row-bound AAD — the security-
  critical invariants had no automated guard (no DB harness for scanIntegration).
- TestCreateRequestAutoApprovalEmptyKeyTreatedAsUnconfigured: pins that a keyless
  connection reads as unconfigured (request stays pending, never submitted), so
  integrationConfigured and resolveRouterConnections can't drift.
- Fix stale fulfillContext comment (referenced a resolved-API-key cache removed
  with SecretResolver).

Assessed-not-changed (documented): decrypt-error-fails-closed and failed-backfill
behaviors are origin/main Silo-Server#95 design we adopt; nil-cipher is unreachable in prod
and matches the codebase-wide no-guard pattern.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
The replace directive was already removed when v0.6.0 was pinned (785606f);
this leftover comment falsely claimed a local replace still existed.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Jun 9, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c1367a45-5ef1-4285-b215-473ce33f80d4

📥 Commits

Reviewing files that changed from the base of the PR and between 1d68ed1 and ebd61c0.

📒 Files selected for processing (17)
  • internal/api/handlers/libraries.go
  • internal/api/handlers/plugins.go
  • internal/api/handlers/plugins_admin_form_test.go
  • internal/api/router.go
  • internal/metadata/chain.go
  • internal/plugins/service_hot_reload_test.go
  • internal/plugins/user_identity_lookup.go
  • internal/requests/service.go
  • internal/requests/service_test.go
  • web/src/api/types.ts
  • web/src/components/admin/plugins/PluginConfigForm.tsx
  • web/src/components/admin/plugins/SchemaForm.tsx
  • web/src/components/admin/plugins/schemaFormUtils.test.ts
  • web/src/components/admin/plugins/schemaFormUtils.ts
  • web/src/pages/AdminRequests.tsx
  • web/src/pages/requestIntegrationMediaTypes.test.ts
  • web/src/pages/requestIntegrationMediaTypes.ts

📝 Walkthrough

Walkthrough

This PR migrates media request fulfillment from adapter-based (Radarr/Sonarr-specific) implementations to a plugin-driven request_router capability model. Request routing, integration management, validation, and reconciliation now delegate to plugin router clients via protobuf-based contracts. Frontend request integration UI is refactored to schema-form-based configuration driven by selected plugin capabilities, with dynamic option loading and cross-connection exclusivity rules. Metadata provider ranking is updated to filter by declared content-level support per capability.

Changes

Request router pluginization rollout

Layer / File(s) Summary
Plugin runtime foundations
go.mod, internal/pluginhost/..., internal/plugins/service.go, internal/plugins/user_identity_lookup.go, internal/plugins/service_singleflight_test.go, internal/plugins/service_hot_reload_test.go
Plugin host client gains RequestRouterClient wrapper with RPC timeout enforcement; Service adds singleflight deduplication for concurrent installation launches (with launch context isolation from leader cancellation); UserIdentity and RequesterIdentityFromLookup add email field/resolver for requester metadata population.
API contracts and router wiring
cmd/silo/main.go, internal/api/requests_wiring.go, internal/api/requests_wiring_test.go, internal/api/handlers/requests.go, internal/api/handlers/requests_test.go, internal/api/autoscan_wiring_test.go, internal/api/router.go
Request fulfillment wiring switches from radarr/sonarr adapter clients to PluginRequestRouterAdapter + AttachRequestRouter attachment; handler integration response contracts narrow to plugin/capability fields; LoadIntegrationOptions returns router-option maps; new validation error handling returns HTTP 400 with structured field/form errors.
Request router provider boundary
internal/requests/provider.go, internal/requests/provider_test.go, internal/requests/errors.go
New RequestRouterProvider interface and host-side data contracts (RouterTarget, RouterConnection, RouterOption) bridge plugin protobuf messages to application models; provider methods resolve per-(installation, capability) router clients, convert connections/targets to/from protobuf, and propagate validation field/form errors.
Request domain and service orchestration
internal/requests/service.go, internal/requests/types.go, internal/requests/service_test.go
Request/Integration models gain requester email/username and plugin capability/config fields; Service replaces fulfillment adapters with router provider + requester identity resolver; submit/reconcile flows are rewritten for router-based fulfill/status-check; integration validation and eligibility gating now use router connection inspection with media-type support checks; comprehensive test matrix covers quality fan-out, idempotency, deduplication, skipping rules, and status coercion.
Integration persistence and migrations
internal/requests/repository.go, migrations/sql/..., internal/requests/arrclient/resources.go, internal/requests/repository_crypto_test.go
Integration storage schema adds capability_id, installation_id, supported_media_types, plugin_config JSON columns; legacy kind/folder/profile/tag/options columns are dropped; list/insert/update/scan logic is rewritten to persist plugin configuration; arrclient helpers return local resource types directly (no integration adapter conversion); encryption round-trip and AAD security are tested.
Plugin admin form JSON contracts
internal/api/handlers/plugins.go, internal/api/handlers/plugins_admin_form_test.go
Admin form serialization now includes Sections, DynamicOptions, ShowWhen conditions, and Validation constraints on fields; DTO completeness test guards against silent field drops during serialization.
Frontend API contracts and validation-error plumbing
web/src/api/client.ts, web/src/api/types.ts, web/src/hooks/queries/useRequests.ts, web/src/pages/admin/autoscan/ConnectionsPanel.tsx
Client error parsing preserves raw response body for structured validation errors; request integration types move to optional plugin-capability model; validation error detection suppresses generic toasts; autoscan reuse mode derives ARR kind from plugin_config["service_kind"].
Schema form utilities and validation/coercion library
web/src/components/admin/plugins/schemaFormUtils.ts, web/src/components/admin/plugins/schemaFormUtils.test.ts
New utilities evaluate show_when visibility, validate required/pattern/bounds, parse JSON schemas for field types, and coerce raw form values using declared types (with per-item numeric array coercion); comprehensive tests cover conditional visibility, validation with hidden-field skipping, default handling, type-driven coercion, and edge cases.
SchemaForm component and PluginConfigForm integration
web/src/components/admin/plugins/SchemaForm.tsx, web/src/components/admin/plugins/SchemaForm.test.tsx, web/src/components/admin/plugins/PluginConfigForm.tsx
React SchemaForm component renders plugin form descriptors with conditional field visibility, merged validation errors, dynamic option loading, switch row grouping, and collapsible sections; PluginConfigForm refactored to use SchemaForm with coerced payload building; component and utility tests cover visibility, validation, defaults, dynamic options, and section behavior.
Admin requests page capability-driven editor
web/src/pages/AdminRequests.tsx, web/src/pages/requestExclusivity.ts, web/src/pages/requestExclusivity.test.ts, web/src/pages/requestIntegrationMediaTypes.ts, web/src/pages/requestIntegrationMediaTypes.test.ts
Admin requests UI refactored from ARR-specific model to generic plugin-driven connection editor: introduction form supports plugin selection (installation + capability); connection cards hold separated pluginConfig payload; dynamic option probing uses debounced generation-keyed latest-wins strategy; schema-form rendering loads/defaults options and validates via form validity callbacks; exclusivity enforcer applies mutual-exclusion rules across sibling cards; media-type derivation maps service_kind to supported types; delete confirmation and error handling updated for connection semantics.

Metadata provider eligibility filtering

Layer / File(s) Summary
Content-level provider support checks
internal/metadata/chain.go, internal/api/handlers/libraries.go
Metadata chain ranking now filters providers by declared positive default_priority for the requested content level and looks up metadata per capability ID (not just installation); LookupDefaultPriority signature includes capability ID; default chain seeding passes capability context when computing provider priorities.

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

Possibly related PRs

  • Silo-Server/silo-server#7: Main PR refactors request reconciliation/fulfillment wiring introduced in PR #7 (formerly using Radarr/Sonarr fulfillment adapters) to use the new request-router plugin-based provider plus requester identity resolution.
  • Silo-Server/silo-server#44: This PR's internal/api/autoscan_wiring_test.go adds a regression/compile-time guard around checkRequestIntegrationUsable using mediarequests.Integration fields, directly targeting autoscan wiring logic.
  • Silo-Server/silo-server#48: Both PRs extend internal/api/autoscan_wiring_test.go test coverage of checkRequestIntegrationUsable behavior with related visibility/integration-usability assertions.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

These design specs and implementation plans are internal development
artifacts; keep them out of the upstream PR diff.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 14

Note

Due to the large number of review comments, Critical, Major severity comments were prioritized as inline comments.

🟡 Minor comments (18)
docs/superpowers/plans/2026-06-08-plugin-platform-sdk-helpers.md-24-35 (1)

24-35: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Specify a language for this fenced block (MD040).

Please annotate this code fence with a language (e.g., text) to satisfy markdownlint.

🤖 Prompt for 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.

In `@docs/superpowers/plans/2026-06-08-plugin-platform-sdk-helpers.md` around
lines 24 - 35, The fenced code block that lists the package layout (the block
starting with "/opt/silo-plugin-sdk/pkg/pluginsdk/") is missing a language tag
for markdownlint MD040; update that fence to include a language (for example
change ``` to ```text or ```bash) so the block is annotated and MD040 passes.

Source: Linters/SAST tools

docs/superpowers/plans/2026-06-08-plugin-launch-singleflight.md-15-15 (1)

15-15: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Adjust heading nesting to satisfy MD001.

Heading level jumps here and should be normalized to keep markdownlint green.

🤖 Prompt for 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.

In `@docs/superpowers/plans/2026-06-08-plugin-launch-singleflight.md` at line 15,
The heading "### Task 1: Single-flight `ensureClient`" jumps levels and violates
MD001; update its markdown header level to match surrounding headings (e.g.,
change to "##" or "####" as appropriate) so the nesting is sequential with the
prior and subsequent headings, and verify other headings around "Task 1:
Single-flight `ensureClient`" follow the same normalized level to keep
markdownlint MD001 satisfied.

Source: Linters/SAST tools

docs/superpowers/plans/2026-06-07-requests-pluginization.md-109-111 (1)

109-111: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix heading-level jump to satisfy markdownlint MD001.

The heading hierarchy skips a level here and will keep lint noisy.

🤖 Prompt for 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.

In `@docs/superpowers/plans/2026-06-07-requests-pluginization.md` around lines 109
- 111, The heading "PHASE 1 — SDK: `request_router.v1` capability
(`silo-plugin-sdk`)" is using a top-level H1 which creates a level jump; change
its markdown level to match the surrounding plan headings (e.g., convert "#
PHASE 1 — SDK: `request_router.v1` capability (`silo-plugin-sdk`)" to "## PHASE
1 — SDK: `request_router.v1` capability (`silo-plugin-sdk`)" or the appropriate
lower-level heading) so the hierarchy flows into the subsequent "Task 1: Add the
`request_router.proto` contract" heading without skipping levels.

Source: Linters/SAST tools

docs/superpowers/plans/2026-06-07-seerr-request-router.md-23-39 (1)

23-39: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add language identifier to fenced code block (MD040).

The file-structure code fence should declare a language (text is sufficient) to satisfy markdown lint.

🤖 Prompt for 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.

In `@docs/superpowers/plans/2026-06-07-seerr-request-router.md` around lines 23 -
39, Add a language identifier to the fenced code block that contains the
repository tree (the block starting with ``` and the lines beginning
"/opt/silo-plugin-requests-seerr/ ... README.md"); change the opening fence to
specify a language (e.g., ```text) so the markdown linter MD040 is satisfied.

Source: Linters/SAST tools

docs/superpowers/plans/2026-06-07-schema-driven-config-form.md-51-51 (1)

51-51: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Normalize heading hierarchy (MD001).

This heading level jumps over the expected level and should be adjusted to keep markdown lint clean.

🤖 Prompt for 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.

In `@docs/superpowers/plans/2026-06-07-schema-driven-config-form.md` at line 51,
The markdown heading for Task 1 skips the expected hierarchy level and needs to
be normalized. In the schema-driven config form plan document, adjust the `###
Task 1: Extend AdminFormDescriptor in common.proto` heading so it follows the
surrounding heading structure without jumping levels, and update any sibling
task headings in the same section if needed to keep the hierarchy consistent.

Source: Linters/SAST tools

docs/superpowers/plans/2026-06-08-request-card-library-collapse-anime.md-11-12 (1)

11-12: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Replace local absolute paths with repo-relative instructions.

Line [11] and later command/file references hardcode local paths (/opt/..., /tmp/...), which makes the plan environment-specific and non-portable for contributors.

As per coding guidelines, "When creating or editing docs/superpowers/specs/ or docs/superpowers/plans/, never include local absolute filesystem paths or transient worktree IDs; use repository-relative paths and wording like 'Commands assume the repository root is the cwd.'"

Also applies to: 226-227, 318-321, 378-379

🤖 Prompt for 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.

In `@docs/superpowers/plans/2026-06-08-request-card-library-collapse-anime.md`
around lines 11 - 12, Replace the hardcoded absolute paths seen in the plan
(e.g. `/opt/silo`, `/opt/silo-plugin-requests-arr`, `/tmp/go/bin`,
`web/node_modules/.bin`) with repository-relative instructions and a single
clarifying sentence such as "Commands assume the repository root is the cwd."
Update all occurrences (including the later occurrences mentioned) so commands
reference repo-root-relative locations (e.g. `silo`, `silo-plugin-requests-arr`,
`./web/node_modules/.bin`, `./go/bin` or just rely on PATH) and remove any
transient local filesystem paths to keep the plan portable for contributors.

Source: Coding guidelines

docs/superpowers/plans/2026-06-08-seerr-permission-simplification.md-9-10 (1)

9-10: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Remove absolute filesystem paths from this plan.

Line [9] and later steps use local absolute paths, which conflicts with the docs portability rule for plans/specs.

As per coding guidelines, "When creating or editing docs/superpowers/specs/ or docs/superpowers/plans/, never include local absolute filesystem paths or transient worktree IDs; use repository-relative paths and wording like 'Commands assume the repository root is the cwd.'"

Also applies to: 258-263, 277-278

🤖 Prompt for 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.

In `@docs/superpowers/plans/2026-06-08-seerr-permission-simplification.md` around
lines 9 - 10, The plan contains local absolute filesystem paths (e.g.,
"/opt/silo-plugin-requests-seerr" and the PATH prefix example) that violate the
docs portability rule; update the plan text to remove all absolute paths and
transient worktree IDs and replace them with repository-relative references
(e.g., "repo: silo-plugin-requests-seerr" or "assume repository root is the
cwd") and neutral command notes such as "Commands assume the repository root is
the cwd"; ensure the same replacements are made for every occurrence of that
absolute path and the PATH prefix example within this document.

Source: Coding guidelines

docs/superpowers/plans/2026-06-08-seerr-per-user-requester-mapping.md-11-12 (1)

11-12: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Use repository-relative paths throughout the plan.

The plan currently embeds machine-local absolute paths (/opt/..., /tmp/...). Please rewrite these to repository-relative references so the instructions are reusable across environments.

As per coding guidelines, "When creating or editing docs/superpowers/specs/ or docs/superpowers/plans/, never include local absolute filesystem paths or transient worktree IDs; use repository-relative paths and wording like 'Commands assume the repository root is the cwd.'"

Also applies to: 205-207, 698-716, 726-727

🤖 Prompt for 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.

In `@docs/superpowers/plans/2026-06-08-seerr-per-user-requester-mapping.md` around
lines 11 - 12, Replace all machine-local absolute paths (e.g. strings like
"/opt/...", "/tmp/..." and specific absolute PATH prefixes) in the plan with
repository-relative references (for example refer to repositories by their
directory names such as "silo-plugin-sdk", "silo", "silo-plugin-requests-seerr")
and add a short preface line: "Commands assume the repository root is the cwd."
Also change any hardcoded PATH suggestions to a portable form (for example
mention adding Go binaries via "PATH=$PATH:$(go env GOPATH)/bin" or by referring
to a repo-local bin directory) and apply the same substitution to the other
ranges noted (lines referenced in the review) so no absolute filesystem paths
remain.

Source: Coding guidelines

docs/superpowers/plans/2026-06-08-silo-server-95-credential-integration.md-9-10 (1)

9-10: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Normalize plan paths to repository-relative form.

This file still uses absolute local paths (/opt/silo, etc.). Please switch to repo-relative instructions to keep the runbook portable and guideline-compliant.

As per coding guidelines, "When creating or editing docs/superpowers/specs/ or docs/superpowers/plans/, never include local absolute filesystem paths or transient worktree IDs; use repository-relative paths and wording like 'Commands assume the repository root is the cwd.'"

Also applies to: 21-26, 162-163

🤖 Prompt for 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.

In `@docs/superpowers/plans/2026-06-08-silo-server-95-credential-integration.md`
around lines 9 - 10, The doc uses local absolute paths and transient IDs (e.g.,
"/opt/silo", "backup/pre-main-rebase-20260608", and the literal PATH hack
"PATH=$PATH:/tmp/go/bin") which must be turned into repository-relative
instructions: replace absolute paths with repo-relative references like
"internal/requests", "internal/plugins", "cmd/silo" and add a short note
"Commands assume the repository root is the cwd"; convert the backup reference
to a generic backup branch name (e.g., "backup/<branch>") or remove it; change
the PATH line to an instruction such as "Ensure /tmp/go/bin is on PATH" or "Add
Go to PATH as needed" rather than injecting an absolute PATH string, and make
the same replacements for the other occurrences of absolute paths mentioned in
the comment.

Source: Coding guidelines

docs/superpowers/plans/2026-06-08-single-default-enforcement.md-15-15 (1)

15-15: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix heading depth jump at Line 15.

This jumps from an H1 to H3, triggering MD001 (heading-increment). Use an H2 at this section level.

🤖 Prompt for 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.

In `@docs/superpowers/plans/2026-06-08-single-default-enforcement.md` at line 15,
The document has a heading depth jump at the line containing "### Task 1: SDK —
add `siblings` + `exclusive_group_field` and regenerate" which should be H2
instead of H3; update that heading from "### Task 1: SDK — add `siblings` +
`exclusive_group_field` and regenerate" to use H2 (i.e., prepend with "##") so
the heading hierarchy is consistent and MD001 is resolved.

Source: Linters/SAST tools

docs/superpowers/specs/2026-06-07-requests-pluginization-design.md-44-44 (1)

44-44: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add language identifiers to fenced code blocks at Lines 44 and 144.

markdownlint MD040 is triggered here; annotate fences (for example, text/plaintext) so docs lint remains clean.

Also applies to: 144-144

🤖 Prompt for 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.

In `@docs/superpowers/specs/2026-06-07-requests-pluginization-design.md` at line
44, Two fenced code blocks in the document use bare triple-backticks (no
language) and trigger markdownlint MD040; update each opening fence from ``` to
an appropriate annotated fence such as ```text, ```plaintext, or ```json
depending on the block content (e.g., request/response payloads should use
```json, plain examples use ```text) so both bare ``` occurrences become
language-annotated.

Source: Linters/SAST tools

docs/superpowers/plans/2026-06-08-typed-quality-tier-signal.md-93-93 (1)

93-93: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Correct the contradictory identifier note at Line 93.

The sentence says the getter is GetIs4K() and then parenthetically says NOT GetIs4K(). That contradiction can send implementers to the wrong symbol. Please fix the “NOT …” example to the actually-wrong variant.

Suggested doc fix
- ... so the proto field `is4k` generates the Go field **`Is4K`** and getter **`GetIs4K()`** (NOT `Is4K`/`GetIs4K()`).
+ ... so the proto field `is4k` generates the Go field **`Is4K`** and getter **`GetIs4K()`** (NOT `Is4k`/`GetIs4k()`).
🤖 Prompt for 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.

In `@docs/superpowers/plans/2026-06-08-typed-quality-tier-signal.md` at line 93,
Fix the contradictory parenthetical on the note about the is4k identifier:
update the example of the actually-wrong generated symbols so it reads that the
proto field is4k generates Go field Is4K and getter GetIs4K() (NOT the
lowercase/incorrect `is4k`/`GetIs4k()`); ensure the surrounding references to
RequestedQuality, GetId(), Is4K, GetIs4K(), and GetQualities() remain unchanged.
internal/requests/errors.go-38-43 (1)

38-43: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Guard ValidationError.Error() against a nil receiver.

If a typed-nil *ValidationError reaches an error interface, this method panics on e.FormError.

Suggested fix
 func (e *ValidationError) Error() string {
+	if e == nil {
+		return "validation failed"
+	}
 	if e.FormError != "" {
 		return e.FormError
 	}
 	return "validation failed"
 }
🤖 Prompt for 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.

In `@internal/requests/errors.go` around lines 38 - 43, The
ValidationError.Error() method should guard against a nil receiver to avoid
panics when a typed-nil *ValidationError is used as an error; update the
ValidationError.Error() implementation to check if e == nil and return
"validation failed" (or another sensible default) before accessing e.FormError,
keeping the existing behavior of returning e.FormError when non-empty; locate
the method by its symbol ValidationError.Error() and the FormError field to
apply the nil-check.
docs/superpowers/specs/2026-06-08-seerr-per-user-requester-mapping-design.md-120-120 (1)

120-120: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix markdownlint warnings in the spec (inline code span + fenced block language).

markdownlint warnings are reported at Line 120 (MD038) and Line 134 (MD040). These are small, but worth cleaning to keep docs lint output green.

Suggested patch
-`seerr.CreateRequestBody` gains `UserID int \`json:"userId,omitempty"\`` — set
+`seerr.CreateRequestBody` gains `UserID int` with JSON tag `json:"userId,omitempty"` — set

-```
+```text
 Silo user requests → host approves → Fulfill(descriptor{requester_email, …}, conns)
   └─ seerr plugin: mode==mapped, email present
        ├─ FindUserByEmail(email)  ──found──▶ userId = user.ID
        │                          └─none──▶ CreateUser(email, permBits) → userId
        └─ POST /api/v1/request { mediaType, mediaId, is4k, userId }
             └─ attributed to that user; auto-approves iff the user has AUTO_APPROVE
</details>


Also applies to: 134-134

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @docs/superpowers/specs/2026-06-08-seerr-per-user-requester-mapping-design.md
at line 120, Fix the markdownlint warnings MD038/MD040 by correcting the inline
code and fenced block: render the symbol seerr.CreateRequestBody as a single
inline code span (seerr.CreateRequestBody) and replace the escaped field
snippet so the struct field reads UserID int json:"userId,omitempty" inside a
fenced code block that includes a language tag (e.g., go or text) instead
of using backslash-escaped backticks; ensure the fenced block around the flow
diagram includes the language marker to satisfy MD040 and remove any stray
backslashes so MD038 is resolved.


</details>

<!-- cr-comment:v1:2894a2ccad80f62a7e0108fe -->

_Source: Linters/SAST tools_

</blockquote></details>
<details>
<summary>docs/superpowers/specs/2026-06-08-single-default-enforcement-design.md-139-147 (1)</summary><blockquote>

`139-147`: _⚠️ Potential issue_ | _🟡 Minor_ | _⚡ Quick win_

**Label the data-flow fenced block with a language.**

Line 139 starts an unlabeled fenced block; adding a language tag will clear MD040.

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @docs/superpowers/specs/2026-06-08-single-default-enforcement-design.md
around lines 139 - 147, The fenced code block that starts with "Admin toggles
is_default on card B (radarr)" is unlabeled; add a language tag (e.g., ```text)
to the opening fence so the block is labeled and MD040 is resolved. Update the
block surrounding the flow (the triple-backtick section containing the
Admin/frontend/host/plugin lines) to use a consistent language label such as
text to avoid syntax highlighting changes.


</details>

<!-- cr-comment:v1:6e0967cd26d20e36d9e2af82 -->

_Source: Linters/SAST tools_

</blockquote></details>
<details>
<summary>docs/superpowers/specs/2026-06-08-silo-server-95-credential-integration-design.md-51-54 (1)</summary><blockquote>

`51-54`: _⚠️ Potential issue_ | _🟡 Minor_ | _⚡ Quick win_

**Specify the fence language for the rebase commands block.**

Line 51 uses an unlabeled fence; please tag it (for example, `bash`) to satisfy MD040.

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
@docs/superpowers/specs/2026-06-08-silo-server-95-credential-integration-design.md
around lines 51 - 54, The fenced code block containing the git commands needs a
language tag to satisfy MD040: edit the fenced block around the two lines "git
config rerere.enabled true" and "git rebase origin/main" and add a shell
language identifier (e.g., bash) immediately after the opening triple backticks
so the block reads like ```bash; this will properly label the code snippet for
linting.


</details>

<!-- cr-comment:v1:bdace6e70209aad903ada51a -->

_Source: Linters/SAST tools_

</blockquote></details>
<details>
<summary>docs/superpowers/specs/2026-06-08-typed-quality-tier-signal-design.md-43-43 (1)</summary><blockquote>

`43-43`: _⚠️ Potential issue_ | _🟡 Minor_ | _⚡ Quick win_

**Use repository-relative paths in this spec instead of local absolute paths.**

Lines 43, 64, 80, and 88 embed workstation-specific absolute paths (`/opt/...`), which makes the runbook non-portable for reviewers and operators.

As per coding guidelines, “When creating or editing `docs/superpowers/specs/` or `docs/superpowers/plans/`, never include local absolute filesystem paths or transient worktree IDs; use repository-relative paths and wording like 'Commands assume the repository root is the cwd.'”






Also applies to: 64-64, 80-80, 88-88

<details>
<summary>🤖 Prompt for AI Agents</summary>

```
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/superpowers/specs/2026-06-08-typed-quality-tier-signal-design.md` at
line 43, Replace workstation-specific absolute paths in the spec with
repository-relative paths and a note that commands assume the repository root is
the current working directory; specifically, update occurrences of paths like
`/opt/silo-plugin-sdk/proto/silo/plugin/v1/request_router.proto` to the
repo-relative form `proto/silo/plugin/v1/request_router.proto` (and apply the
same change for the other absolute `/opt/...` entries in this spec) and add a
short sentence such as "Commands assume the repository root is the cwd" to the
top or relevant section.
```

</details>

<!-- cr-comment:v1:9c25875b7b08f69c1d1877da -->

_Source: Coding guidelines_

</blockquote></details>
<details>
<summary>docs/superpowers/specs/2026-06-08-seerr-permission-simplification-design.md-40-46 (1)</summary><blockquote>

`40-46`: _⚠️ Potential issue_ | _🟡 Minor_ | _⚡ Quick win_

**Add a language identifier to the fenced block.**

Line 40 opens a code fence without a language, which triggers MD040 and will keep markdown lint noisy.

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @docs/superpowers/specs/2026-06-08-seerr-permission-simplification-design.md
around lines 40 - 46, The fenced code block containing the permission-bit
example (variables like bits, REQUEST, REQUEST_4K, AUTO_APPROVE, AUTO_APPROVE_4K
and the conditional snippet) is missing a language identifier; update the
opening triple-backtick to include a language (e.g., python or text) so
the snippet is labeled and MD040 is resolved.


</details>

<!-- cr-comment:v1:36a35bb4668c366e948af339 -->

_Source: Linters/SAST tools_

</blockquote></details>

</blockquote></details>

<details>
<summary>🧹 Nitpick comments (3)</summary><blockquote>

<details>
<summary>internal/api/handlers/plugins_admin_form_test.go (1)</summary><blockquote>

`173-181`: _⚡ Quick win_

**Extend completeness coverage to nested `AdminFormCondition` and `AdminFormValidation` DTOs.**

Right now the guard only proves top-level field presence. Newly added nested proto fields can still be dropped silently while this test stays green.
   
<details>
<summary>Suggested extension</summary>

```diff
  cases := []struct {
    name  string
    proto reflect.Type
    dto   reflect.Type
  }{
    {"AdminFormField", reflect.TypeOf(pluginv1.AdminFormField{}), reflect.TypeOf(pluginAdminFormFieldJSON{})},
    {"AdminFormDescriptor", reflect.TypeOf(pluginv1.AdminFormDescriptor{}), reflect.TypeOf(pluginAdminFormJSON{})},
    {"AdminFormSection", reflect.TypeOf(pluginv1.AdminFormSection{}), reflect.TypeOf(pluginAdminFormSectionJSON{})},
+   {"AdminFormCondition", reflect.TypeOf(pluginv1.AdminFormCondition{}), reflect.TypeOf(pluginAdminFormConditionJSON{})},
+   {"AdminFormValidation", reflect.TypeOf(pluginv1.AdminFormValidation{}), reflect.TypeOf(pluginAdminFormValidationJSON{})},
  }
```
</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

```
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/api/handlers/plugins_admin_form_test.go` around lines 173 - 181, The
current test cases in plugins_admin_form_test.go only verify top-level DTOs;
extend the cases slice to include nested types so the guard covers
AdminFormCondition and AdminFormValidation too by adding entries for
reflect.TypeOf(pluginv1.AdminFormCondition{}) ->
reflect.TypeOf(pluginAdminFormConditionJSON{}) and
reflect.TypeOf(pluginv1.AdminFormValidation{}) ->
reflect.TypeOf(pluginAdminFormValidationJSON{}); alternatively, enhance the test
logic that iterates the cases to recursively walk/compare nested fields in
pluginv1.AdminFormDescriptor / pluginAdminFormJSON (and AdminFormSection) so any
newly added nested proto fields are validated against their corresponding DTO
types as well.
```

</details>

<!-- cr-comment:v1:0aa41ba775cbbfb7f8f083e5 -->

</blockquote></details>
<details>
<summary>docs/superpowers/specs/2026-06-08-request-card-library-collapse-anime-design.md (1)</summary><blockquote>

`64-67`: _💤 Low value_

**Add language specifiers to fenced code blocks.**

The pseudocode blocks at lines 64–67 and 93–96 are missing language specifiers. Even for pseudocode, adding a language hint (e.g., ` ```text ` or ` ```pseudocode `) silences the linter and improves rendering consistency.







Also applies to: 93-96

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
@docs/superpowers/specs/2026-06-08-request-card-library-collapse-anime-design.md
around lines 64 - 67, Add language specifiers to the fenced pseudocode blocks
that define forceOpen and open (the blocks containing expressions using
section.field_keys, mergedErrors, userToggled, and collapsed_default) and the
similar block at the later location; update those triple-backtick fences to
include a language hint such as text or pseudocode so the linter stops
complaining and rendering is consistent.


</details>

<!-- cr-comment:v1:62de359ade1f2f2c2c0a9084 -->

_Source: Linters/SAST tools_

</blockquote></details>
<details>
<summary>migrations/sql/20260607211831_drop_legacy_request_integration_columns.sql (1)</summary><blockquote>

`36-46`: _💤 Low value_

**Down migration backfill is incomplete.**

The `tags`, `anime_quality_profile_id`, `anime_tags`, and `options` columns are re-added in the Down migration but not populated from `plugin_config`. While the comment says "best-effort," these fields could be extracted:

```sql
tags = COALESCE((SELECT array_agg(v::integer) FROM jsonb_array_elements_text(plugin_config->'tags') AS v), '{}'),
anime_quality_profile_id = NULLIF(plugin_config->>'anime_quality_profile_id','')::integer,
anime_tags = COALESCE((SELECT array_agg(v::integer) FROM jsonb_array_elements_text(plugin_config->'anime_tags') AS v), '{}')
```

If rolling back is truly unlikely, the current state is acceptable, but documenting which fields are intentionally omitted would help future maintainers.

<details>
<summary>🤖 Prompt for AI Agents</summary>

```
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@migrations/sql/20260607211831_drop_legacy_request_integration_columns.sql`
around lines 36 - 46, The Down migration's UPDATE for
public.request_integrations omits populating tags, anime_quality_profile_id,
anime_tags (and options) from plugin_config; update the SET clause for those
columns so tags and anime_tags use COALESCE((SELECT array_agg(v::integer) FROM
jsonb_array_elements_text(plugin_config->'tags') AS v), '{}') and
COALESCE((SELECT array_agg(v::integer) FROM
jsonb_array_elements_text(plugin_config->'anime_tags') AS v), '{}')
respectively, set anime_quality_profile_id =
NULLIF(plugin_config->>'anime_quality_profile_id','')::integer, and populate
options from plugin_config (e.g., COALESCE(plugin_config->'options',
'{}'::jsonb)); target the UPDATE on request_integrations and adjust the SET
expressions using jsonb_array_elements_text and NULLIF casts as described.
```

</details>

<!-- cr-comment:v1:0d5268264e9c52bac0dd22e8 -->

</blockquote></details>

</blockquote></details>

<details>
<summary>🤖 Prompt for all review comments with AI agents</summary>

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 @docs/superpowers/plans/2026-06-07-requests-pluginization.md:

  • Around line 403-406: The plan currently hardcodes an absolute path in the
    command sequence (the mkdir/cd lines and the go mod init invocation referencing
    /opt/silo-plugin-requests-arr), which violates docs rules; change these commands
    to use repository-relative paths and a short note that "commands assume the
    repository root is the cwd" (e.g., replace "mkdir -p
    /opt/silo-plugin-requests-arr && cd /opt/silo-plugin-requests-arr" with a
    relative mkdir/cd or just "mkdir -p silo-plugin-requests-arr && cd
    silo-plugin-requests-arr" and update the go mod init module path wording to
    avoid embedding local filesystem locations), and add a brief preface line
    stating commands assume repo root as cwd.

In @docs/superpowers/plans/2026-06-07-schema-driven-config-form.md:

  • Around line 12-15: Replace the three absolute paths (/opt/silo-plugin-sdk,
    /opt/silo, /opt/silo-plugin-requests-arr) and the absolute Go toolchain path
    with repository-relative instructions: describe each component as a repo
    subdirectory (e.g., "silo-plugin-sdk", "silo", "silo-plugin-requests-arr") and
    state "Commands assume the repository root is the cwd." Update the build/codegen
    notes (the make proto/buf generate and Go toolchain mention) to reference
    using the toolchain on PATH or a local SDK under the repo (or a container)
    rather than /opt/..., and convert any container/build recipe text to refer to
    the repo-relative locations and the same cwd assumption.

In @docs/superpowers/plans/2026-06-07-seerr-request-router.md:

  • Around line 14-18: The doc currently hardcodes absolute paths like
    /opt/silo-plugin-requests-seerr and /opt/deployarr/.local/go-sdk/go/bin/go
    which violates the docs path policy; update the text (lines referencing "Repo
    root is /opt/silo-plugin-requests-seerr" and "Go toolchain:
    /opt/deployarr/.local/go-sdk/go/bin/go") to use repository-relative phrasing
    (e.g., "Commands assume the repository root is the cwd" and refer to go on
    PATH or "the Go toolchain (go)"), remove any absolute filesystem paths, and
    reword the path-guard note to say the path-guard restricts tools outside the
    repo root and that files should be written via Bash heredocs from the repository
    root.

In @docs/superpowers/plans/2026-06-08-plugin-launch-singleflight.md:

  • Around line 11-12: Replace the machine-local absolute path "/opt/silo" in the
    plan with repository-relative wording and paths: state "Repo: silo-server
    (branch feat/requests-pluginization). Commands assume the repository root is
    the cwd." and reference internal/plugins (and other files) using repo-relative
    paths (e.g., internal/plugins) instead of /opt/...; similarly keep the PATH
    hint (PATH=$PATH:/tmp/go/bin) but phrase it as an environment setup step run
    from the repo root. Ensure the diff text no longer contains "/opt/silo" and uses
    the repository-relative phrasing throughout.

In @docs/superpowers/plans/2026-06-08-plugin-platform-sdk-helpers.md:

  • Around line 16-17: The plan embeds local absolute filesystem paths (the bullet
    about Edit/Write tools being path-guarded outside /opt/silo and the gofmt
    invocation using an absolute GOROOT), so rewrite those lines to remove absolute
    paths and use repository-relative wording: change the "Edit/Write tools..."
    bullet to say files under the repository should be created/modified via Bash
    heredocs with repository-relative paths and a note that commands assume the
    repository root is the current working directory, and replace the gofmt line to
    instruct running the formatter via the Go toolchain (e.g., using the
    environment's go/gofmt) or just "gofmt" without embedding an absolute GOROOT
    path. Ensure both edits reference the same bullets in the plan (the Edit/Write
    tools bullet and the gofmt invocation) so reviewers can locate and verify the
    changes.

In @docs/superpowers/plans/2026-06-08-single-default-enforcement.md:

  • Around line 11-12: The plan uses hard-coded absolute paths (e.g.
    "/opt/silo-plugin-sdk", "/opt/silo-plugin-requests-arr", "/opt/silo") under the
    "Repos & order:" section which makes it non-portable; update all occurrences
    to repository-relative references (e.g. "silo-plugin-sdk",
    "silo-plugin-requests-arr", "silo-server") and replace filesystem roots with
    wording like "Commands assume the repository root is the cwd" and tool prefixes
    (e.g. "Go: prefix with PATH=$PATH:/tmp/go/bin", "Frontend: node_modules/.bin/")
    so no local absolute filesystem paths or transient worktree IDs remain in the
    document; ensure the branch names and order remain unchanged and run a quick
    grep for "/opt/" to catch any remaining absolute paths.

In @docs/superpowers/plans/2026-06-08-typed-quality-tier-signal.md:

  • Around line 14-38: The plan currently uses absolute host paths like
    /opt/silo-plugin-sdk/... throughout; update the document to use
    repository-relative paths and repository-root phrasing (e.g., "paths are
    relative to the repository root (cwd)") instead of any /opt/... locations.
    Replace every absolute path in the File Structure and bullets with the
    repo-relative equivalents shown (for example:
    silo-plugin-sdk/proto/silo/plugin/v1/request_router.proto,
    silo/internal/requests/provider.go,
    silo-plugin-requests-arr/internal/arr/routing.go, etc.), remove any
    workstation-specific toolchain paths (use go or state "Go toolchain at PATH
    from environment" and say "commands assume repo root is cwd"), and update the
    intent text mentioning SDK/plugin host to describe repos by name rather than
    absolute locations; ensure the branch and build-order notes remain but without
    filesystem prefixes.

In @internal/api/requests_wiring.go:

  • Around line 18-20: The PluginRequestRouterAdapter.RequestRouterClient
    currently dereferences a.Svc unconditionally and can panic if the adapter was
    installed with a nil service; modify RequestRouterClient to check whether a.Svc
    is nil and return a controlled "router unavailable" error when it is instead of
    calling a.Svc.RequestRouterClient, and update the adapter installation path
    (where PluginRequestRouterAdapter is created/installed) to avoid registering the
    adapter when dependencies are nil or to pass a clear nil-safe implementation;
    reference the PluginRequestRouterAdapter type and its RequestRouterClient method
    to locate and change the guard and the registration call.

In @internal/plugins/service.go:

  • Around line 629-637: The current ensureClient uses the caller's ctx inside
    s.launchGroup.Do which lets the leader caller's cancellation/timeouts cancel the
    shared in-flight work; change ensureClient so the launch uses a
    cancellation-isolated context (e.g. a background-derived context) when calling
    s.doEnsureClient inside launchGroup.Do, so waiter cancellations don't cancel the
    shared leader work. Specifically update ensureClient to call
    s.launchGroup.Do(..., func() { return s.doEnsureClient(isolatedCtx,
    installationID) }) where isolatedCtx is created from context.Background() (or
    context.WithCancel(context.Background()) if you need a cancel token you
    control), and keep s.doEnsureClient and return handling unchanged.

In @internal/plugins/user_identity_lookup.go:

  • Around line 78-80: Guard against a nil adapter or missing lookup in
    requesterIdentityAdapter.ResolveRequester by checking if a == nil or a.lookup ==
    nil before calling LookupIdentity; if nil, return empty identity values ("" for
    both ID and display name) and a nil error to gracefully degrade. Locate
    ResolveRequester and the a.lookup.LookupIdentity call and add the nil checks and
    early return, otherwise proceed to call a.lookup.LookupIdentity as before.

In @web/src/components/admin/plugins/schemaForm.ts:

  • Around line 144-145: The boolean coercion in the switch handling for "boolean"
    (case "boolean": return Boolean(raw);) wrongly treats the string "false" as
    true; update that branch to explicitly handle string values by returning
    raw.toLowerCase() === "true" for strings (and optionally treat "1"/"0" if
    desired), otherwise fall back to Boolean(raw) for other types; apply the same
    change to the other identical boolean branch in the file so string "false"
    correctly becomes false.
  • Around line 164-169: The array:num case currently maps values with
    coerceNumericString which only matches integer regex; update the logic so
    decimal numeric strings are converted to numbers too — either extend
    coerceNumericString to accept floating formats (e.g. allow /^-?\d+(.\d+)?$/)
    and return Number(value), or add a new helper (e.g. coerceNumericOrFloat) that
    returns parseFloat/Number for integer and decimal strings and leaves non-numeric
    values untouched; then change the switch's array:num branch to use that updated
    helper (referencing the case "array:num" and the coerceNumericString helper).

In @web/src/pages/AdminRequests.tsx:

  • Around line 577-580: The form/editor currently only stores installation_id
    which causes duplicate Select option values when requestRouterInstallations()
    emits multiple capability options per installation; update the editor state and
    form schema to track capability_id (in addition to installation_id) and wire the
    Select to use capability_id as the value, ensure request probing and save
    payloads read capability_id (not just installation_id), and update any handlers
    that construct payloads or set selected values (references: installation_id,
    capability_id, requestRouterInstallations, the component and the code paths around saving/probing options) so the exact capability sub-id is persisted and sent. Around line 926-933: When the user changes the selected plugin, the previous pluginConfig and any inline save errors must be cleared to avoid sending stale keys to the new plugin; update the plugin-change path (the handler that updates selected / selectedInstallationID) to set pluginConfig to an empty/default object and clear related inline save error state before the options probe runs (this affects the values passed into useConnectionOptions). Locate the code that updates selected (and where selectedInstallationID is set) and add logic to reset pluginConfig and the inline save error variables so the next options call receives a fresh per-plugin config. Minor comments: In @docs/superpowers/plans/2026-06-07-requests-pluginization.md: Around line 109-111: The heading "PHASE 1 — SDK: request_router.v1 capability (silo-plugin-sdk)" is using a top-level H1 which creates a level jump; change its markdown level to match the surrounding plan headings (e.g., convert "# PHASE 1 — SDK: request_router.v1 capability (silo-plugin-sdk)" to "## PHASE 1 — SDK: request_router.v1 capability (silo-plugin-sdk)" or the appropriate lower-level heading) so the hierarchy flows into the subsequent "Task 1: Add the request_router.proto contract" heading without skipping levels. In @docs/superpowers/plans/2026-06-07-schema-driven-config-form.md: Line 51: The markdown heading for Task 1 skips the expected hierarchy level and needs to be normalized. In the schema-driven config form plan document, adjust the ### Task 1: Extend AdminFormDescriptor in common.proto heading so it follows the surrounding heading structure without jumping levels, and update any sibling task headings in the same section if needed to keep the hierarchy consistent. In @docs/superpowers/plans/2026-06-07-seerr-request-router.md: Around line 23-39: Add a language identifier to the fenced code block that contains the repository tree (the block starting with and the lines beginning "/opt/silo-plugin-requests-seerr/ ... README.md"); change the opening fence to specify a language (e.g.,text) so the markdown linter MD040 is satisfied. In @docs/superpowers/plans/2026-06-08-plugin-launch-singleflight.md: Line 15: The heading "### Task 1: Single-flight ensureClient" jumps levels and violates MD001; update its markdown header level to match surrounding headings (e.g., change to "##" or "####" as appropriate) so the nesting is sequential with the prior and subsequent headings, and verify other headings around "Task 1: Single-flight ensureClient" follow the same normalized level to keep markdownlint MD001 satisfied. In @docs/superpowers/plans/2026-06-08-plugin-platform-sdk-helpers.md: Around line 24-35: The fenced code block that lists the package layout (the block starting with "/opt/silo-plugin-sdk/pkg/pluginsdk/") is missing a language tag for markdownlint MD040; update that fence to include a language (for example change totext or ```bash) so the block is annotated and MD040 passes. In @docs/superpowers/plans/2026-06-08-request-card-library-collapse-anime.md: Around line 11-12: Replace the hardcoded absolute paths seen in the plan (e.g. /opt/silo, /opt/silo-plugin-requests-arr, /tmp/go/bin, web/node_modules/.bin) with repository-relative instructions and a single clarifying sentence such as "Commands assume the repository root is the cwd." Update all occurrences (including the later occurrences mentioned) so commands reference repo-root-relative locations (e.g. silo, silo-plugin-requests-arr, ./web/node_modules/.bin, ./go/bin or just rely on PATH) and remove any transient local filesystem paths to keep the plan portable for contributors. In @docs/superpowers/plans/2026-06-08-seerr-per-user-requester-mapping.md: Around line 11-12: Replace all machine-local absolute paths (e.g. strings like "/opt/...", "/tmp/..." and specific absolute PATH prefixes) in the plan with repository-relative references (for example refer to repositories by their directory names such as "silo-plugin-sdk", "silo", "silo-plugin-requests-seerr") and add a short preface line: "Commands assume the repository root is the cwd." Also change any hardcoded PATH suggestions to a portable form (for example mention adding Go binaries via "PATH=$PATH:$(go env GOPATH)/bin" or by referring to a repo-local bin directory) and apply the same substitution to the other ranges noted (lines referenced in the review) so no absolute filesystem paths remain. In @docs/superpowers/plans/2026-06-08-seerr-permission-simplification.md: Around line 9-10: The plan contains local absolute filesystem paths (e.g., "/opt/silo-plugin-requests-seerr" and the PATH prefix example) that violate the docs portability rule; update the plan text to remove all absolute paths and transient worktree IDs and replace them with repository-relative references (e.g., "repo: silo-plugin-requests-seerr" or "assume repository root is the cwd") and neutral command notes such as "Commands assume the repository root is the cwd"; ensure the same replacements are made for every occurrence of that absolute path and the PATH prefix example within this document. In @docs/superpowers/plans/2026-06-08-silo-server-95-credential-integration.md: Around line 9-10: The doc uses local absolute paths and transient IDs (e.g., "/opt/silo", "backup/pre-main-rebase-20260608", and the literal PATH hack "PATH=$PATH:/tmp/go/bin") which must be turned into repository-relative instructions: replace absolute paths with repo-relative references like "internal/requests", "internal/plugins", "cmd/silo" and add a short note "Commands assume the repository root is the cwd"; convert the backup reference to a generic backup branch name (e.g., "backup/") or remove it; change the PATH line to an instruction such as "Ensure /tmp/go/bin is on PATH" or "Add Go to PATH as needed" rather than injecting an absolute PATH string, and make the same replacements for the other occurrences of absolute paths mentioned in the comment. In @docs/superpowers/plans/2026-06-08-single-default-enforcement.md: Line 15: The document has a heading depth jump at the line containing "### Task 1: SDK — add siblings + exclusive_group_field and regenerate" which should be H2 instead of H3; update that heading from "### Task 1: SDK — add siblings + exclusive_group_field and regenerate" to use H2 (i.e., prepend with "##") so the heading hierarchy is consistent and MD001 is resolved. In @docs/superpowers/plans/2026-06-08-typed-quality-tier-signal.md: Line 93: Fix the contradictory parenthetical on the note about the is4k identifier: update the example of the actually-wrong generated symbols so it reads that the proto field is4k generates Go field Is4K and getter GetIs4K() (NOT the lowercase/incorrect is4k/GetIs4k()); ensure the surrounding references to RequestedQuality, GetId(), Is4K, GetIs4K(), and GetQualities() remain unchanged. In @docs/superpowers/specs/2026-06-07-requests-pluginization-design.md: Line 44: Two fenced code blocks in the document use bare triple-backticks (no language) and trigger markdownlint MD040; update each opening fence from to an appropriate annotated fence such astext, plaintext, or json depending on the block content (e.g., request/response payloads should use json, plain examples use text) so both bare ``` occurrences become language-annotated. In @docs/superpowers/specs/2026-06-08-seerr-per-user-requester-mapping-design.md: Line 120: Fix the markdownlint warnings MD038/MD040 by correcting the inline code and fenced block: render the symbol seerr.CreateRequestBody as a single inline code span (seerr.CreateRequestBody) and replace the escaped field snippet so the struct field reads UserID int json:"userId,omitempty" inside a fenced code block that includes a language tag (e.g., go or text) instead of using backslash-escaped backticks; ensure the fenced block around the flow diagram includes the language marker to satisfy MD040 and remove any stray backslashes so MD038 is resolved. In @docs/superpowers/specs/2026-06-08-seerr-permission-simplification-design.md: Around line 40-46: The fenced code block containing the permission-bit example (variables like bits, REQUEST, REQUEST_4K, AUTO_APPROVE, AUTO_APPROVE_4K and the conditional snippet) is missing a language identifier; update the opening triple-backtick to include a language (e.g., python or text) so the snippet is labeled and MD040 is resolved. In @docs/superpowers/specs/2026-06-08-silo-server-95-credential-integration-design.md: Around line 51-54: The fenced code block containing the git commands needs a language tag to satisfy MD040: edit the fenced block around the two lines "git config rerere.enabled true" and "git rebase origin/main" and add a shell language identifier (e.g., bash) immediately after the opening triple backticks so the block reads like ```bash; this will properly label the code snippet for linting. In @docs/superpowers/specs/2026-06-08-single-default-enforcement-design.md: Around line 139-147: The fenced code block that starts with "Admin toggles is_default on card B (radarr)" is unlabeled; add a language tag (e.g., ```text) to the opening fence so the block is labeled and MD040 is resolved. Update the block surrounding the flow (the triple-backtick section containing the Admin/frontend/host/plugin lines) to use a consistent language label such as text to avoid syntax highlighting changes. In @docs/superpowers/specs/2026-06-08-typed-quality-tier-signal-design.md: Line 43: Replace workstation-specific absolute paths in the spec with repository-relative paths and a note that commands assume the repository root is the current working directory; specifically, update occurrences of paths like /opt/silo-plugin-sdk/proto/silo/plugin/v1/request_router.proto to the repo-relative form proto/silo/plugin/v1/request_router.proto (and apply the same change for the other absolute /opt/... entries in this spec) and add a short sentence such as "Commands assume the repository root is the cwd" to the top or relevant section. In @internal/requests/errors.go: Around line 38-43: The ValidationError.Error() method should guard against a nil receiver to avoid panics when a typed-nil *ValidationError is used as an error; update the ValidationError.Error() implementation to check if e == nil and return "validation failed" (or another sensible default) before accessing e.FormError, keeping the existing behavior of returning e.FormError when non-empty; locate the method by its symbol ValidationError.Error() and the FormError field to apply the nil-check. Nitpick comments: In @docs/superpowers/specs/2026-06-08-request-card-library-collapse-anime-design.md: Around line 64-67: Add language specifiers to the fenced pseudocode blocks that define forceOpen and open (the blocks containing expressions using section.field_keys, mergedErrors, userToggled, and collapsed_default) and the similar block at the later location; update those triple-backtick fences to include a language hint such as text or pseudocode so the linter stops complaining and rendering is consistent. In @internal/api/handlers/plugins_admin_form_test.go: Around line 173-181: The current test cases in plugins_admin_form_test.go only verify top-level DTOs; extend the cases slice to include nested types so the guard covers AdminFormCondition and AdminFormValidation too by adding entries for reflect.TypeOf(pluginv1.AdminFormCondition{}) -> reflect.TypeOf(pluginAdminFormConditionJSON{}) and reflect.TypeOf(pluginv1.AdminFormValidation{}) -> reflect.TypeOf(pluginAdminFormValidationJSON{}); alternatively, enhance the test logic that iterates the cases to recursively walk/compare nested fields in pluginv1.AdminFormDescriptor / pluginAdminFormJSON (and AdminFormSection) so any newly added nested proto fields are validated against their corresponding DTO types as well. In @migrations/sql/20260607211831_drop_legacy_request_integration_columns.sql: Around line 36-46: The Down migration's UPDATE for public.request_integrations omits populating tags, anime_quality_profile_id, anime_tags (and options) from plugin_config; update the SET clause for those columns so tags and anime_tags use COALESCE((SELECT array_agg(v::integer) FROM jsonb_array_elements_text(plugin_config->'tags') AS v), '{}') and COALESCE((SELECT array_agg(v::integer) FROM jsonb_array_elements_text(plugin_config->'anime_tags') AS v), '{}') respectively, set anime_quality_profile_id = NULLIF(plugin_config->>'anime_quality_profile_id','')::integer, and populate options from plugin_config (e.g., COALESCE(plugin_config->'options', '{}'::jsonb)); target the UPDATE on request_integrations and adjust the SET expressions using jsonb_array_elements_text and NULLIF casts as described. </details> <details> <summary>🪄 Autofix (Beta)</summary> Fix all unresolved CodeRabbit comments on this PR: - [ ] <!-- {"checkboxId": "4b0d0e0a-96d7-4f10-b296-3a18ea78f0b9"} --> Push a commit to this branch (recommended) - [ ] <!-- {"checkboxId": "ff5b1114-7d8c-49e6-8ac1-43f82af23a33"} --> Create a new PR with the fixes </details> --- <details> <summary>ℹ️ Review info</summary> <details> <summary>⚙️ Run configuration</summary> **Configuration used**: Organization UI **Review profile**: CHILL **Plan**: Pro Plus **Run ID**: `13ccaf57-c4cd-4915-a239-ffe826adb032` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between cb309ca and a6e90aa. </details> <details> <summary>⛔ Files ignored due to path filters (1)</summary> * `go.sum` is excluded by `!**/*.sum` </details> <details> <summary>📒 Files selected for processing (67)</summary> * `cmd/silo/main.go` * `docs/superpowers/plans/2026-06-07-requests-pluginization.md` * `docs/superpowers/plans/2026-06-07-schema-driven-config-form.md` * `docs/superpowers/plans/2026-06-07-seerr-request-router.md` * `docs/superpowers/plans/2026-06-08-plugin-launch-singleflight.md` * `docs/superpowers/plans/2026-06-08-plugin-platform-sdk-helpers.md` * `docs/superpowers/plans/2026-06-08-request-card-library-collapse-anime.md` * `docs/superpowers/plans/2026-06-08-seerr-per-user-requester-mapping.md` * `docs/superpowers/plans/2026-06-08-seerr-permission-simplification.md` * `docs/superpowers/plans/2026-06-08-silo-server-95-credential-integration.md` * `docs/superpowers/plans/2026-06-08-single-default-enforcement.md` * `docs/superpowers/plans/2026-06-08-typed-quality-tier-signal.md` * `docs/superpowers/specs/2026-06-07-requests-pluginization-design.md` * `docs/superpowers/specs/2026-06-07-schema-driven-config-form-design.md` * `docs/superpowers/specs/2026-06-07-seerr-request-router-design.md` * `docs/superpowers/specs/2026-06-08-plugin-launch-singleflight-design.md` * `docs/superpowers/specs/2026-06-08-plugin-platform-sdk-helpers-design.md` * `docs/superpowers/specs/2026-06-08-request-card-library-collapse-anime-design.md` * `docs/superpowers/specs/2026-06-08-seerr-per-user-requester-mapping-design.md` * `docs/superpowers/specs/2026-06-08-seerr-permission-simplification-design.md` * `docs/superpowers/specs/2026-06-08-silo-server-95-credential-integration-design.md` * `docs/superpowers/specs/2026-06-08-single-default-enforcement-design.md` * `docs/superpowers/specs/2026-06-08-typed-quality-tier-signal-design.md` * `go.mod` * `internal/api/autoscan_wiring_test.go` * `internal/api/handlers/plugins.go` * `internal/api/handlers/plugins_admin_form_test.go` * `internal/api/handlers/requests.go` * `internal/api/handlers/requests_test.go` * `internal/api/requests_wiring.go` * `internal/api/router.go` * `internal/pluginhost/client.go` * `internal/pluginhost/handshake.go` * `internal/plugins/service.go` * `internal/plugins/service_hot_reload_test.go` * `internal/plugins/service_singleflight_test.go` * `internal/plugins/user_identity_lookup.go` * `internal/requests/arrclient/resources.go` * `internal/requests/errors.go` * `internal/requests/provider.go` * `internal/requests/provider_test.go` * `internal/requests/radarr/client.go` * `internal/requests/radarr/client_test.go` * `internal/requests/repository.go` * `internal/requests/repository_crypto_test.go` * `internal/requests/routing.go` * `internal/requests/routing_test.go` * `internal/requests/service.go` * `internal/requests/service_test.go` * `internal/requests/sonarr/client.go` * `internal/requests/sonarr/client_test.go` * `internal/requests/types.go` * `migrations/sql/20260607131954_request_router_connections.sql` * `migrations/sql/20260607211831_drop_legacy_request_integration_columns.sql` * `migrations/sql/20260608131649_backfill_request_integration_capability_subid.sql` * `web/src/api/client.ts` * `web/src/api/types.ts` * `web/src/components/admin/plugins/PluginConfigForm.tsx` * `web/src/components/admin/plugins/SchemaForm.test.tsx` * `web/src/components/admin/plugins/SchemaForm.tsx` * `web/src/components/admin/plugins/schemaForm.test.ts` * `web/src/components/admin/plugins/schemaForm.ts` * `web/src/hooks/queries/useRequests.ts` * `web/src/pages/AdminRequests.tsx` * `web/src/pages/admin/autoscan/ConnectionsPanel.tsx` * `web/src/pages/requestExclusivity.test.ts` * `web/src/pages/requestExclusivity.ts` </details> <details> <summary>💤 Files with no reviewable changes (6)</summary> * internal/requests/radarr/client.go * internal/requests/routing.go * internal/requests/sonarr/client_test.go * internal/requests/routing_test.go * internal/requests/sonarr/client.go * internal/requests/radarr/client_test.go </details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->

Comment thread web/src/pages/AdminRequests.tsx Resolved
Comment thread web/src/pages/AdminRequests.tsx Resolved
fluxis and others added 4 commits June 9, 2026 15:42
ResolveChain falls back to every enabled metadata provider when a library
+ content-level has no enabled chain entry. That fallback was media-type
blind: a provider declaring default_priority only for an unrelated level
(e.g. an audiobook provider declaring {"audiobook": N}) was kept in the
list (merely sorted last) and invoked for video content levels.

In production this made silo.audiobook-metadata hammer external audiobook
APIs with anime/movie/series titles every scheduled enrichment pass
(MatchWorker, 30s) for the season/episode levels that had no enabled chain
entry. Disabling the chain entries did not help because the fallback never
consults them; only disabling the installation removed it from the global
set.

Treat a non-empty default_priority map as the provider enumerating the
content levels it supports: in resolveEnabledProvidersByPriority, exclude
providers whose declared map omits the requested level instead of ranking
them last. Providers that declare no default_priority make no claim and
stay eligible everywhere (legacy behavior).

Fixes Silo-Server#105

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
The deduped ensureClient launch ran doEnsureClient under the leader caller's
ctx, so if that caller's request was canceled/timed out mid-launch the shared
plugin start was torn down and the error propagated to every waiter. Run the
launch under context.WithoutCancel so a single caller cannot cancel work the
other waiters depend on (values preserved for tracing/auth). (CodeRabbit)

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
RequestRouterClient dereferenced a.Svc unconditionally and AttachRequestRouter
called SetRouterProvider even with nil deps, so a build without the plugin
service would panic instead of degrading. Guard both: the adapter returns a
controlled error and AttachRequestRouter no-ops, leaving fulfillment to fail
with the existing "no backend configured" path. (CodeRabbit)

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
… form

- schemaForm: Boolean("false") was true; parse string booleans explicitly.
  array:num now coerces decimals ("1.5"), array:int stays integer-only.
- AdminRequests: track capability_id alongside installation_id (composite
  <Select> value) so a multi-capability installation resolves the exact
  backend; reset pluginConfig when the selected plugin changes so plugin A's
  keys never reach plugin B's options probe/save. (CodeRabbit)

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@fluxis

fluxis commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

Review feedback addressed

Thanks @coderabbitai. Summary of dispositions (pushed in 8cd6aab, 5dcb9a4, 1d68ed1):

Fixed

  • plugins/service.go — singleflight ctx coupling: the deduped ensureClient launch now runs under context.WithoutCancel(ctx), so a leader caller's cancellation/timeout no longer tears down the shared launch that other waiters depend on. Added a cancellation-isolation test.
  • api/requests_wiring.go — nil deps: RequestRouterClient returns a controlled error and AttachRequestRouter no-ops when the plugin service is absent (degrades to the existing "no backend configured" failure instead of panicking). Added tests.
  • schemaForm.ts — boolean coercion: Boolean("false") was true; string booleans are now parsed explicitly.
  • schemaForm.ts — array:num: now coerces decimals ("1.5"); array:int stays integer-only.
  • AdminRequests.tsx — capability sub-id: the editor now tracks capability_id alongside installation_id (composite <Select> value) so a multi-capability installation resolves the exact backend.
  • AdminRequests.tsx — config reset: switching the selected plugin now clears pluginConfig (and stale save errors) so the previous plugin's keys never reach the new plugin's options probe/save.

Declined

  • user_identity_lookup.go — nil guard: intentionally not adding the suggested "return empty identity on nil lookup". The adapter is only constructed with a non-nil lookup at wiring time, and silently returning an empty identity would mask a wiring misconfiguration — a silent failure we'd rather surface than swallow.

Obsolete

  • The markdownlint comments on docs/superpowers/plans/* are moot — those files were removed from this PR after the review ran (they're internal design docs, kept out of the upstream diff).

@coderabbitai

coderabbitai Bot commented Jun 9, 2026 •

Copy link
Copy Markdown
Contributor

@fluxis Thanks for the thorough disposition summary — all the fixes look well-reasoned.

A few notes on each:

  • context.WithoutCancel in singleflight — exactly the right call. The shared in-flight launch should not be coupled to any individual caller's deadline; decoupling it and adding a cancellation-isolation test is the correct approach.
  • Nil-safe AttachRequestRouter — good that it degrades gracefully rather than panicking; the "no backend configured" path is already a known-handled failure mode.
  • "false" boolean coercion — the Boolean("false") === true gotcha is a classic, glad it's now explicit.
  • array:num decimals — correct separation of concerns: integers stay integers, decimals belong only in the numeric array type.
  • Composite <Select> value for capability sub-id — avoids the ambiguous multi-capability installation case cleanly.
  • Config reset on plugin switch — the right UX hygiene; stale keys leaking into a different plugin's probe was a real correctness risk.

On the declined nil guard: the reasoning holds up. A constructor-enforced invariant (RequesterIdentityFromLookup only ever called with a valid lookup) means a nil at runtime is a wiring bug, not a runtime edge case. Surfacing that as a panic/error is better than silently producing empty identity and causing subtly wrong attribution behavior downstream.

On the obsolete markdownlint comments: understood — those files being out of scope of the upstream diff makes those comments moot.

The PR looks solid. Happy to re-review if you'd like a pass over the pushed commits.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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 `@internal/metadata/chain.go`:
- Around line 312-313: The metadata lookup is too broad: update
lookupCapabilityMetadata calls (used before providerSupportsLevel) to include
and filter by capability_id in addition to plugin_installation_id, and thread
capabilityID through LookupDefaultPriority (and its callers such as
seedDefaultChain) so queries use both plugin_installation_id AND capability_id
(remove/avoid LIMIT 1 that ignores capability) ensuring per-capability
deterministic metadata selection for eligibility, include/exclude decisions, and
ranking.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: eeca76ab-19b4-4071-aba9-80b11a253cf2

📥 Commits

Reviewing files that changed from the base of the PR and between a6e90aa and 1d68ed1.

📒 Files selected for processing (9)
  • internal/api/requests_wiring.go
  • internal/api/requests_wiring_test.go
  • internal/metadata/chain.go
  • internal/metadata/chain_test.go
  • internal/plugins/service.go
  • internal/plugins/service_singleflight_test.go
  • web/src/components/admin/plugins/schemaForm.test.ts
  • web/src/components/admin/plugins/schemaForm.ts
  • web/src/pages/AdminRequests.tsx
✅ Files skipped from review due to trivial changes (1)
  • internal/metadata/chain_test.go
🚧 Files skipped from review as they are similar to previous changes (5)
  • internal/api/requests_wiring.go
  • internal/plugins/service.go
  • web/src/components/admin/plugins/schemaForm.test.ts
  • web/src/pages/AdminRequests.tsx
  • web/src/components/admin/plugins/schemaForm.ts

Comment thread internal/metadata/chain.go Resolved
@Quick104

Quick104 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

@codex

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1d68ed1c20

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread web/src/pages/AdminRequests.tsx Outdated
Comment on lines +1032 to +1035
capability_id: selected?.capability.id ?? "",
installation_id: hasInstallation ? selectedInstallationID : undefined,
supported_media_types: [],
plugin_config: descriptor

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve each connection's supported media types

Saving any request-router connection now always sends supported_media_types: [], and the repository persists that value on both create and update. Since integrationSupportsMediaType treats an empty slice as "supports all", editing a migrated movie-only/series-only connection (or creating one through this form) makes it eligible for both movies and series, so auto-approval/fulfillment can route a series request to a Radarr-only connection or a movie request to a Sonarr-only one. Derive this from the selected plugin/config or preserve the existing source.supported_media_types instead of overwriting it with an empty array.

Useful? React with 👍 / 👎.

Comment thread web/src/pages/AdminRequests.tsx Resolved
Comment thread internal/api/router.go Resolved
Comment thread internal/requests/service.go Outdated
Comment on lines 955 to 956
if strings.TrimSpace(integration.APIKeyRef) == "" {
integration.APIKeyRef = stored.APIKeyRef

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Don't reuse saved keys for changed option-probe URLs

For an existing connection, the background options probe backfills the stored API key whenever the request omits api_key_ref, even if the submitted base_url has been changed in the form. That lets an admin edit the Base URL to an attacker-controlled endpoint and the server will send the otherwise unreadable saved key during ListConfigOptions before the save path's re-enter-key check can reject it. Mirror the save-time guard here: only backfill the stored key when the probed Base URL is blank or still matches the stored URL.

Useful? React with 👍 / 👎.

Comment thread internal/requests/service.go Resolved
Comment thread internal/metadata/chain.go Outdated
Comment on lines +312 to +320
metadataJSON := lookupCapabilityMetadata(ctx, pool, c.PluginInstallationID)
if !providerSupportsLevel(metadataJSON, contentLevel) {
slog.Debug("skipping metadata provider: does not declare support for content level",
"installation_id", c.PluginInstallationID,
"capability_id", c.CapabilityID,
"content_level", contentLevel)
continue
}
items = append(items, ranked{cap: c, priority: extractDefaultPriority(metadataJSON, contentLevel)})

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Look up metadata for the specific capability

In the chain-less fallback, each CapabilityInfo is filtered/ranked using metadata fetched only by plugin_installation_id with LIMIT 1. If one installation exposes multiple metadata_provider.v1 capabilities with different default_priority maps, every capability is evaluated with the same arbitrary metadata row, so a valid movie/provider capability can be skipped or ranked with an audiobook-only capability's priority. Include c.CapabilityID in the metadata lookup so the support check is applied to the capability being appended.

Useful? React with 👍 / 👎.

Comment thread internal/api/handlers/plugins.go Outdated
Comment on lines +1398 to +1400
DynamicOptions: field.GetDynamicOptions(),
ShowWhen: adminFormConditionsToJSON(field.GetShowWhen()),
Validation: validation,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Serialize exclusive_group_field to the admin form

The frontend has generic exclusivity logic keyed by exclusive_group_field, but adminFormToJSON never copies that proto field into pluginAdminFormFieldJSON. For request-router forms that mark fields like default/default-4K as mutually exclusive, the browser never receives the grouping metadata, so toggling a new default does not clear the sibling card and admins hit validation errors or can persist conflicting defaults if a plugin does not duplicate the check. Add the field to the DTO and populate it here.

Useful? React with 👍 / 👎.

Comment thread internal/requests/service.go Outdated
continue
}
if _, err := s.store.UpdateTargetStatus(ctx, t.ID, newStatus, st.ExternalID, st.ExternalStatus, "", Viewer{}); err != nil {
if _, err := s.store.UpdateTargetStatus(ctx, target.ID, newStatus, "", st.ExternalStatus, "", Viewer{}); err != nil {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3 Badge Preserve plugin failure messages during reconcile

When CheckStatus returns a target as failed, this updates the target with an empty last_error, discarding st.Message. In the scenario where the plugin reports why an external request failed during reconciliation, the admin queue only shows a generic aggregate failure and the target row has no actionable error, unlike initial fulfillment which stores rt.Message. Pass st.Message as the last-error argument when applying status updates.

Useful? React with 👍 / 👎.

@Quick104
Quick104 merged commit 3319c84 into Silo-Server:main Jun 9, 2026
1 check was pending
@fluxis
fluxis deleted the feat/requests-pluginization branch June 9, 2026 17:32
Quick104 added a commit that referenced this pull request Jun 11, 2026
#104)

* docs: design spec for pluginizing requests fulfillment

Pluginize the requests fulfillment backend behind an agnostic
request_router.v1 capability (high seam: whole-request fulfiller).
Host keeps lifecycle/quota/policy/quality-governance and a generic
two-tier connection registry; plugins own routing+submission+status.
First plugin extracts multi-instance Sonarr/Radarr; Seerr follows in
a separate spec. Preserves autoscan reuse of arr connection rows.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* docs: implementation plan for requests pluginization

Three-phase plan: (1) request_router.v1 SDK capability, (2) new
silo-plugin-requests-arr plugin extracting multi-instance Sonarr/Radarr,
(3) host refactor routing fulfillment through the plugin while keeping
quality governance, target records, and autoscan connection reuse host-side.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* feat(db): generalize request_integrations into a two-tier connection registry

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* feat(requests): add generic connection fields to Integration + repo mapping

* feat(pluginhost): typed RequestRouter capability client + resolver

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* feat(requests): plugin-backed RequestRouterProvider seam

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* feat(requests): route fulfillment through RequestRouterProvider; host keeps quality governance

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* fix(requests): base auto-approve gate on router connection model

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* feat(api): wire plugin-backed request router at both service sites

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* refactor(requests): remove in-host Sonarr/Radarr fulfillment code

* test(autoscan): lock request-integration reuse after connection generalization

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* feat(web): plugin-driven request integration config form

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* feat(api): echo router connection fields in integration response

* fix(requests): retry dropped qualities, contain to one router installation, dedupe targets

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* fix(requests): harden plugin trust boundary (validate targets, contain bad connections, media-type routing)

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* fix(requests): tighten auto-approve gate, restore default/4k validation, propagate config-encode error, drop itoa wrapper, test status/options translation

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* perf(requests): resolve integrations/settings/secrets once per reconcile cycle

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* fix(web): dedupe config helpers, preserve zero profile id, stabilize installation default, drop redundant options write

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* docs: design spec for schema-driven plugin config form

Extends AdminFormDescriptor into a full form-description language (dynamic
options, multi-select, conditional visibility, sections, validation) + a
plugin Validate RPC, rendered by one reusable SchemaForm engine. Retires the
bespoke arr connection form and integrationOptionsFromRouter so any
request_router backend renders its config UI from manifest data with zero
host changes. Addresses code-review finding #9.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* docs: implementation plan for schema-driven plugin config form

Six phases: SDK AdminFormDescriptor extensions + Validate RPC; reusable
SchemaForm renderer (refactor PluginConfigForm onto it); host Validate
plumbing + generic options + legacy-column derivation + retire
integrationOptionsFromRouter; requests admin page swap to SchemaForm with
per-plugin grouping; arr manifest enrichment + Validate impl; verification.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* feat(web): extend plugin admin-form TS types (sections, conditions, validation, multi-select)

* feat(web): schema-form pure utils (show_when, validation, value coercion)

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* feat(web): SchemaForm renderer (controls, sections, show_when, dynamic options, errors)

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* refactor(web): render PluginConfigForm via the shared SchemaForm engine

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* feat(requests): RequestRouter Validate client + provider seam

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* feat(requests): plugin Validate on save, generic options, derive legacy columns from plugin_config

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* feat(api): generic options response + 400 field_errors on plugin validation failure

* feat(web): generic request-integration options type + surface validation field_errors

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* feat(web): render request connections via SchemaForm; per-plugin grouping; retire bespoke arr form

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* fix(web): silent connection-options probe with inline failure status (no toast spam)

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* fix(api): serialize admin_form sections/show_when/dynamic_options/validation to the client

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* fix(web): drop show_when-hidden fields from buildSchemaValues payload

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* feat(requests): pass requester user id as int64 (no truncation)

* refactor(requests): drop legacy arr columns; plugin_config is sole source of truth

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* fix(requests): backfill api key in plugin validate; centralize validation 400; drop duplicate host cross-field check; guard admin-form serializer

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* fix(requests): refuse stored api key reuse when base_url changes (security hardening)

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* feat(web): SchemaForm regex-guard, default_value, type-driven coercion, validity callback

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* fix(web): connection-options latest-wins + narrowed deps + clear stale errors; auto-select; type-driven persist; reuse types

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* docs: design spec for silo-plugin-requests-seerr (request_router.v1 backend)

* docs: implementation plan for silo-plugin-requests-seerr

* docs(spec): FindExistingRequest uses /api/v1/request (carries request id)

* docs(spec): seerr hardening — id-recovery, 404 terminal, media-status, sort pin, single missing-tmdb message

* docs: design spec for shared plugin-platform SDK helpers (code-review #10)

* docs: plan for plugin-platform SDK helpers (#10) + spec fix (inline broker wiring, no import cycle)

* docs: design spec for typed 4K quality-tier signal (code-review #9)

* docs: implementation plan for typed 4K quality-tier signal (#9)

* feat(requests): stamp is4k per quality (host owns the 4K-tier fact)

* fix(requests): store capability sub-id, not the type, in request_integrations

request_integrations.capability_id carried the capability TYPE
("request_router.v1") instead of the capability sub-id ("arr"/"seerr").
The host resolves a router plugin via
requireCapability("request_router.v1", id), which keys on (type, id), so
storing the type resolved to no capability: every save/options/fulfill
500'd ("Request operation failed" / "no fulfillment backend configured")
in ~1ms, before the arr/Seerr API was ever contacted. The path was
internally split-brained (the fulfillment filter matched the type while
the dispatcher needed the sub-id), so it never worked end-to-end; the
unit tests hid it behind a fake provider that skips requireCapability.

Align capability_id with the scan_source/metadata convention (sub-id):
- validateInstance: require a non-empty sub-id; drop the default-to-type
  and the "!= request_router.v1" reject.
- resolveRouterConnections / integrationConfigured / unbound-guidance:
  match on a non-empty capability, not type equality.
- repository: persist capability_id verbatim (never default to the type).
- web AdminRequests: send the selected plugin's capability.id in both the
  options probe and the save payload (was a hardcoded type constant).
- migration 20260608131649: backfill capability_id from each bound
  installation's request_router.v1 capability and drop the column's
  misleading default. Unbound legacy rows are left for admin re-save.

Tests: validateInstance now requires the sub-id, and the selected sub-id
must reach the plugin Validate RPC (fakeRouterProvider records it).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* feat(web): polish request connection cards (grouped toggles + option loading states)

The schema-driven connection cards rendered each boolean as its own
bordered, double-labeled box and showed dynamic SELECTs (root folder,
quality profile, tags) as empty controls with a single "Loading options…"
line while the host probed the service.

- Toggles render as a cohesive settings list: consecutive switches collapse
  into one bordered, divided container; each row is toggle-first with the
  label + description hugging beside it (no stranded whitespace between a
  short label and its switch). Honors show_when, so conditional toggles
  still group correctly.
- Dynamic SELECT/MULTI_SELECT fields show a per-field spinner + shimmer
  skeleton while options load, and only when there's nothing to show yet —
  a background re-probe never flashes over the operator's current value.
- Sections get a softer surface and clearer titles; the card's enable
  switch is labeled Enabled/Disabled; the options-load failure is a proper
  inline alert with retry guidance.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* fix(requests): treat "Any"/no-cap playback ceiling as 4K-allowed

allowedQualities decided whether to also request 2160p with
`CompareQuality(ceiling, PlaybackQuality4K) >= 0`. But an "Any" max
playback quality resolves to an empty ceiling ("no cap"), and in
qualityRank "" is the LOWEST rank (0) — so CompareQuality("", "2160p")
returns -1 and 4K was dropped. A requester with unlimited playback quality
only got a 1080p request, never the 4K one.

Use access.QualityAllowed(PlaybackQuality4K, ceiling), which already
encodes "empty ceiling == no cap == allows everything". Now:
- "" / "Any"  -> 1080p + 2160p
- "2160p"     -> 1080p + 2160p
- "1080p"     -> 1080p only
- resolver error still fails safe to the HD ceiling.

Tests: add an "any/no-cap ceiling adds 2160p" case; the unknown-quality,
status-coercion, dedup, and per-quality-idempotency submit tests now pin
an explicit HD ceiling (they relied on the old empty-default == HD-only
behavior and were not about 4K entitlement).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* docs: design spec for collapsible Library + anime gate/nesting (request card UI, Spec A)

Spec A of two for the request connection card UX: Library section becomes
collapsible/collapsed (auto-expanding on validation errors) and the anime
override fields move into a single gated section below Library instead of
popping out as a detached sibling card. Single-default enforcement is Spec B.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* docs: implementation plan for collapsible Library + anime gate/nesting (Spec A)

Task-by-task TDD plan: SchemaForm auto-expand-on-error + nested-field
affordance (silo-server), arr manifest regroup (collapsible Library, anime
gate section), then build/deploy/reinstall + manual verify.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* feat(web): auto-expand collapsible schema sections that have validation errors

SchemaFormSection now accepts a forceOpen prop; when any field in the section
has a mergedError (client validation or server error), the section expands
automatically so required-field setup can never be hidden behind a collapsed
accordion. The operator's manual toggle is preserved via a nullable userOpen
state that only takes effect when forceOpen is false.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* feat(web): indent show_when-revealed schema fields to read as nested

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>

* docs: design spec for schema-driven single-default exclusivity enforcement (Spec B)

At most one connection per service_kind may be the HD default (is_default) or
4K default (is_default_4k). Generic exclusivity: a new AdminFormField
exclusive_group_field declares the rule, the plugin Validate enforces it
against host-supplied siblings (config only, no creds), and the admin UI
auto-clears conflicts as you toggle. Host stays plugin-agnostic. Forward-only;
no migration.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* docs: implementation plan for single-default exclusivity enforcement (Spec B)

Five TDD tasks across 3 repos: SDK proto (siblings + exclusive_group_field)
+ buf regen; arr Validate cross-sibling + manifest; host gathers siblings
(config-only) into Validate; frontend generic mutual-exclusion helper; then
re-vendor/rebuild/redeploy + plugininstall.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* feat(requests): pass sibling connections to plugin Validate for cross-connection rules

Adds siblings []ResolvedRouterConnection to RequestRouterProvider.Validate so
the plugin can enforce cross-connection invariants (e.g. one default per
service_kind) without the host resolving sibling credentials. The new
siblingConnections helper gathers other connections on the same installation,
carrying only ID + PluginConfig. Vendor updated to the Task 1 SDK version that
carries ValidateRequest.Siblings.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>

* feat(web): auto-clear mutually-exclusive defaults across request connection cards

Adds generic applyExclusivity helper and wires it into updateCardConfig so
turning on a field with exclusive_group_field proactively clears the same
field on sibling cards sharing the same group value, matching server-side
enforcement with a proactive UX.

* docs: design spec for single-flighting plugin client launch (cold-start herd fix)

Concurrent ensureClient calls for a cold installation each spawn a redundant
plugin process (Host.Start releases its lock during launch). Wrap ensureClient
in a per-installation singleflight.Group so concurrent first-use collapses to
one launch. Host-only fix; surfaced while testing the request-router feature.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* docs: implementation plan for single-flighting plugin client launch

TDD: concurrency tests (herd collapses to one launch, warm-cache reuse,
distinct installations stay parallel, failed launch propagates) + the
singleflight wrapper around ensureClient; then rebuild/redeploy + verify.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* fix(plugins): single-flight ensureClient to prevent cold-start launch herd

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>

* refactor(requests): harden capability containment + dedupe eligibility; UI/migration cleanups

Addresses /code-review high findings on the previously-unreviewed commits:
- resolveRouterConnections contains fulfillment to the first chosen
  (installation, capability) and locks only after a connection's key resolves,
  so a plugin exposing >1 request_router capability never mixes connections and
  a skipped bad-key connection never pins the capability (+ test).
- extract eligibleRouterConnection, shared by resolveRouterConnections and
  integrationConfigured so the auto-approval gate and fulfillment filter can't
  drift.
- SchemaForm: shared FieldDescription helper (field/switch/section); key switch
  groups by position so a show_when reveal doesn't remount the group (focus loss).
- migration backfill uses a deterministic correlated subquery instead of a join
  cross-product when an installation exposes multiple request_router capabilities.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* docs: design spec for opt-in Seerr per-user requester mapping

Per-connection requester_mode (admin default | mapped). In mapped mode the host
pushes the requester email/username into the Fulfill descriptor and the seerr
plugin resolves/creates the matching Seerr user by email with operator-chosen
default permissions, attributing the request (and gating Seerr-side approval via
the auto-approve permission). Spans SDK (descriptor fields), host (extend
UserIdentityLookup with email + a requester resolver), and the seerr plugin
(Seerr user API + mapping). Fallback to admin on any failure.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* docs: implementation plan for Seerr per-user requester mapping

Five TDD tasks across 3 repos: SDK descriptor fields (requester_email/username);
host resolves identity (UserIdentityLookup+email, RequesterIdentityResolver,
populate descriptor at both Fulfill sites); seerr config+user API (find/create
by email, exported PermissionBits); seerr Fulfill mapping + admin_form; then
re-vendor/rebuild/redeploy + plugininstall (installation 6).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* docs: make Seerr unmapped-requester behavior a toggle (admin fallback | fail request)

Per user feedback: require_mapped_user switch (default off = admin fallback,
on = fail the request). Updates spec + plan Tasks 3/4 (config field, Fulfill
honoring the toggle via a mapFailed signal, a new test, and the manifest switch).

* feat(requests): resolve requester email/username into the Fulfill descriptor

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>

* docs: design spec for simplified Seerr mapped-user permissions

Reduce the 5 permission toggles to two (request_4k_all + auto_approve);
1080p always granted; remove manage_requests; 4K eligibility per-user from the
request's qualities (host-decided, same as arr) with a blanket override toggle.
Seerr-plugin-only; permission-only override (host still gates 4K requests).

* docs: implementation plan for simplified Seerr mapped-user permissions

Two tasks (seerr-plugin-only): replace the 5 perm toggles with request_4k_all +
auto_approve (1080p always; 4K from request qualities via userPermissions;
remove PermManageRequests/PermissionBits; manifest + json_schema), then rebuild
+ reinstall (installation 6). No host/SDK change.

* docs: design spec for host rebase onto main + #95 credential-model adoption

Per-commit rebase of our 68 request-router commits onto the force-pushed
origin/main (drops 188 patch-equivalent). At the credential-path conflicts, adopt
#95's inline secret.Cipher model: keep our plugin columns + #95's encrypt/decrypt
in repository.go; drop our SecretResolver and read in.APIKeyRef directly in
service.go; wire NewRepository(pool, dataCipher). #39-area conflicts take ours
(our pluginization supersedes it). Security review + SECRET_KEY deploy note.

* docs: implementation plan for host rebase + #95 credential adoption

Four tasks: (1) guided per-commit rebase onto origin/main, take-ours on
credential files so it builds; (2) TDD integration commit adopting #95's
secret.Cipher (encrypt/decrypt in repository.go, drop SecretResolver, read
APIKeyRef directly, wire NewRepository(pool, cipher)); (3) security review;
(4) pin published SDK v0.6.0, push fork, open host PR with SECRET_KEY deploy note.

* chore(rebase): restore scan-source service methods + temp requests-repo arity

Post-rebase conflict fixups: take-ours on internal/plugins/service.go dropped
origin's ScanSourceClientByPluginID (independent upstream capability) — restored.
mediarequests.NewRepository temporarily 1-arg to match our pre-#95 repo; Task 2
restores the cipher arg when adopting #95's at-rest credential model.

* feat(requests): adopt at-rest credential cipher (#95) for plugin api keys; drop SecretResolver

* build: pin published silo-plugin-sdk v0.6.0 (drop local replace)

* test(requests): guard at-rest cipher round-trip + empty-key auto-approval (code-review)

Max-effort code review of the #95 credential integration. Fixes the actionable
findings:
- TestEncryptAPIKeyRoundTripAndAAD: pins encryptAPIKey<->DecryptIfEncrypted
  inversion, the id-bound apiKeyAAD == secret.RowAAD(...) match (so #95's backfill
  rows decrypt), the blank-key "" sentinel, and row-bound AAD — the security-
  critical invariants had no automated guard (no DB harness for scanIntegration).
- TestCreateRequestAutoApprovalEmptyKeyTreatedAsUnconfigured: pins that a keyless
  connection reads as unconfigured (request stays pending, never submitted), so
  integrationConfigured and resolveRouterConnections can't drift.
- Fix stale fulfillContext comment (referenced a resolved-API-key cache removed
  with SecretResolver).

Assessed-not-changed (documented): decrypt-error-fails-closed and failed-backfill
behaviors are origin/main #95 design we adopt; nil-cipher is unreachable in prod
and matches the codebase-wide no-guard pattern.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* build: drop stale machine-local SDK replace comment from go.mod

The replace directive was already removed when v0.6.0 was pinned (3410df7);
this leftover comment falsely claimed a local replace still existed.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* style(web): prettier-format schema-form utils to 100-col width

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* docs: drop internal superpowers specs/plans from PR

These design specs and implementation plans are internal development
artifacts; keep them out of the upstream PR diff.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* fix(metadata): exclude providers from content levels they don't declare

ResolveChain falls back to every enabled metadata provider when a library
+ content-level has no enabled chain entry. That fallback was media-type
blind: a provider declaring default_priority only for an unrelated level
(e.g. an audiobook provider declaring {"audiobook": N}) was kept in the
list (merely sorted last) and invoked for video content levels.

In production this made silo.audiobook-metadata hammer external audiobook
APIs with anime/movie/series titles every scheduled enrichment pass
(MatchWorker, 30s) for the season/episode levels that had no enabled chain
entry. Disabling the chain entries did not help because the fallback never
consults them; only disabling the installation removed it from the global
set.

Treat a non-empty default_priority map as the provider enumerating the
content levels it supports: in resolveEnabledProvidersByPriority, exclude
providers whose declared map omits the requested level instead of ranking
them last. Providers that declare no default_priority make no claim and
stay eligible everywhere (legacy behavior).

Fixes #105

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* fix(plugins): isolate singleflight launch from leader ctx cancellation

The deduped ensureClient launch ran doEnsureClient under the leader caller's
ctx, so if that caller's request was canceled/timed out mid-launch the shared
plugin start was torn down and the error propagated to every waiter. Run the
launch under context.WithoutCancel so a single caller cannot cancel work the
other waiters depend on (values preserved for tracing/auth). (CodeRabbit)

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* fix(api): nil-guard request-router wiring

RequestRouterClient dereferenced a.Svc unconditionally and AttachRequestRouter
called SetRouterProvider even with nil deps, so a build without the plugin
service would panic instead of degrading. Guard both: the adapter returns a
controlled error and AttachRequestRouter no-ops, leaving fulfillment to fail
with the existing "no backend configured" path. (CodeRabbit)

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* fix(web): correct value coercion + track capability sub-id in request form

- schemaForm: Boolean("false") was true; parse string booleans explicitly.
  array:num now coerces decimals ("1.5"), array:int stays integer-only.
- AdminRequests: track capability_id alongside installation_id (composite
  <Select> value) so a multi-capability installation resolves the exact
  backend; reset pluginConfig when the selected plugin changes so plugin A's
  keys never reach plugin B's options probe/save. (CodeRabbit)

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* fix(requests): address request-router review findings

* fix(requests): handle router review edge cases

* fix(web): resolve schema form build casing

* fix(requests): skip unconfigured 4k fulfillment targets

---------

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Co-authored-by: Quick <[email protected]>
Quick104 added a commit that referenced this pull request Jun 17, 2026
#104)

* docs: design spec for pluginizing requests fulfillment

Pluginize the requests fulfillment backend behind an agnostic
request_router.v1 capability (high seam: whole-request fulfiller).
Host keeps lifecycle/quota/policy/quality-governance and a generic
two-tier connection registry; plugins own routing+submission+status.
First plugin extracts multi-instance Sonarr/Radarr; Seerr follows in
a separate spec. Preserves autoscan reuse of arr connection rows.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* docs: implementation plan for requests pluginization

Three-phase plan: (1) request_router.v1 SDK capability, (2) new
silo-plugin-requests-arr plugin extracting multi-instance Sonarr/Radarr,
(3) host refactor routing fulfillment through the plugin while keeping
quality governance, target records, and autoscan connection reuse host-side.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* feat(db): generalize request_integrations into a two-tier connection registry

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* feat(requests): add generic connection fields to Integration + repo mapping

* feat(pluginhost): typed RequestRouter capability client + resolver

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* feat(requests): plugin-backed RequestRouterProvider seam

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* feat(requests): route fulfillment through RequestRouterProvider; host keeps quality governance

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* fix(requests): base auto-approve gate on router connection model

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* feat(api): wire plugin-backed request router at both service sites

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* refactor(requests): remove in-host Sonarr/Radarr fulfillment code

* test(autoscan): lock request-integration reuse after connection generalization

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* feat(web): plugin-driven request integration config form

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* feat(api): echo router connection fields in integration response

* fix(requests): retry dropped qualities, contain to one router installation, dedupe targets

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* fix(requests): harden plugin trust boundary (validate targets, contain bad connections, media-type routing)

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* fix(requests): tighten auto-approve gate, restore default/4k validation, propagate config-encode error, drop itoa wrapper, test status/options translation

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* perf(requests): resolve integrations/settings/secrets once per reconcile cycle

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* fix(web): dedupe config helpers, preserve zero profile id, stabilize installation default, drop redundant options write

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* docs: design spec for schema-driven plugin config form

Extends AdminFormDescriptor into a full form-description language (dynamic
options, multi-select, conditional visibility, sections, validation) + a
plugin Validate RPC, rendered by one reusable SchemaForm engine. Retires the
bespoke arr connection form and integrationOptionsFromRouter so any
request_router backend renders its config UI from manifest data with zero
host changes. Addresses code-review finding #9.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* docs: implementation plan for schema-driven plugin config form

Six phases: SDK AdminFormDescriptor extensions + Validate RPC; reusable
SchemaForm renderer (refactor PluginConfigForm onto it); host Validate
plumbing + generic options + legacy-column derivation + retire
integrationOptionsFromRouter; requests admin page swap to SchemaForm with
per-plugin grouping; arr manifest enrichment + Validate impl; verification.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* feat(web): extend plugin admin-form TS types (sections, conditions, validation, multi-select)

* feat(web): schema-form pure utils (show_when, validation, value coercion)

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* feat(web): SchemaForm renderer (controls, sections, show_when, dynamic options, errors)

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* refactor(web): render PluginConfigForm via the shared SchemaForm engine

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* feat(requests): RequestRouter Validate client + provider seam

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* feat(requests): plugin Validate on save, generic options, derive legacy columns from plugin_config

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* feat(api): generic options response + 400 field_errors on plugin validation failure

* feat(web): generic request-integration options type + surface validation field_errors

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* feat(web): render request connections via SchemaForm; per-plugin grouping; retire bespoke arr form

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* fix(web): silent connection-options probe with inline failure status (no toast spam)

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* fix(api): serialize admin_form sections/show_when/dynamic_options/validation to the client

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* fix(web): drop show_when-hidden fields from buildSchemaValues payload

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* feat(requests): pass requester user id as int64 (no truncation)

* refactor(requests): drop legacy arr columns; plugin_config is sole source of truth

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* fix(requests): backfill api key in plugin validate; centralize validation 400; drop duplicate host cross-field check; guard admin-form serializer

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* fix(requests): refuse stored api key reuse when base_url changes (security hardening)

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* feat(web): SchemaForm regex-guard, default_value, type-driven coercion, validity callback

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* fix(web): connection-options latest-wins + narrowed deps + clear stale errors; auto-select; type-driven persist; reuse types

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* docs: design spec for silo-plugin-requests-seerr (request_router.v1 backend)

* docs: implementation plan for silo-plugin-requests-seerr

* docs(spec): FindExistingRequest uses /api/v1/request (carries request id)

* docs(spec): seerr hardening — id-recovery, 404 terminal, media-status, sort pin, single missing-tmdb message

* docs: design spec for shared plugin-platform SDK helpers (code-review #10)

* docs: plan for plugin-platform SDK helpers (#10) + spec fix (inline broker wiring, no import cycle)

* docs: design spec for typed 4K quality-tier signal (code-review #9)

* docs: implementation plan for typed 4K quality-tier signal (#9)

* feat(requests): stamp is4k per quality (host owns the 4K-tier fact)

* fix(requests): store capability sub-id, not the type, in request_integrations

request_integrations.capability_id carried the capability TYPE
("request_router.v1") instead of the capability sub-id ("arr"/"seerr").
The host resolves a router plugin via
requireCapability("request_router.v1", id), which keys on (type, id), so
storing the type resolved to no capability: every save/options/fulfill
500'd ("Request operation failed" / "no fulfillment backend configured")
in ~1ms, before the arr/Seerr API was ever contacted. The path was
internally split-brained (the fulfillment filter matched the type while
the dispatcher needed the sub-id), so it never worked end-to-end; the
unit tests hid it behind a fake provider that skips requireCapability.

Align capability_id with the scan_source/metadata convention (sub-id):
- validateInstance: require a non-empty sub-id; drop the default-to-type
  and the "!= request_router.v1" reject.
- resolveRouterConnections / integrationConfigured / unbound-guidance:
  match on a non-empty capability, not type equality.
- repository: persist capability_id verbatim (never default to the type).
- web AdminRequests: send the selected plugin's capability.id in both the
  options probe and the save payload (was a hardcoded type constant).
- migration 20260608131649: backfill capability_id from each bound
  installation's request_router.v1 capability and drop the column's
  misleading default. Unbound legacy rows are left for admin re-save.

Tests: validateInstance now requires the sub-id, and the selected sub-id
must reach the plugin Validate RPC (fakeRouterProvider records it).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* feat(web): polish request connection cards (grouped toggles + option loading states)

The schema-driven connection cards rendered each boolean as its own
bordered, double-labeled box and showed dynamic SELECTs (root folder,
quality profile, tags) as empty controls with a single "Loading options…"
line while the host probed the service.

- Toggles render as a cohesive settings list: consecutive switches collapse
  into one bordered, divided container; each row is toggle-first with the
  label + description hugging beside it (no stranded whitespace between a
  short label and its switch). Honors show_when, so conditional toggles
  still group correctly.
- Dynamic SELECT/MULTI_SELECT fields show a per-field spinner + shimmer
  skeleton while options load, and only when there's nothing to show yet —
  a background re-probe never flashes over the operator's current value.
- Sections get a softer surface and clearer titles; the card's enable
  switch is labeled Enabled/Disabled; the options-load failure is a proper
  inline alert with retry guidance.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* fix(requests): treat "Any"/no-cap playback ceiling as 4K-allowed

allowedQualities decided whether to also request 2160p with
`CompareQuality(ceiling, PlaybackQuality4K) >= 0`. But an "Any" max
playback quality resolves to an empty ceiling ("no cap"), and in
qualityRank "" is the LOWEST rank (0) — so CompareQuality("", "2160p")
returns -1 and 4K was dropped. A requester with unlimited playback quality
only got a 1080p request, never the 4K one.

Use access.QualityAllowed(PlaybackQuality4K, ceiling), which already
encodes "empty ceiling == no cap == allows everything". Now:
- "" / "Any"  -> 1080p + 2160p
- "2160p"     -> 1080p + 2160p
- "1080p"     -> 1080p only
- resolver error still fails safe to the HD ceiling.

Tests: add an "any/no-cap ceiling adds 2160p" case; the unknown-quality,
status-coercion, dedup, and per-quality-idempotency submit tests now pin
an explicit HD ceiling (they relied on the old empty-default == HD-only
behavior and were not about 4K entitlement).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* docs: design spec for collapsible Library + anime gate/nesting (request card UI, Spec A)

Spec A of two for the request connection card UX: Library section becomes
collapsible/collapsed (auto-expanding on validation errors) and the anime
override fields move into a single gated section below Library instead of
popping out as a detached sibling card. Single-default enforcement is Spec B.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* docs: implementation plan for collapsible Library + anime gate/nesting (Spec A)

Task-by-task TDD plan: SchemaForm auto-expand-on-error + nested-field
affordance (silo-server), arr manifest regroup (collapsible Library, anime
gate section), then build/deploy/reinstall + manual verify.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* feat(web): auto-expand collapsible schema sections that have validation errors

SchemaFormSection now accepts a forceOpen prop; when any field in the section
has a mergedError (client validation or server error), the section expands
automatically so required-field setup can never be hidden behind a collapsed
accordion. The operator's manual toggle is preserved via a nullable userOpen
state that only takes effect when forceOpen is false.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* feat(web): indent show_when-revealed schema fields to read as nested

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>

* docs: design spec for schema-driven single-default exclusivity enforcement (Spec B)

At most one connection per service_kind may be the HD default (is_default) or
4K default (is_default_4k). Generic exclusivity: a new AdminFormField
exclusive_group_field declares the rule, the plugin Validate enforces it
against host-supplied siblings (config only, no creds), and the admin UI
auto-clears conflicts as you toggle. Host stays plugin-agnostic. Forward-only;
no migration.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* docs: implementation plan for single-default exclusivity enforcement (Spec B)

Five TDD tasks across 3 repos: SDK proto (siblings + exclusive_group_field)
+ buf regen; arr Validate cross-sibling + manifest; host gathers siblings
(config-only) into Validate; frontend generic mutual-exclusion helper; then
re-vendor/rebuild/redeploy + plugininstall.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* feat(requests): pass sibling connections to plugin Validate for cross-connection rules

Adds siblings []ResolvedRouterConnection to RequestRouterProvider.Validate so
the plugin can enforce cross-connection invariants (e.g. one default per
service_kind) without the host resolving sibling credentials. The new
siblingConnections helper gathers other connections on the same installation,
carrying only ID + PluginConfig. Vendor updated to the Task 1 SDK version that
carries ValidateRequest.Siblings.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>

* feat(web): auto-clear mutually-exclusive defaults across request connection cards

Adds generic applyExclusivity helper and wires it into updateCardConfig so
turning on a field with exclusive_group_field proactively clears the same
field on sibling cards sharing the same group value, matching server-side
enforcement with a proactive UX.

* docs: design spec for single-flighting plugin client launch (cold-start herd fix)

Concurrent ensureClient calls for a cold installation each spawn a redundant
plugin process (Host.Start releases its lock during launch). Wrap ensureClient
in a per-installation singleflight.Group so concurrent first-use collapses to
one launch. Host-only fix; surfaced while testing the request-router feature.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* docs: implementation plan for single-flighting plugin client launch

TDD: concurrency tests (herd collapses to one launch, warm-cache reuse,
distinct installations stay parallel, failed launch propagates) + the
singleflight wrapper around ensureClient; then rebuild/redeploy + verify.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* fix(plugins): single-flight ensureClient to prevent cold-start launch herd

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>

* refactor(requests): harden capability containment + dedupe eligibility; UI/migration cleanups

Addresses /code-review high findings on the previously-unreviewed commits:
- resolveRouterConnections contains fulfillment to the first chosen
  (installation, capability) and locks only after a connection's key resolves,
  so a plugin exposing >1 request_router capability never mixes connections and
  a skipped bad-key connection never pins the capability (+ test).
- extract eligibleRouterConnection, shared by resolveRouterConnections and
  integrationConfigured so the auto-approval gate and fulfillment filter can't
  drift.
- SchemaForm: shared FieldDescription helper (field/switch/section); key switch
  groups by position so a show_when reveal doesn't remount the group (focus loss).
- migration backfill uses a deterministic correlated subquery instead of a join
  cross-product when an installation exposes multiple request_router capabilities.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* docs: design spec for opt-in Seerr per-user requester mapping

Per-connection requester_mode (admin default | mapped). In mapped mode the host
pushes the requester email/username into the Fulfill descriptor and the seerr
plugin resolves/creates the matching Seerr user by email with operator-chosen
default permissions, attributing the request (and gating Seerr-side approval via
the auto-approve permission). Spans SDK (descriptor fields), host (extend
UserIdentityLookup with email + a requester resolver), and the seerr plugin
(Seerr user API + mapping). Fallback to admin on any failure.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* docs: implementation plan for Seerr per-user requester mapping

Five TDD tasks across 3 repos: SDK descriptor fields (requester_email/username);
host resolves identity (UserIdentityLookup+email, RequesterIdentityResolver,
populate descriptor at both Fulfill sites); seerr config+user API (find/create
by email, exported PermissionBits); seerr Fulfill mapping + admin_form; then
re-vendor/rebuild/redeploy + plugininstall (installation 6).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* docs: make Seerr unmapped-requester behavior a toggle (admin fallback | fail request)

Per user feedback: require_mapped_user switch (default off = admin fallback,
on = fail the request). Updates spec + plan Tasks 3/4 (config field, Fulfill
honoring the toggle via a mapFailed signal, a new test, and the manifest switch).

* feat(requests): resolve requester email/username into the Fulfill descriptor

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>

* docs: design spec for simplified Seerr mapped-user permissions

Reduce the 5 permission toggles to two (request_4k_all + auto_approve);
1080p always granted; remove manage_requests; 4K eligibility per-user from the
request's qualities (host-decided, same as arr) with a blanket override toggle.
Seerr-plugin-only; permission-only override (host still gates 4K requests).

* docs: implementation plan for simplified Seerr mapped-user permissions

Two tasks (seerr-plugin-only): replace the 5 perm toggles with request_4k_all +
auto_approve (1080p always; 4K from request qualities via userPermissions;
remove PermManageRequests/PermissionBits; manifest + json_schema), then rebuild
+ reinstall (installation 6). No host/SDK change.

* docs: design spec for host rebase onto main + #95 credential-model adoption

Per-commit rebase of our 68 request-router commits onto the force-pushed
origin/main (drops 188 patch-equivalent). At the credential-path conflicts, adopt
#95's inline secret.Cipher model: keep our plugin columns + #95's encrypt/decrypt
in repository.go; drop our SecretResolver and read in.APIKeyRef directly in
service.go; wire NewRepository(pool, dataCipher). #39-area conflicts take ours
(our pluginization supersedes it). Security review + SECRET_KEY deploy note.

* docs: implementation plan for host rebase + #95 credential adoption

Four tasks: (1) guided per-commit rebase onto origin/main, take-ours on
credential files so it builds; (2) TDD integration commit adopting #95's
secret.Cipher (encrypt/decrypt in repository.go, drop SecretResolver, read
APIKeyRef directly, wire NewRepository(pool, cipher)); (3) security review;
(4) pin published SDK v0.6.0, push fork, open host PR with SECRET_KEY deploy note.

* chore(rebase): restore scan-source service methods + temp requests-repo arity

Post-rebase conflict fixups: take-ours on internal/plugins/service.go dropped
origin's ScanSourceClientByPluginID (independent upstream capability) — restored.
mediarequests.NewRepository temporarily 1-arg to match our pre-#95 repo; Task 2
restores the cipher arg when adopting #95's at-rest credential model.

* feat(requests): adopt at-rest credential cipher (#95) for plugin api keys; drop SecretResolver

* build: pin published silo-plugin-sdk v0.6.0 (drop local replace)

* test(requests): guard at-rest cipher round-trip + empty-key auto-approval (code-review)

Max-effort code review of the #95 credential integration. Fixes the actionable
findings:
- TestEncryptAPIKeyRoundTripAndAAD: pins encryptAPIKey<->DecryptIfEncrypted
  inversion, the id-bound apiKeyAAD == secret.RowAAD(...) match (so #95's backfill
  rows decrypt), the blank-key "" sentinel, and row-bound AAD — the security-
  critical invariants had no automated guard (no DB harness for scanIntegration).
- TestCreateRequestAutoApprovalEmptyKeyTreatedAsUnconfigured: pins that a keyless
  connection reads as unconfigured (request stays pending, never submitted), so
  integrationConfigured and resolveRouterConnections can't drift.
- Fix stale fulfillContext comment (referenced a resolved-API-key cache removed
  with SecretResolver).

Assessed-not-changed (documented): decrypt-error-fails-closed and failed-backfill
behaviors are origin/main #95 design we adopt; nil-cipher is unreachable in prod
and matches the codebase-wide no-guard pattern.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* build: drop stale machine-local SDK replace comment from go.mod

The replace directive was already removed when v0.6.0 was pinned (3410df7);
this leftover comment falsely claimed a local replace still existed.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* style(web): prettier-format schema-form utils to 100-col width

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* docs: drop internal superpowers specs/plans from PR

These design specs and implementation plans are internal development
artifacts; keep them out of the upstream PR diff.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* fix(metadata): exclude providers from content levels they don't declare

ResolveChain falls back to every enabled metadata provider when a library
+ content-level has no enabled chain entry. That fallback was media-type
blind: a provider declaring default_priority only for an unrelated level
(e.g. an audiobook provider declaring {"audiobook": N}) was kept in the
list (merely sorted last) and invoked for video content levels.

In production this made silo.audiobook-metadata hammer external audiobook
APIs with anime/movie/series titles every scheduled enrichment pass
(MatchWorker, 30s) for the season/episode levels that had no enabled chain
entry. Disabling the chain entries did not help because the fallback never
consults them; only disabling the installation removed it from the global
set.

Treat a non-empty default_priority map as the provider enumerating the
content levels it supports: in resolveEnabledProvidersByPriority, exclude
providers whose declared map omits the requested level instead of ranking
them last. Providers that declare no default_priority make no claim and
stay eligible everywhere (legacy behavior).

Fixes #105

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* fix(plugins): isolate singleflight launch from leader ctx cancellation

The deduped ensureClient launch ran doEnsureClient under the leader caller's
ctx, so if that caller's request was canceled/timed out mid-launch the shared
plugin start was torn down and the error propagated to every waiter. Run the
launch under context.WithoutCancel so a single caller cannot cancel work the
other waiters depend on (values preserved for tracing/auth). (CodeRabbit)

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* fix(api): nil-guard request-router wiring

RequestRouterClient dereferenced a.Svc unconditionally and AttachRequestRouter
called SetRouterProvider even with nil deps, so a build without the plugin
service would panic instead of degrading. Guard both: the adapter returns a
controlled error and AttachRequestRouter no-ops, leaving fulfillment to fail
with the existing "no backend configured" path. (CodeRabbit)

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* fix(web): correct value coercion + track capability sub-id in request form

- schemaForm: Boolean("false") was true; parse string booleans explicitly.
  array:num now coerces decimals ("1.5"), array:int stays integer-only.
- AdminRequests: track capability_id alongside installation_id (composite
  <Select> value) so a multi-capability installation resolves the exact
  backend; reset pluginConfig when the selected plugin changes so plugin A's
  keys never reach plugin B's options probe/save. (CodeRabbit)

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* fix(requests): address request-router review findings

* fix(requests): handle router review edge cases

* fix(web): resolve schema form build casing

* fix(requests): skip unconfigured 4k fulfillment targets

---------

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Co-authored-by: Quick <[email protected]>
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