Found by QA run #10663 driving cli.datasource-introspect-codegen against a live showcase boot at framework 79ebb37.
Symptom
All three os datasource subcommands are broken on the happy path:
os datasource list-tables showcase_external → No remote tables found. (exit 0), while the server returns two tables.os datasource introspect showcase_external --table customers → Error: Failed to generate draft (exit 2).os datasource validate showcase_external → No federated objects to validate. (exit 0) even against induced drift the server flags as missing_column region severity:error — a silent CI-breaking pass.- Unknown datasource →
TypeError: first argument must be a string or instance of Error (exit 1, a crash rather than the server's error text).
Root cause
The commands read the pre-#3843flat response shape (body.tables / body.draft / body.results, and body.error as a string), but the server emits the current wrapped envelope from packages/types/src/response-envelope.ts: sendOk → {success:true, data:{…}}, sendError → {success:false, error:{code,message}}. So payloads (nested under data) read as undefined, and passing the error object to oclif's this.error(...) crashes. Mechanism at list-tables.ts:42-48, introspect.ts:53-63, validate.ts:43-53. This is these commands' first functional coverage — they never worked against the current envelope.
Reproduction
- Boot showcase on a scratch port, mint an admin token.
os datasource list-tables showcase_external --url <U> --token <T> → No remote tables found. exit 0; oracle GET /api/v1/datasources/showcase_external/external/tables = {success:true,data:{tables:[{"name":"customers","columnCount":7},{"name":"orders","columnCount":7}]}}.os datasource introspect showcase_external --table customers … → Error: Failed to generate draft exit 2; oracle POST …/tables/customers/draft returns data.draft.source.- Induce drift (rename
customers.region in the fixture DB), os datasource validate … → No federated objects to validate. exit 0; oracle POST …/external/validate = ok:false … missing_column region.
Suggested fix
Unwrap the envelope in all three commands: read body.data.tables|draft|results and body.error?.message. Secondary quality gap: even once unwrapped, the generated draft fails os build as-is (object name lacks ${namespace}_ prefix; no sharingModel).
QA-source: #10663 · integration-system.external-schema-introspection · CLI lane (the introspection feature's CLI door)
Found by QA run #10663 driving
cli.datasource-introspect-codegenagainst a live showcase boot at framework79ebb37.Symptom
All three
os datasourcesubcommands are broken on the happy path:os datasource list-tables showcase_external→No remote tables found.(exit 0), while the server returns two tables.os datasource introspect showcase_external --table customers→Error: Failed to generate draft(exit 2).os datasource validate showcase_external→No federated objects to validate.(exit 0) even against induced drift the server flags asmissing_column region severity:error— a silent CI-breaking pass.TypeError: first argument must be a string or instance of Error(exit 1, a crash rather than the server's error text).Root cause
The commands read the pre-#3843flat response shape (
body.tables/body.draft/body.results, andbody.erroras a string), but the server emits the current wrapped envelope frompackages/types/src/response-envelope.ts:sendOk→{success:true, data:{…}},sendError→{success:false, error:{code,message}}. So payloads (nested underdata) read asundefined, and passing the error object to oclif'sthis.error(...)crashes. Mechanism atlist-tables.ts:42-48,introspect.ts:53-63,validate.ts:43-53. This is these commands' first functional coverage — they never worked against the current envelope.Reproduction
os datasource list-tables showcase_external --url <U> --token <T>→No remote tables found.exit 0; oracleGET /api/v1/datasources/showcase_external/external/tables={success:true,data:{tables:[{"name":"customers","columnCount":7},{"name":"orders","columnCount":7}]}}.os datasource introspect showcase_external --table customers …→Error: Failed to generate draftexit 2; oraclePOST …/tables/customers/draftreturnsdata.draft.source.customers.regionin the fixture DB),os datasource validate …→No federated objects to validate.exit 0; oraclePOST …/external/validate=ok:false … missing_column region.Suggested fix
Unwrap the envelope in all three commands: read
body.data.tables|draft|resultsandbody.error?.message. Secondary quality gap: even once unwrapped, the generated draft failsos buildas-is (object name lacks${namespace}_prefix; nosharingModel).QA-source: #10663 · integration-system.external-schema-introspection · CLI lane (the introspection feature's CLI door)