Skip to content

Commit e238003

Browse files
hesreallyhimclaude
andcommitted
docs: update HANDOFF.md to reflect current project state
- Update architecture diagram from mode=start/stop to pre/main/post lifecycle with accurate descriptions - Update test count from 67 to 128 across 6 test files - Update build output to list all 4 ncc bundles - Resolve outstanding questions (poll-log.jsonl exists, dist/ is committed) - Update next steps to reflect current priorities Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent a04f01c commit e238003

1 file changed

Lines changed: 27 additions & 24 deletions

File tree

HANDOFF.md

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# HANDOFF — github-api-usage-monitor
22

3-
**Date:** 2026-01-25
4-
**Branch:** `build-spec`
5-
**Status:** v1 implementation complete, ready for integration testing
3+
**Date:** 2026-01-31
4+
**Branch:** `claude`
5+
**Status:** v1 implementation complete, self-test suite operational, code review fixes applied
66

77
---
88

@@ -32,39 +32,45 @@ A GitHub Action that monitors API rate-limit usage during a workflow job by poll
3232

3333
### Test Status
3434

35-
- **67 tests passing** across 4 test files
36-
- TypeScript: clean
37-
- ESLint: clean
38-
- Build: `dist/main.js` (991KB) + `dist/poller/index.js` (28KB)
35+
- **128 tests passing** across 6 test files
36+
- TypeScript: clean (strict mode)
37+
- ESLint: clean (`no-explicit-any` enforced)
38+
- Build: 4 ncc bundles — `dist/main.js`, `dist/pre.js`, `dist/post.js`, `dist/poller/index.js`
3939

4040
---
4141

4242
## Architecture Summary
4343

4444
```
45-
Workflow Step: start
45+
pre.ts → start.ts (action.yml pre hook)
4646
4747
├── Validate platform (Linux/macOS only)
4848
├── Initial poll to /rate_limit (fail-fast token validation)
4949
├── Create initial state with baseline
5050
├── Spawn detached poller process
51-
└── Write PID to $RUNNER_TEMP
51+
├── Write PID to $RUNNER_TEMP
52+
└── Verify poller startup (poll state.json for poller_started_at_ts)
5253
53-
Poller (background, every 30s)
54+
Poller (detached child process, adaptive interval)
5455
5556
├── GET /rate_limit
5657
├── Reduce: calculate deltas per bucket
5758
│ ├── Same window: delta = used - last_used
5859
│ ├── New window: total += used (post-reset)
5960
│ └── Anomaly: used decreased without reset
60-
└── Atomic write state.json
61+
├── Atomic write state.json
62+
└── Append to poll-log.jsonl (diagnostic JSONL log)
6163
62-
Workflow Step: stop (always)
64+
main.ts (no-op, required by action.yml)
65+
66+
post.ts (action.yml post hook, runs always)
6367
64-
├── Kill poller by PID (SIGTERM)
68+
├── Kill poller by PID (SIGTERM → SIGKILL escalation)
69+
├── Perform final API poll
6570
├── Read final state
6671
├── Generate warnings
67-
└── Render summary to $GITHUB_STEP_SUMMARY + console
72+
├── Render summary to $GITHUB_STEP_SUMMARY + console
73+
└── Expose state_json and poll_log_json as action outputs
6874
```
6975

7076
---
@@ -107,23 +113,20 @@ See `docs/planning/IMPL-PLAN-declarative-self-test.md` for full design.
107113

108114
## Next Steps
109115

110-
1. **Verify self-test workflow** — Run via workflow_dispatch on GitHub and confirm all 12 scenarios produce expected state.json output
111-
2. **Consider test isolation** — Dedicated repo or reserved token to avoid cross-workflow rate-limit noise
112-
3. **Test edge cases**:
113-
- Token with no permissions
114-
- Very short job (< 30s)
115-
- Multiple window resets during job
116+
1. **Write README.md** — Usage examples, inputs/outputs reference, example summary output
117+
2. **Increase test coverage** — poller lifecycle (20%), post.ts (0%), pre.ts (0%), poll-log.ts (0%)
118+
3. **Consider test isolation** — Dedicated repo or reserved token to avoid cross-workflow rate-limit noise
116119
4. **Consider adding**:
117-
- Debug log file for poller (currently silent)
118120
- `report_buckets` input for filtering output (v2)
121+
- Threshold-based alerting (warn/fail when usage exceeds percentage)
119122

120123
---
121124

122-
## Outstanding Questions
125+
## Resolved Questions
123126

124-
1. **Poller log file**Should the poller write debug logs to a file? Currently uses `stdio: 'ignore'`. Could add `$RUNNER_TEMP/github-api-usage-monitor/poller.log`.
127+
1. **Poller log file**Resolved: poller writes diagnostic JSONL to `$RUNNER_TEMP/github-api-usage-monitor/poll-log.jsonl` via `poll-log.ts`. Exposed as `poll_log_json` action output.
125128

126-
2. **dist/ in repo**Should `dist/` be committed to the repo (common for Actions) or generated on release? Currently gitignored.
129+
2. **dist/ in repo**Resolved: `dist/` is committed to git. Pre-commit hook verifies it stays in sync after `build:all`. CI also verifies.
127130

128131
---
129132

0 commit comments

Comments
 (0)