# Foldershare decisions Record durable accepted project choices here. Pending proposals are explicitly non-authoritative until Captain accepts them. No historical project rationale was found or inferred during the 2026-11-04 reconciliation. ## WF-001: Context and task authority - Status: Accepted by Captain's 2026-11-04 reconciliation instruction - Date: 2026-11-04 ### Decision Use Roborto Context System 1.0 as the six-file documentation format and Workflow 2.0 for operating rules. Captain is project owner and retains merge/release authority unless explicitly delegated. Current repository evidence is authoritative for current facts. Preserve existing behavior outside accepted scope. Use one accepted numbered implementation task per isolated branch/worktree by default, separate worktrees for concurrent tasks, and a Captain validation gate before marking work Complete where review is required. ### Consequences Documentation administration does not start feature work. Application changes require preflight of worktree, branch, status, task, decisions, and dependencies. Task validation and diff review lead to an implementation-ready handoff; they do not imply Captain acceptance. ## WF-002: Task branch and worktree convention - Status: Accepted by Captain for TASK-001 on 2026-11-04 - Date: 2026-11-04 Use `main` as TASK-001's base, `task/TASK-001-handover-zip` as its branch, and `.worktrees/TASK-001` as its isolated worktree. This approval covers the task's implementation location. It does not authorize a merge, release, or deployment. ## Pending: Merge and release conventions No merge or release convention is documented in the pre-existing repository. The following are **proposals for Captain approval**, not current rules: 1. Future tasks use `main` as integration/base, `task/TASK-###-short-name` branches, and `.worktrees/TASK-###` worktrees. TASK-001's specific branch and worktree are approved above. 2. Merge strategy: Captain reviews the task diff and performs a squash merge into the approved integration branch after acceptance. 3. Release/deployment branch: use `main` only if Captain confirms it as the release source; otherwise define a separate release branch before any release workflow. Until approved, brief the concrete convention choice before creating later task branches/worktrees or merging. Do not infer deployment authorization from a branch choice. Record Captain's decision here and preserve any later superseded decision. ## PRD-001: Private media-share purpose and V1 boundaries - Status: Accepted from Captain's explicit requirements, 2026-11-04. - FolderShare serves selected friends authenticated to a Raspberry Pi-hosted application accessing the existing video library via a mounted/shared directory. This is not a public registration or upload service. - V1 scope: admin-created accounts, per-user folder access, folder browsing and individual read-only file downloads. No write, upload, rename or delete access to media. - The media mount/container binding must be read-only. API authorization is required independently of UI restrictions; deny access by default. ## PRD-002: Folder permissions for first release - Status: Accepted as V1 simplification from current discussion, 2026-11-04; revisit before implementing multi-root support. - Use **one assigned root directory per user** and permit descendants only, with an unassigned root granting no media access. Do not grant access to ancestors, siblings, or paths outside the configured media root. - Admin manages assignments. Do not rely on user-supplied filesystem paths or raw string-prefix checking. Resolve/canonicalize paths, reject traversal and symlink escapes, and recheck access at every listing and download request. - A future multiple-independent-folder permission model is outside V1 scope. ## PRD-003: Opaque single-file download requests - Status: Accepted from Captain's explicit requirement, 2026-11-04. - File names and server filesystem paths must not appear in download URLs. Use non-guessable opaque short-lived download grants (suggested initial lifetime: five minutes to *start* a download), bound to the requesting account and a server-resolved file identity; validate current permission and file existence on use. - Grant URLs must never substitute for authorization. Serve the actual filename through `Content-Disposition` to the authorized downloader; names will remain visible in browsing UI and browser download history. - Large-file streaming and HTTP Range/resume support belong to V1. Ensure grants do not expire mid-stream; define safe behavior for resumed requests. Avoid exposing sensitive tokens in logs and referrers. ## PRD-004: Deferred batch ZIP downloads - Status: Accepted as a future feature concept, **not an authorized implementation task**, 2026-11-04. - Later allow selection of multiple files/folders and downloading a ZIP that preserves folder structure. Reuse centralized server-side authorization; reject symlink escapes and unauthorized members. - Raspberry Pi resource constraints favor streaming/stored ZIP entries rather than recompressing already-compressed videos. Whether to prepare archives as temporary jobs or stream them directly remains an implementation decision for that future release. ## DEP-001: LAN-hosted Pi and intended URL - Status: Partially accepted; **remote access method pending Captain decision**, 2026-11-04. - Host the app on a Raspberry Pi on Captain's LAN; obtain the video library via a mounted network share or local share directory; target `share.roborto.net` or another suitable subdomain. Keep media storage independent of the app host. - Unresolved: external browser access via public HTTPS reverse proxy versus VPN; chosen Pi/service distribution; TLS/DNS routing, authentication hardening, backup/restore, network mount reliability, and deployment container arrangement. Do **not** infer port forwarding or public exposure authorization. ## Pending: Git integration branch convention The 2026-11-04 snapshot references work on `codex` while the existing proposal suggests `main`. There is no evidence that a general integration branch choice was approved. Before creating a task worktree, Codex must inspect live Git state and ask Captain to approve the integration base, worktree path, and eventual merge destination. A task branch is not authority to merge or deploy. ## WF-003: TASK-002 implementation location - Status: Accepted by Captain's “engage task-002” response to the concrete proposal, 2026-11-04. - Use `codex` at `cd6d6b3` as TASK-002 base and intended merge destination, branch `task/TASK-002-authorization`, worktree `.worktrees/TASK-002`. - This approves TASK-002 only. Merge/deployment authority remains with Captain; future-task/release conventions remain pending. The earlier main-base proposal is not used for this task. ## TASK-002 API/security implementation contract - Implements PRD-002: stored assigned roots are virtual `/` or `/folder/descendant`, relative to configured `ROOT_PATH`; `null` grants no access. Existing malformed/host-absolute assignments fail closed and require admin reassignment. No automatic conversion of old assignments. - Symlinks inside the media tree are omitted/rejected entirely (including links within the tree). Descriptor-relative directory opens with `O_NOFOLLOW` prevent listing redirection during link swaps; Linux/Pi is the target runtime. - Admin `GET /api/file/root` retains tree entries `{root, dirs, files}` with virtual roots, filename/size metadata; unavailable media returns generic 503. The model's user listing rebases its assigned directory to `/` and returns `[]` when unassigned/invalid/unavailable. TASK-003 supplies the user-facing browse route/UI. - `POST /api/file` returns authenticated 410 without reading its payload or filesystem until TASK-004 replaces downloads with authorized grants. Anonymous requests remain 401. - User POST/PATCH/DELETE require admin (authenticated non-admin 403); POST accepts username/password only, PATCH root/login_disabled only with validated types. Disabled/missing users cannot use Basic/access/refresh authentication; disabling revokes credentials so re-enabling does not restore them. - `FOLDERSHARE_DATABASE_URI` optionally overrides SQLite configuration for isolated tests; default database remains unchanged. `ROOT_PATH` still configures media, resolved from process working directory at startup. ## WF-004: TASK-003 implementation location - Captain engaged the briefed task from `codex` at `549f11d`, using branch `task/TASK-003-secure-browsing` and worktree `.worktrees/TASK-003`. ## TASK-003 browse API contract - `GET /api/file/browse?path=/folder` uses bearer authentication. The `path` query value defaults to `/` and is relative to the current user's assigned root. This applies to admin accounts on the browsing endpoint as well. The admin-only `GET /api/file/root` retains the existing assignable tree and response shape. - Success returns `{root, dirs, files}` for the requested folder's direct children. `root` is the requested virtual path. `dirs` contains directory names. `files` contains `{name, size, ref}` entries with byte sizes and slash-delimited virtual references such as `/folder/video.mp4`. The client URL-encodes the query value once. The server resolves the assigned root and requested directory on each call without following symlinks. Success responses specify `Cache-Control: no-store`. - The endpoint returns 401 for invalid authentication, 403 for a missing or unusable assignment, 400 for invalid virtual path structure, 404 for a folder missing within the assignment, and 503 for unavailable media or storage errors. A readable empty folder returns 200 with empty arrays. Sign-in omits the stored assignment from the session payload. - TASK-004 may use `ref` as a file reference in its grant request body. The download-grant endpoint must recheck current ownership, containment and file existence. The opaque download URL follows PRD-003. ## WF-005: TASK-007 testtask implementation - Accepted by Captain on 2026-11-05: codex base at cd6d6b3, task/TASK-007-testtask, .worktrees/TASK-007. Merge and deployment remain Captain authority. - Use the existing standalone roborto-testtask engine with a project adapter. Safe source copies are disposable testing snapshots, not Git checkouts or development sources. The adapter discovers a unique checked-out task/TASK-###-* branch and includes current tracked/permitted untracked source. - Flask/Vite bind only 127.0.0.1:5502/5503, with an isolated Vite proxy. Reuse existing dependency installations without installs or runtime source changes. Mutable Vite cache goes into run state. - SQLite, accounts and sample media are generated per session; no live state is copied. Candidate must support FOLDERSHARE_DATABASE_URI. No application code is patched to make the harness work.