Repository navigation
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
acdcad0 to
e1df1ea
Compare
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Capture the original recipe before dispatch and restore it only under exact live route ownership after acknowledged cleanup. Preserve expiry and revocation state, fence delayed Redis commands, and keep recovery from proven undispatched starts.
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
|
@coderabbitai full review |
|
|
The CodeRabbit title and description warnings use the old The implementation title is accurate for this head. A full CodeRabbit review was requested but could not run because 359 files exceed its 150-file limit. The PR records the independent source reviews and passing CI; the stale documentation-only warning is not a reason to retitle the implementation as evidence work. |
Problem
Transcode nodes currently need library mounts and shared infrastructure credentials. This adds standalone workers that read admitted media over HTTP/HTTPS and decode, filter and encode locally, using local scratch and optional GPU devices.
Related issue: #1176
Validation tasks: changes #1177 C1–C3; changes #1178 C2
The server validation results and web Activity results record passed cases in comments, although their issue-body tables still say not run. This PR changes those paths; it does not replace the validators’ results.
Approach
The core owns catalog access, current permissions, recipes, source identity and durable work generations. Workers enroll with a single-use ticket and a separate Ed25519 identity. They receive scoped source descriptors and short signed control snapshots, without PostgreSQL, Redis, object-storage credentials, customer signing secrets or original customer JWTs. Remote links verify HTTPS certificates and hostnames; local HTTP requires explicit enrollment permission.
Each source stays bound to the API process that admitted it. Core-only owner routing preserves the full local file-identity pin across replicas; owner loss returns retryable 503 while the original grant is unexpired, without deleting it or reinterpreting it on another host. Multi-replica setups need a direct origin for each source-serving process in
SILO_WORKER_SOURCE_URL. Cross-owner failover remains unsupported without backend-stable version identities.Workers refresh the unchanged two-second authority lease every 500 ms from request send, with a shared runtime-owned request, bounded attempt and one transient retry. Newly admitted work/viewers require a snapshot covering their exact scope. Core and worker source-reader limits are configurable, with bounded 503 admission when full. Production execution and viewer checks share request-local SQL batches, retaining independent credential and profile checks.
An admitted HTTP adapter supplies Range/ETag-pinned input to FFmpeg and the native Matroska index reader, including shared thumbnail keyframes. A normal transfer uses one upstream response. Interrupted transfers retry only the undelivered range, with four total attempts under the original context and signed authority. Temporary backend errors retain recoverable state; definitive source loss still retires it. Existing playback, seek, copy/remux, subtitles/fonts, themes, samples, chapters, trickplay and prepared downloads use the existing runtime. Native, Apple, Android and Jellyfin clients retain their routes and response contracts.
Output grants preserve the originating login or API key through reconstruction and replans. Workers check each viewer on cached requests and open responses. Tokenless core relays obtain private viewer grants, so client URLs remain unchanged. Revoking one login leaves another login and shared prepared bytes available. The bounded core registry reclaims stopped or definitively revoked records and retains valid records during temporary authority errors so access can recover after checks succeed.
Playback replacements retain one server-owned capacity identity while each transport keeps its separate work ID, generation, source and stop fences. The core signs that identity into execute assignments and output grants; reconstruction preserves it. Native replans hold the existing shared session lock through preparation and commit, allowing one replacement candidate to share the retained session slot. A failed replacement keeps the previous working stream. Unrelated sessions and background operations still consume separate slots.
At a finite job limit, capability readers wait without reserving compute slots. A full worker can reuse its last complete report only when FFmpeg identity and hardware configuration still match. Spare capacity retains normal probing; accepted reprobes invalidate the fallback until success. Independent encoder jobs and cold probes remain capped. Worker reports use shared Redis membership, full telemetry snapshots and lease-fenced publication across API replicas. Log sanitization matches credentials and locations against the same original text, then removes their combined ranges.
Core and proxy processes classify node origins from complete database snapshots valid for two seconds. Database triggers serialize enrollment and protocol changes, then drain earlier snapshots before commit. Warm legacy requests perform no classification SQL. Append-only origin history prevents edited or deleted standalone nodes from receiving legacy requests after a restart; refresh failures deny fallback.
Prepared-download grant reuse reads one matching indexed record rather than the node registry. Refreshes batch exact originating credentials, reuse one assignment snapshot and memoize content checks within the request. Unknown permission checks fail the refresh without extending authority or deleting recoverable records. Overlapping reports use the committed playback transport; ambiguous sessions cannot suppress unrelated telemetry.
Jellyfin-compatible playback serializes remote starts and recipe publication by canonical work across API replicas. Publication receipts bind exact candidate versions and bytes; delayed retries cannot recreate rejected candidates. Lost database commit replies require a fresh locked read before compensation. Unknown outcomes retain work, and proven database acceptance survives failed Redis acknowledgement.
Native executor moves update the durable report route under the same session lock as replans. Lost write acknowledgements require a fresh locked read; pending local runtimes cannot serve bytes until their original attempt and plan are confirmed. Enrolled HTTP workers refuse same-transport moves before dispatch and use the existing failure-recovery replan to mint a fresh transport. A proven dial failure before any connection skips remote cleanup, allowing a healthy-worker replan; connected or uncertain starts retain owned cleanup. After failed starts or rejected route updates, legacy-node cleanup restores a stored recipe only after acknowledged deletion and fresh confirmation of its exact live predecessor. The captured restoration ticket preserves revocation state and original expiry; uncertain writes either confirm retirement or retain ownership through their fixed admission deadline.
Memory-backed compatibility sessions use per-session mutation gates across recipe publication and compensation, keeping Redis I/O outside the shared map mutex. Old pre-receipt recipes can recover only from an exact, locked authoritative compatibility row: the old unknown version is retired and replaced by a fresh committed baseline without extending its expiry. Worker report registrations identify the exact producer instance before asynchronous reporting, so delayed updates and cleanup cannot overwrite a successor or restore a stopped observation.
Migration rollback keeps worker authentication reads available while classification snapshots drain, then uses bounded lock-promotion retries for schema removal.
The internal protocol, route inventory and migration ledger declare the new surfaces. User-manual follow-up: Silo-Server/siloserver.org#200, waiting for this PR to merge.
Validation
Reliability source
dbcd948e0includesmainatfada4210d. The five acknowledged reliability concerns now have implementation changes and regression controls; the human review threads remain available for maintainer re-review.d40cd0b48passed all 149 query-budget pins and 322 mandatory database contracts, without skips. The final request-context and generation corrections are covered by the final race checks above.d40cd0b48passed 196 packages. Two tests failed:TestRunStatsWithRealFFmpegreports the 11.003-second frame, andTestProvider_DirectoryListingFollowsChangesreports a stale listing. Both failures reproduce on exact untouched mainfada4210d. The full local suite is not green.Hosted CI on
dbcd948e0passes, including Go lint, unit/integration tests, both database jobs, repository checks, web checks/build and all four web test shards. Kody’s automatic review also completed without new inline findings on this head. CodeRabbit’s summary covers an older documentation-only range. Its full review could not run because the PR has 359 changed files, above its 150-file limit. No CodeRabbit review is claimed for this code head; the completed independent review described below is from local collaborating agents.The production budgets exercise
initializeHTTPWorkersand the signed HTTP snapshot handler with real PostgreSQL and Redis, without a stubbed execution callback. Request-tagged counters measure 12 SQL statements for distinct movie works plus viewers at each of 1/32/128, and 14 statements for 128 prepared artifacts. These query counts do not establish a latency guarantee. Both budgets also passed with no Redis URL supplied, starting real isolated Redis as required by the current trusted CI workflow.Independent agents reviewed source ownership, renewal/recovery, refresh continuity, capacity, production permission batching and their integration. Failing-before controls exposed unavailable-owner recovery being treated as expiry, source revisions that could be reproduced on another owner, and shared snapshots predating new admissions. The fixes preserve typed unknown authority, bind revisions to owner incarnation and require fresh scope coverage. Final integration review also verified the current-main composition and Redis fixture bootstrap. Human verification of this corrective diff is pending.
Historical checks on
580a22dacincluded all 141 then-selected HTTP-worker contracts and ten worker-related package race suites. Its hosted CI run passed. Historical GPU and timing results below remain pinned to their recorded sources.Earlier source verification:
Go formatting, build and vet passed. The final changed-line lint run against included main
846ba62areported zero issues. The two affected race cases also passed after their test-only lint simplifications.All 141 mandatory HTTP-worker contracts passed with PostgreSQL 18, Redis 8.2 and the race detector, without skips. The runner rejects missing or skipped named cases. The 24 new recipe cases cover both cleanup paths, tokenless retry, stopped or superseded authority, acknowledged deletion, delayed Redis commands, expiry/revocation, dispatch evidence and healthy-node fallback. The four admitted HTTP thumbnail cases are also mandatory.
All 141 query-budget pins passed. All 215 mandatory database contracts passed on an isolated PostgreSQL/Redis fixture, without skips.
Generated settings, playback fixtures, route inventory, migration/scenario ledgers, offline routes, OpenAPI, API fixtures, web types and path/case checks passed. Generated OpenAPI matches the committed schema; native client contracts are unchanged.
The full local Go run passed 192 packages; 18 had no test files and two packages failed.
TestRunStatsWithRealFFmpegrepeated the out-of-window frame reproduced on exact unmodified main8f285837.TestProvider_DirectoryListingFollowsChangesrepeated the directory-cache failure reproduced 20/20 on untouched main sources. There were no additional failing tests. These baseline controls do not make the full local Go run green.Frontend frozen install, lint, formatting, production build and bundle budget passed. The complete local run had one PGS parser timeout, independently reproduced on exact unmodified main
846ba62awith the same Node version and dependency set. A second full run ended with an unexplained test-worker exit and no complete totals; its two late UI failures did not reproduce in a focused exact-main run (22 tests passed). The frontend tree is byte-identical to that main commit. These controls do not make the full local web run green.Earlier GitHub CI run 38653917687 and Kody passed on
1a8777b04, including the full Go suite, integration, database checks and all four web test shards. The earlier CI run 38660226617 passed onec513c7b1: Go lint, the full Go suite, integration, database pins and external-auth checks, repository checks, web checks/build and all four web test shards. Kody’s latest review completed. Its failed-Commit finding was answered with independent Astra verification: actual Redis/TCP race controls passed on the unchanged runtime after STOP and delayed retries; removing only the published-state no-op guard reproduced resurrection. The thread is resolved.Earlier live Flex 140 regression, pinned to
b993b3300, at worker limits 1/2 over HTTP and verified HTTPS: 243 checks passed, with 8 complete outputs, 44 TS segments and 2,640 decoded video frames. Each case retained a session past the capability TTL, sought with a distinct transport ID, then stopped and refused revoked source/output access. Segment, decoded audio/video and packet hashes matched across cases. Limit one also refused an independent job; limit two retained one session with a spare slot. Task cleanup and the final protected-host guard passed.The SQL fix passed 28 focused top-level race tests with real PostgreSQL, including both HTTP transports, cross-replica enrollment, retired origins after restart, cancellation, savepoint rollback and migration up/down. Astra independently checked the database fence and snapshot deadlines. Deliberately bypassing expiry or origin history caused the HTTP security regressions to fail; three additional concurrency/savepoint tests were retained. The startup, malformed-origin and rollback-lock corrections in
849e06calso passed independent Astra review.Astra independently reproduced the native seek capacity failure, capability-limit failures, stale publisher writes, cached login bypass, tokenless native relay bypass, origin-alias failures and renewal boundary, then verified their corrections. Its review also checked registry bounds, concurrent cleanup, cancellation, source identity, sibling-login isolation and long-response recovery. Historical timing samples remain unchanged.
The previous source included
mainat846ba62a. Its local-file thumbnail correction also works through the admitted HTTP reader, including shifted timelines, cancellation and source retirement; independent Astra review verified complete JPEG and frame parity. The current reliability source includesmainatfada4210d; the older measurements retain their original source revisions.Evidence
SQL classification results for
e76e5063ef284abb19d569f8efc0fa6185fb98ef, checked against the unchanged25df1944implementation:The new query budgets and security cases are mandatory database checks. This measures query counts, without adding a new latency or GPU-throughput claim.
For
849e06c, a 128-viewer refresh fixture measured 1,152→9 SQL statements using the production token verifier and HTTP snapshot handler, with anExecutionActivestub returning true. Production adds per-work execution checks, and distinct users/content add work. This measures the viewer-validation portion, not full production refresh latency. Real Redis controls also reject registry-scan commands during targeted prepared-grant lookup and check bounded index maintenance with old writers.The
fa6c69asource recovery tests use actual FFmpeg with no reconnect flags and the original two-second signed authority lease. Baseline, injected 503 and short-body cases each decode 120 frames and produce identical 9,813-byte framemd5 output; upstream request counts are 3/4/4. Independent Astra race runs passed 315 tests/subtests without skips. Additional HTTP controls verify response-body deadlines, connection resets, truncation and cancellation recover, while completed malformed or invalid signed replies remain definitive. These are CPU correctness checks, without a new GPU, WAN, sustained-capacity or latency claim.Captured CLI help and the worker HTTP response after signed stop, from tested source
b993b3300:{ "source_commit": "b993b3300f528eb38cc64989d04b2f8fc8f4949a", "binary_sha256": "bd1ebe34e5b9002ff0b5ca880ac880ace5a409655a37cfc8aaf5885a7c7bb57a", "health_after_signed_stop": { "status": "ok", "active_jobs": 0, "worker_protocol": "http_only_v1" }, "cli_help": { "worker": { "exit": 0, "flags": [ "-binding string", "-ffmpeg string", "-ffprobe string", "-hw-accel string", "-hw-device string", "-listen string", "-max-jobs int", "-scratch string" ] }, "worker-enroll": { "exit": 0, "flags": [ "-binding string", "-ticket string" ] }, "worker-enrollment": { "exit": 0, "flags": [ "-allow-http", "-core-url string", "-env string", "-node-id int", "-out string" ] } }, "finite_capacity_results": { "checks_passed": 243, "cases_passed": 4, "complete_outputs": 8, "segments": 44, "decoded_video_frames": 2640, "transports": [ "HTTP", "verified HTTPS" ], "worker_limits": [ 1, 2 ], "cleanup": true } }The runtime report and runtime JSON capture the new worker/enrollment CLI, health responses, isolation checks and GPU outputs. The integration report pins corrected source
e1748f5ed, which passed HTTP 66/66 and verified HTTPS 68/68 checks, including complete startup/reconstruction outputs, seek, stop and cleanup. These are earlier source-pinned results.The finite-capacity report and JSON pin tested code
b993b3300, include both earlier failed attempts and record the corrected 243/243 functional checks. The fixture stores plannermax_jobs=NULLand uses actual finite worker CLI limits. These cases add no latency comparison.The transport measurements retain 30 paired synthetic runs per operation/mode: median startup overhead was 5.82 ms for HTTP and 12.33 ms for verified HTTPS; seek overhead was 9.98 ms and 15.55 ms. Producer rates were 98.69% and 96.71% of local-file throughput. These measure direct FFmpeg source transport on a LAN.
The separate full-runtime pilot pins source
37af64c48and all 40 observations. Five paired rounds per action/protocol measured median startup 768→1069 ms for HTTP and 788→1075 ms for HTTPS; seek 507→861 ms and 395→812 ms. Median paired increases were 304.7/292.0 ms for startup and 366.5/409.1 ms for seek. The pilot used warmed capabilities, uncontrolled source caches and gateways that closed both connections after ordinary responses. It establishes complete matching output, without establishing production pooled-connection, p95 or sustained-capacity parity.The run reports are no longer committed under
docs/architecture/; the links above point at the commits that carried them, and the architecture doc keeps a short measured-cost section.Client playback routes retain their existing interfaces; these fixes add no UI or client configuration surface. Runtime CLI/HTTP captures are in the linked reports. The tested
worker --helpondbcd948e0also reports the new source limits:Risks
This introduces a database migration and a separate worker enrollment lifecycle. Short authority leases stop work when the core cannot renew permission. Operators need local scratch, adequate source/network capacity and verified HTTPS termination for remote workers. Existing standalone tokens without originating-credential binding are refused; legacy transports retain their existing token behavior.
Classification-changing configuration transactions take a three-second drain, once per transaction, plus ordinary lock waits. New legacy admissions can wait or fail closed during that transition; already admitted response bodies can finish. Health updates and unchanged writes do not drain. Retired worker origins remain reserved and cannot later become legacy nodes.
Source ownership is process-specific. An unavailable or restarted owner withholds bytes; there is no automatic cross-owner recovery. The 500 ms refresh attempt deadline trades tolerance of slow control responses for retry room within the two-second lease, and healthy workers request two snapshots per second. Source limits default to 32 readers at each end; configured ceilings still need capacity planning for replacements and auxiliary reads. Catalog presence uses a bounded 250 ms positive cache, which stores no viewer permissions; the full post-read file pin remains. SQL cost grows with distinct account/profile scopes, 512-item chunks and theme path/scope pairs.
Jellyfin-compatible publication under overlapping failures is fixed in
bf727a6; native executor moves preserve durable report selection and withhold unconfirmed local output. Same-transport failover onto enrolled HTTP workers remains disabled until native publication can supply durable acceptance evidence; those workers retain fresh-transport replans. Prepared-relay lookup and viewer batching are fixed in849e06c; permanent transient-source failure paths are fixed infa6c69a.The pre-dispatch, memory-store contention, pre-receipt recovery and delayed tracker corrections include regression controls and independent Astra review. The adjacent expired-read fix prevents a stale read from deleting a live same-ID replacement. The recipe restoration and current-main HTTP thumbnail parity corrections include mandatory regression controls and independent Astra approval of the exact integrated files. The recipe review also reproduced and fixed the adjacent failed-start cleanup race.
WAN, shared-storage, cold-cache, HDR and sustained-capacity validation remain outside the accepted timing evidence. Passed deployment cases in #1177 and #1178 need revalidation for this change. No merge or deployment is included.
Checklist
The user reviewed
9a431613; the new corrective diff awaits human review. The PR remains ready for review as requested.Note
Add standalone HTTP/HTTPS transcode worker mode with core-side control and enrollment
workersubcommand that runs a standalone, HTTP-only transcode node without core infrastructure credentials, plusworker-enrollmentandworker-enrollCLI commands that issue and redeem one-use enrollment tickets (cmd/silo/standalone_worker.go, cmd/silo/worker_enrollment.go)/api/internal/workers/routes only when worker control is configuredMacroscope summarized 580a22d.
AI Disclosure
gpt-6.1-solfor implementation and collaborating agents;gpt-6-astrafor the requested independent aggressive review.claude-opus-5-5) with a Codex (gpt-6.1-sol) cross-check. The nine maintainer commits are preserved.849e06cfollow-up additionally covers targeted grant indexing, durable report selection, request-scoped viewer batching, startup recovery, malformed origins and migration rollback contention. Astra also independently checked thefa6c69asource recovery patch, its unchanged original timeout regression, FFmpeg output parity, mandatory CI selections and test-only lint corrections. Astra independently reviewed thebf727a6compatibility-publication correction, actual Redis retry/deadline controls, PostgreSQL lost-commit handling, cross-replica cleanup ownership and its integration with source-error handling. It also reviewed the native routing correction, uncertain local output, same-work successors, current-main composition and final lint/test deltas. The final review also covers pre-dispatch cleanup evidence, per-session memory-store serialization, legacy receipt recovery, expired-read cleanup and exact producer registrations, with failing-before controls and actual PostgreSQL/Redis race tests where applicable. The follow-up review also covers captured recipe expiry/revocation, acknowledged candidate cleanup, delayed Redis restoration, duplicate retries, bounded settlement and native row ownership. Separate agent GPU validation and primary-agent repository checks are recorded above.