Archiving Workflow
The archiving workflow is the final step in Spectr’s change management process. After your implementation is deployed, you archive the change and update the master specifications.
When to Archive
Section titled “When to Archive”Archive a change when:
- ✅ Implementation is complete and tested
- ✅ All tasks in
tasks.mdare finished - ✅ Changes are merged to main/master
- ✅ Features are deployed to production
Archiving a Change
Section titled “Archiving a Change”1. Prepare Your Implementation
Section titled “1. Prepare Your Implementation”Ensure all work is complete:
# Verify all tasks are donecat spectr/changes/<change-id>/tasks.md
# Example - all tasks should be checked:# - [x] 1.1 Task completed# - [x] 1.2 Task completed# - [x] 2.1 Task completed2. Archive the Change
Section titled “2. Archive the Change”Use the archive command:
# Interactive mode - choose optionsspectr archive <change-id>
# Non-interactive modespectr archive <change-id> --yesFor tooling-only changes (no spec updates needed):
spectr archive <change-id> --skip-specs --yes3. What Gets Archived
Section titled “3. What Gets Archived”The archiver automatically:
- Moves
changes/<change-id>/tochanges/archive/YYYY-MM-DD-<change-id>/ - Merges spec deltas into
specs/(the source of truth) - Updates requirement content, adds new requirements, removes deprecated ones
- Validates all changes
Archive Workflow Steps
Section titled “Archive Workflow Steps”Step 1: Review Your Change
Section titled “Step 1: Review Your Change”Before archiving, verify:
# See what's in your changespectr view <change-id> --json
# Validate the change passes strict checksspectr validate <change-id> --strictStep 2: Run Archive
Section titled “Step 2: Run Archive”spectr archive add-two-factor-auth --yesThis:
- Moves the change directory to archive
- Processes all spec deltas
- Merges into
specs/(master specs) - Updates requirements with new/modified/removed items
Step 3: Verify Results
Section titled “Step 3: Verify Results”Check that specs were updated correctly:
# View the updated speccat spectr/specs/auth/spec.md
# Validate all specs passspectr validate --strictStep 4: Commit Changes
Section titled “Step 4: Commit Changes”Commit the archived change and updated specs:
git add spectr/git commit -m "Archive: add-two-factor-auth
- Move change proposal to archive- Update auth spec with 2FA requirements- Update notifications spec with OTP delivery"Understanding Spec Merging
Section titled “Understanding Spec Merging”When you archive, deltas are merged into master specs. Here’s what happens:
ADDED Requirements
Section titled “ADDED Requirements”# Delta## ADDED Requirements### Requirement: Two-Factor AuthenticationThe system SHALL support OTP-based 2FA....
# Result# specs/auth/spec.md now contains:### Requirement: Two-Factor AuthenticationThe system SHALL support OTP-based 2FA....MODIFIED Requirements
Section titled “MODIFIED Requirements”# Delta## MODIFIED Requirements### Requirement: User AuthenticationUsers SHALL provide credentials and OTP....
# Result# The entire requirement is replaced with the modified versionREMOVED Requirements
Section titled “REMOVED Requirements”# Delta## REMOVED Requirements### Requirement: Deprecated Legacy Login**Reason**: Replaced by OAuth**Migration**: Use OAuth flow instead
# Result# The requirement is removed from specs/Example: Complete Archiving
Section titled “Example: Complete Archiving”Before Archiving
Section titled “Before Archiving”spectr/├── changes/│ └── add-2fa/│ ├── proposal.md│ ├── tasks.md # All [x] checked│ └── specs/│ ├── auth/spec.md│ └── notifications/spec.md└── specs/ ├── auth/spec.md # Current auth requirements └── notifications/spec.mdArchive Command
Section titled “Archive Command”spectr archive add-2fa --yesAfter Archiving
Section titled “After Archiving”spectr/├── changes/│ └── archive/│ └── 2025-01-15-add-2fa/│ ├── proposal.md│ ├── tasks.md│ └── specs/│ ├── auth/spec.md│ └── notifications/spec.md└── specs/ ├── auth/spec.md # Now includes 2FA requirements └── notifications/spec.md # Now includes OTP notificationsTroubleshooting Archive Issues
Section titled “Troubleshooting Archive Issues”Issue: Requirement not found when archiving
Section titled “Issue: Requirement not found when archiving”Problem: You modified a requirement that doesn’t exist in the current spec.
Solution: Check the requirement name matches exactly:
# View current spec requirementsspectr view auth --json | jq '.requirements[].title'
# Verify your modified requirement name matchesIssue: Validation fails after archive
Section titled “Issue: Validation fails after archive”Problem: The merged specs have validation errors.
Solution:
# See validation errorsspectr validate --strict
# Check the archived spec for issuescat spectr/specs/auth/spec.md
# Fix manually if neededIssue: Archive didn’t move directory
Section titled “Issue: Archive didn’t move directory”Problem: Change directory wasn’t archived.
Solution: Check if archive succeeded:
# Should existls spectr/changes/archive/2025-01-15-add-2fa/
# Should not existls spectr/changes/add-2fa/ # Should failSpecial Cases
Section titled “Special Cases”Tooling-Only Changes
Section titled “Tooling-Only Changes”For changes that don’t affect specs (e.g., CI/CD, infrastructure):
spectr archive <change-id> --skip-specs --yesThis archives the change without attempting to merge specs.
Multi-Spec Changes
Section titled “Multi-Spec Changes”If your change modified multiple specs, the archiver handles all of them:
spectr/changes/add-webhook-auth/└── specs/ ├── auth/spec.md # Auth changes ├── api-design/spec.md # API changes └── webhooks/spec.md # Webhook changesAll three are merged into their respective specs/ files automatically.
Checklist: Before Archiving
Section titled “Checklist: Before Archiving”- All tasks marked complete in
tasks.md - Implementation merged to main
- All tests passing
- No validation errors:
spectr validate <change-id> --strict - Changes deployed to production
- Team notified of new features
Checklist: After Archiving
Section titled “Checklist: After Archiving”- Change moved to
changes/archive/ - Specs updated in
specs/ - No validation errors:
spectr validate --strict - All changes committed to git
- Team can reference new spec in future changes
Next Steps
Section titled “Next Steps”After archiving:
- Use updated specs - Future changes reference the new requirements
- Plan next changes - Create new change proposals as needed
- Monitor deployment - Ensure features work as specified
Key Concepts
Section titled “Key Concepts”Why Archive?
Section titled “Why Archive?”- Auditing: Track what changes were made and when
- Context: See the reasoning in proposals
- Evolution: Understand how requirements evolved
- Rollback: Recover change details if needed
Master Spec as Truth
Section titled “Master Spec as Truth”After archiving, the specs/ directory is the source of truth. Older specs are replaced with merged updates from the change.