@pdlc-os/pdlc 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/commands/brainstorm.md +360 -0
- package/.claude/commands/build.md +383 -0
- package/.claude/commands/init.md +371 -0
- package/.claude/commands/ship.md +349 -0
- package/.claude/settings.json +40 -0
- package/CLAUDE.md +179 -0
- package/README.md +452 -0
- package/agents/bolt.md +84 -0
- package/agents/echo.md +87 -0
- package/agents/friday.md +83 -0
- package/agents/jarvis.md +87 -0
- package/agents/muse.md +87 -0
- package/agents/neo.md +78 -0
- package/agents/oracle.md +81 -0
- package/agents/phantom.md +85 -0
- package/agents/pulse.md +95 -0
- package/bin/pdlc.js +221 -0
- package/hooks/pdlc-context-monitor.js +129 -0
- package/hooks/pdlc-guardrails.js +307 -0
- package/hooks/pdlc-session-start.sh +73 -0
- package/hooks/pdlc-statusline.js +183 -0
- package/package.json +48 -0
- package/scripts/frame-template.html +332 -0
- package/scripts/helper.js +88 -0
- package/scripts/server.cjs +357 -0
- package/scripts/start-server.sh +173 -0
- package/scripts/stop-server.sh +54 -0
- package/skills/reflect.md +189 -0
- package/skills/repo-scan.md +266 -0
- package/skills/review.md +156 -0
- package/skills/safety-guardrails.md +168 -0
- package/skills/ship.md +148 -0
- package/skills/tdd.md +88 -0
- package/skills/test.md +153 -0
- package/templates/CONSTITUTION.md +254 -0
- package/templates/INTENT.md +120 -0
- package/templates/OVERVIEW.md +93 -0
- package/templates/PRD.md +212 -0
- package/templates/STATE.md +113 -0
- package/templates/episode.md +182 -0
- package/templates/review.md +215 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# State
|
|
2
|
+
<!-- This file is the live operational state of the PDLC workflow.
|
|
3
|
+
It is written by PDLC hooks and commands — do not edit manually unless recovering from an error.
|
|
4
|
+
Claude reads this file at the start of every session to auto-resume from the last checkpoint.
|
|
5
|
+
If this file is missing or empty, PDLC will prompt you to run /pdlc init. -->
|
|
6
|
+
|
|
7
|
+
**Last updated:** <!-- YYYY-MM-DDTHH:MM:SSZ — set automatically by hooks -->
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Current Phase
|
|
12
|
+
|
|
13
|
+
<!-- Valid values: Initialization | Inception | Construction | Operation -->
|
|
14
|
+
|
|
15
|
+
Initialization
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Current Feature
|
|
20
|
+
|
|
21
|
+
<!-- The name of the feature currently being worked on.
|
|
22
|
+
Matches the [feature-name] slug used in file paths under docs/pdlc/.
|
|
23
|
+
Example: user-auth | billing-integration | onboarding-flow
|
|
24
|
+
Set to "none" when between features. -->
|
|
25
|
+
|
|
26
|
+
none
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Active Beads Task
|
|
31
|
+
|
|
32
|
+
<!-- The Beads task currently claimed by Claude.
|
|
33
|
+
Format: [task-id] — [task title]
|
|
34
|
+
Example: bd-a1b2 — Add OAuth2 login with GitHub
|
|
35
|
+
Set to "none" when no task is active. -->
|
|
36
|
+
|
|
37
|
+
none
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Current Sub-phase
|
|
42
|
+
|
|
43
|
+
<!-- The specific sub-phase within the current phase.
|
|
44
|
+
Inception sub-phases: Discover | Define | Design | Plan
|
|
45
|
+
Construction sub-phases: Build | Review | Test
|
|
46
|
+
Operation sub-phases: Ship | Verify | Reflect
|
|
47
|
+
Set to "none" during Initialization or between phases. -->
|
|
48
|
+
|
|
49
|
+
none
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Last Checkpoint
|
|
54
|
+
|
|
55
|
+
<!-- The most recent point where state was explicitly saved.
|
|
56
|
+
Format: [Phase] / [Sub-phase] / [YYYY-MM-DDTHH:MM:SSZ]
|
|
57
|
+
Example: Construction / Build / 2026-04-03T14:32:00Z
|
|
58
|
+
Updated: (a) at every phase/sub-phase transition, (b) on context CRITICAL warning,
|
|
59
|
+
(c) after every Beads task completes. -->
|
|
60
|
+
|
|
61
|
+
Initialization / — / <!-- timestamp -->
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Active Blockers
|
|
66
|
+
|
|
67
|
+
<!-- List anything currently preventing forward progress.
|
|
68
|
+
Each blocker should have: what it is, when it was logged, and who/what needs to resolve it.
|
|
69
|
+
Format: - [YYYY-MM-DD] [description] — waiting on: [person/system]
|
|
70
|
+
Example:
|
|
71
|
+
- [2026-04-03] Supabase project not provisioned — waiting on: human (needs account setup)
|
|
72
|
+
- [2026-04-03] bd-c3d4 has unresolved merge conflict — waiting on: Claude (will resolve next session)
|
|
73
|
+
Clear this list as blockers are resolved. -->
|
|
74
|
+
|
|
75
|
+
<!-- none -->
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Context Checkpoint
|
|
80
|
+
|
|
81
|
+
<!-- Auto-populated by the context monitor hook when context hits CRITICAL (≤25% remaining).
|
|
82
|
+
Records exactly where Claude was so the next session can resume cleanly.
|
|
83
|
+
Do not edit manually.
|
|
84
|
+
|
|
85
|
+
Fields written by hook:
|
|
86
|
+
- active_task: Beads task ID and title at time of save
|
|
87
|
+
- sub_phase: sub-phase in progress
|
|
88
|
+
- work_in_progress: one-sentence summary of what was being done
|
|
89
|
+
- next_action: the exact next step Claude should take on resume
|
|
90
|
+
- files_open: list of files that were being edited
|
|
91
|
+
-->
|
|
92
|
+
|
|
93
|
+
```json
|
|
94
|
+
{
|
|
95
|
+
"triggered_at": null,
|
|
96
|
+
"active_task": null,
|
|
97
|
+
"sub_phase": null,
|
|
98
|
+
"work_in_progress": null,
|
|
99
|
+
"next_action": null,
|
|
100
|
+
"files_open": []
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Phase History
|
|
107
|
+
|
|
108
|
+
<!-- Append a row every time the phase or sub-phase changes.
|
|
109
|
+
Written automatically by hooks. Do not edit manually. -->
|
|
110
|
+
|
|
111
|
+
| Timestamp | Event | Phase | Sub-phase | Feature |
|
|
112
|
+
|-----------|-------|-------|-----------|---------|
|
|
113
|
+
| <!-- YYYY-MM-DDTHH:MM:SSZ --> | init | Initialization | — | none |
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
# Episode [ID]: [Feature Name]
|
|
2
|
+
<!-- Replace [ID] with the zero-padded episode number (e.g. 001) and [Feature Name] with the feature title.
|
|
3
|
+
File naming convention: [ID]_[feature-slug]_[YYYY-MM-DD].md
|
|
4
|
+
This file lives at: docs/pdlc/memory/episodes/[ID]_[feature-slug]_[YYYY-MM-DD].md
|
|
5
|
+
Claude drafts this file at the end of Construction. Human reviews and approves before it is committed.
|
|
6
|
+
After commit, PDLC updates docs/pdlc/memory/OVERVIEW.md and docs/pdlc/memory/episodes/index.md. -->
|
|
7
|
+
|
|
8
|
+
**Episode ID:** <!-- e.g. 001 -->
|
|
9
|
+
**Feature name:** <!-- Human-readable feature name, e.g. "User Auth — GitHub OAuth" -->
|
|
10
|
+
**Feature slug:** <!-- kebab-case slug used in file paths, e.g. user-auth-github-oauth -->
|
|
11
|
+
**Date delivered:** <!-- YYYY-MM-DD — date of merge to main -->
|
|
12
|
+
**Phase delivered in:** Construction
|
|
13
|
+
**Status:** Draft <!-- Change to "Approved" after human sign-off -->
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## What Was Built
|
|
18
|
+
|
|
19
|
+
<!-- A paragraph (3–6 sentences) summarising what was designed, built, and shipped.
|
|
20
|
+
Written by Claude; reviewed and edited by human before commit.
|
|
21
|
+
Should be readable by someone coming to the codebase fresh.
|
|
22
|
+
Example:
|
|
23
|
+
This episode delivered GitHub OAuth login as an alternative authentication method.
|
|
24
|
+
Users can now click "Sign in with GitHub" on the login page, authorize the app via
|
|
25
|
+
the standard OAuth 2.0 PKCE flow, and be redirected to their dashboard — all in under
|
|
26
|
+
3 seconds. New accounts are created automatically on first login; if the GitHub email
|
|
27
|
+
matches an existing account the identities are linked. The implementation uses the
|
|
28
|
+
existing auth session infrastructure from ep-001 and adds a new oauth_accounts join
|
|
29
|
+
table to support multiple identity providers in future episodes. -->
|
|
30
|
+
|
|
31
|
+
<!-- Auto-drafted by Claude at end of Construction. Review and edit as needed. -->
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Links
|
|
36
|
+
|
|
37
|
+
- **PRD:** <!-- [PRD_feature-name_YYYY-MM-DD.md](../../prds/PRD_feature-name_YYYY-MM-DD.md) -->
|
|
38
|
+
- **PR:** <!-- [#42](https://github.com/org/repo/pull/42) -->
|
|
39
|
+
- **Review file:** <!-- [REVIEW_bd-a1b2_YYYY-MM-DD.md](../../reviews/REVIEW_bd-a1b2_YYYY-MM-DD.md) -->
|
|
40
|
+
- **Design docs:** <!-- [ARCHITECTURE.md](../../design/feature-name/ARCHITECTURE.md) | [data-model.md](../../design/feature-name/data-model.md) -->
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Key Decisions & Rationale
|
|
45
|
+
|
|
46
|
+
<!-- Numbered list of significant decisions made during this feature's lifecycle.
|
|
47
|
+
Each entry should explain: what was decided, why, and what was rejected/considered.
|
|
48
|
+
These feed into docs/pdlc/memory/DECISIONS.md (ADR log).
|
|
49
|
+
Example:
|
|
50
|
+
1. Used PKCE flow instead of implicit flow for OAuth — PKCE is the current best practice
|
|
51
|
+
for public clients; implicit flow is deprecated in OAuth 2.1. Rejected server-side
|
|
52
|
+
flow because it adds complexity without benefit at current scale.
|
|
53
|
+
2. Stored OAuth access tokens encrypted at rest, not in plaintext — Phantom flagged
|
|
54
|
+
plaintext storage as a Tier 1 security risk. AES-256-GCM encryption added with
|
|
55
|
+
key managed via environment variable.
|
|
56
|
+
3. Did not implement account unlinking in this episode — out of scope per PRD.
|
|
57
|
+
Deferred to ep-004. Tech debt ticket: td-007.
|
|
58
|
+
-->
|
|
59
|
+
|
|
60
|
+
1.
|
|
61
|
+
2.
|
|
62
|
+
3.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Files Created
|
|
67
|
+
|
|
68
|
+
<!-- List every new file added in this feature's branch that was merged.
|
|
69
|
+
Format: - `path/from/project/root` — one-line description of the file's purpose
|
|
70
|
+
Example:
|
|
71
|
+
- `src/lib/auth/github-oauth.ts` — GitHub OAuth PKCE flow implementation
|
|
72
|
+
- `src/app/api/auth/github/route.ts` — API route handler for OAuth callback
|
|
73
|
+
- `src/app/api/auth/github/callback/route.ts` — redirect target after GitHub authorization
|
|
74
|
+
- `db/migrations/0003_add_oauth_accounts.sql` — adds oauth_accounts table
|
|
75
|
+
- `src/components/auth/GitHubLoginButton.tsx` — "Sign in with GitHub" button component
|
|
76
|
+
- `tests/unit/auth/github-oauth.test.ts` — unit tests for OAuth flow helpers
|
|
77
|
+
- `tests/e2e/auth/github-login.spec.ts` — E2E test for full OAuth login journey
|
|
78
|
+
-->
|
|
79
|
+
|
|
80
|
+
-
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Files Modified
|
|
85
|
+
|
|
86
|
+
<!-- List every pre-existing file changed in this feature's branch.
|
|
87
|
+
Format: - `path/from/project/root` — one-line description of what changed and why
|
|
88
|
+
Example:
|
|
89
|
+
- `src/lib/auth/session.ts` — extended session type to include oauth_provider field
|
|
90
|
+
- `src/app/(auth)/login/page.tsx` — added GitHub login button below email form
|
|
91
|
+
- `src/middleware.ts` — added /auth/github/* to public routes list
|
|
92
|
+
- `db/schema.ts` — added oauth_accounts table definition to Drizzle schema
|
|
93
|
+
- `docs/pdlc/memory/OVERVIEW.md` — updated active functionality and shipped features
|
|
94
|
+
-->
|
|
95
|
+
|
|
96
|
+
-
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Test Summary
|
|
101
|
+
|
|
102
|
+
<!-- Filled in by Claude from the Test sub-phase results. Edit if numbers are wrong. -->
|
|
103
|
+
|
|
104
|
+
| Layer | Status | Passed | Failed | Skipped | Notes |
|
|
105
|
+
|-------|--------|--------|--------|---------|-------|
|
|
106
|
+
| Unit | <!-- pass / fail / skip --> | <!-- n --> | <!-- n --> | <!-- n --> | <!-- e.g. all core logic covered --> |
|
|
107
|
+
| Integration | <!-- pass / fail / skip --> | <!-- n --> | <!-- n --> | <!-- n --> | <!-- e.g. DB interactions verified --> |
|
|
108
|
+
| E2E | <!-- pass / fail / skip --> | <!-- n --> | <!-- n --> | <!-- n --> | <!-- e.g. full login journey via Chromium --> |
|
|
109
|
+
| Performance | <!-- pass / fail / skip --> | <!-- — --> | <!-- — --> | <!-- — --> | <!-- e.g. OAuth round-trip p95 = 1.2s --> |
|
|
110
|
+
| Accessibility | <!-- pass / fail / skip --> | <!-- — --> | <!-- — --> | <!-- — --> | <!-- e.g. WCAG 2.1 AA — 0 violations --> |
|
|
111
|
+
| Visual Regression | <!-- pass / fail / skip --> | <!-- — --> | <!-- — --> | <!-- — --> | <!-- e.g. login page diff approved --> |
|
|
112
|
+
|
|
113
|
+
**Constitution gates:** <!-- All required gates passed / [list any that failed and how resolved] -->
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Known Tradeoffs & Tech Debt Introduced
|
|
118
|
+
|
|
119
|
+
<!-- Honest record of shortcuts taken, things deferred, or imperfections knowingly accepted.
|
|
120
|
+
Each item will be tracked in docs/pdlc/memory/OVERVIEW.md under "Known Tech Debt".
|
|
121
|
+
Format: - [TD-nnn] Description — why accepted — planned resolution (if known)
|
|
122
|
+
Example:
|
|
123
|
+
- [TD-012] Access tokens encrypted with a single app-wide key instead of per-user keys
|
|
124
|
+
— accepted for v1 simplicity; move to per-user key derivation before SOC 2 audit
|
|
125
|
+
- [TD-013] No rate limiting on /api/auth/github/callback — deferred until after launch;
|
|
126
|
+
add before scaling past 1k users
|
|
127
|
+
- [TD-014] GitHub avatar URL stored as-is (external URL) — should proxy/cache before launch
|
|
128
|
+
to avoid broken images if GitHub changes URL structure
|
|
129
|
+
-->
|
|
130
|
+
|
|
131
|
+
<!-- None. -->
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## Agent Team
|
|
136
|
+
|
|
137
|
+
<!-- List all agents that participated in this feature's delivery.
|
|
138
|
+
Always-on agents are pre-filled. Remove any that did not participate.
|
|
139
|
+
Add auto-selected agents (Bolt, Friday, Muse, Oracle, Pulse) that were activated. -->
|
|
140
|
+
|
|
141
|
+
**Always-on:**
|
|
142
|
+
- **Neo** (Architect) — architecture review and PRD conformance
|
|
143
|
+
- **Echo** (QA Engineer) — test strategy and coverage review
|
|
144
|
+
- **Phantom** (Security Reviewer) — OWASP and auth security review
|
|
145
|
+
- **Jarvis** (Tech Writer) — inline docs, API docs, episode draft
|
|
146
|
+
|
|
147
|
+
**Auto-selected for this feature:**
|
|
148
|
+
- <!-- **Bolt** (Backend Engineer) — API routes, business logic, DB migrations -->
|
|
149
|
+
- <!-- **Friday** (Frontend Engineer) — UI components, state management -->
|
|
150
|
+
- <!-- **Muse** (UX Designer) — interaction design, accessibility -->
|
|
151
|
+
- <!-- **Oracle** (PM) — requirements clarity, acceptance criteria -->
|
|
152
|
+
- <!-- **Pulse** (DevOps) — CI/CD, deployment, environment config -->
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## Reflect Notes
|
|
157
|
+
|
|
158
|
+
<!-- Retro observations generated by Claude during the Reflect sub-phase.
|
|
159
|
+
Covers: what went well, what broke, what to improve, and metrics snapshot.
|
|
160
|
+
Auto-drafted by Claude; human edits before commit. -->
|
|
161
|
+
|
|
162
|
+
**What went well:**
|
|
163
|
+
<!-- Auto-drafted by Claude -->
|
|
164
|
+
|
|
165
|
+
**What broke or slowed us down:**
|
|
166
|
+
<!-- Auto-drafted by Claude -->
|
|
167
|
+
|
|
168
|
+
**What to improve next time:**
|
|
169
|
+
<!-- Auto-drafted by Claude -->
|
|
170
|
+
|
|
171
|
+
**Cycle time:** <!-- e.g. Inception to merge: 3 days -->
|
|
172
|
+
**Test pass rate:** <!-- e.g. 94% (48/51 tests passed; 3 skipped) -->
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## Approval
|
|
177
|
+
|
|
178
|
+
<!-- Do not commit this episode file until a human has reviewed and approved it. -->
|
|
179
|
+
|
|
180
|
+
**Reviewed by:** <!-- Name / initials -->
|
|
181
|
+
**Date approved:** <!-- YYYY-MM-DD -->
|
|
182
|
+
**Notes:** <!-- Any edits made or observations about this episode -->
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
# Review: [Task ID] — [Task Title]
|
|
2
|
+
<!-- Replace [Task ID] and [Task Title] with the Beads task being reviewed.
|
|
3
|
+
File naming convention: REVIEW_[task-id]_[YYYY-MM-DD].md
|
|
4
|
+
This file lives at: docs/pdlc/reviews/REVIEW_[task-id]_[YYYY-MM-DD].md
|
|
5
|
+
Claude generates this file during the Review sub-phase after all tests pass.
|
|
6
|
+
Human reviews the findings and makes the final call before PDLC posts PR comments.
|
|
7
|
+
All reviewer findings are soft warnings only — human decides: fix, accept, or defer. -->
|
|
8
|
+
|
|
9
|
+
**Task ID:** <!-- e.g. bd-a1b2 -->
|
|
10
|
+
**Task title:** <!-- Full task title from Beads -->
|
|
11
|
+
**Date reviewed:** <!-- YYYY-MM-DD -->
|
|
12
|
+
**Feature:** <!-- Feature name / slug -->
|
|
13
|
+
**Feature branch:** <!-- e.g. feature/user-auth-github-oauth -->
|
|
14
|
+
**Episode:** <!-- e.g. ep-003 (assigned after delivery) -->
|
|
15
|
+
**PRD:** <!-- [PRD_feature-name_YYYY-MM-DD.md](../prds/PRD_feature-name_YYYY-MM-DD.md) -->
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Reviewers
|
|
20
|
+
|
|
21
|
+
<!-- Always-on reviewers are pre-filled. Add builder agent(s) who worked on this task. -->
|
|
22
|
+
|
|
23
|
+
| Reviewer | Role | Present |
|
|
24
|
+
|----------|------|---------|
|
|
25
|
+
| Neo | Architect | yes |
|
|
26
|
+
| Echo | QA Engineer | yes |
|
|
27
|
+
| Phantom | Security Reviewer | yes |
|
|
28
|
+
| Jarvis | Tech Writer | yes |
|
|
29
|
+
| <!-- Bolt / Friday / Muse / Oracle / Pulse --> | <!-- Role --> | <!-- yes --> |
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Neo's Findings — Architecture & PRD Conformance
|
|
34
|
+
|
|
35
|
+
<!-- Neo checks: does the implementation match the design docs and PRD?
|
|
36
|
+
Are there architectural concerns (coupling, abstraction, tech debt, scalability)?
|
|
37
|
+
Does this introduce cross-cutting concerns that affect other parts of the system?
|
|
38
|
+
Severity: BLOCKER | MAJOR | MINOR | INFO
|
|
39
|
+
A BLOCKER from Neo means the architecture must be corrected before shipping.
|
|
40
|
+
All other severities are recommendations; human decides. -->
|
|
41
|
+
|
|
42
|
+
**PRD conformance:** <!-- Fully conformant / Partially conformant / Non-conformant -->
|
|
43
|
+
**Design doc adherence:** <!-- Followed / Minor deviations / Significant deviations -->
|
|
44
|
+
|
|
45
|
+
### Findings
|
|
46
|
+
|
|
47
|
+
<!-- Format: [SEVERITY] [Finding title]
|
|
48
|
+
Description of the issue and Neo's recommended action.
|
|
49
|
+
Example:
|
|
50
|
+
[MAJOR] Business logic leaking into route handler
|
|
51
|
+
The GitHub token exchange logic in `/api/auth/github/route.ts` (lines 34–67) mixes
|
|
52
|
+
HTTP concerns with OAuth business logic. Per the architectural constraint in CONSTITUTION.md
|
|
53
|
+
(§3), business logic must live in the service layer. Recommend extracting to
|
|
54
|
+
`src/lib/auth/github-oauth.ts`.
|
|
55
|
+
|
|
56
|
+
[INFO] oauth_accounts table will support future providers cleanly
|
|
57
|
+
The schema design correctly anticipates multi-provider OAuth. No action needed.
|
|
58
|
+
-->
|
|
59
|
+
|
|
60
|
+
<!-- Auto-generated by Claude (Neo role). Review and supplement as needed. -->
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Phantom's Findings — Security
|
|
65
|
+
|
|
66
|
+
<!-- Phantom checks against OWASP Top 10, auth best practices, input validation, and
|
|
67
|
+
any security requirements defined in CONSTITUTION.md §4.
|
|
68
|
+
Severity: CRITICAL | HIGH | MEDIUM | LOW | INFO
|
|
69
|
+
CRITICAL means the feature MUST NOT ship without resolution (Tier 1 guardrail).
|
|
70
|
+
All other severities are recommendations; human decides.
|
|
71
|
+
Reference: https://owasp.org/www-project-top-ten/ -->
|
|
72
|
+
|
|
73
|
+
**OWASP Top 10 sweep:** <!-- Pass / Issues found (see below) -->
|
|
74
|
+
**Auth & session security:** <!-- Pass / Issues found (see below) -->
|
|
75
|
+
**Input validation:** <!-- Pass / Issues found (see below) -->
|
|
76
|
+
**Secrets & credential handling:** <!-- Pass / Issues found (see below) -->
|
|
77
|
+
|
|
78
|
+
### Findings
|
|
79
|
+
|
|
80
|
+
<!-- Format: [SEVERITY] [Finding title]
|
|
81
|
+
Description, location (file + line), and Phantom's recommended fix.
|
|
82
|
+
Example:
|
|
83
|
+
[HIGH] OAuth state parameter not validated on callback
|
|
84
|
+
The /api/auth/github/callback/route.ts handler (line 18) does not verify that the
|
|
85
|
+
`state` parameter in the callback matches the value stored in the session before
|
|
86
|
+
exchanging the code for a token. This allows CSRF attacks against the OAuth flow.
|
|
87
|
+
OWASP A01:2021 (Broken Access Control). Fix: compare state before proceeding.
|
|
88
|
+
|
|
89
|
+
[LOW] GitHub access token logged at debug level
|
|
90
|
+
`src/lib/auth/github-oauth.ts` line 89 logs `token` at debug level. Tokens must
|
|
91
|
+
not appear in logs per CONSTITUTION.md §4. Remove the log statement.
|
|
92
|
+
-->
|
|
93
|
+
|
|
94
|
+
<!-- Auto-generated by Claude (Phantom role). Review and supplement as needed. -->
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Echo's Findings — Test Coverage & Quality
|
|
99
|
+
|
|
100
|
+
<!-- Echo checks: are all acceptance criteria from the PRD covered by tests?
|
|
101
|
+
Are edge cases and error paths tested? Is test quality high (clear, isolated, deterministic)?
|
|
102
|
+
Severity: BLOCKER | HIGH | MEDIUM | LOW | INFO
|
|
103
|
+
BLOCKER means a critical path has zero test coverage — human must decide before shipping. -->
|
|
104
|
+
|
|
105
|
+
**Acceptance criteria coverage:** <!-- All covered / Partial (see below) / None -->
|
|
106
|
+
**Unit test coverage:** <!-- Adequate / Gaps found (see below) -->
|
|
107
|
+
**Integration test coverage:** <!-- Adequate / Gaps found (see below) -->
|
|
108
|
+
**E2E test coverage:** <!-- Adequate / Gaps found (see below) -->
|
|
109
|
+
**Edge cases tested:** <!-- Yes / Partial / No -->
|
|
110
|
+
|
|
111
|
+
### Findings
|
|
112
|
+
|
|
113
|
+
<!-- Format: [SEVERITY] [Finding title]
|
|
114
|
+
Description of the coverage gap, which AC it affects, and recommended test to add.
|
|
115
|
+
Example:
|
|
116
|
+
[HIGH] AC-3 (account linking) has no integration test
|
|
117
|
+
The acceptance criterion "if GitHub email matches an existing account, link the identities"
|
|
118
|
+
is only tested via E2E. There is no integration test verifying the database state after
|
|
119
|
+
linking — if the E2E test is skipped, this path is completely untested.
|
|
120
|
+
Recommend: add `tests/integration/auth/account-linking.test.ts`.
|
|
121
|
+
|
|
122
|
+
[MEDIUM] No test for GitHub OAuth service unavailability
|
|
123
|
+
There is no test covering the graceful degradation path (NFR item: "degrade gracefully
|
|
124
|
+
if GitHub OAuth is unavailable"). Recommend mocking GitHub to return a 503 and asserting
|
|
125
|
+
the user sees the fallback error message.
|
|
126
|
+
|
|
127
|
+
[INFO] Unit tests for github-oauth.ts are thorough — 12 cases, all edge paths covered.
|
|
128
|
+
-->
|
|
129
|
+
|
|
130
|
+
<!-- Auto-generated by Claude (Echo role). Review and supplement as needed. -->
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## Jarvis's Findings — Documentation Completeness
|
|
135
|
+
|
|
136
|
+
<!-- Jarvis checks: are all public functions/methods documented? Is the API contract documented?
|
|
137
|
+
Are there inline comments on non-obvious logic? Is the CHANGELOG entry ready?
|
|
138
|
+
Severity: MAJOR | MINOR | INFO
|
|
139
|
+
All findings are recommendations; human decides. -->
|
|
140
|
+
|
|
141
|
+
**Inline code documentation:** <!-- Complete / Gaps (see below) -->
|
|
142
|
+
**API documentation:** <!-- Complete / Gaps (see below) -->
|
|
143
|
+
**CHANGELOG entry drafted:** <!-- Yes / No -->
|
|
144
|
+
**README updated (if needed):** <!-- Yes / N/A -->
|
|
145
|
+
|
|
146
|
+
### Findings
|
|
147
|
+
|
|
148
|
+
<!-- Format: [SEVERITY] [Finding title]
|
|
149
|
+
Description and location of the documentation gap.
|
|
150
|
+
Example:
|
|
151
|
+
[MINOR] exchangeCodeForToken() missing JSDoc
|
|
152
|
+
`src/lib/auth/github-oauth.ts` lines 34–67 — the main token exchange function has no
|
|
153
|
+
JSDoc comment. Per CONSTITUTION.md §2, all public functions must have JSDoc.
|
|
154
|
+
Recommend adding a JSDoc block with @param, @returns, and @throws annotations.
|
|
155
|
+
|
|
156
|
+
[INFO] CHANGELOG entry drafted and ready for Jarvis to commit
|
|
157
|
+
See the staged CHANGELOG.md update — no changes needed.
|
|
158
|
+
-->
|
|
159
|
+
|
|
160
|
+
<!-- Auto-generated by Claude (Jarvis role). Review and supplement as needed. -->
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## Builder's Notes
|
|
165
|
+
|
|
166
|
+
<!-- The agent(s) who built this task add context here: decisions made during Build,
|
|
167
|
+
anything the reviewers should know, known limitations, or questions for the human.
|
|
168
|
+
Written by the builder agent; reviewed as part of this file. -->
|
|
169
|
+
|
|
170
|
+
<!-- Auto-drafted by the builder agent. Review and supplement as needed. -->
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## Summary & Overall Recommendation
|
|
175
|
+
|
|
176
|
+
<!-- Claude's overall read after all four reviewer findings are considered.
|
|
177
|
+
Options: Approve | Approve with conditions | Revise -->
|
|
178
|
+
|
|
179
|
+
**Overall recommendation:** <!-- Approve | Approve with conditions | Revise -->
|
|
180
|
+
|
|
181
|
+
**Blocking issues (must fix before shipping):**
|
|
182
|
+
<!-- List any BLOCKER / CRITICAL findings. If none, write "None." -->
|
|
183
|
+
|
|
184
|
+
**Recommended fixes (strong advice):**
|
|
185
|
+
<!-- List HIGH / MAJOR findings that reviewers recommend addressing before ship. -->
|
|
186
|
+
|
|
187
|
+
**Deferred items (accepted for now):**
|
|
188
|
+
<!-- List MEDIUM / LOW findings that can be addressed in a follow-up episode. -->
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## Human Decision
|
|
193
|
+
|
|
194
|
+
<!-- This section is completed by the human after reviewing the findings above.
|
|
195
|
+
PDLC will not post PR comments until this section is filled in. -->
|
|
196
|
+
|
|
197
|
+
**Decision:** <!-- Approve | Fix | Accept warning | Defer -->
|
|
198
|
+
<!-- Approve — ship as-is; post PR comments
|
|
199
|
+
Fix — pause; Claude addresses the listed issues then generates an updated review
|
|
200
|
+
Accept warning — ship despite warnings; Phantom/Echo findings logged as Tier 3 events in STATE.md
|
|
201
|
+
Defer — do not ship yet; item moved to next episode or tech debt log -->
|
|
202
|
+
|
|
203
|
+
**Conditions / notes from human:**
|
|
204
|
+
<!-- Any instructions, caveats, or context the human wants recorded here -->
|
|
205
|
+
|
|
206
|
+
**Reviewed by:** <!-- Name / initials -->
|
|
207
|
+
**Date of decision:** <!-- YYYY-MM-DD -->
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## PR Comments
|
|
212
|
+
|
|
213
|
+
**Pushed to PR:** <!-- yes / no -->
|
|
214
|
+
**Date pushed:** <!-- YYYY-MM-DD — set by PDLC after human approves and comments are posted -->
|
|
215
|
+
**PR link:** <!-- https://github.com/org/repo/pull/N -->
|