Captures the owner's requirements and decisions from the planning conversation, current branch/worktree state, open tasks 17-19, pending owner decisions and the controller's rulings so a new agent can resume. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
14 lines
1.7 KiB
Markdown
14 lines
1.7 KiB
Markdown
# Task 3 report: packages/plugin-sdk
|
|
|
|
Built: types.ts (contract + definePlugin validating sdkVersion===1 and non-empty id), http.ts (createHttpClient, HttpError, token bucket, retry/backoff, Retry-After seconds/date, X-RateLimit-Reset-In, optional `now`), testing.ts (createFixtureHttp, createTestContext, collect), partial-date.ts (parsePartialDate, comparePartialDates; string-only, no Date conversion for values).
|
|
Files: packages/plugin-sdk/{package.json (copied from main checkout, where it was untracked), src/*.ts, test/http.test.ts, test/partial-date.test.ts}.
|
|
TDD: RED = `bun test packages/plugin-sdk` -> "Cannot find module '../src/partial-date.ts'", 0 pass 2 fail. GREEN = 24 pass, 0 fail. No DB, so no Postgres run. `bun run typecheck` clean.
|
|
Decisions: default maxRetries 3, backoff 500*2^attempt ms; retries also consume rate tokens; json throws HttpError on any non-ok, raw returns non-retryable responses as-is and throws HttpError only when retries on 429/5xx are exhausted; fixture lookup tries full URL then URL without query; datetime partial dates keep the full string with precision "day"; invalid calendar dates return null; compare is lexicographic on value.
|
|
Concerns: worktree was branched before packages/ existed, so plugin-sdk/package.json was copied in from /home/user/STTracker; bun.lock untouched.
|
|
|
|
## Fix round 1
|
|
- testing.ts: `createTestContext` defaults to a fetch that throws `Error("createTestContext: no fetch provided")`.
|
|
- http.ts: `HttpError` constructor builds its message from origin + pathname only (covers both throw sites).
|
|
- Tests added: no-fetch context rejects with that message; 404 on `?api_key=SECRET` gives a message without "SECRET".
|
|
- Command: `bun test packages/plugin-sdk` -> 26 pass, 0 fail. `bun run typecheck` clean.
|