Skip to content

feat(cli): manifestVerify and hostsFetch, so a CLI made from a config keeps no token check of its own - #3110

Merged
leemour merged 2 commits into
mainfrom
feat/manifest-verify
Nov 18, 2026
Merged

leemour merged 2 commits into
mainfrom
feat/manifest-verify

Conversation

@leemour

@leemour leemour commented Nov 18, 2026

Copy link
Copy Markdown
Member

Task

Move the token check of a CLI made from wirecat.config.ts into 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, with auth.verify) passed every check except its own pnpm test:coverage: the tracker reached 52% of branches against a floor of 75%. The seed carried the token check and x ? { 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's verify from the config'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 provider_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, taking environment.fetch as it is.
  • ProfileTokenStore takes keyring: undefined, so a CLI passes baseContext's keyring straight through.

Testing

  • Unit tests for every branch of manifestVerify and hostsFetch (checked with coverage); typecheck, lint and docs check pass; the nearby suites (token session, profile token, service api, manifest) pass, 62 tests.
  • With this package packed and installed, a tracker CLI (GraphQL) and a CRM CLI (OpenAPI) made by new --from-config from the cli-template branch test/kit-e2e-from-config pass install, build, doctor, generate, lint, ci:quick, contracts:check, docs:check and test:coverage (tracker: lines 97%, branches 100%; CRM: lines 96.8%, branches 100%).

🤖 Generated with Claude Code

leemour and others added 2 commits November 18, 2026 10:18
… 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>
@leemour
leemour merged commit aab917f into main Nov 18, 2026
43 checks passed
@leemour
leemour deleted the feat/manifest-verify branch November 18, 2026 09:42
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