Skip to content

schema: add 'schema reset' command to rebuild org schemas#295

Merged
maximelb merged 1 commit into
cli-v2from
cli-v2-schema-reset
May 18, 2026
Merged

schema: add 'schema reset' command to rebuild org schemas#295
maximelb merged 1 commit into
cli-v2from
cli-v2-schema-reset

Conversation

@maximelb
Copy link
Copy Markdown
Contributor

Summary

Exposes the existing backend endpoint DELETE /orgs/{oid}/schema (resetOrgSchemas) through the Python CLI/SDK. This was previously only reachable via the Go SDK (Organization.ResetSchemas()) or a raw API call — there was no Python CLI/SDK surface for it.

Resetting schemas clears the cached schema/ontology so it rebuilds from newly observed events — useful when the recorded schema has gone stale (e.g. after telemetry shape changes) and fields are missing from schema list / schema get.

Changes

  • SDK (limacharlie/sdk/organization.py): Organization.reset_schemas()DELETE orgs/{oid}/schema. Returns the raw response dict, consistent with sibling methods (delete_org, dismiss_error).
  • CLI (limacharlie/commands/schema.py): limacharlie schema reset, guarded by --confirm (exits 4 without it, mirroring the ai-memory delete convention), with register_explain text surfaced via --ai-help.
  • Tests: SDK request assertion; CLI tests for the --confirm guard and happy path; a schema list regression guard; updated the lazy-loading regression's expected subcommand set.

Usage

limacharlie schema reset --confirm

Validation

  • Targeted suite (SDK org / CLI commands / lazy-loading / command-map lint / discovery): 1134 passed.
  • New tests pass individually.
  • The pre-existing test_search_* failures on cli-v2 are unrelated (confirmed by stashing this change and re-running on the clean base branch).
  • Smoke-tested: schema --help lists reset, schema reset --help shows --confirm, --ai-help renders the explain text.

Note for reviewers

The backend authorizes this destructive, org-wide endpoint with the org.get permission (lc_api-go/.../endpoint_org_info.go). Not changed here (backend concern), but worth being aware of.

🤖 Generated with Claude Code

Exposes the existing backend endpoint DELETE /orgs/{oid}/schema
(resetOrgSchemas) through the Python CLI/SDK, mirroring the Go SDK's
Organization.ResetSchemas().

- SDK: Organization.reset_schemas() -> DELETE orgs/{oid}/schema
- CLI: 'limacharlie schema reset', guarded by --confirm (exit 4
  without it), with register_explain text for --ai-help
- Tests: SDK request assertion, CLI tests for the --confirm guard
  and the happy path, plus a 'schema list' regression guard;
  updated the lazy-loading regression's expected subcommand set

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@maximelb maximelb requested a review from dzimine-lc May 18, 2026 03:32
@maximelb maximelb marked this pull request as ready for review May 18, 2026 03:32
@maximelb maximelb merged commit 10323ca into cli-v2 May 18, 2026
6 of 7 checks passed
@maximelb maximelb deleted the cli-v2-schema-reset branch May 18, 2026 03:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant