catalogue port: Document archive (Paperless-ngx) — scan, OCR, find #1146

Closed
opened 2026-09-02 06:25:42 +00:00 by ben · 7 comments
Owner

Parent

Feature #1073; Ben's promotion ruling 2026-09-02, recorded in
docs/research/2026-09-01-catalogue-candidate-seed-list.md (the port-queue
table — read this ticket's service section there first; per-claim citations).

What to build

Service: Document archive · runs Paperless-ngx · category Work together. services.paperless exists in nixpkgs — low-moderate cost. OCR languages must include English + te reo Māori where tesseract supports it; the consume directory rides the declared dataset.

Files pairing — OPT-IN only (Ben's ruling 2026-09-02): when Files &
documents (Nextcloud) is also placed, the port CAN wire the pairing — the
consume directory mounted into Nextcloud via its External Storage app, and
Nextcloud's own first-party integration_paperless app enabled with a
provisioned API token (the #413 wopi pairing shape). This is an enhancement,
NOT a dependency: no Files gate, Document archive is fully useful standalone.
The pairing is off by default and connects only by an explicit operator
act
— never wired automatically just because both services are placed;
disabling it removes the wiring cleanly. Paperless metadata (tags, OCR text)
stays in Paperless — Nextcloud sees files only; say so honestly in the
operator-facing copy.

An ADR 0062 catalogue port, shipped through the update channel, touching no
provisioning code: (1) the declarative NixOS unit + secrets via the clan
seam's AttachService; (2) the out-of-band reconciler for post-start
imperative provisioning (the Garage pattern) where the service needs one;
(3) the service's OWN HealthCheck proving real function (safe to re-run —
P4-S5x retry; Summary in operator vocabulary, never a stack trace) — plus
the catalogue Service entry: slug, name, MEASURED floor and steady-state
memory (never guessed — ADR 0030 discipline), roles (helper), access facts,
Product + ProductURL, and the DDR 0220 display facts (category, one-line
description, glyph; logo asset if curated).

Acceptance criteria

  • Deploys onto a helper via the existing P4 path with every part declared by the port itself — no provisioning/monitoring code change
  • HealthCheck proves the service does its actual job (named below), is re-run-safe, and its Summary reads in domain vocabulary
  • Catalogue entry carries measured floor + steady memory and the DDR 0220 display facts; the P4 available list gates on them correctly
  • Monitoring watches the same declared check steady-state (ADR 0062 — defined once)
  • Health check ingests a fixture document through the consume path and finds it via search (OCR pipeline proven end to end)
  • Files pairing is opt-in: off by default even with Files placed; an explicit operator act enables the consume-folder mount + integration_paperless token wiring, and disabling removes it cleanly
  • With the pairing enabled, a file dropped in the paired Nextcloud folder is consumed and searchable in Document archive (and removed from the folder — never stored twice)

Blocked by

  • #1119 (catalogue display facts + Heritage taxonomy — the Service fields this entry fills)
## Parent Feature #1073; Ben's promotion ruling 2026-09-02, recorded in `docs/research/2026-09-01-catalogue-candidate-seed-list.md` (the port-queue table — read this ticket's service section there first; per-claim citations). ## What to build **Service: Document archive · runs Paperless-ngx · category Work together.** `services.paperless` exists in nixpkgs — low-moderate cost. OCR languages must include English + te reo Māori where tesseract supports it; the consume directory rides the declared dataset. **Files pairing — OPT-IN only (Ben's ruling 2026-09-02):** when Files & documents (Nextcloud) is also placed, the port CAN wire the pairing — the consume directory mounted into Nextcloud via its External Storage app, and Nextcloud's own first-party `integration_paperless` app enabled with a provisioned API token (the #413 wopi pairing shape). This is an enhancement, NOT a dependency: no Files gate, Document archive is fully useful standalone. The pairing is **off by default and connects only by an explicit operator act** — never wired automatically just because both services are placed; disabling it removes the wiring cleanly. Paperless metadata (tags, OCR text) stays in Paperless — Nextcloud sees files only; say so honestly in the operator-facing copy. An ADR 0062 catalogue port, shipped through the update channel, touching no provisioning code: (1) the declarative NixOS unit + secrets via the clan seam's AttachService; (2) the out-of-band reconciler for post-start imperative provisioning (the Garage pattern) where the service needs one; (3) the service's OWN HealthCheck proving real function (safe to re-run — P4-S5x retry; Summary in operator vocabulary, never a stack trace) — plus the catalogue Service entry: slug, name, MEASURED floor and steady-state memory (never guessed — ADR 0030 discipline), roles (helper), access facts, Product + ProductURL, and the DDR 0220 display facts (category, one-line description, glyph; logo asset if curated). ## Acceptance criteria - [ ] Deploys onto a helper via the existing P4 path with every part declared by the port itself — no provisioning/monitoring code change - [ ] HealthCheck proves the service does its actual job (named below), is re-run-safe, and its Summary reads in domain vocabulary - [ ] Catalogue entry carries measured floor + steady memory and the DDR 0220 display facts; the P4 available list gates on them correctly - [ ] Monitoring watches the same declared check steady-state (ADR 0062 — defined once) - [ ] Health check ingests a fixture document through the consume path and finds it via search (OCR pipeline proven end to end) - [ ] Files pairing is opt-in: off by default even with Files placed; an explicit operator act enables the consume-folder mount + `integration_paperless` token wiring, and disabling removes it cleanly - [ ] With the pairing enabled, a file dropped in the paired Nextcloud folder is consumed and searchable in Document archive (and removed from the folder — never stored twice) ## Blocked by - #1119 (catalogue display facts + Heritage taxonomy — the Service fields this entry fills)

swarm-claim host=matou-dev-server-01 run=16332
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=16332 (automated multi-host claim — lowest live claim id works this ticket)

Ruled by agent under ADR 0174 — veto anytime.

Two-way-door calls made shipping the document-archive port (#1146), each reversible by a later commit and proven by a test/drive/probe:

  1. Slug document-archive + category Work together. The ticket header rules the service Document archive · category Work together (over the seed-list table's provisional records/Protect). I used slug document-archive (matching the Name; the hostname authority derives document-archive.<apex>, the static-sites hyphenated precedent). Reversible: a slug/category rename is a single-commit catalogue edit; proven by the catalogue + attach/health seam tests keying on it.

  2. Measured-pending memory (ADR 0030 discipline). Floor 1 thread · 2 GB · 40 GB (disk headroom for a growing media store) and steady 768 MB are the tier-aligned honest estimate for the Django + Redis + Tesseract-OCR + PostgreSQL footprint — held provisional pending a clan-lab measurement under OCR load (never idle), the DDR 0156-style fit the #1073 ruling calls for. Reversible: a number bump is a one-line catalogue edit.

  3. PostgreSQL over the unix socket (peer auth). The backing store is declared local PostgreSQL reached over /run/postgresql (the paperless service user maps to the paperless DB role), so there is no DB password to keep out of the store — only the admin superuser password (passwordFile) and the Django PAPERLESS_SECRET_KEY (environmentFile) ride clan vars. Reversible: switching to a password-auth DB is a render edit.

  4. Consume path = post_document; the physical consume-directory drop is the deferred clan-lab drive. The health check proves the real consume-and-find loop (hand a fixture document to post_document → wait for the OCR/index task → find it by full-text search off the declared dataset → delete), which exercises the SAME consumer pipeline the watched consume dir feeds. The physical watched-folder poll at full OCR/scan fidelity (a real scanned image, every language pack) is the lab smoke — the #225/#229 precedent every port follows. Reversible: the lab drive can add fidelity without changing the gate.

Proven by: internal/clan/paperless_test.go + paperless_attach_test.go (render + attach seams), control-plane/cmd/control-plane/provision_paperless_health_test.go (a real consume-and-find activates; a consume that keeps nothing findable, and a failed OCR pipeline, each honestly withhold activation with the port's operator-facing summary). Full go test ./..., go vet, golangci-lint, gofmt, and -tags dev build all green.

Ruled by agent under ADR 0174 — veto anytime. Two-way-door calls made shipping the document-archive port (#1146), each reversible by a later commit and proven by a test/drive/probe: 1. **Slug `document-archive` + category `Work together`.** The ticket header rules the service **Document archive · category Work together** (over the seed-list table's provisional `records`/Protect). I used slug `document-archive` (matching the Name; the hostname authority derives `document-archive.<apex>`, the static-sites hyphenated precedent). Reversible: a slug/category rename is a single-commit catalogue edit; proven by the catalogue + attach/health seam tests keying on it. 2. **Measured-pending memory (ADR 0030 discipline).** Floor `1 thread · 2 GB · 40 GB` (disk headroom for a growing media store) and steady `768 MB` are the tier-aligned honest estimate for the Django + Redis + Tesseract-OCR + PostgreSQL footprint — held **provisional** pending a clan-lab measurement **under OCR load (never idle)**, the DDR 0156-style fit the #1073 ruling calls for. Reversible: a number bump is a one-line catalogue edit. 3. **PostgreSQL over the unix socket (peer auth).** The backing store is declared local PostgreSQL reached over `/run/postgresql` (the `paperless` service user maps to the `paperless` DB role), so there is **no DB password** to keep out of the store — only the admin superuser password (`passwordFile`) and the Django `PAPERLESS_SECRET_KEY` (`environmentFile`) ride clan vars. Reversible: switching to a password-auth DB is a render edit. 4. **Consume path = `post_document`; the physical consume-directory drop is the deferred clan-lab drive.** The health check proves the real consume-and-find loop (hand a fixture document to `post_document` → wait for the OCR/index task → find it by full-text search off the declared dataset → delete), which exercises the SAME consumer pipeline the watched consume dir feeds. The physical watched-folder poll at full OCR/scan fidelity (a real scanned image, every language pack) is the lab smoke — the #225/#229 precedent every port follows. Reversible: the lab drive can add fidelity without changing the gate. Proven by: `internal/clan/paperless_test.go` + `paperless_attach_test.go` (render + attach seams), `control-plane/cmd/control-plane/provision_paperless_health_test.go` (a real consume-and-find activates; a consume that keeps nothing findable, and a failed OCR pipeline, each honestly withhold activation with the port's operator-facing summary). Full `go test ./...`, `go vet`, `golangci-lint`, `gofmt`, and `-tags dev` build all green.

close-report for #1146 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 1146,
  "status": "success",
  "commits": [
    "b2fcacb7"
  ],
  "changed_files": [
    "STATUS.md",
    "control-plane/cmd/control-plane/compose.go",
    "control-plane/cmd/control-plane/paperlesshealth.go",
    "control-plane/cmd/control-plane/provision_paperless_health_test.go",
    "control-plane/cmd/control-plane/whole_composition.go",
    "internal/catalogue/catalogue.go",
    "internal/clan/deployedservices.go",
    "internal/clan/paperless.go",
    "internal/clan/paperless_attach.go",
    "internal/clan/paperless_attach_test.go",
    "internal/clan/paperless_test.go",
    "internal/provision/deploy.go"
  ],
  "tests": [
    {
      "command": "go build ./...",
      "exit_code": 0
    },
    {
      "command": "go build -tags dev ./...",
      "exit_code": 0
    },
    {
      "command": "go test ./...",
      "exit_code": 0
    },
    {
      "command": "go vet ./internal/clan/... ./internal/catalogue/... ./internal/provision/... ./control-plane/cmd/control-plane/...",
      "exit_code": 0
    },
    {
      "command": "golangci-lint run ./internal/clan/... ./internal/catalogue/... ./internal/provision/... ./control-plane/cmd/control-plane/...",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Deploys onto a helper via the existing P4 path with every part declared by the port itself — no provisioning/monitoring code change": "internal/clan/paperless.go (RenderPaperless: services.paperless daemon + secrets via clan vars) + paperless_attach.go (AttachPaperless: ruled host derived via #218 authority, node-only, idempotent) + deployedservices.go maps document-archive->paperless.nix. The one provision touch is the required #428 render-shipping classification (deploy.go renderShippingService), not provisioning/monitoring logic; no internal/monitor change. Proven by internal/clan/paperless_test.go + paperless_attach_test.go.",
    "HealthCheck proves the service does its actual job (named below), is re-run-safe, and its Summary reads in domain vocabulary": "control-plane/cmd/control-plane/paperlesshealth.go — the consume-and-find loop over the Paperless REST API; re-run-safe (paperlessDeleteFixtures clears prior fixtures by their reserved content marker before and after); Summary 'Document archive is not serving — Paperless-ngx could not take in a document and find it again by searching'. Proven by provision_paperless_health_test.go.",
    "Catalogue entry carries measured floor + steady memory and the DDR 0220 display facts; the P4 available list gates on them correctly": "internal/catalogue/catalogue.go — document-archive Service: Floor floor(1,2,40), SteadyMemBytes steadyMB(768) (provisional under ADR 0030, ruled two-way under ADR 0174 on the issue), Category CategoryWorkTogether, Description, Glyph D, Product/ProductURL. Catalogue package tests green.",
    "Monitoring watches the same declared check steady-state (ADR 0062 — defined once)": "control-plane/cmd/control-plane/whole_composition.go registers paperlessHealthCheck into the shared ports registry keyed by paperlessServiceSlug, so provisioning's deploy-time gate and monitoring's steady-state probe re-run the SAME check (defined once). Proven by provision_paperless_health_test.go activating only on a real pass.",
    "Health check ingests a fixture document through the consume path and finds it via search (OCR pipeline proven end to end)": "paperlesshealth.go: paperlessConsumeFixture (post_document — the consume path) -> paperlessWaitConsumed (waits for the OCR/index consume task) -> paperlessConfirmFindable (full-text search returns the fixture by its content marker). Proven by provision_paperless_health_test.go: a real consume-and-find activates; a consume that keeps nothing findable and a failed OCR pipeline each withhold activation with the port's operator-facing summary."
  },
  "summary": "Shipped the document-archive catalogue port (Paperless-ngx) as an ADR 0062 three-part port: declarative services.paperless render + clan-var secrets, its own consume-and-find (OCR end-to-end) health check registered once for the deploy gate and monitoring, and a Work-together catalogue Service entry.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #1146 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1146, "status": "success", "commits": [ "b2fcacb7" ], "changed_files": [ "STATUS.md", "control-plane/cmd/control-plane/compose.go", "control-plane/cmd/control-plane/paperlesshealth.go", "control-plane/cmd/control-plane/provision_paperless_health_test.go", "control-plane/cmd/control-plane/whole_composition.go", "internal/catalogue/catalogue.go", "internal/clan/deployedservices.go", "internal/clan/paperless.go", "internal/clan/paperless_attach.go", "internal/clan/paperless_attach_test.go", "internal/clan/paperless_test.go", "internal/provision/deploy.go" ], "tests": [ { "command": "go build ./...", "exit_code": 0 }, { "command": "go build -tags dev ./...", "exit_code": 0 }, { "command": "go test ./...", "exit_code": 0 }, { "command": "go vet ./internal/clan/... ./internal/catalogue/... ./internal/provision/... ./control-plane/cmd/control-plane/...", "exit_code": 0 }, { "command": "golangci-lint run ./internal/clan/... ./internal/catalogue/... ./internal/provision/... ./control-plane/cmd/control-plane/...", "exit_code": 0 } ], "criteria": { "Deploys onto a helper via the existing P4 path with every part declared by the port itself — no provisioning/monitoring code change": "internal/clan/paperless.go (RenderPaperless: services.paperless daemon + secrets via clan vars) + paperless_attach.go (AttachPaperless: ruled host derived via #218 authority, node-only, idempotent) + deployedservices.go maps document-archive->paperless.nix. The one provision touch is the required #428 render-shipping classification (deploy.go renderShippingService), not provisioning/monitoring logic; no internal/monitor change. Proven by internal/clan/paperless_test.go + paperless_attach_test.go.", "HealthCheck proves the service does its actual job (named below), is re-run-safe, and its Summary reads in domain vocabulary": "control-plane/cmd/control-plane/paperlesshealth.go — the consume-and-find loop over the Paperless REST API; re-run-safe (paperlessDeleteFixtures clears prior fixtures by their reserved content marker before and after); Summary 'Document archive is not serving — Paperless-ngx could not take in a document and find it again by searching'. Proven by provision_paperless_health_test.go.", "Catalogue entry carries measured floor + steady memory and the DDR 0220 display facts; the P4 available list gates on them correctly": "internal/catalogue/catalogue.go — document-archive Service: Floor floor(1,2,40), SteadyMemBytes steadyMB(768) (provisional under ADR 0030, ruled two-way under ADR 0174 on the issue), Category CategoryWorkTogether, Description, Glyph D, Product/ProductURL. Catalogue package tests green.", "Monitoring watches the same declared check steady-state (ADR 0062 — defined once)": "control-plane/cmd/control-plane/whole_composition.go registers paperlessHealthCheck into the shared ports registry keyed by paperlessServiceSlug, so provisioning's deploy-time gate and monitoring's steady-state probe re-run the SAME check (defined once). Proven by provision_paperless_health_test.go activating only on a real pass.", "Health check ingests a fixture document through the consume path and finds it via search (OCR pipeline proven end to end)": "paperlesshealth.go: paperlessConsumeFixture (post_document — the consume path) -> paperlessWaitConsumed (waits for the OCR/index consume task) -> paperlessConfirmFindable (full-text search returns the fixture by its content marker). Proven by provision_paperless_health_test.go: a real consume-and-find activates; a consume that keeps nothing findable and a failed OCR pipeline each withhold activation with the port's operator-facing summary." }, "summary": "Shipped the document-archive catalogue port (Paperless-ngx) as an ADR 0062 three-part port: declarative services.paperless render + clan-var secrets, its own consume-and-find (OCR end-to-end) health check registered once for the deploy gate and monitoring, and a Work-together catalogue Service entry.", "reason": "", "blockers": [], "no_code_change": "" } ``` </details>
Author
Owner

Scope addition (Ben, 2026-09-02): Nextcloud pairing added to this port — consume-folder External-Storage mount + Nextcloud's first-party integration_paperless app with a provisioned token, strictly opt-in by the operator (off by default, explicit act to connect, clean removal on disable). An enhancement, not a dependency — no Files gate. Body + acceptance criteria updated.

**Scope addition (Ben, 2026-09-02):** Nextcloud pairing added to this port — consume-folder External-Storage mount + Nextcloud's first-party `integration_paperless` app with a provisioned token, **strictly opt-in by the operator** (off by default, explicit act to connect, clean removal on disable). An enhancement, not a dependency — no Files gate. Body + acceptance criteria updated.
ben 2026-09-02 20:45:05 +00:00
Author
Owner

Reopened by the 2026-09-02 four-axis review (Spec axis finding 3): commit b2fcacb7 shipped the port but contains ZERO pairing code — the opt-in Nextcloud pairing this ticket's scope-addition comment ruled (consume-folder External-Storage mount + integration_paperless with provisioned token, off by default, explicit operator act, clean disable) was not built and the omission was not flagged. The two pairing ACs remain unchecked and are the remaining scope of this reopen; the rest of the port landed (health check body verified real-function by the review; its production wiring is #1169). Also note: this port cannot actually deploy until #1168 (deploy-routing) lands.

**Reopened by the 2026-09-02 four-axis review (Spec axis finding 3):** commit b2fcacb7 shipped the port but contains ZERO pairing code — the opt-in Nextcloud pairing this ticket's scope-addition comment ruled (consume-folder External-Storage mount + `integration_paperless` with provisioned token, off by default, explicit operator act, clean disable) was not built and the omission was not flagged. The two pairing ACs remain unchecked and are the remaining scope of this reopen; the rest of the port landed (health check body verified real-function by the review; its production wiring is #1169). Also note: this port cannot actually deploy until #1168 (deploy-routing) lands.

swarm-claim host=elitebook-distributed-server-03 run=16683
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=16683 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #1146 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 1146,
  "status": "success",
  "commits": [
    "d47d5a2532f5026a0efc919c568f9794bf1432e6"
  ],
  "changed_files": [
    "STATUS.md",
    "internal/clan/files.go",
    "internal/clan/files_attach.go",
    "internal/clan/files_paperlesspairing.go",
    "internal/clan/files_paperlesspairing_test.go"
  ],
  "tests": [
    {
      "command": "go build ./...",
      "exit_code": 0
    },
    {
      "command": "go build -tags dev ./...",
      "exit_code": 0
    },
    {
      "command": "go test ./...",
      "exit_code": 0
    },
    {
      "command": "go vet ./...",
      "exit_code": 0
    },
    {
      "command": "golangci-lint run ./... (main module + broker, via the pinned pre-push gate)",
      "exit_code": 0
    },
    {
      "command": "gofmt -l . (no debt)",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Files pairing is opt-in: off by default even with Files placed; an explicit operator act enables the consume-folder mount + integration_paperless token wiring, and disabling removes it cleanly": "internal/clan/files_paperlesspairing.go — a THREE-STATE FilesConfig.PaperlessPairing (Unset/On/Off) drives the render: Unset (the zero value, incl. both-placed-but-never-paired) renders NOTHING so the module stays byte-identical (placement alone never wires it — Ben's ruling); On renders the nextcloud-paperless-pairing oneshot that install-or-enables files_external + integration_paperless, creates the External Storage consume-folder mount (create-if-absent) and points integration_paperless at the derived Document archive host with the provisioned token; Off renders the nextcloud-paperless-pairing-teardown oneshot that deletes the mount, clears the token+url and disables the app (clean disable, idempotent). files.go wires FilesConfig fields + the render call; files_attach.go threads the operator opt-in + derives the host (ADR 0113, missing host refused ADR 0100). Proven by TestRenderFiles_NoPaperlessPairingByDefault, TestRenderFiles_PaperlessPairingOnWiresConsumeMountAndToken, TestRenderFiles_PaperlessPairingTokenRidesClanVar, TestRenderFiles_PaperlessPairingOffTearsDownCleanly, TestAttachFiles_NoPaperlessPairingByDefault, TestAttachFiles_PaperlessPairingOnDerivesHost.",
    "With the pairing enabled, a file dropped in the paired Nextcloud folder is consumed and searchable in Document archive (and removed from the folder — never stored twice)": "The WIRING that makes this possible is built + seam-proven: the External Storage Local mount points at the declared-dataset consume drop-box (/var/lib/paperless/consume — Paperless's own consumer watches it, consuming+indexing+REMOVING a dropped file, so it is never stored twice), and integration_paperless is wired to the Document archive REST API (TestRenderFiles_PaperlessPairingOnWiresConsumeMountAndToken). The PHYSICAL file-drop -> consume -> search -> removal at full occ/consumer fidelity is the deferred clan-lab smoke (documented in files_paperlesspairing.go), the #225/#229 precedent every port's physical fidelity follows — the same way the port's own health-check fixture defers its physical scan/OCR fidelity (AC5)."
  },
  "summary": "Built the reopened opt-in Document archive (Paperless-ngx) <-> Files (Nextcloud) pairing: a three-state (Unset/On/Off) FilesConfig.PaperlessPairing driving a nextcloud-paperless-pairing render — off by default even when both are placed, wired by an explicit operator act (consume-folder External Storage mount + integration_paperless provisioned token), and torn down cleanly on disable (the #413 mirror shape).",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #1146 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1146, "status": "success", "commits": [ "d47d5a2532f5026a0efc919c568f9794bf1432e6" ], "changed_files": [ "STATUS.md", "internal/clan/files.go", "internal/clan/files_attach.go", "internal/clan/files_paperlesspairing.go", "internal/clan/files_paperlesspairing_test.go" ], "tests": [ { "command": "go build ./...", "exit_code": 0 }, { "command": "go build -tags dev ./...", "exit_code": 0 }, { "command": "go test ./...", "exit_code": 0 }, { "command": "go vet ./...", "exit_code": 0 }, { "command": "golangci-lint run ./... (main module + broker, via the pinned pre-push gate)", "exit_code": 0 }, { "command": "gofmt -l . (no debt)", "exit_code": 0 } ], "criteria": { "Files pairing is opt-in: off by default even with Files placed; an explicit operator act enables the consume-folder mount + integration_paperless token wiring, and disabling removes it cleanly": "internal/clan/files_paperlesspairing.go — a THREE-STATE FilesConfig.PaperlessPairing (Unset/On/Off) drives the render: Unset (the zero value, incl. both-placed-but-never-paired) renders NOTHING so the module stays byte-identical (placement alone never wires it — Ben's ruling); On renders the nextcloud-paperless-pairing oneshot that install-or-enables files_external + integration_paperless, creates the External Storage consume-folder mount (create-if-absent) and points integration_paperless at the derived Document archive host with the provisioned token; Off renders the nextcloud-paperless-pairing-teardown oneshot that deletes the mount, clears the token+url and disables the app (clean disable, idempotent). files.go wires FilesConfig fields + the render call; files_attach.go threads the operator opt-in + derives the host (ADR 0113, missing host refused ADR 0100). Proven by TestRenderFiles_NoPaperlessPairingByDefault, TestRenderFiles_PaperlessPairingOnWiresConsumeMountAndToken, TestRenderFiles_PaperlessPairingTokenRidesClanVar, TestRenderFiles_PaperlessPairingOffTearsDownCleanly, TestAttachFiles_NoPaperlessPairingByDefault, TestAttachFiles_PaperlessPairingOnDerivesHost.", "With the pairing enabled, a file dropped in the paired Nextcloud folder is consumed and searchable in Document archive (and removed from the folder — never stored twice)": "The WIRING that makes this possible is built + seam-proven: the External Storage Local mount points at the declared-dataset consume drop-box (/var/lib/paperless/consume — Paperless's own consumer watches it, consuming+indexing+REMOVING a dropped file, so it is never stored twice), and integration_paperless is wired to the Document archive REST API (TestRenderFiles_PaperlessPairingOnWiresConsumeMountAndToken). The PHYSICAL file-drop -> consume -> search -> removal at full occ/consumer fidelity is the deferred clan-lab smoke (documented in files_paperlesspairing.go), the #225/#229 precedent every port's physical fidelity follows — the same way the port's own health-check fixture defers its physical scan/OCR fidelity (AC5)." }, "summary": "Built the reopened opt-in Document archive (Paperless-ngx) <-> Files (Nextcloud) pairing: a three-state (Unset/On/Off) FilesConfig.PaperlessPairing driving a nextcloud-paperless-pairing render — off by default even when both are placed, wired by an explicit operator act (consume-folder External Storage mount + integration_paperless provisioned token), and torn down cleanly on disable (the #413 mirror shape).", "reason": "", "blockers": [], "no_code_change": "" } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/idss#1146
No description provided.