feat: Phase 1-2 v2 stabilization#49
Merged
Merged
Conversation
…rvice metadata, wake_up, v2 API, push/pull, CI/CD
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
Implements Phase 1 (Stabilize Current v2 Core) and Phase 2 (Team Sync Shared Backend MVP) from the LeanKG roadmap.
Phase 1 Changes
Schema migration hardening (
src/db/schema.rs):replacechain (migrations 002-005) with safeensure_canonical_*functions:replaceon schema mismatchrepair_canonical_schema,get_column_count,ensure_incidents_tableEnv-aware indexing (
src/cli/mod.rs,src/main.rs,src/mcp/tools.rs,src/mcp/handler.rs)--env,--service-name,--versionflags onleankg indexCLImcp_indexMCP toolService metadata model (
src/db/models.rs,src/db/schema.rs,src/db/mod.rs)ServiceMetadatastruct: team, on_call, repo_url, language, health_endpoint, slo_p99_ms, tags, version, deploy_envsupsert_service_metadataandget_service_metadataCRUDService context completeness (
src/graph/query.rs,src/mcp/handler.rs)ServiceContextwith: team, on_call, repo_url, language, schemas, last_incident, known_risksget_service_metadata_fieldshelperIncident validation (
src/db/mod.rs)validate_incident: checks severity (P0-P3), required fields (title, root_cause, resolution, author), valid timestamps, ticket formatFolder-structure graph (
src/indexer/mod.rs)containsedges (dir->dir, dir->file)Wake-up context protocol (
src/mcp/tools.rs,src/mcp/handler.rs,src/graph/query.rs)wake_upMCP tool returning ~170 token project summaryGraphEngine::wake_up_summarygenerates L0/L1 context.leankg/wake_up.txtPhase 2 Changes
v2 REST API (
src/api/mod.rs,src/api/handlers.rs)/api/v2/status- project status/api/v2/service/context- service context/api/v2/incidents- incident query/api/v2/env/diff- environment diff/api/v2/health- health checkTeam auth middleware (
src/api/auth.rs)team_token_middlewarewithX-LeanKG-Token,X-LeanKG-Engineer,X-LeanKG-EnvheadersTeamAuthContextstruct andget_team_ctxextractorPush/pull CLI (
src/cli/mod.rs,src/main.rs,Cargo.toml)leankg push- push local graph to remote serverleankg pull- pull shared graph from remote serverCI/CD workflow (
.github/workflows/leankg-update.yml)LEANKG_TOKENis configuredVerification
cargo clippy: 0 warnings, 0 errorscargo test --lib: 352 passed, 0 failed