Skip to content

refactor!: rename tetra to flash#165

Merged
deanq merged 61 commits intomainfrom
deanq/ae-1522-rename-tetra-to-flash
Feb 4, 2026
Merged

refactor!: rename tetra to flash#165
deanq merged 61 commits intomainfrom
deanq/ae-1522-rename-tetra-to-flash

Conversation

@deanq
Copy link
Member

@deanq deanq commented Jan 31, 2026

No description provided.

deanq and others added 30 commits January 28, 2026 07:39
- Add Python AST indexer (ast_to_sqlite.py) to extract framework symbols
- Add fast query CLI interface (code_intel.py) with Rich formatted output
- SQLite database with optimized indexes for symbol lookup
- Extract classes, functions, methods, decorators, type hints, docstrings
- Update Makefile with index/query targets
- Update CONTRIBUTING.md with setup and usage documentation
- Performance: 466 symbols indexed in 0.09s, database size 260KB
- Reduces token usage by ~85% when exploring framework structure

Commands:
  make index              - Generate/update code intelligence index
  make query SYMBOL=name  - Find symbol by name
  make query-classes      - List all classes
  make query-all          - List all symbols
…ude Code

Adds Model Context Protocol (MCP) server integration to expose the SQLite code
intelligence database as native Claude Code tools. This enables Claude to query
framework symbols, classes, and structure without reading full files, reducing
token usage by ~85% for code exploration tasks.

## Changes

- Add mcp_code_intel_server.py: MCP server with 5 specialized tools
  - find_symbol: Search for classes, functions, methods
  - list_classes: Browse all framework classes
  - get_class_interface: View class methods without implementations
  - list_file_symbols: Explore file structure
  - find_by_decorator: Find decorated symbols

- Create .mcp.json: MCP server configuration for automatic Claude Code discovery
- Add tetra-explorer skill: Guidance for using code intelligence tools
- Update CONTRIBUTING.md: Document MCP integration for developers
- Add mcp>=1.0.0 dependency to pyproject.toml
- Update .gitignore for .claude/ directory

## Benefits

- Zero-configuration Claude Code integration via MCP
- 85% token reduction for code exploration (from ~10k to ~2k tokens)
- <10ms query performance with SQLite indexing
- Type-safe tool interfaces with MCP schemas
- Automatic tool discovery by Claude Code

## Technical Details

- Database: 466 symbols indexed from tetra-rp source
- Storage: .code-intel/flash.db (~250KB)
- Transport: stdio for Claude Code integration
- Python 3.10+ compatible

All quality checks passed. Tests: 34 passed, code coverage: 68.78%
Allow additional open-source licenses used by transitive dependencies:
- Python-2.0: Python standard library and some tools
- Unlicense: Some utility libraries
- MPL-2.0: Some utility packages (certifi, pathspec)

These are all permissive licenses compatible with MIT distribution.
- Extract hardcoded LIMIT values into named constants for maintainability
- Rename handle_list_tools to list_tools for naming consistency
- Extract duplicated error handling into _log_indexing_error helper
- Add clarification about which dependencies require non-standard licenses
- Add Python AST indexer (ast_to_sqlite.py) to extract framework symbols
- Add fast query CLI interface (code_intel.py) with Rich formatted output
- SQLite database with optimized indexes for symbol lookup
- Extract classes, functions, methods, decorators, type hints, docstrings
- Update Makefile with index/query targets
- Update CONTRIBUTING.md with setup and usage documentation
- Performance: 466 symbols indexed in 0.09s, database size 260KB
- Reduces token usage by ~85% when exploring framework structure

Commands:
  make index              - Generate/update code intelligence index
  make query SYMBOL=name  - Find symbol by name
  make query-classes      - List all classes
  make query-all          - List all symbols
…ude Code

Adds Model Context Protocol (MCP) server integration to expose the SQLite code
intelligence database as native Claude Code tools. This enables Claude to query
framework symbols, classes, and structure without reading full files, reducing
token usage by ~85% for code exploration tasks.

- Add mcp_code_intel_server.py: MCP server with 5 specialized tools
  - find_symbol: Search for classes, functions, methods
  - list_classes: Browse all framework classes
  - get_class_interface: View class methods without implementations
  - list_file_symbols: Explore file structure
  - find_by_decorator: Find decorated symbols

- Create .mcp.json: MCP server configuration for automatic Claude Code discovery
- Add tetra-explorer skill: Guidance for using code intelligence tools
- Update CONTRIBUTING.md: Document MCP integration for developers
- Add mcp>=1.0.0 dependency to pyproject.toml
- Update .gitignore for .claude/ directory

- Zero-configuration Claude Code integration via MCP
- 85% token reduction for code exploration (from ~10k to ~2k tokens)
- <10ms query performance with SQLite indexing
- Type-safe tool interfaces with MCP schemas
- Automatic tool discovery by Claude Code

- Database: 466 symbols indexed from tetra-rp source
- Storage: .code-intel/flash.db (~250KB)
- Transport: stdio for Claude Code integration
- Python 3.10+ compatible

All quality checks passed. Tests: 34 passed, code coverage: 68.78%
Allow additional open-source licenses used by transitive dependencies:
- Python-2.0: Python standard library and some tools
- Unlicense: Some utility libraries
- MPL-2.0: Some utility packages (certifi, pathspec)

These are all permissive licenses compatible with MIT distribution.
…rename-tetra-to-flash

Merge code intelligence MCP server implementation with tetra-to-flash rename.

Resolved conflicts:
- .github/workflows/dependency-review.yml: Took improved license comments
- scripts/ast_to_sqlite.py: Took version with extracted error logging
- scripts/mcp_code_intel_server.py: Took version with constants for limits
- uv.lock: Regenerated to match current dependencies
Implement two features for the code intelligence MCP server:

1. Smart Re-indexing
   - Index auto-rebuilds on MCP server startup when stale
   - Checks if any Python files in src/ changed since last index
   - Compares file mtimes against index_timestamp in metadata table
   - Triggers rebuilding only when necessary
   - Fast: only checks file mtimes, no AST parsing until rebuild needed

2. Test Output Parser MCP Tool
   - New tool parses pytest output and returns structured data
   - Extracts test summary (passed/failed/errors/skipped counts)
   - Lists failed tests with file locations and error messages
   - Parses coverage statistics if present
   - Returns markdown-formatted summary for easy reading
   - Reduces token usage by ~85% vs reading full test output

Changes to ast_to_sqlite.py:
- Track latest_file_mtime and file_count in metadata table
- Enables staleness detection in MCP server

Changes to mcp_code_intel_server.py:
- Add should_reindex() function for checking if index is stale
- Add smart re-indexing in main() before server starts
- Add parse_test_output() function to parse pytest output
- Add format_test_summary() for markdown formatting
- Add new parse_test_output MCP tool with clear description
- Tool description teaches Claude when/why to use it
- Add parse_test_output tool documentation with usage examples
- Add explicit prohibition of bash commands (tail/grep/cat) for MCP-compatible tasks
- Document bad patterns with token cost comparisons (99% reduction for test output)
- Expand skill file with:
  - Step 1.5: NEVER use bash commands for MCP tool tasks
  - Analyzing Test Results section with good/bad examples
  - Available MCP Tools reference list
  - Strong enforcement notes in Important Notes
- Add 200-token example showing difference between MCP tool vs bash approaches

This forces Claude Code to consistently use parse_test_output (~200 tokens) instead
of bash commands (~20,000+ tokens) when analyzing test output, reducing token usage
by 99% for test analysis workflows.
- Add .claude/settings.json with pre-approved permissions for all contributors
- Update code coverage requirement from 35% to 65% in CONTRIBUTING.md
- Simplify authors to generic Runpod email in pyproject.toml
- Remove empty [tool.ruff] section from pyproject.toml
- Remove outdated docs/PRD.md
- Update dependency lock file (uv.lock)
Manual dependency review during PR review is sufficient.
Removes automated license check that adds friction for legitimate dependencies.
deanq added 17 commits January 31, 2026 17:41
- Update all documentation with correct import paths and references
- Update project documentation with new GitHub URLs
- Update script docstrings and help text
- Update Claude skill references
- Remove temporary migration planning documents
- Fix broken imports: tetra_rp → runpod_flash in manifest.py and preview.py
- Rename constants: TETRA_* → FLASH_* (IMAGE_TAG, GPU_IMAGE, CPU_IMAGE, etc.)
- Update CLI flags: --use-local-tetra → --use-local-flash
- Update internal references: .tetra/ → .flash/, tetra.metrics → flash.metrics
- Update pyproject.toml: package name tetra_rp → runpod-flash
- Update all imports and usages throughout codebase
…hase 5)

- Replace all tetra_rp imports with runpod_flash in 72 test files
- Update TETRA_* constants to FLASH_* in tests
- Fix sys.modules references from tetra_rp to runpod_flash
- Update docstring examples to use runpod_flash
- Ensure all imports and references use new package name
- Update test assertions to expect tetra-rp: image names (not flash:)
- Docker images remain as runpod/tetra-rp* until Phase 10 infrastructure coordination
- All 829 unit tests now pass
- Update Makefile: --cov=tetra_rp → --cov=runpod_flash in all coverage commands
- Update test-image-constants.py: Replace all tetra_rp imports with runpod_flash
- Update constant names: TETRA_* → FLASH_* in scripts
- Update environment variable names: TETRA_IMAGE_TAG → FLASH_IMAGE_TAG
- Update skeleton_template/requirements.txt: tetra_rp → runpod-flash
- Update imports: from tetra_rp → from runpod_flash
- Update package installation: pip install tetra_rp → pip install runpod-flash
- Update constants: TETRA_* → FLASH_*
- Update all markdown files: README, CONTRIBUTING, VERIFICATION, CHANGELOG, docs/

Modified files:
- CHANGELOG.md
- CLAUDE.md
- CONTRIBUTING.md
- README.md
- VERIFICATION.md
- docs/ (7 files)
Update all Docker image default values and test assertions to use the new
flash image names instead of tetra-rp:

- FLASH_GPU_IMAGE: runpod/tetra-rp → runpod/flash
- FLASH_CPU_IMAGE: runpod/tetra-rp-cpu → runpod/flash-cpu
- FLASH_LB_IMAGE: runpod/tetra-rp-lb → runpod/flash-lb
- FLASH_CPU_LB_IMAGE: runpod/tetra-rp-lb-cpu → runpod/flash-lb-cpu

Updated files:
- src/runpod_flash/core/resources/constants.py: Updated Docker image defaults
- tests/unit/resources/test_live_serverless.py: Updated 6 test assertions
- tests/unit/resources/test_live_load_balancer.py: Updated 6 test assertions
- tests/integration/test_cpu_disk_sizing.py: Updated 3 test assertions
- tests/integration/test_lb_remote_execution.py: Updated 2 test assertions
- .env: Updated comment from TETRA_IMAGE_TAG to FLASH_IMAGE_TAG
- scripts/verify-image-constants.sh: Updated to use FLASH_* constants
- scripts/verify-manifest-constants.sh: Updated to use FLASH_* constants

All 893 tests pass with the new Docker image names.
Complete the renaming project by:
- Updating remaining docstrings and comments (tetra → flash)
- Renaming MCP server (tetra-code-intel → flash-code-intel)
- Renaming skill directory (.claude/skills/tetra-explorer → flash-explorer)
- Updating documentation file paths (src/tetra_rp → src/runpod_flash)
- Fixing metrics namespace and image constants test patterns
- Cleaning up build artifacts (removed tetra_rp.egg-info)
- Final verification of all 893 tests passing

All "tetra" references have been replaced with "flash" throughout:
- Package code (docstrings, comments, internal references)
- CLI documentation and command descriptions
- MCP tools and skills
- Integration documentation

External references to "worker-tetra" repository are preserved as they
reference the upstream base image package, not the renamed framework.

This completes the tetra-rp → runpod-flash renaming project.
Complete the MCP tool and documentation renaming by:
- Updating MCP configuration (.mcp.json, .claude/settings.json)
- Renaming all MCP tool references (tetra-code-intel → flash-code-intel)
- Updating file paths in documentation (src/tetra_rp → src/runpod_flash)
- Fixing VERIFICATION.md, CONTRIBUTING.md, and CLAUDE.md references

All intentional references preserved:
- CHANGELOG.md: Historical commit references
- worker-tetra: External upstream package references

This completes ALL tetra → flash renaming across the project.
All 893 tests passing. No unintentional tetra references remain.
@deanq deanq requested a review from Copilot February 3, 2026 06:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request renames the project from "tetra" to "flash" across the entire codebase, updating package names, import statements, environment variables, configuration files, and documentation.

Changes:

  • Renamed Python package from tetra_rp to runpod_flash throughout the codebase
  • Updated environment variable prefixes from TETRA_ to FLASH_
  • Updated Docker image names from tetra-rp to flash

Reviewed changes

Copilot reviewed 141 out of 197 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/unit/*.py (multiple) Updated imports from tetra_rp to runpod_flash and patch paths
tests/integration/*.py (multiple) Updated imports and mock paths for integration tests
tests/conftest.py Updated imports and documentation references
src/runpod_flash/**/*.py (multiple) Updated imports, constants, and internal references
src/runpod_flash/config.py Created new config file replacing old tetra_rp/config.py with Flash naming
scripts/.py, scripts/.sh Updated references in build and verification scripts
pyproject.toml Updated package name and metadata
docs/*.md Updated documentation with new naming
README.md, CONTRIBUTING.md Updated user-facing documentation
.github/workflows/*.yml Updated CI/CD configuration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@deanq deanq marked this pull request as ready for review February 3, 2026 22:18
@deanq deanq changed the title WIP: rename tetra to flash refactor!: rename tetra to flash Feb 3, 2026
# Conflicts:
#	CHANGELOG.md
#	pyproject.toml
#	uv.lock
@deanq deanq merged commit 7546eaf into main Feb 4, 2026
6 checks passed
@deanq deanq deleted the deanq/ae-1522-rename-tetra-to-flash branch February 4, 2026 02:31
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.

2 participants