Skip to content

docs: add architecture analysis document (stage 1) - #12

Open
Z11zhang wants to merge 2 commits into
XiaoCow666:mainfrom
Z11zhang:docs/architecture-analysis
Open

docs: add architecture analysis document (stage 1)#12
Z11zhang wants to merge 2 commits into
XiaoCow666:mainfrom
Z11zhang:docs/architecture-analysis

Conversation

@Z11zhang

@Z11zhang Z11zhang commented Sep 5, 2026

Copy link
Copy Markdown

Summary

This PR adds docs/architecture-analysis.md, completing Stage 1 project understanding and architecture analysis for CodeSense. Covers project positioning, module responsibilities (8 routes, 8 services, 15+ utils, agents/ subsystem), 3 core flows, run/test instructions, risks, and personal insights. All facts backed by code or runtime verification. No business code changes.

Verification

  • Code analysis: models.py has 18 db.Model classes; tests/ has 43 test_*.py files
  • Runtime: python run.py starts on Python 3.14.7, /login returns 200
  • POST /api/submit is async: returns submission_id immediately, evaluation runs in background thread
  • Python 3.14 requires Flask 2.3.3/Werkzeug 2.3.7/Flask-Session 0.8.0

Changes

  • Updated docs/architecture-analysis.md: fixed model count (18), test count (43), clarified /api/submit async flow

@XiaoCow666 XiaoCow666 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

需要先修正核心提交流程:当前 routes/api.py::submit_code 是同步路径,会直接调用 evaluate_cpp_code 并在 HTTP 请求内更新 Submission;异步沙箱路径是 routes/assignments.py::submit_code -> tasks/submission_tasks.evaluate_submission_async。文档当前把 /api/submit 画成异步沙箱主链,会误导接管者。另,models.py 当前有 18 个模型类而文档写 16 张表,tests 当前按 test_*.py 统计为 43 个而文档写 50+,请修正或明确统计口径。GitHub 上当前 PR description 显示为大量问号/乱码,请重新用 UTF-8 补充 PR 说明(AI 工具、阅读范围、验证命令/结果、未验证事项和风险)。

@XiaoCow666 XiaoCow666 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

复审(当前 head: 1601355):仍需修改,暂不通过。

当前 PR body 的交付说明已经比上一版完整,但文档仍有一个会影响接管的核心事实错误:它把 /api/submit 描述为异步提交主链。当前 main 的 routes/api.py::submit_code() 在默认 thread 配置下会在请求内直接调用 evaluate_cpp_code();只有 SUBMISSION_EVALUATION_QUEUE_BACKEND=RQ 时才进入排队分支。异步网页提交入口是 routes/assignments.py::submit_code(),不是无条件的 /api/submit。

请修正流程图、文字和验证结论,明确默认配置与 RQ 配置的差异,并重新核对相关行号/函数名。修正后再申请复审。

@XiaoCow666 XiaoCow666 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

  • P2|§4.1 本地运行:安装步骤无法复现文档声称的验证环境。 文档声明 Python 3.14 需要 Flask 2.3.3、Werkzeug 2.3.7、Flask-Session 0.8.0,但唯一安装命令是 pip install -r requirements.txt;§5.1 又明确该文件固定的是 2.2.3、2.2.3、0.4.0,并称直接运行会报错。影响:使用 Python 3.14 的读者按步骤操作,会安装文档已指出不兼容的依赖,无法复现启动结果。建议:在启动步骤中补充实际验证使用的依赖覆盖命令和安装顺序,明确其属于临时兼容方案;或将步骤限定到已验证可直接使用现有 requirements 的 Python 版本,并把 3.14 验证单独说明。

审查仅依据提供的元数据和 diff,未执行命令或核验仓库源码。

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