Commit Graph
80 Commits
Author SHA1 Message Date
1224ff916d Archivist : page Outils + outil « Recherche des fichiers perdus » (US-40, US-41) (#16)
* Add tools page with find-lost-files consistency tool (US-40, US-41)

Co-authored-by: napnap75 <napnap75@users.noreply.github.com>

* tools page: hide the job panel when there is nothing to show, guard against undefined rendering

Co-authored-by: napnap75 <napnap75@users.noreply.github.com>

* inbox: leave non-PDF objects in place, never imported (US-12)

Co-authored-by: napnap75 <napnap75@users.noreply.github.com>

---------

Co-authored-by: Vibe Nuage Agent <vibe@mistral.ai>
Co-authored-by: napnap75 <napnap75@users.noreply.github.com>
2026-11-12 19:35:56 +01:00
thomas 85784ef578 fix: correct missing new-lines 2026-11-12 12:05:21 +01:00
thomas 2617ad656c archivist: specs updated for the official enum value lists (US-37) 2026-11-12 10:06:12 +01:00
thomas cdd2be326e archivist: e2e coverage of the enum lifecycle
- 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
2026-11-12 09:46:43 +01:00
thomas a8ff31a3c5 archivist: enum dropdowns on the official values, template as enum
- 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
2026-11-12 09:44:57 +01:00
thomas 9d7a1add12 archivist: fix setup.go to keep the original collection shape
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
2026-11-12 09:43:52 +01:00
thomas 900c799f82 archivist: enum values on the official lists in routes and pipeline
- 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
2026-11-12 09:42:38 +01:00
thomas 2c0fb89144 archivist: official enum select fields with application-managed value lists
- 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
2026-11-12 09:39:20 +01:00
thomas a834cf2576 First run of the web UI 2026-11-11 23:25:16 +01:00
thomas 9d8b560bac feat(dashboard) review UI: static pages, Beszel-styled CSS and vanilla JS (US-30, US-32..36) 2026-11-07 19:27:59 +01:00
thomas b7bfe1152a feat(routes) config, pdf proxy, dry-run and correct routes + e2e coverage (US-31, US-34..36) 2026-11-07 19:18:34 +01:00
thomas 2ba78724cc docs(dashboard) Beszel design reference for dashboard CSS 2026-11-07 19:03:42 +01:00
thomas f461d0874f docs(archivist): default table columns = mandatory fields + status + file_key 2026-11-07 12:21:59 +01:00
thomas 81f194d492 docs(archivist): default table columns = mandatory fields + status + file_key 2026-11-07 12:21:52 +01:00
thomas 82ad4d1cdf docs(archivist): reformat section 5 into readable bullet lists 2026-11-07 12:15:57 +01:00
thomas faee46d60b docs(archivist): sha256 unique-indexed column; draft save allowed despite render errors 2026-11-07 12:13:50 +01:00
thomas 80070be503 docs(archivist): allow draft save when rendered name has errors (align with US-22/US-35) 2026-11-07 12:13:42 +01:00
thomas ddf4b7bfe8 docs(archivist): align US-01 env var to ARCHIVIST_HTTP_ADDR 2026-11-07 12:13:25 +01:00
thomas c32fd02abc docs(specs): review dashboard epic US-30..US-36 and section 7 design
user-stories.md: new epic with 7 stories (static serving, config
metadata route, configurable table, bulk edit, detail page, dry-run with
its two exclusive modes, full-correction route); US-5x (config editor)
replaces US-3x in the deferred list; US-3x references updated.
arch.md: section 7 restructured (7.1 list, 7.2 detail, 7.3 application
routes with the config/pdf/dry-run/correct contracts, 7.4 standard UI
hooks); section 10 notes the future gate coverage of these routes.
2026-11-07 11:55:55 +01:00
thomas 33b278af0d docs(arch): review dashboard as static files in pb_public
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.
2026-11-07 10:53:55 +01:00
thomas b716d3d94d feat(setup): add the standard created/updated autodate columns
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.
2026-11-04 22:37:32 +01:00
thomas b1a37bc29b archivist: add scripts/import_meta_files.py to import pre-existing filed documents into PocketBase 2026-11-04 22:20:45 +01:00
thomas 7b25b7b144 feat(ui): US-22 becomes a side-effect-free draft correction; add US-24 S3 deletion
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.
2026-11-04 22:08:31 +01:00
thomas 6961256538 refactor(config): rename the period helper to frPeriod
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(...).
2026-11-04 22:00:36 +01:00
thomas f8734f79ca feat(docker): update Dockerfile to include git and adjust file copying structure
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
2026-11-04 21:56:44 +01:00
thomas 320b030bde fix(config): guard the emission-date probes against absent formats
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.
2026-11-03 23:12:45 +01:00
thomas 4baf2f3368 feat(events): store before/after as diffs, not full snapshots
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.
2026-11-03 23:05:34 +01:00
thomas 5d09e7a780 feat(config): add frDate helper for French natural-language dates
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.
2026-11-03 22:56:47 +01:00
thomas 09d0c9b99b fix(pipeline): skip rule evaluation when PDF extraction fails (US-13)
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.
2026-11-03 22:53:16 +01:00
thomas 02f7fd99bb Corrections after first run 2026-11-03 22:36:27 +01:00
thomas 6f94674fc9 archivist: migrate to PocketBase v0.41.1 (module ganigeorgiev.com/pocketbase/pocketbase); dbx moved to ganigeorgiev.com/pocketbase/dbx; go 1.27 and golang:1.27-alpine builder 2026-11-03 21:01:00 +01:00
thomas 7829d73cd4 archivist: scratch runtime Dockerfile (static binary only, non-root, CA bundle + tzdata); .dockerignore; README build section; arch.md packaging; fix ARCHIVIST_HTTP_ADDR doc row 2026-11-02 13:28:50 +01:00
thomas 233c153072 archivist: single-file E2E regression gate (Garage + image under test); superuser-only poll route; ARCHIVIST_S3_REGION 2026-11-02 12:28:58 +01:00
thomas 1cbe96b173 archivist: fix README spacing before Troubleshooting section 2026-11-02 11:27:57 +01:00
thomas 67c337eb14 archivist: runtime logs through PocketBase logger (Dashboard > Logs); stderr kept for pre-bootstrap fatals 2026-11-02 11:27:00 +01:00
thomas 61586a670a archivist: clarify Remove() comment re optional versioning 2026-11-02 11:13:02 +01:00
thomas 3bba6a82db archivist: versioning check becomes a startup warning in code 2026-11-02 11:12:31 +01:00
thomas 72fe21c9c1 archivist: brief aligned with versioning-optional decision 2026-11-02 11:12:23 +01:00
thomas 20385eafca archivist: README aligned with versioning-optional decision 2026-11-02 11:12:15 +01:00
thomas e667ee7203 archivist: US-01/US-12/US-17 aligned with versioning-optional decision 2026-11-02 11:12:08 +01:00
thomas fd35991397 archivist: versioning no longer required, warning at startup instead (recommended) 2026-11-02 11:11:59 +01:00
thomas 24b22c5815 archivist: render template from stored fields when recovering interrupted filings 2026-11-01 23:02:52 +01:00
thomas a9b4fa5eca archivist: initial Go implementation of the written user stories (US-01..US-23) 2026-11-01 23:02:24 +01:00
thomas 7de824d797 archivist: correction and validation through the standard PocketBase UI via the update hook 2026-11-01 22:52:40 +01:00
thomas ce19e97711 archivist: allow document correction and validation through the standard PocketBase UI via the update hook (US-22, US-23) 2026-11-01 22:52:32 +01:00
thomas d04134d8cd archivist: enforce document_events append-only via request hooks instead of API rules (superusers bypass rules) 2026-11-01 22:46:02 +01:00
thomas a2f448873a archivist: add user stories for startup, configuration, polling/classification and PocketBase UI visualization 2026-11-01 19:16:17 +01:00
thomas a9d6af7f9c archivist: add user-facing README (docker deployment, configuration, dashboard) 2026-11-01 18:43:34 +01:00
thomas fe9ba799b9 archivist: document firstMatch empty-string semantics, interrupted-filing recovery, log-only duplicates 2026-11-01 18:37:27 +01:00
thomas d6cf724878 archivist: move status into before/after snapshots in document_events payloads 2026-11-01 16:15:04 +01:00