Files
photoreport/AGENTS.md
T
spark 75ca04f890
ci / rust (pull_request) Successful in 5m2s
ci / typescript (pull_request) Successful in 9m10s
fix(delivery): honour Melhores count — stop under-filling the gallery (BIT-172)
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.
2026-11-03 22:28:53 +00:00

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

  1. LightCraft is consumed, never forked. Only engine/core imports lightcraft-* crates. Pin by rev in the root Cargo.toml. A bump is its own PR and must pass the reference-image tests. Missing engine features go upstream as PRs to storytold/lightcraft.
  2. Edits are commands, not pixels. Every edit is an EditCommand (packages/contracts, mirrored in engine/core). The server assigns a per-photo seq; clients replay from a seq.
  3. Files and edits travel separately. Uploads go through the queue (tus / SFTPGo); edits through Socket.io.
  4. 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.
  5. No Adobe assets or names in the UI. Same workflow as Lightroom, original icons, labels and presets.
  6. Biometrics are opt-in per organization and the legal basis is stored with the setting.
  7. No third-party AI by default. Faces and OCR run locally; external fallbacks are opt-in per organization.
  8. Language: code, comments, identifiers and commit messages in English. User-facing copy via i18n (pt-PT first).
  9. Never commit secrets, .env, generated status/summary markdown files, or build output. Deploys never overwrite a server .env (norm BIT-25005, docs/DEPLOY.md).
  10. Tests touch real infrastructure safely: API tests run against PostgreSQL and only on a database whose name ends in _test. Never run prisma migrate reset or other destructive commands against shared databases.
  11. Green CI before merge: pnpm -r build && pnpm -r typecheck && pnpm -r test and cargo fmt --check, cargo clippy -D warnings, cargo test.
  12. 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.
  13. 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.