TenantAtlas/specs/016-backup-version-reuse/spec.md
Ahmed Darrazi 1145e45fb9 feat: always capture policy when adding to backup
Admin-first: always run orchestrated capture when adding policies to a backup set so backups reflect current Intune state. Still avoids redundant PolicyVersion growth via orchestrator snapshot-hash reuse. Adds feature tests and updates spec/plan/tasks.
2026-01-02 15:32:00 +01:00

30 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Feature Specification: Backup Version Reuse (016)
**Feature Branch**: `016-backup-version-reuse`
**Created**: 2026-01-02
**Status**: Draft
## User Scenarios & Testing
### User Story 1 — Avoid unnecessary version growth (Priority: P1)
As an admin, I want adding policies to a backup set to reuse an existing recent policy version when safe, so backups dont create redundant versions and operations stay fast.
**Acceptance Scenarios**
1. Given a policy already has an identical captured snapshot, when I add it to a backup set, then the backup item links to the existing version (no new version is created).
2. Given a policy has no suitable version, when I add it to a backup set, then a new version is captured and linked.
## Requirements
### Functional Requirements
- **FR-001**: Adding policies to a backup set SHOULD avoid creating redundant `PolicyVersion` records by reusing an existing version when the captured snapshot is unchanged.
- **FR-002**: If reuse is not safe/possible, the system MUST capture a new `PolicyVersion` as it does today.
- **FR-003**: Reuse MUST respect capture options:
- If assignments are requested, the reused version must include assignments.
- If scope tags are requested, the reused version must include scope tags.
- **FR-005**: Adding a policy to a backup set MUST capture from Intune to ensure the backup reflects the current state.
- **FR-004**: Behavior changes MUST be covered by automated tests.
## Success Criteria
- **SC-001**: Backups avoid creating redundant policy versions in the common case.
- **SC-002**: Backup correctness is preserved (no missing required data for restore/preview).