Archive Documents (permit/plan files on legacy records)

Shipped: 2026-07-19 (entirely-api e63c44a, entirely-portal 07f0b22)

The portal /archive page (roles: up_owner, up_admin, triage) previously surfaced only certs for legacy blkhse.PMS records. It now also lists permit packages, plans, and other on-disk documents, with inline-open links.

How it resolves files

services/archive_cert_resolver.resolve_archive_documents(record_id):

  1. Handle bridge (exact): parses the PMS record’s raw_json for SmartSuite attachment lists ([{handle, metadata.filename}]), then matches project_files.source_path = "handle:{...}" — the stamp the TB-20 PMS file migration wrote. This is the only bridge for files that landed under an unrelated hex folder with non-address filenames (e.g. 12TH ST BP PLANS.pdf under 39ac0572... for record 664169...), which the address-based cert bridge can never find.
  2. Own-folder scan: category subfolders of /data/projects/{record_id}/, excluding CERTS.

Serving

GET /portal/archive/file?folder=&category=&filename= — same ARCHIVE_ROLES gate, FileResponse inline. Restricted to archive-provenance triples (registered in project_files, or folder is a PMS record id); path components sanitized. Auth rides the httpOnly portal_token cookie, so plain <a target="_blank"> links work through the entirely.it.com /api/* Caddy proxy.

  • Entirely-v2
  • Driven by the 4014 12th Street / blkhse.44492 cert-regen request (LITTLE, Calvert County) — plans/permits existed on disk but were invisible in the portal.