backups: community-data export has no sealed packer — the second Take-a-copy download 501s until ADR 0104 multi-dataset packing + a log archive land #1457

Closed
opened 2026-09-12 19:38:01 +00:00 by matou-build-agent · 3 comments

Parent

Split out of #1429 (the two Take-a-copy exports get a packer). #1429 shipped stack-config live (the secret-free blueprint) and wired the stackExport seam in production; community-data is the deferred half. See ADR 0242 (the two bundle shapes) for the contract.

What exists

  • internal/stackexport packs stack-config and refuses community-data loud (ErrCommunityDataUnavailable → POST /export/community-data / GET /export/community-data/manifest 501; the dialog reads the sentence out as its download-failed state, AC3 of #1429).
  • The backup engine (ADR 0104) packages one locally-readable dataset snapshot at a time today (internal/backupexport.Store, Identity on the gateway). There is no multi-dataset "pack everything sealed" archiver, no remote-node snapshot packaging, and no log-archive primitive (/logs/download/{scope} serves bounded JSON lines, not a byte blob).

What community-data must be (ADR 0242, Ben's ruling)

The community's CONTENT — files, each service's DB dump, and the operation logs — sealed with the same offsite-grade (age) encryption the backup engine's copies use (ADR 0104). Shipping it unsealed would put member content in plaintext in a browser download (a security-posture decision, not made implicitly).

What to do

  1. A multi-dataset sealed packer behind the stackexport (or backup-engine) seam: per dataset, a fresh snapshot → age-seal with the dataset's crown-jewel key → tar beside the service DB dumps and a log archive, served by the same TTL handle /exports/{ref} already serves.
  2. Wire it into the whole composition (crown-jewel keys are available only there — wholeBackupPorts, not the resting one).
  3. Replace the community-data refusal in internal/stackexport with the real manifest + pack; flip the controlapi 501 to a real 200.
  4. A log-archive primitive (or a bounded, honest subset) for the operation logs half.

Acceptance

  • Download community data on a founded community streams a sealed tar whose contents match the manifest, part for part.
  • The archive is encrypted with the same story the offsite copies use — a rebuild reads it with the community's keys and age, no unsealed member content anywhere.
  • A dataset whose snapshot can't be reached refuses cleanly (named reason), never a partial/fake archive (ADR 0100).
## Parent Split out of #1429 (the two Take-a-copy exports get a packer). #1429 shipped `stack-config` live (the secret-free blueprint) and wired the `stackExport` seam in production; `community-data` is the deferred half. See **ADR 0242** (the two bundle shapes) for the contract. ## What exists - `internal/stackexport` packs `stack-config` and **refuses `community-data` loud** (`ErrCommunityDataUnavailable` → `POST /export/community-data` / `GET /export/community-data/manifest` 501; the dialog reads the sentence out as its download-failed state, AC3 of #1429). - The backup engine (ADR 0104) packages **one locally-readable dataset snapshot at a time** today (`internal/backupexport.Store`, Identity on the gateway). There is **no** multi-dataset "pack everything sealed" archiver, no remote-node snapshot packaging, and **no log-archive primitive** (`/logs/download/{scope}` serves bounded JSON lines, not a byte blob). ## What community-data must be (ADR 0242, Ben's ruling) The community's CONTENT — files, each service's DB dump, and the operation logs — **sealed with the same offsite-grade (age) encryption the backup engine's copies use** (ADR 0104). Shipping it unsealed would put member content in plaintext in a browser download (a security-posture decision, not made implicitly). ## What to do 1. A multi-dataset sealed packer behind the `stackexport` (or backup-engine) seam: per dataset, a fresh snapshot → age-seal with the dataset's crown-jewel key → tar beside the service DB dumps and a log archive, served by the same TTL handle `/exports/{ref}` already serves. 2. Wire it into the whole composition (crown-jewel keys are available only there — `wholeBackupPorts`, not the resting one). 3. Replace the `community-data` refusal in `internal/stackexport` with the real manifest + pack; flip the controlapi 501 to a real 200. 4. A log-archive primitive (or a bounded, honest subset) for the operation logs half. ## Acceptance - [ ] Download community data on a founded community streams a sealed tar whose contents match the manifest, part for part. - [ ] The archive is encrypted with the same story the offsite copies use — a rebuild reads it with the community's keys and `age`, no unsealed member content anywhere. - [ ] A dataset whose snapshot can't be reached refuses cleanly (named reason), never a partial/fake archive (ADR 0100).
Author
Member

This was generated by AI during triage.

Ruled by agent under ADR 0174 — veto anytime.

Ruling: category enhancement + state ready-for-agent.

Triage checks.

  • Redundancy: not implemented. internal/stackexport ships stack-config live and refuses community-data loud (ErrCommunityDataUnavailable → 501), and internal/backupexport.Store packages one locally-readable dataset snapshot at a time — there is no multi-dataset sealed archiver and no log-archive primitive. This ticket is the deferred half of #1429, correctly split.
  • Design gate: the contract is settled — ADR 0242 records the two bundle shapes and Ben's ruling that community-data is sealed content; ADR 0104 defines the offsite-grade (age) sealing to reuse; the dialog's download-failed state already exists. No missing flow/wireframe/seam → not needs-design.
  • Human gate / one-way door: the only security-posture call — ship member content sealed, never plaintext in a browser download — was already made by Ben in ADR 0242. Implementing that ruling is not itself a posture widening; shipping unsealed would be, and the ticket forbids it. No human residue.

Why a two-way door: an additive packer behind the existing stackexport/backup-engine seam, wired only in the whole composition (where crown-jewel keys live), flipping a 501 to a real 200 — revertible by commit, and a revert simply restores today's honest refusal.

What proves it: the three acceptance criteria are all test-provable — a sealed tar whose contents match the manifest part-for-part, a rebuild that reads it with the community's keys + age (no unsealed member content anywhere), and a clean named-reason refusal when a dataset snapshot can't be reached (ADR 0100).

The log-archive primitive choice (full blob vs. a bounded honest subset) is itself a two-way door for the implementer — start with the honest subset if the byte-blob primitive is a larger slice, and note it on the ticket.

> *This was generated by AI during triage.* **Ruled by agent under ADR 0174 — veto anytime.** **Ruling:** category `enhancement` + state `ready-for-agent`. **Triage checks.** - *Redundancy:* not implemented. `internal/stackexport` ships `stack-config` live and **refuses `community-data` loud** (`ErrCommunityDataUnavailable` → 501), and `internal/backupexport.Store` packages one locally-readable dataset snapshot at a time — there is no multi-dataset sealed archiver and no log-archive primitive. This ticket is the deferred half of #1429, correctly split. - *Design gate:* the contract is settled — **ADR 0242** records the two bundle shapes and Ben's ruling that `community-data` is sealed content; ADR 0104 defines the offsite-grade (age) sealing to reuse; the dialog's download-failed state already exists. No missing flow/wireframe/seam → not `needs-design`. - *Human gate / one-way door:* the only security-posture call — *ship member content sealed, never plaintext in a browser download* — was **already made by Ben in ADR 0242**. Implementing that ruling is not itself a posture widening; shipping unsealed would be, and the ticket forbids it. No human residue. **Why a two-way door:** an additive packer behind the existing `stackexport`/backup-engine seam, wired only in the whole composition (where crown-jewel keys live), flipping a 501 to a real 200 — revertible by commit, and a revert simply restores today's honest refusal. **What proves it:** the three acceptance criteria are all test-provable — a sealed tar whose contents match the manifest part-for-part, a rebuild that reads it with the community's keys + `age` (no unsealed member content anywhere), and a clean named-reason refusal when a dataset snapshot can't be reached (ADR 0100). The log-archive primitive choice (full blob vs. a bounded honest subset) is itself a two-way door for the implementer — start with the honest subset if the byte-blob primitive is a larger slice, and note it on the ticket.
Author
Member

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

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

close-report for #1457 — status success

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

envelope
{
  "issue": 1457,
  "status": "success",
  "commits": [
    "5cb65318"
  ],
  "changed_files": [
    "STATUS.md",
    "control-plane/cmd/control-plane/backup_wiring.go",
    "control-plane/cmd/control-plane/community_data_wiring_test.go",
    "control-plane/cmd/control-plane/stack_wiring.go",
    "control-plane/cmd/control-plane/whole_composition.go",
    "docs/adr/0242-take-it-with-you-bundles-stack-config-is-a-secret-free-blueprint-community-data-is-sealed-content.md",
    "internal/backupengine/backupengine.go",
    "internal/oplog/oplog.go",
    "internal/stackexport/communitydata.go",
    "internal/stackexport/communitydata_realseal_test.go",
    "internal/stackexport/communitydata_test.go",
    "internal/stackexport/store.go"
  ],
  "tests": [
    {
      "command": "go build ./...",
      "exit_code": 0
    },
    {
      "command": "go vet ./internal/stackexport/ ./internal/oplog/ ./internal/backupengine/ ./control-plane/cmd/control-plane/",
      "exit_code": 0
    },
    {
      "command": "go test ./internal/stackexport/ ./internal/oplog/ ./internal/backupengine/ ./internal/backup/ ./internal/controlapi/ ./internal/wireconvention/ ./control-plane/cmd/control-plane/",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Download community data on a founded community streams a sealed tar whose contents match the manifest, part for part": "internal/stackexport/communitydata.go packs the sealed multi-dataset tar (data/<id>.sealed + logs.sealed + self-describing manifest.json + rebuild.md); TestPackage_CommunityData_SealedTarMatchesManifestPartForPart (internal/stackexport/communitydata_test.go) asserts every manifest part maps to a tar entry with matching sizes and no orphan sealed files; TestCommunityDataWiring_WholeStatesSealedManifest (control-plane/cmd/control-plane/community_data_wiring_test.go) proves the whole composition states the sealed manifest live (the controlapi 501->200 flip).",
    "The archive is encrypted with the same story the offsite copies use — a rebuild reads it with the community's keys and age, no unsealed member content anywhere": "The composition seals each dataset with backup.Seal under backup.KeyRefFor(id) — the SAME seal backupengine movement/offsite copies use (ADR 0104/0082 §4) — in control-plane/cmd/control-plane/stack_wiring.go (newCommunityData). TestPackage_CommunityData_SealedWithTheOffsiteStoryAndOpensWithCommunityKey (internal/stackexport/communitydata_realseal_test.go) seals via real backup.Seal + a fake CrownJewelKeys and reads each part back with backup.Open, asserting no unsealed member content anywhere in the archive; TestPackage_CommunityData_NoUnsealedMemberContentAndOpensWithTheKey adds the seam-level opacity proof.",
    "A dataset whose snapshot can't be reached refuses cleanly (named reason), never a partial/fake archive (ADR 0100)": "packCommunityData assembles the tar in memory and returns a named error (naming the dataset + reason) before writing anything if SealDataset errors; TestPackage_CommunityData_UnreachableDatasetRefusesCleanly asserts the refusal names the dataset and reason and the export dir holds no partial artifact."
  },
  "summary": "community-data is now a sealed multi-dataset packer wired live in the whole composition — every dataset's content sealed under its crown-jewel key beside a sealed operation-log archive — replacing the honest 501 refusal.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #1457 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1457, "status": "success", "commits": [ "5cb65318" ], "changed_files": [ "STATUS.md", "control-plane/cmd/control-plane/backup_wiring.go", "control-plane/cmd/control-plane/community_data_wiring_test.go", "control-plane/cmd/control-plane/stack_wiring.go", "control-plane/cmd/control-plane/whole_composition.go", "docs/adr/0242-take-it-with-you-bundles-stack-config-is-a-secret-free-blueprint-community-data-is-sealed-content.md", "internal/backupengine/backupengine.go", "internal/oplog/oplog.go", "internal/stackexport/communitydata.go", "internal/stackexport/communitydata_realseal_test.go", "internal/stackexport/communitydata_test.go", "internal/stackexport/store.go" ], "tests": [ { "command": "go build ./...", "exit_code": 0 }, { "command": "go vet ./internal/stackexport/ ./internal/oplog/ ./internal/backupengine/ ./control-plane/cmd/control-plane/", "exit_code": 0 }, { "command": "go test ./internal/stackexport/ ./internal/oplog/ ./internal/backupengine/ ./internal/backup/ ./internal/controlapi/ ./internal/wireconvention/ ./control-plane/cmd/control-plane/", "exit_code": 0 } ], "criteria": { "Download community data on a founded community streams a sealed tar whose contents match the manifest, part for part": "internal/stackexport/communitydata.go packs the sealed multi-dataset tar (data/<id>.sealed + logs.sealed + self-describing manifest.json + rebuild.md); TestPackage_CommunityData_SealedTarMatchesManifestPartForPart (internal/stackexport/communitydata_test.go) asserts every manifest part maps to a tar entry with matching sizes and no orphan sealed files; TestCommunityDataWiring_WholeStatesSealedManifest (control-plane/cmd/control-plane/community_data_wiring_test.go) proves the whole composition states the sealed manifest live (the controlapi 501->200 flip).", "The archive is encrypted with the same story the offsite copies use — a rebuild reads it with the community's keys and age, no unsealed member content anywhere": "The composition seals each dataset with backup.Seal under backup.KeyRefFor(id) — the SAME seal backupengine movement/offsite copies use (ADR 0104/0082 §4) — in control-plane/cmd/control-plane/stack_wiring.go (newCommunityData). TestPackage_CommunityData_SealedWithTheOffsiteStoryAndOpensWithCommunityKey (internal/stackexport/communitydata_realseal_test.go) seals via real backup.Seal + a fake CrownJewelKeys and reads each part back with backup.Open, asserting no unsealed member content anywhere in the archive; TestPackage_CommunityData_NoUnsealedMemberContentAndOpensWithTheKey adds the seam-level opacity proof.", "A dataset whose snapshot can't be reached refuses cleanly (named reason), never a partial/fake archive (ADR 0100)": "packCommunityData assembles the tar in memory and returns a named error (naming the dataset + reason) before writing anything if SealDataset errors; TestPackage_CommunityData_UnreachableDatasetRefusesCleanly asserts the refusal names the dataset and reason and the export dir holds no partial artifact." }, "summary": "community-data is now a sealed multi-dataset packer wired live in the whole composition — every dataset's content sealed under its crown-jewel key beside a sealed operation-log archive — replacing the honest 501 refusal.", "reason": "", "blockers": [], "no_code_change": "" } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#1457
No description provided.