Repository navigation
test(connectors): cover methodLines, docSection and snakeId (#264) - #284
Merged
juancguerrerodev merged 9 commits intoDec 6, 2026
Merged
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
…ngLabs#264) Signed-off-by: Ashiq Hussain Mir <128612922+mir-ashiq@users.noreply.github.com>
juancguerrerodev
force-pushed
the
test/connectors-derive
branch
from
December 6, 2026 09:10
418762f to
0302149
Compare
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.
What and why
Closes #264
Adds a
describeblock for each of the three helperspackages/connectors/src/connect/derive.tsreads a service's API docs with, importingmethodLines,docSectionandsnakeIdfrom../src/connect/derive.ts, with a made-up doc:methodLinesfinds bothMETHOD /pathlines of the doc, with the trailing.dropped from the path, accepts spaces before the method, and skips a lower case method, a method in the middle of a sentence and a method it doesn't know (HEAD);docSectiongives the heading line before the method, the method line and what follows, stopping before the next endpoint's heading, runs the last endpoint's section to the end of the doc, and gives""for a method or a path that isn't there;snakeIdturns names into snake case with accents dropped (Café Ñandúgivescafe_nandu), prefixes a name that doesn't start with a letter, gives the fallback when there is no letter at all, pads a one letter id, and cuts a long name to 40 characters with no_at the end.It also pins today's
docSectionbehaviour the issue names: the line just before the next method line is always treated as that endpoint's heading, sodocSection("GET /a\nx\nPOST /b", "GET", ["/a"])gives"GET /a".Tests only:
packages/connectors/src/connect/derive.tsis unchanged, and the doc, names, paths and fallback in the tests are all made up.Vision fit
Principle 7, "Small, typed and tested": packages are plain TypeScript behind ports, tested on Node. The three helpers decide what a drafted connector may read and how it is named, so their behaviour is pinned by tests that call each by name instead of only through whole drafts.
Non-negotiables
Checklist
acceptedproposal.pnpm check:privacy,pnpm typecheck,pnpm lint,pnpm testandnode scripts/guard/check.mjs --patterns scripts/guard/patterns.txt.packages/copy, in es-419 and en, with matching keys and placeholders, and no em or en dashes. (No UI string in this change.)One step of the gates I could not complete in this sandbox, named as AGENTS.md asks: a full
pnpm installdoes not finish on this machine (it is killed for memory, and the Expo dependencies fill the disk), soapps/mobile's typecheck and tests, and with them the single full-repopnpm typecheckandpnpm test, did not run locally. This change touches one test file inpackages/connectorsand nothing inapps/mobile; CI runs the full set. Everything else ran locally:pnpm --filter @hermit/connectors test: 358 passed (345 existing + 13 new,connect-derive.test.tsnow 23).pnpm -r --if-present --filter '!@hermit/mobile' test: 16 projects, 4,218 tests passed.pnpm --filter @hermit/connectors typecheck: passed.node --test scripts/*.test.mjs scripts/devices/*.test.mjs: 93 passed.pnpm lint: passed.pnpm check:privacy: passed.node scripts/guard/check.mjs --patterns scripts/guard/patterns.txt:guard: ok. 1 changed files checked against origin/HEAD.Model path
packages/model,agent,skillsoreval, the prompt, the router, tool descriptions, normalizers, examples or the model file.Screenshots
New dependencies and network calls
n/a
AI agents