AGENTS.md
internal/photoprism/AGENTS.mdAGENTS.md
Quality
39/100
Scores the file, not the repository.Length
274 words
4 headings · 0 code blocksRepository
40k
— · pushed 0 days agoLast changed
2 days ago
First indexed 2 days ago.1# PhotoPrism Core Import & Index Guidelines23**Last Updated:** April 9, 202645## Import & Index Behavior67- `ImportWorker` may skip a file when an identical file already exists. Use unique copies or assert DB rows only after ensuring the destination is not a duplicate.8- Keep `SamplesPath()`, `ImportPath()`, and `OriginalsPath()` consistent when testing related files so `RelatedFiles` and `AllowExt` behave correctly.9- `IndexOptions*` helpers now require a `*config.Config`; pass the active config, or `config.NewMinimalTestConfig(t.TempDir())` in unit tests, so face, label, and NSFW scheduling matches the current run.10- Vision scheduling is controlled by `VisionSchedule`, `VisionFilter`, and the `Run` property in `vision.yml`. Use helpers such as `vision.FilterModels` and `entity.Photo.ShouldGenerateLabels` or `ShouldGenerateCaption` before loading media.11- Folder albums use path-first lookup and update via `album_path` to avoid slug collisions for emoji child paths; re-indexing may repair stale collision titles while preserving user-custom titles.12- Reuse `entity.FindLabels(...)`, `entity.FindLabelIDs(...)`, and `entity.LabelSlugs(...)` for label lookup so homophone-aware exact-name matching stays aligned across entity and search packages.1314## File I/O Overwrite Policy1516- Default to safety: callers must not overwrite non-empty destination files unless they opt in with `force=true`.17- Replacing an empty destination file is allowed without `force=true`.18- Open overwriting destinations with `O_WRONLY|O_CREATE|O_TRUNC` so stale trailing bytes cannot survive; use `O_EXCL` when the caller must detect collisions.19- App-level overwrite helpers live in `internal/photoprism/mediafile.go`; reusable helpers live in `pkg/fs/copy.go` and `pkg/fs/move.go`.20- Set `force=true` only for explicit replace flows or admin tools with confirmed overwrite, not for import or index flows that touch Originals.2122## Tests2324- In `internal/photoprism` tests, rely on `photoprism.Config()` for runtime-accurate behavior; only build a new config if you replace it with `photoprism.SetConfig`.2526
Also in photoprism/photoprism
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| photoprism/photoprisminternal/config/AGENTS.md · 40k | AGENTS.md | databasedo-not | 46/100 | 2 days ago | |
| photoprism/photoprisminternal/entity/migrate/AGENTS.md · 40k | AGENTS.md | testtesting-strategydatabase | 63/100 | 2 days ago | |
| photoprism/photoprisminternal/service/cluster/AGENTS.md · 40k | AGENTS.md | buildtestapi | 76/100 | 2 days ago | |
| photoprism/photoprismpkg/AGENTS.md · 40k | AGENTS.md | teststylesecurity | 55/100 | 2 days ago | |
| photoprism/photoprisminternal/commands/AGENTS.md · 40k | AGENTS.md | teststyle | 66/100 | 2 days ago | |
| photoprism/photoprism.claude/CLAUDE.md · 40k | CLAUDE.md | buildtestlint-formatstyle+7 | 96/100 | 2 days ago | |
| photoprism/photoprism.github/copilot-instructions.md · 40k | Copilot instructions | buildtestlint-formatstyle+5 | 90/100 | 2 days ago | |
| photoprism/photoprism.github/instructions/backend.instructions.md · 40k | Copilot instructions | testlint-formatstyletypes+4 | 83/100 | 2 days ago | |
| photoprism/photoprism.github/instructions/frontend.instructions.md · 40k | Copilot instructions | testlint-formatstyleagent-behaviour | 76/100 | 2 days ago | |
| photoprism/photoprismAGENTS.md · 40k | AGENTS.md | setupbuildtestlint-format+8 | 82/100 | 2 days ago | |
| photoprism/photoprismfrontend/AGENTS.md · 40k | AGENTS.md | setupteststyletesting-strategy+1 | 76/100 | 2 days ago | |
| photoprism/photoprisminternal/AGENTS.md · 40k | AGENTS.md | teststyletesting-strategy | 71/100 | 2 days ago | |
| photoprism/photoprisminternal/api/AGENTS.md · 40k | AGENTS.md | teststyletesting-strategyapi | 62/100 | 2 days ago |
Diff against internal/config/AGENTS.md Diff against internal/entity/migrate/AGENTS.md Diff against internal/service/cluster/AGENTS.md Diff against pkg/AGENTS.md Diff against internal/commands/AGENTS.md Diff against .claude/CLAUDE.md Diff against .github/copilot-instructions.md Diff against .github/instructions/backend.instructions.md Diff against .github/instructions/frontend.instructions.md Diff against AGENTS.md Diff against frontend/AGENTS.md Diff against internal/AGENTS.md Diff against internal/api/AGENTS.md
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| trick77/agents-md-syncAGENTS.md · 2 | AGENTS.md | setupbuildteststyle+5 | 100/100 | 3 days ago | |
| SkeneTechnologies/skene-cookbookAGENTS.md · 51 | AGENTS.md | setupbuildtestlint-format+7 | 100/100 | 2 days ago | |
| duckduckgo/content-scope-scriptsspecial-pages/AGENTS.md · 70 | AGENTS.md | buildteststylearch+3 | 100/100 | 3 days ago | |
| mui/material-uiAGENTS.md · 99k | AGENTS.md | setupbuildtestlint-format+9 | 100/100 | 3 days ago | |
| n8n-io/n8npackages/@n8n/agents/AGENTS.md · 199k | AGENTS.md | buildteststylearch+3 | 100/100 | 3 days ago | |
| TryGhost/Ghoste2e/AGENTS.md · 55k | AGENTS.md | setupteststylearch+2 | 100/100 | 3 days ago | |
| code-yeongyu/oh-my-openagentpackages/web/AGENTS.md · 67k | AGENTS.md | setupbuildtestlint-format+6 | 100/100 | 2 days ago | |
| ethereum/go-ethereumAGENTS.md · 51k | AGENTS.md | buildtestlint-formatgit+1 | 100/100 | 3 days ago |
