Skip to content

Phase 1/9: Freeze the immutable job identity contract and migration fixture matrix #471

Description

@borg-codex-bot

Parent: #447

Delivery branch: codex/issue-447-immutable-job-ids

Delivery model: This phase is committed to the shared #447 integration branch and the single draft pull request against main. It is not merged or released independently.

Objective

Freeze the target identity contract and create a representative, sanitized migration fixture matrix before any migration is allowed to modify user data.

Issue #447 touches every job-dependent subsystem. The implementation must start from explicit invariants and reproducible legacy states rather than adapting the schema while write logic is already active.

Scope

Canonical contract

Document and test the final rules for:

  • UUIDv4 job_id generation, validation, uniqueness and immutability;
  • <job_id>.json canonical metadata filenames;
  • editable name, explicit complete archive_prefixes[0], one current repository_key and bounded legacy_job_keys;
  • removal of Type ID, backup_type, location and mutable job_key as active identity;
  • historical descriptor snapshots that remain readable but are never foreign keys;
  • archive-prefix history within the current repository;
  • duplicate, import, merge, configuration restore and deletion identity behavior;
  • classification of unassigned legacy history without guessing.

Dependency inventory

Turn the inventory in #447 into a code-level checklist that names the active readers and writers for:

  • job metadata and discovery;
  • repository assignments;
  • schedules and cron;
  • runtime state, locks, cancellation and recovery;
  • statuses, logs and weekly snapshots;
  • notifications and reminder state;
  • dashboard and external widgets;
  • History and Reports;
  • Browse and Restore, restore runs and restore history;
  • restore-test policy, scheduling, results and proof;
  • import/export, settings backup/restore, support bundles, health checks and deletion.

Every current job_key, backup_type or filename-derived join must have an owner phase and target behavior.

Fixture matrix

Create sanitized fixtures and expected outcomes for at least:

  • a fresh installation with no jobs;
  • one normal legacy job;
  • multiple jobs across different storage types and repositories;
  • jobs with and without archive_prefixes;
  • a job whose Type ID was changed from config to pfsense, leaving config_local schedules, status and reports behind;
  • renamed jobs and archive prefixes;
  • disabled schedules and overdue state;
  • restore-test results and restore history;
  • archived and orphaned status records;
  • ambiguous aliases and conflicting active references;
  • incomplete or corrupt JSON files;
  • an interrupted migration with an already journaled UUID mapping;
  • production-derived edge cases only after all secrets and personal data are removed.

Each fixture must state whether migration is not_applicable, applicable, blocked, or expected to succeed, and must define the exact post-migration invariants.

Deliverables

  • Maintainer-facing identity and migration contract documentation.
  • A complete dependency ownership checklist mapped to phases 2-9.
  • Sanitized version-controlled fixtures with expected results.
  • Reusable assertions for referential integrity and legacy classification.
  • Explicit resolution of contradictions found between current code and Introduce immutable job IDs across all job-dependent data and workflows #447 before implementation continues.

Tests

  • Fixture schema validation.
  • Duplicate UUID and alias detection.
  • Archive-prefix normalization expectations.
  • Expected classification of every fixture.
  • Confirmation that fixture data contains no secrets or production-identifying values.

Test-channel policy

Do not build or publish a test-channel version in this phase. There is no safe user-testable migration or complete application flow yet. Verification is limited to documentation review, fixture validation and local automated tests.

Acceptance criteria

  • The target schema and identity invariants are unambiguous.
  • Every known mutable-key dependency is assigned to a later phase.
  • The support-reported Type ID change failure is represented by a regression fixture.
  • Successful, ambiguous, invalid and interrupted migration states have expected outcomes.
  • No production data is modified and no migration is registered for startup execution.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area::workflowRepository workflow, issues, PRs, and release processimpact::internalInternal-only change without direct user impactpriority::1-criticalHighest priority; address firstrelease-note::noNo user-facing release note neededtype::maintenanceMaintenance, cleanup, build, or tooling

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions