Skip to content

docs(skill+pitfalls): three defect classes from the Library P1 review cycle#2079

Merged
jaylfc merged 4 commits into
devfrom
docs/pitfalls-round3
Jul 21, 2026
Merged

docs(skill+pitfalls): three defect classes from the Library P1 review cycle#2079
jaylfc merged 4 commits into
devfrom
docs/pitfalls-round3

Conversation

@jaylfc

@jaylfc jaylfc commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Distils this cycle into the contributor docs. Every item is drawn from a real defect, not a hypothetical.

Pitfall 20: a tolerance is not a test of an invariant. assert abs(after - before) <= 2 ran green in #2062 while reprocess destroyed the user's original uploaded file (observed before=2, after=0). The same tolerance would have accepted a doubling. Assert equality and assert the resulting status.

Pitfall 21: shell snippets inside template literals must escape ${. In #2077 a bash snippet in a JS template literal produced 225 TypeScript syntax errors from one cause, in one of four otherwise-clean files, which read like incoherent output rather than a single mechanical mistake. Generalises to any language sharing ${...} with the shell, and is invisible without compiling.

Pitfall 22: conflict resolution is a decision, not a mechanical act. Library P2/P3 both went CONFLICTING when P1 landed, and all four defects P1 fixed are reintroducible by a plausible-looking resolution.

Skill gains a short verify-before-you-claim section covering those three plus the mock-from-the-contract rule: a test whose fixture is built from the caller's assumption rather than the service's documented response certifies the bug. That happened three times in one PR cycle (invented dbPath shape, un-nested poll response, tolerance assertion).

Docs only.

Summary by CodeRabbit

  • Documentation
    • Added contributor guidance for verifying exact test outcomes, using accurate external-service response fixtures, and running type checks and builds before submitting changes.
    • Documented best practices for escaping template-literal shell snippets and resolving merge conflicts carefully.
    • Added new entries covering recurring review pitfalls.

… cycle

Pitfalls: tolerances do not test invariants (20), shell snippets in template
literals must escape the interpolation sigil (21), conflict resolution reverts
fixes when done mechanically (22). All three are drawn from real defects in
this cycle, including a data-loss bug that a tolerance-based assertion kept
green and 225 syntax errors from one unescaped construct.

Skill: a verify-before-you-claim section covering tolerance assertions, mocks
built from the caller's assumptions rather than the service contract, and
compiling before opening a PR.
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@jaylfc, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 28 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 076b444f-7780-4b60-ba85-2a80b4a99991

📥 Commits

Reviewing files that changed from the base of the PR and between b9697f2 and 52b8390.

📒 Files selected for processing (2)
  • .claude/skills/taos-development-skill/SKILL.md
  • docs/contributor-pitfalls.md
📝 Walkthrough

Walkthrough

Contribution documentation adds verification and compilation checklists plus recurring pitfalls covering invariant assertions, external-service fixtures, template literals, and conflict resolution.

Changes

Contributor Guidance

Layer / File(s) Summary
Verification checklist
.claude/skills/taos-development-skill/SKILL.md
Adds guidance for invariant-style assertions, documented external response fixtures, typechecking/build execution, and rebasing before conflict resolution.
Process pitfalls
docs/contributor-pitfalls.md
Adds pitfalls covering tolerant assertions, escaping ${ in template literals, and deliberate conflict resolution.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Possibly related PRs

  • jaylfc/taOS#1871: Updates the same contribution skill documentation workflow.
  • jaylfc/taOS#2000: Refreshes contribution, testing, and CI workflow requirements in SKILL.md.
  • jaylfc/taOS#2040: Extends recurring contributor pitfalls in docs/contributor-pitfalls.md.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the docs-only addition of three defect classes from the Library P1 review cycle.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/pitfalls-round3

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gitar-bot

gitar-bot Bot commented Jul 21, 2026

Copy link
Copy Markdown

Gitar is working

Gitar

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.claude/skills/taos-development-skill/SKILL.md:
- Around line 286-288: Update the guidance around the “Typecheck or run the
thing” statement to reference the repository’s actual CI command, npm run build,
or use the neutral phrase “typecheck/build gate.” Remove the claim that the
executor directly runs tsc --noEmit, while preserving the instruction to
validate frontend changes before opening a PR.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 41dd6dc3-9176-4023-bc78-795a3f771365

📥 Commits

Reviewing files that changed from the base of the PR and between 4498855 and b9697f2.

📒 Files selected for processing (2)
  • .claude/skills/taos-development-skill/SKILL.md
  • docs/contributor-pitfalls.md

Comment on lines +286 to +288
- Typecheck or run the thing before opening the PR. A frontend change that does
not compile wastes a full review round, and the executor now gates on
`tsc --noEmit` for exactly that reason (pitfall 21).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Align the command claim with the actual CI gate.

The supplied repository contract runs npm run build, which executes tsc -b && vite build; tsconfig.json makes this non-emitting, but the executor is not shown running tsc --noEmit directly. Document the actual command or say “the typecheck/build gate” to avoid contributors validating a different check than CI.

Suggested wording
--  `tsc --noEmit` for exactly that reason (pitfall 21).
+-  the frontend typecheck/build gate for exactly that reason (pitfall 21).
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- Typecheck or run the thing before opening the PR. A frontend change that does
not compile wastes a full review round, and the executor now gates on
`tsc --noEmit` for exactly that reason (pitfall 21).
- Typecheck or run the thing before opening the PR. A frontend change that does
not compile wastes a full review round, and the executor now gates on
the frontend typecheck/build gate for exactly that reason (pitfall 21).
🧰 Tools
🪛 SkillSpector (2.3.11)

[warning] 415: [RA2] Session Persistence: Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Remediation: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.

(Rogue Agent (RA2))


[error] 379: [TM1] Tool Parameter Abuse: Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Remediation: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.

(Tool Misuse (TM1))

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/skills/taos-development-skill/SKILL.md around lines 286 - 288,
Update the guidance around the “Typecheck or run the thing” statement to
reference the repository’s actual CI command, npm run build, or use the neutral
phrase “typecheck/build gate.” Remove the claim that the executor directly runs
tsc --noEmit, while preserving the instruction to validate frontend changes
before opening a PR.

Strengthens the mock guidance from a general principle into an enforceable
rule. Scopes the danger to mocks of services we do not control, requires a
captured real response over a hand-composed fixture, asks for one feature
detecting integration test per contract, and rejects a follow-up issue as
sufficient mitigation since it detaches the caveat from the code.
@jaylfc

jaylfc commented Jul 21, 2026

Copy link
Copy Markdown
Owner Author

Strengthened the mock guidance after a challenge from Jay, who asked whether we should avoid mocks entirely or at least force a follow-up issue.

I checked before answering: 372 of 535 Python test files use mocking, so a blanket ban is neither actionable nor right. Most of that is mocking our own internals or injecting errors nobody can produce on demand (a 500, a timeout, an ImportError), and none of it is what bit us.

The dangerous class is narrow: mocks of external service contracts we do not control, whose fixtures were hand-composed from what the calling code expects. That fixture encodes a belief about someone else's API, and a wrong belief produces a green test that certifies the bug. All three failures in the #2062 cycle were that exact shape.

Added as pitfall 23 with an enforceable hierarchy rather than a principle:

  1. Capture a real response and commit it as the fixture. A recorded response cannot encode a wrong belief.
  2. Keep one real integration test per external contract, feature detecting so it skips when the service is unreachable. taosmd's GET /version capabilities list exists for exactly this.
  3. If neither is possible, mark the mock provisional in code with its source and verification date.

On the follow-up-issue suggestion specifically: I argued against it as the primary mitigation and said so in the text. With 260 open issues, filing one detaches the caveat from the code and functions as indefinite deferral. A comment in the file travels with the code and shows up in review; an issue does not.

The reviewer-facing version is one question: where did this fixture come from? That is a question I could have asked on #2062 and did not.

…achable

Sibling services are not third parties. taOSmd's maintainer is on the A2A bus,
so a contract question costs one message. Every mock failure in the 2062 cycle
was a guess at something that was free to ask, and asking produced documented
envelopes, a self-corrected stats key list, and a capabilities endpoint. Guessing
is only justified when there is genuinely nobody to ask.
@jaylfc

jaylfc commented Jul 21, 2026

Copy link
Copy Markdown
Owner Author

Revised again after Jay pointed out the obvious thing I had missed: for taOSmd there is no danger, because that is what the A2A bus is for.

He is right, and it reframes the rule. taOSmd is not a third-party API, it is a sibling service whose maintainer is one message away. Every mock failure in the #2062 cycle was a guess at something that was free to obtain:

  • The builder invented a dbPath request shape rather than asking what the endpoint takes.
  • I verified the envelope against taosmd's source rather than asking its owner, which found the right answer but only after the wrong one had already shipped twice.
  • When we finally did ask, we got the response envelopes documented, a partially wrong stats key list corrected by its own author, and a /version capabilities endpoint built specifically so the contract becomes machine-checkable.

So pitfall 23 now splits by whether the contract has a reachable owner:

Sibling services: ask, do not guess. Reverse-engineering a sibling's API from its source is a smell rather than diligence, because source tells you what it does today while the owner tells you what it guarantees. Contributors without bus access ask in the PR and the lead relays, which is what happened here.

Genuine third parties (GitHub, OpenRouter, Reddit): capture, do not compose. There is nobody to ask, so record a real response instead of writing a fixture from what the caller expects.

Both then keep one feature-detecting integration test, or mark the mock provisional in code.

Worth stating plainly since it is my own miss: I spent a lot of this cycle verifying contracts against source when a bus message would have been faster and more authoritative. The rule now says so.

Adds the routing rule that makes pitfall 23 actionable for contributors who are
not on the A2A bus: a contract question goes to the commons repo (or taosmd
directly, which is public), the lead relays to the owning agent, and the
contributor escalates on the PR if it stalls. Marked explicitly as temporary
scaffolding that retires when contributors can hold a taOS identity.
@jaylfc
jaylfc merged commit 056350a into dev Jul 21, 2026
8 of 9 checks passed
@jaylfc
jaylfc deleted the docs/pitfalls-round3 branch July 21, 2026 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant