test: [#883] harden #881 guard — loosen regex + sweep all altimate-core tool descriptions#884
Conversation
…re tool descriptions Follow-up to #882. Two test-only improvements to the regression guard: - Loosen the false-claim regex from `/requires?\b[^.]{0,40}\bapi key\b/` to `/requires?\b.*?\bapi key\b/` so long-gap variants ("requires an API key for authentication") can't slip through. Still does not match the legitimate "no API key required" copy (there "required" follows "api key"). - Add a source sweep over every `altimate-core-*.ts` tool asserting none contains the stale `altimate_core.init` marker — the unambiguous fingerprint of the Python-bridge-era "needs an API key" claim. No native engine tool calls a dispatcher method by that name, so any occurrence is a regression, and scanning the source auto-covers tools added later (the original guard only covered the two known tools). Closes #883 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis test-only PR hardens regression protection for altimate-core tool descriptions. It loosens the existing API key detection regex to catch longer variants, and adds a new directory-wide file scan that asserts all altimate-core tools lack the stale ChangesTool Description Regression Guards
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
What does this PR do?
Hardens the #881 regression guard added in #882 (test-only — no runtime change).
/requires?\b[^.]{0,40}\bapi key\b/to/requires?\b.*?\bapi key\b/, so a long-gap variant like "requires an API key for authentication" can't slip through the 40-char cap. It still does not false-positive on the legitimate "no API key required" copy (there "required" follows "api key", so the require→api-key order never matches).altimate-core-*.tstool, asserting none contains the unambiguousaltimate_core.initmarker — the fingerprint of the old Python-bridge "needs an API key" claim. No native engine tool calls a dispatcher method by that name, so any occurrence is a regression. Scanning the source (rather than two hard-coded tools) auto-covers tools added later.Raised by the multi-model review of #882 (DeepSeek V3.2 + Gemini 3.1 Pro).
Type of change
Issue for this PR
Closes #883
How did you verify your code works?
bun test test/altimate/altimate-core-tool-descriptions.test.ts→ 30 pass / 0 fail (2 focused + 27-file sweep + 1 non-empty guard).grep -rn "altimate_core.init" packages/opencode/src/altimate/tools/altimate-core-*.ts→ 0 matches across all 27 files.toContain("no api key")assertion guards the corrected wording).bun run typecheckclean;prettier --checkclean; marker check reports no upstream-shared files touched.Checklist
Summary by cubic
Hardened the #881 regression guard in tests by loosening the false-claim regex and adding a sweep across all
altimate-core-*tools to block the old “needs an API key” marker. Test-only; no runtime changes. Addresses #883./requires?\b[^.]{0,40}\bapi key\b/to/requires?\b.*?\bapi key\b/to catch long-gap variants; still ignores valid “no API key required”.altimate-core-*.tsto assert noaltimate_core.initoccurrences, covering future tools automatically.Written for commit 2f92369. Summary will update on new commits.
Summary by CodeRabbit