Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ Not every file needs a comment, but the ones that other files lean on heavily an

Hand a folder to someone and get a folder back — what did they actually change? Drop the before and after versions into the comparison page and CodeABC lists every added, deleted and modified file with a readable diff, and tells you whether the new version picked up any new risk warnings along the way. A file it cannot read on one side is reported as "not compared" rather than silently treated as deleted, and the risk delta matches warnings by what they are, not by line number, so a shifted line does not look like a fixed bug. Everything runs locally: no code is executed, no API key is needed, and nothing leaves your machine.

### Will It Run on My Machine?

Before installing anything, you want to know what you are signing up for: does this project need a specific Python or Node version, a database server running in the background, an NVIDIA graphics card, or a particular operating system? CodeABC reads the version pins in the project's manifests, the service clients in its dependencies and imports, GPU-shaped dependencies and CUDA source files, and OS-specific components, then lays out the answer in plain words, each item linked to the file it came from. A service that only shows up in a manifest but is never used in the code is marked as "maybe only for some features" rather than presented as a hard requirement. And when the project ships a Dockerfile, CodeABC says so, because that is usually the easy way out. Deterministic, no API key needed.

## Tech Stack

| Layer | Choice | Why |
Expand Down
8 changes: 8 additions & 0 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,14 @@ Cursor/VS Code 是给程序员用的瑞士军刀,码上懂是给普通人用

不是每个文件都需要注释,但那些被很多别的文件依赖、自己却几乎没有任何说明的文件,是最让新人头疼的。码上懂会按"有多核心"对比"有多缺说明"给每个文件打分,挑出那几个"只要有人在开头写几句话就最能帮到大家"的文件。它既是写文档的提示,也是读代码的向导:这几个文件通常正是最值得先搞懂的。

### 这两个文件夹之间到底改了什么?

把一个文件夹交出去、再拿回来一个文件夹——对方到底改了什么?把改前改后两个版本拖进对比页,码上懂会列出每个新增、删除和修改的文件,配上看得懂的 diff,并告诉你新版本有没有多出新的风险提醒。某一边读不出来的文件会如实标成"未能对比",不会悄悄当成被删除;风险对比按警告的内容对齐而不是按行号,所以行号挪了也不会看起来像"修好了一个 bug"。一切都在本地完成:不执行任何代码,不需要 API key,也没有任何东西离开你的电脑。

### 我的电脑跑得动吗?

装任何依赖之前,先搞清楚一件事:这个项目要多新的 Python 或 Node?要不要先在后台开一个数据库服务?是不是得有一张英伟达显卡?挑不挑操作系统?码上懂从项目清单里读出版本要求,从依赖和代码里认出数据库等外部服务的客户端,找出 GPU 相关的依赖和 CUDA 源文件,以及只在某个操作系统上才有的组件,用大白话把答案列出来,每条都注明证据来自哪个文件。只在清单里出现、代码里没真用到的服务,会标成"可选/部分功能",不当成硬要求。如果项目带了 Dockerfile,也会直接告诉你——装了 Docker 的话,上面这些要求通常都可以跳过。全程确定性分析,不需要 API key。

## 技术栈

| 层 | 选择 | 理由 |
Expand Down
9 changes: 9 additions & 0 deletions backend/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,14 @@ class Dependency(BaseModel):
purpose: str | None = None


class RunRequirement(BaseModel):
category: str # "python" | "node" | "service" | "gpu" | "os" | "container"
name: str # short label, e.g. 'Python >=3.10', 'PostgreSQL'
detail: str # the raw evidence (which file, which constraint)
note: str # plain-language explanation of what this means for the reader
required: bool = True # False = "only needed for some features / optional path"


class ActivityWindow(BaseModel):
commits: int = 0
authors: list[str] = []
Expand Down Expand Up @@ -493,6 +501,7 @@ class ProjectMeta(BaseModel):
licenses: LicenseSummary | None = None
complexity_files: list[ComplexFile] = []
dependencies: list[Dependency] = []
run_requirements: list[RunRequirement] = []
security: SecuritySummary | None = None
api_map: ApiMap | None = None
activity: ActivitySummary | None = None
Expand Down
4 changes: 4 additions & 0 deletions backend/routers/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
ReleaseAutomation,
ReleaseSummary,
RiskHotspot,
RunRequirement,
ScheduledTask,
SecurityFinding,
SecuritySummary,
Expand Down Expand Up @@ -113,6 +114,7 @@
release_map,
report_export,
risk,
runreqs,
scanner,
schedules,
security,
Expand Down Expand Up @@ -269,6 +271,7 @@ def _content_analyses(
license_map = licenses.find_licenses(file_contents)
complex_files = complexity.scan_complexity(file_contents)
deps = dependencies.scan_dependencies(file_contents)
run_reqs = runreqs.scan_run_requirements(file_contents)
sec = security.scan_security(file_contents)
api = apimap.scan_api_routes(file_contents)
doc = docs.assess_doc_coverage(file_contents)
Expand Down Expand Up @@ -398,6 +401,7 @@ def _content_analyses(
)
for d in deps["dependencies"]
],
"run_requirements": [RunRequirement(**r) for r in run_reqs["requirements"]],
"security": SecuritySummary(
total=sec["total"],
critical=sec["critical"],
Expand Down
Loading
Loading