Repository navigation
cli: show rendering tiers, never engine names - #6
Merged
Merged
Conversation
Customers see three tiers (fetch, js, browser), not the engines behind them. The API already reports tiers on every public endpoint, so the CLI follows. - sessions create/list and browser url take a tier with --engine. The names older CLIs took still work (sent as typed) with a stderr notice that does not repeat them. - scrape/batch submit keep --engine and the display flag hidden: the API ignores both (ENGINE_IGNORED). The spinner no longer reads an engine pin. - Human output maps any engine name the API sends to its tier (logs, sessions, usage, --meta) and rewrites engine names in warnings, hints and errors. --json and --jsonl stay exactly as sent. - openapi.yaml, the schemas and the embedded skill are re-synced from the docs site (make spec); README, DESIGN.md and CHANGELOG use tier names. - Tests: help, human output, live summary, errors, the embedded skill and the specs never name an engine; goldens updated to the API's tier values.
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.
Stacked on #4 (base
feat/tui-progress); retargets tomainwhen #4 merges.Product rule: customers never see the internal engine or browser names. The public tiers are
fetch,jsandbrowser, and users do not choose engines.What the API does
It already maps every public endpoint to a tier (
router.Engine.Tier, fail-closed tobrowser), so the CLI was the one leaking: its help, flags, goldens, spec copy and docs were written before the API moved./v1/sessionsand/v1/browsertakefetch|js|browserand still accept the old names silently./v1/scrapeand/v1/batchignoreengineandheadless(ENGINE_IGNORED).Changes
sessions create --engineandbrowser url --enginetake and list a tier. The old names (obscura,chromium,camoufox) still work and are sent as typed, withwarning: --engine: this value is deprecated; use ...on stderr that does not repeat the name.sessions list --enginetakes a tier (the API accepts old names too).scrape/batch submit:--engineand the display flag are hidden from--helpbut still accepted, since the API ignores them and already warns. The spinner no longer reads an engine pin.--stealthhelp no longer names its browser.browser url: the display flag is hidden, the CDP hints no longer name client libraries, the default engine isbrowser.output.Tier: moli/obscura/headless ->js, fetch ->fetch, anything else ->browser, same as the API):logsENGINE column andlogs get,sessionslist/get/create/release,usage --group-by engine,scrape --meta. Warnings, hints, errors andinfolines rewrite engine names in server prose (output.PublicText, same set as the API'srouter.PublicText).--jsonlare untouched: the scrape wrapper'sengine, session bodies and the rest stay exactly as the API sent them.openapi.yamlrefreshed withmake spec, schemas regenerated (go generate ./internal/schema/), embeddedskill.mdsynced from the docs site. README, DESIGN.md (new contract item 10) and CHANGELOG use tier names.Goldens
Fixtures now carry the API's real tier values, so the regenerated goldens change only for that:
browser/*andbrowser_human/url(engine=chromium->engine=browserin the token URL),sessions/*andsessions_human/*(chromium->browser,obscura->js, one invented warning replaced),usage_human/by_engine_unattributed(rowchromium->Browser rendering), and theschema/*andschema_human/*digests (regenerated schemas).Tests
internal/cmd/engine_names_test.go: every command's--help, the human output of scrape/sessions/logs/usage against an API that leaks engine names, the live summary line and the error block, the embedded skill, schemas andopenapi.yamlnever contain the names; JSON output stays verbatim. Unit tests forTierandPublicText.go vet ./...andgo test -race ./...pass.Left on purpose
headlessis still a wire field in the API's spec (a deprecated, ignored scrape field and a/v1/browseroption), so it stays inopenapi.yaml, the schemas, the synced skill and the hidden flag. The tests allow that one word in those files.