- the e2e config declares "template" as enum, exercising the
configuration-driven template vocabulary
- test 11 asserts the official template vocabulary and the schema-driven
enum vocabularies
- new test 16: the add-value route extends the official list (with the
refusals: unknown field, empty value, reserved placeholder, template
field, unauthenticated), and a restart proves the cleanup drops the
unused values while keeping the used ones
- buildEnumControl offers only the official select values plus the
"Ajouter une valeur…" entry; the entry opens a modal that registers
the value through POST /api/archivist/fields/{field}/values, then
selects it (US-37)
- the free-text fallback input is gone; a value unknown to the list
(e.g. a pipeline proposal) appears as a temporary option registered
by the correction or the import path
- config.jsonc declares "template" as enum so its select list is
managed by the application and always equals the template names
The previous commit replaced setup.go with an incomplete rewrite. This
restores the original file (fixed columns with created/updated, pages,
sha256 unique index, config-removal cleanup, event relation,
superuser upsert, errAppendOnly) and keeps only the intended changes:
- enum fields become select fields created with the dummy placeholder
(or the configured template names for the template field)
- the startup cleanup of the enum value lists runs at the end of Setup
- setup_test.go asserts the select columns and the cleanup
- the config metadata route now serves the official enum vocabularies
read from the documents collection schema (placeholder excluded)
instead of the rule-derived vocabularies (US-31, US-37)
- new superuser-only route POST /api/archivist/fields/{field}/values
registers a value on an enum field's select list, the action behind
the dashboard's add-a-value entry; the template field is refused
- the pipeline and the full correction register new enum values before
the record save validates them
- enum fields become PocketBase select columns created with a single
'-----' placeholder; the special template field starts with the
configured template names (US-03, US-37)
- new enums.go owns the value lists: EnsureEnumValues registers new
values before a record save validates them, CleanupEnumValues runs at
startup and keeps only the values a document uses (placeholder kept
only while alone), template forced to the configuration
- setup_test.go now asserts the select columns and the cleanup
The dashboard is a static frontend (no build toolchain, vendored JS) served
by PocketBase's built-in static file serving from pb_public/ shipped in
the image. The browser persists through the standard API and its hooks;
only the PDF stream, the FTS5 search and the dry-run go through dedicated
JSON routes. Overview, stack, section 7 and packaging updated.
Both collections are created programmatically, so PocketBase's default
created/updated autodate fields were absent and the admin UI showed no
creation/modification dates. Declared explicitly on documents (re-added
each start like the other fixed columns, protected from the config
cleanup) and on document_events at creation. The authoritative history
remains document_events.
US-22: the PocketBase UI edits one field at a time with no preview of
the final name, so a field edit now persists the values with no template
evaluation, no re-filing and no status change; the corrected event carries
the field diff alone. The full correction (all fields, dry-run, re-filing,
validation) moves to the custom dashboard (US-3x).
US-24: deleting a documents record deletes the S3 object at file_key first;
the cascade delete removes the history. Spec, hooks, E2E updated together.
The helper renders French period labels (Janvier 2026, T2 2026, S1 2026),
so it carries the fr prefix like frDate. Config example, arch.md and
user-stories.md updated. Configs calling period(...) must switch to
frPeriod(...).
fix(docs): update Garage image version in README and architecture documentation
fix(e2e): change default Garage image version in e2e tests and improve directory handling
fix(s3): skip adding inbox directory markers in S3 listing
fix(main): set HTTP address argument correctly for the application
The generic emissionDate rule ran unconditionally: on a document whose
date is not numeric (e.g. "le 19 janvier 2026"), date(firstMatch(...))
errored on the empty match and routed a correctly classified document to
pending/. Each format probe now checks for its own format first, and a
frDate fallback handles French natural-language dates.
AppendEvent now reduces the before/after snapshots to the changed keys:
identical values on both sides are omitted, a key on one side only is an
addition or a deletion. The imported, corrected and validated payloads all
follow the same rule (an import is a diff from nothing, a validation keeps
carrying the status alone). arch.md section 4 updated accordingly.
Go date layouts only know English month names, so date(value, layout)
cannot parse "le 19 janvier 2026". frDate(text) extracts and parses such
dates (day optional, abbreviated months, accents optional) into a native
date; no match is a rule error routing the document to pending/.
Documented in arch.md §5, covered by unit tests.
An unreadable PDF was still passed to cfg.Evaluate with nil pages, producing
a cascade of spurious errors (index out of range on pages[0], missing
mandatory fields) in the imported event. Route straight to pending/ with the
extraction failure as the single error.