Asking for 200–300 was capped by the 8s twin gap and one-frame-per-burst fill. fillToCount now treats the asked number as a hard target, then relaxes gap and allows a second frame from a burst when still short. Local-first/Rust noted in AGENTS.
3.2 KiB
3.2 KiB
Rules for agents (Paperclip, Claude Code, Cursor)
Read docs/ARCHITECTURE.md before any task. One task id per branch/PR (task/BIT-<id>-short-slug).
Non-negotiables
- LightCraft is consumed, never forked. Only
engine/coreimportslightcraft-*crates. Pin byrevin the rootCargo.toml. A bump is its own PR and must pass the reference-image tests. Missing engine features go upstream as PRs to storytold/lightcraft. - Edits are commands, not pixels. Every edit is an
EditCommand(packages/contracts, mirrored inengine/core). The server assigns a per-photoseq; clients replay from aseq. - Files and edits travel separately. Uploads go through the queue (tus / SFTPGo); edits through Socket.io.
- Organizations from day one. Every row that belongs to someone carries
organization_id. Agency mode and independent-photographer mode are an organization setting, not separate code paths. - No Adobe assets or names in the UI. Same workflow as Lightroom, original icons, labels and presets.
- Biometrics are opt-in per organization and the legal basis is stored with the setting.
- No third-party AI by default. Faces and OCR run locally; external fallbacks are opt-in per organization.
- Language: code, comments, identifiers and commit messages in English. User-facing copy via i18n (pt-PT first).
- Never commit secrets,
.env, generated status/summary markdown files, or build output. Deploys never overwrite a server.env(norm BIT-25005,docs/DEPLOY.md). - Tests touch real infrastructure safely: API tests run against PostgreSQL and only on a database whose name
ends in
_test. Never runprisma migrate resetor other destructive commands against shared databases. - Green CI before merge:
pnpm -r build && pnpm -r typecheck && pnpm -r testandcargo fmt --check,cargo clippy -D warnings,cargo test. - Local-first; web is sync glue. Every photographer-facing feature must work on the desktop without
the network (library, cull, develop, autopilot picks, export of what is already on disk, local FTP/USB),
except genuinely heavy shared jobs called out as such (e.g. org-wide face clustering across the federation).
The web app is how several people work from anywhere and how the desktop syncs when it has a link — it must
not be the only place a feature exists. Offline work is done locally and synced later; never force uploading
every frame just so the server can decide. Autopilot culls and edits on the desktop
(
apps/app/src/offline/autopilot.ts) with the same rules as the worker. - Prefer Rust for local heavy work. Detection, measure, level, develop and anything CPU-bound on the
desktop should live in
engine/(native / WASM), not in ad-hoc TypeScript, when practical. TypeScript orchestrates; Rust does the pixels and the scores. Safer, faster, one implementation with the workers.
Porting from the old projects
Port logic and tests, not UI. Sources: BitReport.pt/app.photoreport.pt, BitReport.pt/events.photoreport.pt,
BitReport.pt/PhotoReport_Studio. Keep behaviour identical unless the task says otherwise, and note the
original file in the PR description.