Skip to content

feat: define complete backup contract#10

Merged
J3m5 merged 2 commits into
mainfrom
feat/complete-backup-contract
Jul 20, 2026
Merged

feat: define complete backup contract#10
J3m5 merged 2 commits into
mainfrom
feat/complete-backup-contract

Conversation

@J3m5

@J3m5 J3m5 commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • define dedicated versioned types for layout, backup metadata, scoped manifests and retention
  • parse and serialize canonical UTF-8 JSON with strict versions, fields and duplicate-key rejection
  • cross-validate backup.json, manifest.json and POSIX pax gzip archives
  • validate bounded persisted identifiers and reject overlapping targets within the complete-backup contract
  • classify legacy namespace paths without touching remote state
  • add a reproducible two-scope golden bundle with binary, remote-only and empty-directory entries

Safety boundary

This PR does not perform SSH, create remote state, or change apply, rollback, the CLI, or the Action. Existing configurations remain accepted by the current engine; overlapping targets are rejected only when entering the future complete-backup contract. The public format documentation states that the mutable engine does not use this format yet.

Validation

  • mise run fix, twice after final changes
  • 182 unit tests passed on each final run
  • 16 SSH E2E scenarios passed on GNU tar 1.34
  • 16 SSH E2E scenarios passed on GNU tar 1.35
  • 16 PEX SSH E2E scenarios passed on GNU tar 1.35
  • Ruff, Pyrefly, actionlint, action-validator and zizmor passed
  • fixture regeneration produced no diff

Follow-up

PR 2.2 will introduce the static remote executor against this contract.

J3m5 added 2 commits July 20, 2026 17:15
# Why

Stabilize a generic, versioned and directly restorable backup format before replacing the mutable transaction engine or introducing new remote writes.

# What changed

- add dedicated complete-backup types, strict canonical JSON parsers and cross-validation for metadata, manifests and tar archives
- validate persisted identifiers and reject ambiguous scope ownership in version 2 configuration
- add deterministic retention and legacy namespace classification helpers
- cover the contract with a reproducible two-scope golden bundle and negative regression tests
- document the format as implemented but not yet connected to apply or rollback
# Why

PR 2.1 must reject ambiguous ownership for the future complete-backup contract without changing which configurations the existing mutable and read-only engines can parse.

# What changed

- move overlapping-target validation from global config parsing to complete-backup scope digest calculation
- keep immediate bounded validation for the persisted baseline identifier
- add a contract-level overlap regression while preserving the existing root-plus-nested E2E fixture
- verify both qualified GNU tar suites and the released-shape PEX E2E flow
@J3m5
J3m5 merged commit 7ee815a into main Jul 20, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant