Background
The sl-builder skill in ai-kit currently uses hand-rolled urllib/httpx calls against the Keboola Metastore API (e.g. https://metastore.<stack>.keboola.com/v1/api/...). This pre-dates the kbagent semantic-layer command group (shipped in kbagent v0.34.0, PR keboola/cli#293) which now wraps every metastore operation behind the kbagent error envelope, retry/backoff layer, permission gate, and --hint client|service snippet generator.
Why migrate
Keeping the raw urllib path on top of the new kbagent surface means:
- Duplicate-name normalization (server's HTTP 500
Failed to create meta object -> ALREADY_EXISTS) is implemented once in kbagent and again in the skill.
- Constraint shape validators (
rule is STRING not OBJECT, name regex ^[a-z][a-z0-9_]*$, 3-level severity enum) live in two places.
kbagent semantic-layer build --tables T1,T2,... already does the schema-discovery + heuristic-generate dance the skill orchestrates.
- The skill bypasses kbagent's permission gates (
--deny-writes / --deny-destructive) so policy-enforced runners can't constrain it.
- The skill cannot leverage
--hint client / --hint service for Python code generation when the human operator wants to inspect or customize.
Acceptance criteria
- Audit every call site in
sl-builder that talks to metastore.*.keboola.com.
- Replace each with the equivalent
kbagent semantic-layer ... invocation (CLI subprocess, or import + use SemanticLayerService directly if the skill runs in-process).
- Where the kbagent surface is too narrow (e.g. bulk batch operations), file a kbagent enhancement issue first rather than working around with raw urllib.
- Update the skill docs (
SKILL.md, references/) to reference the kbagent surface.
Cross-link
Filed from kbagent PR keboola/cli#293 review (pre-merge follow-up tracking). See also issues #294 (edit_metric cascade rollback) and #295 (build_model rollback) for kbagent-side gaps in the same PR.
Filed from PR #293 review (pre-merge follow-up tracking)
Background
The
sl-builderskill inai-kitcurrently uses hand-rolledurllib/httpxcalls against the Keboola Metastore API (e.g.https://metastore.<stack>.keboola.com/v1/api/...). This pre-dates thekbagent semantic-layercommand group (shipped in kbagent v0.34.0, PR keboola/cli#293) which now wraps every metastore operation behind the kbagent error envelope, retry/backoff layer, permission gate, and--hint client|servicesnippet generator.Why migrate
Keeping the raw urllib path on top of the new kbagent surface means:
Failed to create meta object->ALREADY_EXISTS) is implemented once in kbagent and again in the skill.ruleis STRING not OBJECT, name regex^[a-z][a-z0-9_]*$, 3-level severity enum) live in two places.kbagent semantic-layer build --tables T1,T2,...already does the schema-discovery + heuristic-generate dance the skill orchestrates.--deny-writes/--deny-destructive) so policy-enforced runners can't constrain it.--hint client/--hint servicefor Python code generation when the human operator wants to inspect or customize.Acceptance criteria
sl-builderthat talks tometastore.*.keboola.com.kbagent semantic-layer ...invocation (CLI subprocess, or import + useSemanticLayerServicedirectly if the skill runs in-process).SKILL.md,references/) to reference the kbagent surface.Cross-link
Filed from kbagent PR keboola/cli#293 review (pre-merge follow-up tracking). See also issues #294 (edit_metric cascade rollback) and #295 (build_model rollback) for kbagent-side gaps in the same PR.
Filed from PR #293 review (pre-merge follow-up tracking)