Archive location (Gitea issue 7): ARCHIVE_ROOT, Admin file-locations API, archive-copy job, doctor check

A filed packet's sealed data book, documents and a manifest are copied to the archive folder by the worker.
A failed copy never blocks filing: it is retried with backoff and raises the archive_failed condition.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-30 17:50:04 -06:00
co-authored by Claude Opus 5.5
parent 3fdf063b70
commit da31b0a87a
21 changed files with 1537 additions and 11 deletions
+17
View File
@@ -414,6 +414,7 @@ def test_feed_tables_and_app_grants(pg_settings: Settings) -> None:
jobs = [r[0] for r in conn.execute("SELECT job FROM job_schedule ORDER BY job").fetchall()]
assert jobs == [
"ad-reconcile",
"archive-copy",
"backup-check",
"drawing-lookup",
"housekeeping",
@@ -632,3 +633,19 @@ def test_qc_columns_checks_and_items(pg_settings: Settings) -> None:
"ph_clean",
"ph_qty",
]
def test_archive_copies_grants(pg_settings: Settings) -> None:
"""0012: the app reads, queues and updates archive copies and never deletes one."""
with app_conn(pg_settings) as conn:
for priv, want in (
("SELECT", True),
("INSERT", True),
("UPDATE", True),
("DELETE", False),
("TRUNCATE", False),
):
got = one(conn, "SELECT has_table_privilege('ps_app', 'archive_copies', %s)", (priv,))
assert got is want, priv
with pytest.raises(psycopg.errors.CheckViolation):
conn.execute("INSERT INTO archive_copies (seal_id, packet_id, status) VALUES (1, 1, 'done')")