This document tracks the ongoing effort to produce comprehensive product requirements and test specifications following the component system audits. The goal is to formalize existing behaviors, map tests to requirements, and identify coverage gaps across all major subsystems.
Started: January 2026
Approach: Audit-first methodology - review component audits, then create formal requirements specs and test specifications with traceability matrices.
| Area | Requirements Doc | Test Spec | Status |
|---|---|---|---|
| Data Shape Handling | requirements/data-shape-requirements.md |
test-specs/shape-handling-tests.md |
Complete |
| API v1 Compatibility | requirements/api-v1-compatibility-requirements.md |
(integrated) | Complete |
| Authorization/Security | requirements/authorization-security-requirements.md |
test-specs/authorization-tests.md |
Complete |
| Treatments Schema | data-schemas/treatments-schema.md |
N/A | Complete |
| Profiles Schema | data-schemas/profiles-schema.md |
N/A | Complete |
These audits provide the foundation for requirements extraction:
| Audit Document | Subsystem | Req/Test Status |
|---|---|---|
architecture-overview.md |
System-wide | Reference only |
security-audit.md |
Auth, brute-force, JWT | Extracted to specs |
api-layer-audit.md |
REST v1/v2/v3, WebSocket | Partial (v1 done, v3 needed) |
data-layer-audit.md |
MongoDB, collections, sync | Shape handling extracted |
realtime-systems-audit.md |
Socket.IO, event bus | Not started |
plugin-architecture-audit.md |
38 plugins, Pebble | Not started |
dashboard-ui-audit.md |
Client bundle, D3/jQuery | Not started (may defer) |
messaging-subsystem-audit.md |
Pushover, IFTTT, notifications | Not started |
modernization-roadmap.md |
Tech debt, refactoring | Reference only |
| Area | Why Important | Estimated Effort | Blocking Issues |
|---|---|---|---|
| API v3 Security | Distinct auth model from v1/v2, health data access | Medium | Need to review lib/api3/security.js |
| WebSocket Auth | Real-time data streams need auth coverage | Medium | Identified as coverage gap |
| Core Calculations (IOB/COB) | Critical for diabetes management decisions | High | Complex algorithms, requires domain expertise |
| Area | Why Important | Estimated Effort | Blocking Issues |
|---|---|---|---|
| Plugin System | 38 plugins, extensibility foundation | High | Large surface area |
| Real-time Event Bus | Data synchronization between components | Medium | Need to trace event flows |
| Notification/Messaging | Alerts for dangerous glucose levels | Medium | Multiple providers |
| Area | Why Important | Estimated Effort | Blocking Issues |
|---|---|---|---|
| Dashboard UI | User-facing but may be rewritten | Low (defer) | Testing Modernization Proposal suggests UI rewrite |
| Report Plugins | Secondary to real-time monitoring | Low | Depends on plugin system work |
| Pebble Integration | Legacy smartwatch support | Very Low | Pebble discontinued |
-
Start with code, not assumptions - Every requirement must cite a source file and line number.
-
Separate requirements from implementation details - Requirements state "what" and "why"; implementation notes explain "how" the code does it.
-
Test ID conventions - Using prefixed IDs (SEC-001, HASH-002, etc.) makes traceability matrices scannable and enables automated coverage checks.
-
Coverage gaps are as valuable as coverage - Documenting what's NOT tested is critical for security audits and prioritization.
-
Each area tracks its own progress - Technical discoveries and coverage gaps are documented in the relevant test spec, not centrally. See
test-specs/coverage-gaps.mdfor aggregated view.
- Architect reviews catch accuracy issues - Multiple review cycles improved documentation accuracy significantly
- Traceability matrices expose gaps visually - Easy to spot "Not Covered" in a table
- Quirks/Barriers sections prevent future frustration - Document the weird stuff so others don't rediscover it
-
IOB/COB algorithm correctness - Are the calculation algorithms clinically validated? What are acceptable error bounds?
-
Alarm threshold safety margins - What are the clinical requirements for glucose alarm thresholds? Are current defaults evidence-based?
-
Plugin interaction edge cases - When multiple plugins modify the same data, what's the expected precedence?
-
API v3 vs v1/v2 long-term - Should v1/v2 be deprecated? What's the migration timeline?
-
Rate limiting addition - Security audit identified missing general rate limiting. Priority?
-
OIDC/OAuth2 integration - Modernization roadmap mentions this. Does it supersede current auth model?
-
Schema registration for controllers - AAPS, Loop, xDrip use different sync identity fields. Should controllers register their schema conventions?
-
Socket.IO namespace isolation - Do
/storageand/alarmproperly isolate data by authorization level? -
MongoDB transaction support - With MongoDB 5.x, should multi-document writes use transactions?
-
Event bus memory leaks - Are there cleanup mechanisms for event subscriptions on disconnect?
Welcome! If you're picking up this documentation effort, here's how to get started:
- Read the audits first - The
docs/*-audit.mdfiles provide system understanding before diving into specs - Pick from the priority queue - Tier 1 items are most impactful
- Follow the established pattern:
- Create
docs/requirements/<area>-requirements.mdfor formal requirements - Create
docs/test-specs/<area>-tests.mdfor test mappings - Update this progress document when done
- Create
Requirements documents should include:
- Purpose and scope
- Terminology (be precise, cite code)
- Numbered requirements with IDs (REQ-XXX-NNN format)
- Implementation references (file:line)
- Security considerations
Test specifications should include:
- Progress & Coverage Status section at top (current state, recent discoveries, priority gaps)
- Existing test inventory with unique IDs
- Test case descriptions with expected behavior
- Requirement traceability matrix
- Discovered quirks and barriers
lib/authorization/index.js- Main auth entry pointlib/server/env.js- Environment/configuration loadinglib/server/bootevent.js- Server initialization sequencelib/plugins/index.js- Plugin loading systemtests/*.test.js- Existing test suite
This effort is documentation-only. Do not:
- Modify source code (log bugs separately)
- Add new tests (document gaps for future work)
- Refactor existing tests (conflicts with testing modernization proposal)
- Update
replit.mdwith significant general discoveries - Add findings to relevant test spec's Progress section
- Note any blocking issues in the priority queue
Good luck, and thank you for contributing!
| Date | Author | Changes |
|---|---|---|
| 2026-01-18 | Agent | Reorganized: moved technical discoveries to individual test specs, standardized file naming |
| 2026-01-15 | Agent | Initial document, completed auth/security specs |
| 2026-01-15 | Agent | Added lessons learned, open questions, priority queue |
| 2026-01-15 | Agent | Added data-schemas/treatments-schema.md and profiles-schema.md from domain expert interview |