Skip to content

Phase 3/9: Introduce canonical ID-based job metadata and replace Type ID in the wizard #473

Description

@borg-codex-bot

Parent: #447

Depends on: Phases 1/9 and 2/9

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

Implement the canonical ID-based job model and the target wizard experience while preserving the frozen migration contract. Type ID must disappear from the new canonical user model and be replaced by an explicit complete archive prefix.

Canonical job metadata

Introduce the target metadata contract:

  • generated immutable UUIDv4 job_id;
  • metadata filename <job_id>.json;
  • editable display name;
  • one current repository_key;
  • ordered, de-duplicated archive_prefixes with the current complete prefix first;
  • bounded legacy_job_keys only for migration and compatibility resolution;
  • all existing job-owned operational settings preserved.

Rules:

  • creating a job generates a new ID exactly once;
  • editing a job always retains the ID;
  • duplicating a job always creates a new ID;
  • no new canonical job stores job_key, Type ID, backup_type or location as identity;
  • location is resolved from the selected repository/storage context;
  • a missing ID is never silently generated while merely reading active migrated metadata.

Wizard changes

Replace the current fields with:

Job name
Archive prefix
Repository

The job ID remains internal and non-editable.

The wizard must:

  • show the complete exact archive prefix;
  • never append a hidden -backup suffix;
  • show an exact archive-name preview including the timestamp pattern;
  • offer a safe editable suggestion for new jobs;
  • retain the previous prefix in archive_prefixes when the current prefix changes;
  • explain that old prefixes remain available only in the currently assigned repository;
  • preserve the repository-change confirmation owned by Warn and require confirmation before changing a job repository #452;
  • preserve all unrelated job settings on name or prefix edits;
  • use German and English text throughout.

Archive-prefix contract

  • archive_prefixes[0] is used for new archives.
  • Remaining entries are previous complete prefixes used by restore and retention scoping.
  • Prefixes remain readable and never contain the UUID merely for identity.
  • Validation must prevent invalid Borg archive names and argument injection.
  • Existing valid prefix order must be preserved during migration normalization.

Compatibility boundary

Legacy job parsing may exist only in explicit migration or boundary adapters. New UI requests and new metadata must use job_id. Do not introduce permanent dual-write behavior.

Tests

  • create, edit, rename, prefix change and duplicate operations;
  • immutable ID retention across every edit;
  • safe prefix validation and exact preview;
  • no hidden suffix;
  • preservation and de-duplication of previous prefixes;
  • repository/location changes without identity changes;
  • preservation of all job settings;
  • German and English wizard rendering;
  • legacy fixtures can be converted into the target metadata model without activating startup migration.

Test-channel policy

Do not publish a test-channel version yet. The wizard and metadata model are not useful or safe on a real installation until schedules, runtime, status readers and all dependent stores use the new identity.

Acceptance criteria

  • New target-model jobs have one immutable UUID and an ID-named metadata file.
  • Type ID is absent from the new wizard and canonical active model.
  • The exact user-visible prefix creates the exact archive prefix.
  • Edits cannot change the job ID or create a second logical job.
  • Previous archive prefixes are retained correctly.
  • Existing job settings remain intact in target-model tests.

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::wizardJob wizard and guided job creationimpact::user-visibleVisible effect for plugin userspriority::1-criticalHighest priority; address firstrelease-note::yesInclude in user-facing release notestype::featureNew user-facing or plugin feature

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions