BA14 release - #27
Conversation
- Add database tables for providers, api_keys, and provider_models - Add crypto module for API key encryption using Fernet (AES-128-CBC) - Add REST API endpoints for CRUD operations on providers - Update frontend ChatView to sync with backend API - API Keys are encrypted at rest with auto-generated master key
- Add detailed path logging in production mode - Add stack trace to error dialogs - Create electron-builder-debug.json for debug builds - Add test-build.bat for local backend testing
- Create diagnostic-window.js to show paths, logs, and errors - Store startup logs in memory for diagnostics - Show diagnostic window on initialization failure - Display actual file paths and whether they exist
- Fix DATABASE_FILE import from papyrus.paths instead of database - Fix pythonDistPath to use app.asar.unpacked for production - Fix frontendDistPath for production build
- 清理 build/ 目录下被忽略的旧构建输出 (build/Papyrus, build/PapyrusAPI) - 修复 release.yml 触发条件:移除无效的 v2* 分支匹配,改为明确分支名 - 修复 release job 被禁用的问题:改为仅在打标签时触发 - 更新 .gitignore:避免忽略 build/ 目录下的关键配置文件 - 添加遗漏的 root-ca.cer 证书文件到版本控制
- 修复 pythonDistPath: extraResources 直接放在 resources/,不是 app.asar.unpacked/ - 修复 getPythonExecutableInfo: 当前是单文件模式,exe 直接在 python/ 目录下 这些路径错误导致打包后应用找不到 Python 后端,静默崩溃。
- 添加测试准确性验证步骤(在构建前运行) - 修复 Python 构建验证:更新为单文件模式路径 - 添加 Electron 构建验证:检查所有关键文件存在性 - app.asar - assets/icon.ico, assets/icon.png - certs/root-ca.cer - python/Papyrus.exe - 平台特定文件(Papyrus.exe, chrome_100_percent.pak, ffmpeg.dll 等) - 添加文件大小检查(>15MB) - 添加可执行文件运行测试 失败时显示详细的目录内容便于调试
PyInstaller spec 使用 COLLECT -> one-dir 模式 - 输出: dist-python/Papyrus/Papyrus.exe - 之前 Electron 找: resources/python/Papyrus.exe (错误) - 现在 Electron 找: resources/python/Papyrus/Papyrus.exe (正确)
- 在 run_tests() 中正确设置 PYTHONPATH 环境变量 - 添加 os 模块导入 - 增强错误输出:显示详细错误信息和模块导入失败原因 - 显示 PYTHONPATH 用于调试
- 优先运行可靠的单元测试 (AI, MCP Vault, Integration) - 移除需要启动服务器的 API 端点测试 - API 模型测试改为非关键
- 添加 python/Papyrus/_internal 目录检查 - 添加文件大小阈值验证(Python exe >10MB, app.asar >1MB) - 添加目录内容计数检查(防止空目录) - 增强错误输出,显示详细的构建摘要
- Add __init__.py with exports for storage and relations modules - Add notes_storage.py, progress.py, relations.py, storage.py - Fixes ModuleNotFoundError in CI tests
Linux/macOS executables in one-dir mode are just launchers (~7MB is normal). The main dependencies are in _internal/ directory. Only enforce 10MB threshold for Windows single-exe build.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a9e8d2957d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| // ==================== Migration ==================== | ||
|
|
||
| export function migrateFromJson(cardsFile?: string, notesFile?: string, logger?: PapyrusLogger): void { |
There was a problem hiding this comment.
Migrate the legacy Papyrusdata.json on startup
When an existing user upgrades from the parent Python application, their cards remain in data/Papyrusdata.json, but this migration helper is never invoked anywhere outside tests and the new database starts empty under $HOME/PapyrusData. Wire a one-time startup migration to the actual legacy path and normalize missing SM-2 fields so an upgrade does not appear to erase all cards.
AGENTS.md reference: AGENTS.md:L493-L499
Useful? React with 👍 / 👎.
| const card = getNextDueCard(); | ||
| const stats = getCardStats(); |
There was a problem hiding this comment.
Apply the collection tag to due-card queries
When a user starts review from a collection, the frontend sends /review/next?tag=<collection>, but this endpoint ignores request.query and selects from every due card; the post-rating selection at line 58 does the same. Consequently collection review can display unrelated cards and global counts, so both selection paths need to filter cards and statistics by the requested tag.
AGENTS.md reference: AGENTS.md:L296-L302
Useful? React with 👍 / 👎.
# Conflicts: # README.md # src/Papyrus.py # src/ai/tools.py # src/mcp/server.py # tests/test_ai.py # tests/test_papyrus.py
|
looks well |
Changelog
核心架构与桌面端
功能新增
体验与界面
安全与稳定性
变更规模
相对
main(537e856)共涉及 556 个文件,约 98,066 行新增 / 5,471 行删除。