Skip to content

BA14 release - #27

Merged
Alpaca233114514 merged 390 commits into
mainfrom
BA14-release
Jul 24, 2026
Merged

BA14 release#27
Alpaca233114514 merged 390 commits into
mainfrom
BA14-release

Conversation

@Alpaca233114514

Copy link
Copy Markdown
Collaborator

Changelog

核心架构与桌面端

  • 后端从 Python 迁移至 Node.js + TypeScript + Fastify,并引入 SQLite 持久化、WAL 模式及更完整的数据访问层。
  • 升级 Electron 桌面端运行与打包链路,补充跨平台构建、诊断窗口、预加载安全边界和 Node.js 运行时随包分发。
  • 完善 CI/CD、版本同步、安装包校验及发布文档,提升发布流程的可重复性与产物可靠性。

功能新增

  • 新增笔记、卡片及知识库版本控制:支持历史查看、恢复与相关 API / 设置页入口。
  • 新增 AI Agent 工具体系,覆盖卡片、笔记、关系、文件、扩展、数据及设置操作,并配套审批与工具调用展示。
  • 新增聊天会话侧栏历史、会话重命名与删除、AI 自动生成标题、标题长度约束及会话顺序保持。
  • 新增扩展管理、Desktop CLI、文件库预览、笔记关系图、Obsidian Vault 导入与文件监听等能力。
  • 增强间隔重复复习、卡片集合、批量导入、搜索、统计和数据管理能力。

体验与界面

  • 重构前端页面与设计令牌,统一主题、卡片、字体、间距及焦点样式。
  • 优化聊天面板窄屏布局、消息操作、删除确认、文件添加国际化及侧栏溢出处理。
  • 新增 Windows Acrylic 标题栏效果,改善标题栏搜索框可见性、图表标签和首页卷轴场景布局。
  • 完善无障碍支持、键盘操作与多语言界面。

安全与稳定性

  • 加强 API 鉴权、SSRF 防护、路径校验、API Key 加密存储、速率限制和安全响应头。
  • 修复打包后 ASAR 路径、ESM/CSS 加载、后端依赖及启动流程相关问题。
  • 补充 API 边界隔离、版本恢复保护、工具调用、文件操作、数据库和安全场景测试。

变更规模

相对 main537e856)共涉及 556 个文件,约 98,066 行新增 / 5,471 行删除

- 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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 {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Comment thread backend/src/api/routes/review.ts Outdated
Comment on lines +9 to +10
const card = getNextDueCard();
const stats = getCardStats();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Comment thread frontend/src/ScrollPage/FlashcardStudy/useFlashcardStudy.ts Outdated
Comment thread backend/src/api/routes/notes.ts Outdated
Comment thread backend/src/api/routes/progress.ts Outdated
# Conflicts:
#	README.md
#	src/Papyrus.py
#	src/ai/tools.py
#	src/mcp/server.py
#	tests/test_ai.py
#	tests/test_papyrus.py
@CloverIris

Copy link
Copy Markdown
Collaborator

looks well

@CloverIris CloverIris closed this Jul 24, 2026
@CloverIris CloverIris reopened this Jul 24, 2026
@Alpaca233114514
Alpaca233114514 merged commit dc7564a into main Jul 24, 2026
24 checks passed
@Alpaca233114514
Alpaca233114514 deleted the BA14-release branch August 5, 2026 07:00
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.

3 participants