fix(systematic-debugging): default waitFor's description so examples compile#1839
Open
An-idd wants to merge 1 commit into
Open
fix(systematic-debugging): default waitFor's description so examples compile#1839An-idd wants to merge 1 commit into
An-idd wants to merge 1 commit into
Conversation
…compile
The waitFor snippet in condition-based-waiting.md declared `description` as a
required parameter, but every usage example in the file (the Core Pattern and
all five Quick Patterns rows) calls waitFor with a single argument. Copying the
documented call form fails to type-check:
error TS2554: Expected 2-3 arguments, but got 1.
Give `description` a default ('condition') so the documented examples compile.
The timeout error message is preserved.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Who is submitting this PR? (required)
claude-opus-4-8, 1M-context variant)superpowers@6.0.3,ponytail@4.7.0,andrej-karpathy-skills@1.0.0Division of labour, stated plainly: human-directed, agent-executed, human-reviewed. My human partner directed an audit of the skills for objective defects and reviewed/approved this complete diff before submission. The defect was surfaced by the agent during that audit and the one-line patch was written by the agent under their direction. This is grounded in a real Claude Code session with Superpowers installed, not reasoned from documentation alone.
What problem are you trying to solve?
The
waitForTypeScript example inskills/systematic-debugging/condition-based-waiting.mddoes not compile as written.The "Implementation" snippet declares
description: stringas a required second parameter:…but every usage example in the same file calls
waitForwith a single argument — the Core Pattern at L43 (await waitFor(() => getResult() !== undefined);) and all five Quick Patterns rows at L52–L56.So the skill's own examples contradict the skill's own implementation. An agent that uses this skill to fix a flaky test and copies the documented call form emits code that does not type-check. Reproduced with a real compiler (
tsc --noEmit --strict) on the exact snippet plus the exact single-argument example from the file:Honesty note: this was found via a documentation-consistency audit of the skills, not from a live failing session. It is included here because it is objectively reproducible (compile output above), not a speculative or behavioral claim.
What does this PR change?
Gives
descriptiona default value (description = 'condition') in thewaitForsnippet, so the single-argument call sites shown throughout the skill type-check. The error-message text is preserved (it now readsTimeout waiting for condition after <ms>mswhen no description is passed). One line, one file.Is this change appropriate for the core library?
Yes.
systematic-debuggingis a general-purpose core skill. The fix makes its illustrative code correct for everyone who reads it, regardless of project, domain, or tool. No project/team/tool specificity, no third-party integration.What alternatives did you consider?
descriptionargument to all six example call sites. Rejected: it clutters the teaching examples — whose whole point is the concise condition-based pattern — and produces a larger, noisier diff that changes the pedagogy rather than fixing the bug.description?: string(optional, no default). Works for the call sites, but then${description}interpolatesundefinedinto the timeout error string. Defaulting to'condition'keeps the error message meaningful, so I chose the default over the bare optional.Does this PR contain multiple unrelated changes?
No. A single one-line fix to one file.
Existing PRs
Method: searched all open and closed PRs by title/keyword for
condition-based-waiting,waitFor, andsystematic-debugging. No PR touches this file or thewaitForsnippet. The twosystematic-debuggingPRs that exist are unrelated (#1145 adds a hypothesis-preflight module; #1558 defuses an "ultrathink" keyword trigger).Environment tested
claude-opus-4-8(1M context)Verification = TypeScript compile check (TypeScript via
npx -p typescript tsc --noEmit --strict) on the skill's snippet + its documented one-argument example:error TS2554: Expected 2-3 arguments, but got 1.New harness support (required if this PR adds a new harness)
N/A — this PR does not add or change any harness integration.
Evaluation
This is a code-example correctness fix, not a behaviour-shaping change, so behavioural eval sessions do not apply. The relevant verification is a compiler check, run before and after the change:
tscbefore/after above). Before =TS2554compile error; after = clean compile.Rigor
superpowers:writing-skillsand completed adversarial pressure testing — N/A and intentionally left unchecked. This does not modify behaviour-shaping content; it fixes a TypeScript example that does not compile. No pressure scenarios apply to a compile bug.Human review