schema: add 'schema reset' command to rebuild org schemas#295
Merged
Conversation
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>
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.
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
limacharlie/sdk/organization.py):Organization.reset_schemas()→DELETE orgs/{oid}/schema. Returns the raw response dict, consistent with sibling methods (delete_org,dismiss_error).limacharlie/commands/schema.py):limacharlie schema reset, guarded by--confirm(exits 4 without it, mirroring theai-memory deleteconvention), withregister_explaintext surfaced via--ai-help.--confirmguard and happy path; aschema listregression guard; updated the lazy-loading regression's expected subcommand set.Usage
Validation
test_search_*failures oncli-v2are unrelated (confirmed by stashing this change and re-running on the clean base branch).schema --helplistsreset,schema reset --helpshows--confirm,--ai-helprenders the explain text.Note for reviewers
The backend authorizes this destructive, org-wide endpoint with the
org.getpermission (lc_api-go/.../endpoint_org_info.go). Not changed here (backend concern), but worth being aware of.🤖 Generated with Claude Code