Repository navigation
fix(toolsets): register earnings-transcript tools once - #114
Conversation
The calendar and earnings tool sets both listed the earnings-transcript module, so its four tools were registered twice in ALL_TOOLS mode. Toolception 0.8.0 rejects duplicate tool names at initialize. Drop the module from calendar (earnings owns transcripts) and add a test that fails on any module or tool name shared between tool sets. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lq4R64VHie4GLCcJbKtMTS
TS review:
|
| # | Sev | Location | Finding |
|---|---|---|---|
| 1 | LOW | CHANGELOG.md [Unreleased] |
Entry sits under [Unreleased], which is below [2.6.12]/[2.7.0]; if it ships in 2.7.0 it belongs there. |
| 2 | LOW | CHANGELOG.md |
User-visible for STATIC_TOOL_SETS/DYNAMIC (calendar no longer exposes transcripts) but filed only as "Fixed"; add a "Changed"/migration note. |
| 3 | LOW | toolSets.test.ts test 2 |
No reverse check that every MODULE_ADAPTERS key is referenced by a tool set. |
| 4 | LOW | toolSets.test.ts test 3 |
MODULE_ADAPTERS[module]({}) unguarded (obscure TypeError if adapter missing); owners loop duplicated between tests 2 and 3. |
| 5 | LOW | __tests__/smoke/* |
New (p: any)/(t: any) callbacks. |
| 6 | INFO | diff scope | Diff contains stacked 0.7 upgrade, verify script, version bump, etc. |
{"recommendation":"APPROVE","summary":"The calendar/earnings duplicate-module fix is minimal and correct, and the new catalog test properly guards against shared modules and duplicate tool names; only low-severity polish items remain.","findings":[{"severity":"LOW","file":"CHANGELOG.md","issue":"Entry under [Unreleased] below the 2.7.0 section"},{"severity":"LOW","file":"CHANGELOG.md","issue":"User-visible change filed only as Fixed"},{"severity":"LOW","file":"__tests__/unit/constants/toolSets.test.ts","issue":"No reverse check that every MODULE_ADAPTERS key is referenced"},{"severity":"LOW","file":"__tests__/unit/constants/toolSets.test.ts","issue":"Unguarded adapter call and duplicated owners loop"},{"severity":"LOW","file":"__tests__/smoke/smoke-test-dynamic.test.ts","issue":"any in callbacks (stale-base artifact)"},{"severity":"LOW","file":"(diff scope)","issue":"Stacked changes in diff (stale-base artifact)"}]}Generated by Claude Code
Add the reverse module check, guard missing adapters, share the owners helper, and file the changelog entry above 2.7.0 with a Changed note. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lq4R64VHie4GLCcJbKtMTS
Fix mapping for TS review round 1Fixes are in c93bb18.
Generated by Claude Code |
TS review:
|
| # | Sev | Location | Finding | Disposition |
|---|---|---|---|---|
| 1 | LOW | docs/API_REFERENCE.md:24,28 |
Row 24 lists transcripts and getEarningsCalendar together under earnings, calendar; the Calendar row omits getEarningsCalendar. |
Left as is: the row is a sample of tools across two tool sets and stays accurate, and the file is untouched by this PR. Not worth another review round. |
| 2 | LOW | toolSets.test.ts:39-54 |
moduleOwners() TSDoc has no @returns; the file-level doc block is attached to no symbol. |
Left as is: nit on a test helper; the block explains why the test exists. |
| 3 | LOW | toolSets.test.ts:72-80 |
The "exactly one toolset" test makes two assertions, so a first failure hides the second. | Left as is: both assertions state one invariant (the module-to-toolset partition), and the first failure already names the offending modules. |
{"recommendation":"APPROVE","summary":"Minimal, correct fix: calendar no longer lists earnings-transcript, the ALL_TOOLS count is unchanged at 253, and the round-1 findings are all addressed. Only LOW nits remain.","findings":[{"severity":"LOW","file":"docs/API_REFERENCE.md","line":24,"issue":"Earnings row groups tools across earnings and calendar; Calendar row omits getEarningsCalendar"},{"severity":"LOW","file":"__tests__/unit/constants/toolSets.test.ts","line":45,"issue":"moduleOwners() TSDoc lacks @returns; file-level doc block attached to no symbol"},{"severity":"LOW","file":"__tests__/unit/constants/toolSets.test.ts","line":72,"issue":"One test makes two independent assertions"}]}Generated by Claude Code
Requested by Ben · project thread
Before: the
calendarandearningstool sets both listed theearnings-transcriptmodule, so its four tools (getLatestEarningsTranscripts,getEarningsTranscript,getEarningsTranscriptDates,getAvailableTranscriptSymbols) were registered twice inALL_TOOLSmode. Toolception 0.7.0 silently keeps one; 0.8.0 (code-rabi/toolception#33, strict) failsinitialize, so the default mode would not start.After:
earningsowns the transcript module andcalendarkeeps onlycalendar(still includesgetEarningsCalendar). A new test fails on any module listed in two tool sets or any tool name registered twice.How
src/constants/toolSets.ts:calendar.modulesis["calendar"].earningsis named "Earnings & Transcripts", whilecalendaris described as dividends/IPOs/splits/earnings dates, so transcripts belong toearnings. No other module is shared between tool sets.__tests__/unit/constants/toolSets.test.ts(new): checks every module has an adapter, appears in exactly one tool set, and that loading every module yields unique tool names. It fails onmainwith the four tools above.docs/src/tools/AGENTS.mdandCHANGELOG.md(Unreleased) updated.docs/API_REFERENCE.mdalready listsearningsandcalendarfor these tools, which is still accurate.STATIC_TOOL_SETS/dynamic mode, selecting onlycalendarno longer exposes the transcript tools; selectearnings.ALL_TOOLSexposes the same 253 tools as before.Verification
typecheck,lint,test:run(including smoke tests afternpm run build) pass.npm run verify:toolception -- --source 0.7.0: 26/26.npm run verify:toolception -- --source git:claude/project-thread-4ocdp6(toolception feat(server): add smithery shield location #34, 0.8.0): 25/26.ALL_TOOLSnow starts. The one failure is the dynamic smoke testshould disable toolset (state only, tools remain), which asserts the old disable behaviour and is fixed by server test: don't assert that disabled toolset tools stay registered #113.Merge order
Base is
main; this is independent of #113. Both must merge before the server takes toolception 0.8.0 (which then needsverify:toolception -- --source 0.8.0green once 0.8.0 is on npm).🤖 Generated with Claude Code
https://claude.ai/code/session_01Lq4R64VHie4GLCcJbKtMTS
Generated by Claude Code