Repository navigation
feat(cli): manifestVerify and hostsFetch, so a CLI made from a config keeps no token check of its own - #3110
Merged
Merged
Conversation
… keeps no token check of its own manifestVerify is tokenSessionCommand's verify from wirecat.config.ts's auth.verify: it sends the one operation, refuses a token the answer does not call active (Attio answers a revoked key with 200), names a missing id as the service's error, and keeps the id and the name when it is text. hostsFetch(hosts, fetch) is the hosts-only fetch over a test's fake. ProfileTokenStore takes keyring: undefined, so a CLI passes baseContext's keyring as it is. A CLI made by cli-template's new --from-config held this logic in its seed, with branches on the config's values that no test of that CLI can take both ways: its coverage floor failed (FIND-2767). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <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.
Task
Move the token check of a CLI made from
wirecat.config.tsinto cli-core, so the CLI holds config and no logic of its own.Why
A CLI made by cli-template's
new --from-config(CRM or tracker, withauth.verify) passed every check except its ownpnpm test:coverage: the tracker reached 52% of branches against a floor of 75%. The seed carried the token check andx ? { x } : {}spreads whose sides depend only on the config or on a real run, so no test of that CLI can take both. Logic every such CLI needs belongs here, tested once.What
manifestVerify({ manifest, service, verify, fetch }):tokenSessionCommand'sverifyfrom the config'sauth.verify. It sends the one operation, refuses a token the answer does not callactive(Attio answers a revoked key with 200), names a missing id asprovider_error(verify.no-id), and keeps the id and the name when it is text.hostsFetch(hosts, fetch): the hosts-only fetch over a test's fake, takingenvironment.fetchas it is.ProfileTokenStoretakeskeyring: undefined, so a CLI passesbaseContext's keyring straight through.Testing
manifestVerifyandhostsFetch(checked with coverage); typecheck, lint and docs check pass; the nearby suites (token session, profile token, service api, manifest) pass, 62 tests.new --from-configfrom the cli-template branchtest/kit-e2e-from-configpass install, build, doctor, generate, lint, ci:quick, contracts:check, docs:check andtest:coverage(tracker: lines 97%, branches 100%; CRM: lines 96.8%, branches 100%).🤖 Generated with Claude Code