Skip to content

Comments

Schema#11

Merged
hev merged 14 commits intomainfrom
schema
Jan 14, 2026
Merged

Schema#11
hev merged 14 commits intomainfrom
schema

Conversation

@hev
Copy link
Owner

@hev hev commented Jan 14, 2026

Summary

Changes made by Ralph automated loop.

  • Made 39 commits

Generated by Ralph

hev and others added 13 commits January 14, 2026 04:17
These directories contain local agent/workflow tracking state
that should not be committed to the repository.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implements Phase 1 of schema management:
- Create schema.py with Click command group structure
- Add schema get subcommand to display namespace schemas
- Support --raw flag for piping JSON output
- Register schema command in CLI

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Adds SchemaDiff dataclass and compute_schema_diff function to compare
current and new schemas. Identifies unchanged attributes, additions,
and type conflicts for use in the schema apply command.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implements the core `tpuff schema apply` command that:
- Loads schema from a JSON file
- Shows a git-style diff of changes
- Detects type conflicts (which turbopuffer disallows)
- Applies schema via upsert with placeholder row
- Supports --dry-run and --yes flags

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Validates schema files before applying:
- Simple types: string, uint64, uuid, bool
- Vector types: [dims]f32, [dims]f16
- Complex types with options: full_text_search, regex_index, filterable
- Reports all validation errors with clear messages

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Tests cover:
- Schema type normalization and display formatting
- Schema validation (simple types, vectors, complex types)
- Schema diff computation (additions, unchanged, conflicts)
- Schema apply command with dry-run, confirmation prompt, and error cases

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implements the `tpuff schema copy` command which:
- Copies schema from a source namespace to a new target namespace
- Validates that source namespace exists and has a schema
- Validates that target namespace is empty or non-existent
- Displays the schema being copied before applying
- Creates target with placeholder row to initialize namespace
- Includes unit tests for all copy scenarios

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Extend the schema apply command to support applying schemas to multiple
namespaces at once using a prefix filter. Features include:

- List and filter namespaces by prefix
- Summary table showing changes per namespace before applying
- Conflict detection blocks all applies if any namespace has conflicts
- Skips namespaces already up to date
- Progress reporting and final success/failure summary

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Extends schema apply command to support applying a schema to all
namespaces at once using the --all flag. This complements the existing
--prefix option for targeting specific namespace groups.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When applying schema to multiple namespaces (--prefix or --all), if some
namespaces have type conflicts, this option allows skipping conflicted
namespaces and continuing to apply schema to the remaining ones.

Without this flag, any conflict causes an immediate exit. With the flag,
a warning is shown and conflicted namespaces are skipped.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Tests cover:
- Write errors during batch apply (ns.write() failures)
- get_namespace errors during analysis phase
- All namespaces failing to write
- Partial success reporting (correct counts)
- Error display in dry-run mode
- Mixed errors (conflicts + write failures) with --continue-on-error

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Test on Python 3.10, 3.11, 3.12
- Run ruff linter
- Run pytest

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@hev hev merged commit 72be0dd into main Jan 14, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant