Skip to content

Commit 56f5b36

Browse files
committed
Archive completed OpenSpec changes: integrity protocol and navigation sidebar
Archive add-integrity-protocol and add-navigation-sidebar changes to 2025-12-19 archive directories, as both features are now fully implemented and merged into base specs. Update affected base specs (commitment, task, integrity, tui-chat, tui-nav, etc.) to reflect the integrated capabilities.
1 parent bf2a899 commit 56f5b36

File tree

27 files changed

+823
-410
lines changed

27 files changed

+823
-410
lines changed

openspec/changes/add-integrity-protocol/design.md renamed to openspec/changes/archive/2025-12-19-add-integrity-protocol/design.md

File renamed without changes.

openspec/changes/add-integrity-protocol/proposal.md renamed to openspec/changes/archive/2025-12-19-add-integrity-protocol/proposal.md

File renamed without changes.

openspec/changes/add-integrity-protocol/specs/commitment/spec.md renamed to openspec/changes/archive/2025-12-19-add-integrity-protocol/specs/commitment/spec.md

File renamed without changes.

openspec/changes/add-integrity-protocol/specs/integrity/spec.md renamed to openspec/changes/archive/2025-12-19-add-integrity-protocol/specs/integrity/spec.md

File renamed without changes.

openspec/changes/add-integrity-protocol/specs/task/spec.md renamed to openspec/changes/archive/2025-12-19-add-integrity-protocol/specs/task/spec.md

File renamed without changes.

openspec/changes/add-integrity-protocol/specs/tui-chat/spec.md renamed to openspec/changes/archive/2025-12-19-add-integrity-protocol/specs/tui-chat/spec.md

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -164,24 +164,4 @@ The system SHALL provide access to integrity features through NavSidebar.
164164
- **WHEN** user is viewing a commitment in DataPanel and types `/atrisk`
165165
- **THEN** the at-risk workflow begins for that commitment
166166

167-
## REMOVED Requirements
168167

169-
### Requirement: Legacy Letter-Key Integrity Shortcut
170-
171-
**Reason**: Letter-key shortcuts are replaced by NavSidebar navigation per `add-navigation-sidebar` change.
172-
173-
#### Scenario: Quick access integrity via 'i' key (REMOVED)
174-
- **WHEN** user presses 'i' on home screen
175-
- **THEN** the integrity dashboard is displayed in the data panel
176-
177-
**Migration**: Use NavSidebar selection "Integrity" or press number key '7'.
178-
179-
### Requirement: Legacy Footer Shortcuts
180-
181-
**Reason**: Footer letter shortcuts are replaced by NavSidebar per `add-navigation-sidebar` change.
182-
183-
#### Scenario: Home screen footer includes i:integrity (REMOVED)
184-
- **WHEN** viewing home screen
185-
- **THEN** footer includes: i:integrity alongside existing shortcuts
186-
187-
**Migration**: Integrity is accessible via NavSidebar; footer shows context-appropriate bindings only.

openspec/changes/add-integrity-protocol/tasks.md renamed to openspec/changes/archive/2025-12-19-add-integrity-protocol/tasks.md

Lines changed: 63 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ This task list tracks implementation status for the integrity protocol.
124124
### 8.1-8.2 At-Risk Styling
125125
- [x] DataPanel has INTEGRITY, CLEANUP, ATRISK_WORKFLOW modes
126126
- [x] Rendering methods for each new mode
127-
- [ ] At-risk commitment shows warning color in lists (deferred)
128-
- [ ] Notification task shows distinct icon (deferred)
127+
- [x] At-risk commitment shows warning color in lists (CSS class `.status-at_risk`)
128+
- [x] Notification task shows distinct icon (🔔)
129129

130130
## Phase 9: Integration Tests
131131
- [x] Integration tests for integrity dashboard flows
@@ -134,19 +134,20 @@ This task list tracks implementation status for the integrity protocol.
134134
- [x] Integration tests for ChatScreen integrity features
135135
- [x] Integration tests for HomeScreen integrity features
136136

137-
## Phase 10: Snapshot Tests (Deferred)
138-
- [ ] Snapshot: Integrity dashboard
139-
- [ ] Snapshot: Commitment list with at_risk items
140-
- [ ] Snapshot: CleanupPlan view
137+
## Phase 10: Snapshot Tests
138+
- [x] Snapshot: Integrity dashboard (A- and C- grade scenarios)
139+
- [x] Snapshot: Commitment list with at_risk items
140+
- [x] Snapshot: CleanupPlan view
141141

142142
## Summary
143143

144144
**Implemented**:
145-
- Core models (CommitmentStatus.AT_RISK, CleanupPlan, IntegrityMetrics)
146-
- IntegrityService (mark_at_risk, calculate_metrics, detect_risks)
147-
- Commands (/atrisk, /cleanup, /integrity)
148-
- TUI integration (HomeScreen grade, ChatScreen risk detection, DataPanel modes)
149-
- Full test coverage
145+
- Core models (CommitmentStatus.AT_RISK, CleanupPlan, IntegrityMetrics with TrendDirection)
146+
- IntegrityService (mark_at_risk, calculate_metrics, detect_risks, recover_commitment, get_affecting_commitments, calculate_metrics_with_trends)
147+
- Commands (/atrisk, /cleanup, /integrity, /abandon, /recover)
148+
- TUI integration (HomeScreen grade, ChatScreen risk detection, DataPanel modes with trends and affecting commitments)
149+
- Full test coverage including snapshot tests
150+
- Visual indicators for at-risk status and notification tasks
150151

151152
## Running Tests
152153

@@ -217,89 +218,75 @@ The following items are deferred to future iterations. Each is tracked here with
217218
- [x] If mark at-risk, user can type 'atrisk' to redirect to /atrisk flow
218219
- [x] Tests added to verify prompt behavior
219220

220-
### D5: Visual Indicators for At-Risk Status
221-
**Current**: No visual distinction in lists
222-
**Target**: Warning color for at-risk commitments, distinct icon for notification tasks
221+
### D5: Visual Indicators for At-Risk Status ✅ COMPLETED
222+
**Status**: Already implemented in DataPanel
223223

224224
**Implementation**:
225-
- [ ] Add CSS class `.commitment-at-risk` with warning color (yellow/orange)
226-
- [ ] Update commitment list rendering to apply class based on status
227-
- [ ] Add notification task icon (e.g., 📢 or ⚠️) in task list
228-
- [ ] Sort commitment lists: overdue > at_risk > pending > in_progress
225+
- [x] CSS class `.status-at_risk` with warning color (yellow/bold) in `DataPanel.DEFAULT_CSS`
226+
- [x] CSS class `.notification-task` with warning color for notification tasks
227+
- [x] Status icons including ⚠ for at-risk and 🔔 for notification tasks in `_render_list_item()`
228+
- [x] `_sort_items_by_priority()` sorts: at_risk > in_progress > pending > completed > abandoned
229229

230-
**Effort**: Small (1-2 hours)
231-
**Priority**: Low - Polish/UX improvement
232-
233-
### D6: Metric Trends
234-
**Current**: Not implemented
235-
**Target**: Show improving/stable/declining indicators for each metric
230+
### D6: Metric Trends ✅ COMPLETED
231+
**Status**: Implemented in `IntegrityService` and `DataPanel`
236232

237233
**Implementation**:
238-
- [ ] Store previous period metrics (could use session cache or simple comparison)
239-
- [ ] Calculate delta for each metric vs previous period
240-
- [ ] Add trend indicator to IntegrityMetrics dataclass
241-
- [ ] Display ↑/→/↓ in integrity dashboard
242-
243-
**Effort**: Medium (2-3 hours)
244-
**Priority**: Low - Nice-to-have analytics
245-
246-
### D7: Commitments Affecting Score
247-
**Current**: Not implemented
248-
**Target**: List recent commitments that negatively impacted score
234+
- [x] Added `TrendDirection` enum (UP, DOWN, STABLE) to `IntegrityMetrics`
235+
- [x] Added trend fields to `IntegrityMetrics`: on_time_trend, notification_trend, cleanup_trend, overall_trend
236+
- [x] Implemented `calculate_integrity_metrics_with_trends()` method
237+
- [x] Added `_calculate_period_on_time_rate()`, `_calculate_period_cleanup_rate()`, `_calculate_period_notification_timeliness()` for period-based calculations
238+
- [x] Added `_determine_trend()` helper with 5% threshold
239+
- [x] Updated `DataPanel._render_integrity()` to display trend indicators (↑/→/↓)
240+
- [x] Added 8 unit tests in `tests/unit/integrity/test_service.py`
241+
- [x] Added 7 unit tests in `tests/unit/models/test_integrity_metrics.py`
242+
243+
### D7: Commitments Affecting Score ✅ COMPLETED
244+
**Status**: Implemented in `IntegrityService` and `DataPanel`
249245

250246
**Implementation**:
251-
- [ ] Query commitments where: completed_on_time=False OR status=abandoned
252-
- [ ] Filter to recent (last 30 days)
253-
- [ ] Include in integrity dashboard response
254-
- [ ] Render as list in DataPanel integrity mode
255-
256-
**Effort**: Small (1-2 hours)
257-
**Priority**: Low - Helps user understand score
247+
- [x] Added `AffectingCommitment` dataclass with commitment and reason fields
248+
- [x] Implemented `get_affecting_commitments()` method in `IntegrityService`
249+
- [x] Query late completions (completed_on_time=False) from last 30 days
250+
- [x] Query abandoned commitments from last 30 days
251+
- [x] Limit to 5 most recent affecting commitments
252+
- [x] Updated `IntegrityHandler._show_dashboard()` to include affecting commitments
253+
- [x] Added `_render_affecting_commitments()` method to DataPanel
254+
- [x] Added 6 unit tests in `tests/unit/integrity/test_service.py`
258255

259-
### D8: Recovery Flow (at_risk → in_progress)
260-
**Current**: No handling when commitment recovers from at_risk
261-
**Target**: Cancel CleanupPlan and prompt about notification task when recovering
256+
### D8: Recovery Flow (at_risk → in_progress) ✅ COMPLETED
257+
**Status**: Implemented in `IntegrityService` and `RecoverHandler`
262258

263259
**Implementation**:
264-
- [ ] Add /recover command or status change handler
265-
- [ ] When commitment status changes at_risk → in_progress:
266-
- Set CleanupPlan.status = CANCELLED
267-
- Prompt user: "Do you still need to notify [stakeholder], or has the situation resolved?"
268-
- If resolved: Mark notification task as skipped with reason "Situation resolved"
269-
- If still need to notify: Keep task active
270-
- [ ] Update IntegrityService with recover_commitment() method
271-
- [ ] Add tests for recovery flow
272-
273-
**Effort**: Medium (2-3 hours)
274-
**Priority**: Medium - Completes the at-risk lifecycle
275-
276-
### D9: Snapshot Tests
277-
**Current**: No snapshot tests for integrity views
278-
**Target**: Visual regression tests for integrity UI
260+
- [x] Added `/recover` command to parser
261+
- [x] Created `RecoverHandler` class in handlers.py
262+
- [x] Implemented `recover_commitment()` method in `IntegrityService`
263+
- [x] Sets CleanupPlan.status = CANCELLED on recovery
264+
- [x] Prompts about notification task if still pending
265+
- [x] `/recover resolved` skips notification task with reason "Situation resolved"
266+
- [x] Added 9 unit tests for recover_commitment() in `tests/unit/integrity/test_service.py`
267+
- [x] Added 7 unit tests for RecoverHandler in `tests/unit/commands/test_handlers.py`
268+
269+
### D9: Snapshot Tests ✅ COMPLETED
270+
**Status**: Snapshot tests exist in `tests/tui/test_snapshots.py`
279271

280272
**Implementation**:
281-
- [ ] Create snapshot app for integrity dashboard (A+ grade scenario)
282-
- [ ] Create snapshot app for integrity dashboard (C- grade scenario)
283-
- [ ] Create snapshot for commitment list with at_risk items
284-
- [ ] Create snapshot for CleanupPlan view
285-
- [ ] Run `uv run pytest --snapshot-update` to generate baselines
286-
287-
**Effort**: Small (1-2 hours)
288-
**Priority**: Low - Testing infrastructure
273+
- [x] `integrity_dashboard_app.py` - A- grade scenario
274+
- [x] `integrity_dashboard_low_app.py` - C- grade scenario
275+
- [x] `commitment_list_atrisk_app.py` - Commitment list with at-risk items
276+
- [x] `cleanup_plan_app.py` - CleanupPlan view
277+
- [x] All 13 snapshot tests passing
289278

290279
---
291280

292281
### Deferred Work Priority Order
293282

294-
**Completed**:
283+
**All Completed**:
295284
1.**D1: Notification Timeliness** - Implemented
296285
2.**D2: Reliability Streak** - Implemented
297286
3.**D3: Soft Enforcement** - Implemented
298287
4.**D4: Pre-Abandon Prompt** - Implemented
299-
300-
**Remaining**:
301-
1. **D8: Recovery Flow** - Medium, completes at-risk lifecycle
302-
2. **D5: Visual Indicators** - Low, polish
303-
3. **D6: Metric Trends** - Low, analytics
304-
4. **D7: Affecting Commitments** - Low, debugging aid
305-
5. **D9: Snapshot Tests** - Low, infrastructure
288+
5.**D5: Visual Indicators** - Implemented (was already done)
289+
6.**D6: Metric Trends** - Implemented
290+
7.**D7: Affecting Commitments** - Implemented
291+
8.**D8: Recovery Flow** - Implemented (was already done)
292+
9.**D9: Snapshot Tests** - Implemented (were already done)

openspec/changes/add-navigation-sidebar/design.md renamed to openspec/changes/archive/2025-12-19-add-navigation-sidebar/design.md

File renamed without changes.

openspec/changes/add-navigation-sidebar/proposal.md renamed to openspec/changes/archive/2025-12-19-add-navigation-sidebar/proposal.md

File renamed without changes.

openspec/changes/add-navigation-sidebar/specs/inbox/spec.md renamed to openspec/changes/archive/2025-12-19-add-navigation-sidebar/specs/inbox/spec.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# inbox Specification Delta
22

3-
## MODIFIED Requirements
3+
## ADDED Requirements
44

55
### Requirement: Triage Workflow
66

0 commit comments

Comments
 (0)