Repository navigation
fix: type-check clean against the 2.1.332 hooks API - #57
ralphstodomingo wants to merge 1 commit into
Conversation
- `collectFacts` checks the platform for undefined before `OS.has`: 2.1.332 types it optional. An undefined platform already gave `unknown`. - Tests: `(globalThis as any).setTimeout` as elsewhere, `URLSearchParams.forEach` for the keys, a block body for `onCall`, a non-null `argv`, an optional `argv[0]`, and a `FoundElement` annotation `tsc -p plugins/altimate-code` gives 0 errors on 2.1.332's types (10 before). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BXxzvqLZuTJdDJ1Ku2ZMDY
|
Review log: claims and residuals Claims (each can be violated by a concrete trace):
Disclosed residuals (accepted; instances are not findings):
Rounds: |
|
@codex review against the numbered claims and the disclosed residuals in the review-log comment on this PR: report only a reproducible trace that violates a numbered claim. Instances of the disclosed residuals are not findings. A round with no claim violation ends review. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
| $.session | ||
| .info() | ||
| .then(info => (OS.has(info.platform) ? info.platform : 'unknown')) | ||
| .then(info => (info.platform !== undefined && OS.has(info.platform) ? info.platform : 'unknown')) |
There was a problem hiding this comment.
SUGGESTION: The platform → OS-name mapping is now duplicated.
OS on line 318 is a second copy of the identical set in usage.ts:36, and usage.ts:104 already performs this same mapping (platform && OS.has(platform) ? platform : 'unknown'). This file already imports from ./usage, so one exported helper there (for example osOf($)) could own the accepted-platform list and the 'unknown' fallback for both call sites, so the two copies cannot drift apart when a platform is added.
The guard itself is correct and behaviour-preserving: an undefined platform already produced 'unknown'.
There was a problem hiding this comment.
Leaving this for a follow-up. This PR only makes the type check pass, and the guard here is the same one usage.ts:104 already uses, as you note. Moving the platform list into one helper changes two call sites in shipped code, which is a cleanup Harish may want to shape himself.
Code Review SummaryStatus: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (7 files)
Fix these issues in Kilo Cloud Reviewed by deepseek-v4.1-flash-1017 · Input: 36.7K · Output: 12.5K · Cached: 598.9K |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
tsc -p plugins/altimate-code --noEmitgoes from 10 errors to 0 against the hooks API that Claude Code 2.1.332 declares. To get those types, load the plugin in a 2.1.332 session; it writes.claude-plugin/types/. The repo's CI runs onlytests/*.sh, so nothing caught these.Changes
hooks/feedback.ts: 2.1.332 typessession.info().platformas optional, since a hook that answerssession.infowhole may leave it out.collectFactsnow checks it for undefined beforeOS.has. No user-visible change: an undefined platform already gaveunknown, becauseSet.has(undefined)is false.(globalThis as any).setTimeoutinfeatures/cost.test.tsxandfeatures/runs.test.tsx, ashealth.test.tsxalready does, since the hook environment declares nosetTimeout.URLSearchParams.forEachin place of.keys(), which the environment doesn't declare.onCallinhealth.test.tsx.argv!inusage.test.tsx.argv[0]?.and aFoundElementannotation indbt-mods.test.tsx.Checks
tsc -p plugins/altimate-code --noEmiton 2.1.332's types: 0 errors (10 on main).claude plugin validate --strict .andclaude plugin validate --strict ./plugins/altimate-code: both pass.bash tests/*.sh: all 8 pass.claude plugin test plugins/altimate-codeon 2.1.332: 1481 pass, 2 fail. Both failures are the same onmainwithout this change, on 2.1.332 and 2.1.322:features/cost.test.tsx"a line with a great many dbt calls is not read call by call": its assertions pass, and the 10 s wall-clock bound comes out at 11 to 12 s on a quiet Linux machine.features/runs.test.tsx"a dbt call that starts while another call reads its artifact: the first is left out, the later one is recorded":stored.get("runs")is undefined, so the later call isn't recorded. It passes at 2017923, where it was added, and first fails at e06c39b. That commit bounds the cost gate'ssession.cwd()wait at 80 ms; since 1c80847 the runs tests run with the cost feature on. I've left it alone here: whether a real session can hit it, or only the test's host, is a call for someone who knows the gate.Internal only: no changelog entry or version bump.
🤖 Generated with Claude Code
https://claude.ai/code/session_01BXxzvqLZuTJdDJ1Ku2ZMDY