feat: add GSD Memory cross-project knowledge system
Implements MCP server for semantic search across GSD projects: MCP Tools: - gsd_memory_search: Search across all registered projects - gsd_memory_decisions: Find decisions from SUMMARY/PROJECT.md - gsd_memory_patterns: Find patterns from SUMMARY.md - gsd_memory_pitfalls: Find pitfalls from RESEARCH.md - gsd_memory_stack: Find tech stack entries - gsd_memory_register: Register project with memory - gsd_memory_index: Trigger indexing/update - gsd_memory_status: Show system status Architecture: - QMD wrapper with grep fallback when QMD unavailable - YAML frontmatter extractors for GSD document types - Project registry at ~/.gsd/projects.json - Auto-install via bin/install.js for Claude Code Workflow integrations: - new-project: Registers project with memory - plan-phase: Indexes after planning - execute-phase: Indexes after execution - complete-milestone: Indexes milestone completion - Researcher agents query memory before Context7 Tests: 117 passing (66 unit + 51 integration) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
121
gsd-memory/tests/fixtures/sample-summary.md
vendored
Normal file
121
gsd-memory/tests/fixtures/sample-summary.md
vendored
Normal file
@@ -0,0 +1,121 @@
|
||||
---
|
||||
phase: 01-foundation
|
||||
plan: 01
|
||||
subsystem: auth
|
||||
tags: [jwt, jose, prisma, bcrypt]
|
||||
|
||||
requires:
|
||||
- phase: none
|
||||
provides: greenfield project
|
||||
|
||||
provides:
|
||||
- User model with email/password authentication
|
||||
- JWT access/refresh token system
|
||||
- Protected API middleware
|
||||
|
||||
affects: [02-features, 03-dashboard]
|
||||
|
||||
tech-stack:
|
||||
added:
|
||||
- jose: 5.2.0
|
||||
- bcrypt: 5.1.1
|
||||
- prisma: 5.10.0
|
||||
patterns:
|
||||
- httpOnly cookies for tokens
|
||||
- refresh token rotation
|
||||
|
||||
key-files:
|
||||
created:
|
||||
- src/lib/auth.ts
|
||||
- src/middleware.ts
|
||||
- prisma/schema.prisma
|
||||
modified:
|
||||
- package.json
|
||||
|
||||
key-decisions:
|
||||
- "Used jose instead of jsonwebtoken for ESM and Edge compatibility"
|
||||
- "15-min access tokens, 7-day refresh tokens for security/UX balance"
|
||||
- "Database-stored refresh tokens enable revocation"
|
||||
|
||||
patterns-established:
|
||||
- "Token rotation: every refresh request issues new refresh token"
|
||||
- "Protected routes: middleware checks JWT before handler"
|
||||
- "Password hashing: bcrypt with 10 salt rounds"
|
||||
|
||||
duration: 28min
|
||||
completed: 2025-01-15
|
||||
---
|
||||
|
||||
# Phase 1: Foundation Summary
|
||||
|
||||
**JWT auth with refresh rotation using jose library, Prisma User model, and protected API middleware**
|
||||
|
||||
## Performance
|
||||
|
||||
- **Duration:** 28 min
|
||||
- **Started:** 2025-01-15T14:22:10Z
|
||||
- **Completed:** 2025-01-15T14:50:33Z
|
||||
- **Tasks:** 5
|
||||
- **Files modified:** 8
|
||||
|
||||
## Accomplishments
|
||||
- User model with email/password auth
|
||||
- Login/logout endpoints with httpOnly JWT cookies
|
||||
- Protected route middleware checking token validity
|
||||
- Refresh token rotation on each request
|
||||
|
||||
## Task Commits
|
||||
|
||||
Each task was committed atomically:
|
||||
|
||||
1. **Task 1: Create User model** - `abc123f` (feat)
|
||||
2. **Task 2: Login endpoint** - `def456g` (feat)
|
||||
3. **Task 3: Logout endpoint** - `hij789k` (feat)
|
||||
4. **Task 4: JWT helpers** - `lmn012o` (feat)
|
||||
5. **Task 5: Protected middleware** - `pqr345s` (feat)
|
||||
|
||||
**Plan metadata:** `tuv678w` (docs: complete plan)
|
||||
|
||||
## Files Created/Modified
|
||||
- `prisma/schema.prisma` - User and Session models
|
||||
- `src/app/api/auth/login/route.ts` - Login endpoint
|
||||
- `src/app/api/auth/logout/route.ts` - Logout endpoint
|
||||
- `src/middleware.ts` - Protected route checks
|
||||
- `src/lib/auth.ts` - JWT helpers using jose
|
||||
|
||||
## Decisions Made
|
||||
- Used jose instead of jsonwebtoken (ESM-native, Edge-compatible)
|
||||
- 15-min access tokens with 7-day refresh tokens
|
||||
- Storing refresh tokens in database for revocation capability
|
||||
|
||||
## Deviations from Plan
|
||||
|
||||
### Auto-fixed Issues
|
||||
|
||||
**1. [Rule 2 - Missing Critical] Added password hashing with bcrypt**
|
||||
- **Found during:** Task 2 (Login endpoint implementation)
|
||||
- **Issue:** Plan didn't specify password hashing - storing plaintext would be critical security flaw
|
||||
- **Fix:** Added bcrypt hashing on registration, comparison on login with salt rounds 10
|
||||
- **Files modified:** src/app/api/auth/login/route.ts, src/lib/auth.ts
|
||||
- **Verification:** Password hash test passes, plaintext never stored
|
||||
- **Committed in:** abc123f (Task 2 commit)
|
||||
|
||||
---
|
||||
|
||||
**Total deviations:** 1 auto-fixed (1 missing critical)
|
||||
**Impact on plan:** Auto-fix essential for security. No scope creep.
|
||||
|
||||
## Issues Encountered
|
||||
- jsonwebtoken CommonJS import failed in Edge runtime - switched to jose (planned library change, worked as expected)
|
||||
|
||||
## User Setup Required
|
||||
|
||||
None - no external service configuration required.
|
||||
|
||||
## Next Phase Readiness
|
||||
- Auth foundation complete, ready for feature development
|
||||
- User registration endpoint needed before public launch
|
||||
|
||||
---
|
||||
*Phase: 01-foundation*
|
||||
*Completed: 2025-01-15*
|
||||
Reference in New Issue
Block a user