-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathprogress.json
More file actions
143 lines (143 loc) · 9.04 KB
/
Copy pathprogress.json
File metadata and controls
143 lines (143 loc) · 9.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
{
"project": "Daily LeetCode Problem Workflow",
"spec": "spec.md",
"status": "completed",
"tasks": [
{
"id": 1,
"title": "Create LeetCode problem fetcher script",
"description": "Shell script (scripts/fetch-problem.sh) that queries LeetCode GraphQL API to get daily challenge or a specific problem by URL/slug. Handles exponential backoff retry (3 attempts, 2s initial delay), extracts problem metadata (number, title, slug, difficulty, tags, acceptance rate, content, isPaidOnly), and outputs structured JSON.",
"status": "completed",
"files": ["scripts/fetch-problem.sh"]
},
{
"id": 2,
"title": "Create Claude prompt template for dsa-coach analysis",
"description": "Markdown prompt template (scripts/prompt-template.md) that instructs Claude Code to act as a DSA coach. Includes instructions for generating: analysis.md with progressive hints, solution.go with inline types, and solution_test.go with table-driven tests from all examples. Uses delimiters for output parsing.",
"status": "completed",
"files": ["scripts/prompt-template.md"]
},
{
"id": 3,
"title": "Create GitHub Actions workflow file",
"description": "Main workflow (.github/workflows/daily-leetcode.yml) with: schedule trigger (00:30 UTC) + workflow_dispatch (optional problem_url input), job steps for fetching problem, detecting premium/duplicates, running claude-code-action with CLAUDE_CODE_OAUTH_TOKEN, executing Go tests, and creating PR with proper naming (feat/daily-YYYYMMDD-slug branch, daily-YYYY-MM-DD-NNNN-name PR title).",
"status": "completed",
"files": [
".github/workflows/daily-leetcode.yml",
"scripts/build-prompt.py"
],
"depends_on": [1, 2]
},
{
"id": 4,
"title": "Handle duplicate problem detection",
"description": "Logic within the workflow to check if problems/[NNNN-problem-name]/ already exists. If it does, instruct Claude to use _daily_YYYYMMDD suffix for solution and test files instead of overwriting.",
"status": "completed",
"notes": "Implemented as 'Check for duplicate problem' step in the workflow. The IS_DUPLICATE flag is passed to build-prompt.py which adjusts file naming instructions in the prompt.",
"depends_on": [3]
},
{
"id": 5,
"title": "Handle premium problem detection and issue creation",
"description": "Logic within the workflow to detect isPaidOnly=true from fetched problem data, skip solution generation, and create a GitHub issue titled 'Daily Challenge Skipped: Premium Problem - [Title]' with problem number, title, and date.",
"status": "completed",
"notes": "Implemented as 'Handle premium problem' step. All subsequent steps have if: is_premium != 'true' guard.",
"depends_on": [3]
},
{
"id": 6,
"title": "Validate workflow end-to-end",
"description": "Review the complete workflow for correctness: verify GraphQL queries work, prompt template produces expected output structure, workflow YAML syntax is valid, permissions are correct, and all edge cases (premium, duplicate, test failure) are handled.",
"status": "completed",
"notes": "Validated via live GitHub Actions run. Fixed three issues during validation: added mode: 'agent' for workflow_dispatch, enabled PR creation permissions, and removed redundant commit/push step since claude-code-action handles git operations in agent mode.",
"depends_on": [3, 4, 5]
},
{
"id": 7,
"description": "for manual dispatch workflow, don't start PR's name with 'daily'",
"status": "todo",
"notes": "Currently, the PR title is always prefixed with 'daily-'. For manual dispatches, we should adjust this to avoid confusion.",
"depends_on": []
},
{
"id": 8,
"description": "daily leetcode workflow lost the number in the branch's name when trigger (by schedule or manual)",
"status": "todo",
"notes": "the PR still has the number, but the branch name misses it. Need to fix the branch naming logic to include the problem number.",
"depends_on": []
},
{
"id": 9,
"title": "Create submit.sh script — argument parsing and directory resolution",
"description": "Implement the first section of scripts/submit.sh: shebang, set -euo pipefail, argument parsing (accept problem number or directory path, optional --file flag defaulting to solution.go), resolve problem directory from problems/ by zero-padded glob, validate the solution file exists. Exit code 2 on bad input.",
"status": "completed",
"spec": "specs/submit-leetcode.md",
"files": ["scripts/submit.sh"],
"depends_on": []
},
{
"id": 10,
"title": "Create submit.sh — authentication and slug derivation",
"description": "Add auth validation (check LEETCODE_SESSION and LEETCODE_CSRF env vars are set and non-empty, exit code 3 if missing) and slug derivation (strip NNNN- prefix from directory name to get the LeetCode slug).",
"status": "completed",
"spec": "specs/submit-leetcode.md",
"files": ["scripts/submit.sh"],
"depends_on": [9]
},
{
"id": 11,
"title": "Create submit.sh — GraphQL question ID lookup with local cache",
"description": "Implement the questionId fetch: reuse graphql_request helper pattern from fetch-problem.sh (Referer/Origin headers, inline slug, retry with backoff). Read/write .leetcode-cache/problems.json for slug->questionId mapping. Create cache dir and file if missing. Atomic write via temp file + mv.",
"status": "completed",
"spec": "specs/submit-leetcode.md",
"files": ["scripts/submit.sh", ".gitignore"],
"depends_on": [10]
},
{
"id": 12,
"title": "Create submit.sh — submission POST and result polling",
"description": "POST to /problems/<slug>/submit/ with lang=golang, question_id, typed_code payload. Include Cookie, X-CSRFToken, X-Requested-With, Referer, Origin headers. Extract submission_id from response. Poll /submissions/detail/<id>/check/ every 2s, max 15 attempts (30s timeout). Exit code 4 on API/network errors.",
"status": "completed",
"spec": "specs/submit-leetcode.md",
"files": ["scripts/submit.sh"],
"depends_on": [11]
},
{
"id": 13,
"title": "Create submit.sh — result formatting and exit codes",
"description": "Parse the final check response: print formatted summary (problem name, verdict, test pass count, runtime/memory percentile). On non-Accepted verdicts, print last_testcase, expected_output, code_output if available. Exit 0 for Accepted, exit 1 for any other verdict.",
"status": "completed",
"spec": "specs/submit-leetcode.md",
"files": ["scripts/submit.sh"],
"depends_on": [12]
},
{
"id": 14,
"title": "Create submit-leetcode.yml GitHub Actions workflow",
"description": "Create .github/workflows/submit-leetcode.yml with workflow_dispatch trigger, two inputs (problem_number: required string, solution_file: optional string defaulting to solution.go). Single job: checkout repo, run scripts/submit.sh with LEETCODE_SESSION and LEETCODE_CSRF from repository secrets.",
"status": "completed",
"spec": "specs/submit-leetcode.md",
"files": [".github/workflows/submit-leetcode.yml"],
"depends_on": [13]
},
{
"id": 15,
"title": "Test submit.sh locally end-to-end",
"description": "Run the script locally against a known solved problem (e.g. 1382) to verify the full flow: directory resolution, slug derivation, GraphQL ID fetch, cache write, submission, polling, and result output. Verify exit codes for both Accepted and error scenarios.",
"status": "completed",
"spec": "specs/submit-leetcode.md",
"notes": "Tested against problem 1382. Full flow works: directory resolution, slug derivation, question ID fetch + cache write, submission POST, polling, and result reporting. Got 'Compile Error' due to solution file having inline TreeNode definition that conflicts with LeetCode's environment — script behavior is correct.",
"depends_on": [13]
},
{
"id": 16,
"title": "Minify solution.go before submission",
"description": "Add a preprocessing step in submit.sh that strips LeetCode-incompatible boilerplate from the solution file before submitting. Remove 'package main/solution' declaration, inline struct definitions that LeetCode provides (TreeNode, ListNode, Node, etc.), and any imports that become unused after removal. The minified code is used only for the typed_code payload — the original file is never modified. This fixes the Compile Error seen in e2e testing where inline TreeNode definitions conflict with LeetCode's environment.",
"status": "completed",
"spec": "specs/submit-leetcode.md",
"files": ["scripts/submit.sh"],
"notes": "Strips package declaration, LeetCode-provided struct types (TreeNode, ListNode, Node) and their preceding doc comments. Verified with e2e test: problem 1382 went from Compile Error to Accepted (17/17 tests).",
"depends_on": [13]
}
]
}