{"id":48653499,"url":"https://github.com/paritoshk/ucm-core","last_synced_at":"2026-04-10T08:57:07.620Z","repository":{"id":343373498,"uuid":"1155751737","full_name":"paritoshk/ucm-core","owner":"paritoshk","description":" context graph with temporal versioning and change propagation","archived":false,"fork":false,"pushed_at":"2026-03-31T18:24:54.000Z","size":408,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-10T08:57:04.569Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://contextqa-test.vercel.app","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paritoshk.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-11T21:32:44.000Z","updated_at":"2026-03-31T18:24:58.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/paritoshk/ucm-core","commit_stats":null,"previous_names":["paritoshk/contextqa-test"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/paritoshk/ucm-core","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paritoshk%2Fucm-core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paritoshk%2Fucm-core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paritoshk%2Fucm-core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paritoshk%2Fucm-core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paritoshk","download_url":"https://codeload.github.com/paritoshk/ucm-core/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paritoshk%2Fucm-core/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31635969,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T07:40:12.752Z","status":"ssl_error","status_checked_at":"2026-04-10T07:40:11.664Z","response_time":98,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-10T08:57:03.552Z","updated_at":"2026-04-10T08:57:07.614Z","avatar_url":"https://github.com/paritoshk.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UCM — Unified Context Model\n\n**Probabilistic impact analysis for code changes.**\n\nUCM builds a Bayesian dependency graph of your codebase and answers:\n*\"I changed this function — what else might break, and how confident are you?\"*\n\n[![CI](https://github.com/paritoshk/ucm-core/actions/workflows/ci.yml/badge.svg)](https://github.com/paritoshk/ucm-core/actions/workflows/ci.yml)\n[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n[![Case Study](https://img.shields.io/badge/case%20study-marimo-green)](https://paritoshk.github.io/ucm-core/)\n\n---\n\n## ⚡ TL;DR: What is UCM?\n\n**UCM is not a log collector. It is a Code Impact Analysis Engine.**\n\nUCM acts like a highly intelligent, real-time map of your codebase:\n1. **It ingests code and tickets**: It parses your source code (functions, imports, API endpoints) and your Jira/Linear tickets to find entities and relationships. \n2. **It builds a Graph**: It connects all of this together in memory. It knows that \"Ticket JIRA-42\" requires changes to the `validateToken` function, and that the `processPayment` endpoint imports `validateToken`.\n3. **It answers \"What if?\":** If you ask, *\"I am about to change `validateToken`, what else is going to break?\"*, UCM runs a Bayesian probability algorithm to highlight every connected piece of code and calculate a \"confidence score\" that it will be impacted.\n\n### What is the `ucm-api` server for?\nThe API server exists so that other tools can talk to that graph cleanly:\n- Your **React Dashboard** uses the API to visualize the graph and show the impact reports to managers.\n- A **GitHub Action (CI/CD)** could ping the API with a git diff to auto-comment on PRs with impact warnings.\n\nIts core job is to sit in the background, hold the codebase graph in memory, listen for new code changes, and answer impact queries.\n\n---\n\n## Install\n\n```bash\ncargo install ucm\n```\n\nOr build from source:\n\n```bash\ngit clone https://github.com/paritoshk/ucm-core\ncd ucm-core\ncargo build --release\n```\n\n---\n\n## Quick start\n\n```bash\n# Scan a TypeScript project\nucm scan ./src --language typescript\n\n# What breaks if I change validateToken?\nucm impact src/auth/service.ts validateToken\n\n# Get test recommendations for that change\nucm intent src/auth/service.ts validateToken\n```\n\n**Example output:**\n\n```\nUCM Impact Analysis\n====================\n  Changed: src/auth/service.ts#validateToken\n\n  DIRECT IMPACTS:\n    authMiddleware — 95% confidence\n      1. authMiddleware imports validateToken directly (StaticAnalysis)\n\n  INDIRECT IMPACTS:\n    processPayment — 76% confidence (2 hops)\n      1. processPayment depends on authMiddleware\n      2. authMiddleware imports validateToken\n\n  NOT IMPACTED:\n    generateReport — 90% safe (No graph path to changed entities)\n```\n\n---\n\n## How it works\n\nUCM scans your source files, builds a typed dependency graph, and runs a\n**reverse BFS** from the changed entity. Each hop applies confidence decay:\n\n```\nconfidence(path) = Π edge_weight_i\n```\n\nWhen multiple independent sources confirm the same relationship (static\nanalysis + API traffic logs), UCM fuses them with **Noisy-OR**:\n\n```\nP(edge) = 1 − Π(1 − P(source_i))\n```\n\nThis means two 80% signals produce 96% confidence — not 64% (naive multiply).\nConfidence also decays over time at rates tuned per relationship type (import\nstatements decay slowly; API traffic patterns decay fast).\n\n---\n\n## CLI reference\n\n```\nucm scan \u003cpath\u003e [--language rust|typescript|python]\n    Scan source files and print graph statistics.\n\nucm graph \u003cpath\u003e [--export json]\n    Show entity list or export full graph as JSON.\n\nucm impact \u003cfile\u003e \u003csymbol\u003e [--min-confidence 0.1] [--max-depth 10] [--json]\n    Run reverse BFS from a changed symbol. Print impacted entities with\n    confidence scores and explanation chains.\n\nucm intent \u003cfile\u003e \u003csymbol\u003e [--json]\n    Same as impact, but formats output as prioritised test scenarios:\n    MUST TEST / SHOULD TEST / RISKS / COVERAGE GAPS.\n```\n\n---\n\n## REST API\n\nThe `ucm-api` binary exposes the same analysis over HTTP (default: `localhost:3001`).\n\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | `/health` | Liveness check |\n| GET | `/graph/entities` | All entities in graph |\n| GET | `/graph/edges` | All edges with confidence |\n| GET | `/graph/stats` | Entity/edge counts, avg confidence |\n| POST | `/ingest/code` | Scan a file path into graph |\n| POST | `/impact` | Impact analysis for a change set |\n| POST | `/intent` | Test intent for a change set |\n| POST | `/linear/connect` | Connect Linear workspace (API key) |\n| GET | `/linear/status` | Connection status |\n| POST | `/ingest/linear` | Import Linear issues as graph nodes |\n\n```bash\ncargo run --bin ucm-api\n\ncurl -s http://localhost:3001/health\n# {\"status\":\"ok\"}\n\ncurl -s -X POST http://localhost:3001/impact \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"changed_entities\":[{\"file_path\":\"src/auth/service.ts\",\"symbol\":\"validateToken\"}]}'\n```\n\n---\n\n## Dashboard\n\nInteractive UI for exploring the graph and running impact analysis:\n\n```bash\ncd dashboard\nnpm install \u0026\u0026 npm run dev\n# http://localhost:5173\n```\n\nSet `VITE_API_URL` to point at a remote `ucm-api` instance.\n\n---\n\n## Architecture\n\n```\nucm-core      — graph types, Bayesian math, SCIP identity  [open-source]\nucm-ingest    — source adapters: code, git, Jira, Linear   [this repo]\nucm-events    — event store + graph projection             [this repo]\nucm-reason    — BFS impact engine, test intent             [this repo]\nucm-observe   — event replay, audit trail                  [this repo]\nucm-api       — Axum REST server                           [this repo]\nucm-cli       — terminal interface                         [this repo]\n```\n\n**Event sourcing:** every parser and adapter emits immutable `UcmEvent`s. The\nprojection replays them to build the graph — any point-in-time state is\nreproducible by replaying the event log up to that timestamp.\n\n**SCIP identity:** entities use Sourcegraph SCIP-style strings\n(`scip:local/project/0.0.0/src/auth/service.ts#validateToken`), so files can\nbe re-indexed independently without central ID coordination.\n\n---\n\n## Current limitations\n\n| Item | Status |\n|------|--------|\n| Parser | Regex-based. Works for extracting functions and import relationships. Not as precise as tree-sitter for complex generics or macros. |\n| Graph persistence | In-memory only. Restarting `ucm-api` rebuilds from scratch. |\n| Language support | TypeScript, JavaScript, Rust, Python. Other languages return module entities only. |\n| Call-site detection | Import edges are detected. Call edges within function bodies are not yet extracted. |\n\n---\n\n## Development\n\n```bash\ncargo test --workspace   # run all tests\ncargo clippy --workspace # lint\ncargo fmt --all          # format\n```\n\n---\n\n## License\n\nMIT — see [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparitoshk%2Fucm-core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparitoshk%2Fucm-core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparitoshk%2Fucm-core/lists"}