Skip to content

LinaPro Release v0.2.0

Choose a tag to compare

@gqcn gqcn released this 18 May 01:35
· 158 commits to main since this release

Highlights

  • Redis cluster coordination: Introduced Redis as the unified distributed coordination backend for cluster mode. Single-machine mode continues with PostgreSQL and process cache for a lightweight footprint. Cluster mode now uses Redis for distributed locks, cache revision coordination, cross-node events, short-TTL authentication state, and distributed KV cache, decoupling the main database from high-frequency coordination paths.

  • Plugin runtime upgrade: Added a runtime upgrade lifecycle for plugins. On host startup, plugin file metadata is compared against the database effective version and only marked as pending upgrade or abnormal — no automatic upgrade or startup blocking. A new upgrade API and management UI walk through dependency pre-checks, plugin-defined upgrade callbacks, upgrade SQL execution, governance resource synchronization, version switching, cache invalidation, and cluster notification.

  • Plugin dependency management: Plugins can now declare dependencies with framework version constraints in their manifest. Installation resolves the dependency graph, validates framework and plugin version compatibility, detects circular dependencies, and auto-installs hard dependencies in topological order. Uninstall protection prevents removing plugins that other installed plugins still depend on.

  • Official plugins submodule decoupling: Official source plugins have been extracted to a standalone repository (linaproai/official-plugins) and mounted back as a git submodule at apps/lina-plugins. The host service, frontend workbench, development tools, and test suites now all pass when the plugin workspace is absent or empty, giving contributors a lighter host-only development path.

  • linactl CLI tool: Added a cross-platform Go-based CLI (hack/tools/linactl) that unifies plugin development workflows, build commands, release validation, asset management, and environment checks. Includes a release-tag version gate that verifies the Git tag matches metadata.yaml before any image build or publish runs.

Improvements

  • Explicit service dependency injection: Backend Controller, Middleware, Service, plugin host service adapters, and WASM host services now receive their dependencies through explicit constructor parameters instead of implicit service.New() calls. Shared instances are enforced across high-risk paths including authentication, permissions, plugin state, runtime config, i18n, and cache coordination.

  • Data scope and tenant middleware: Added a dedicated data scope service with tenant scope support for data visibility and permission boundaries. A new tenancy middleware handles multi-tenant request context across the host service.

  • Cluster leader election lease: Migrated leader election from PostgreSQL table-based coordination to a lease-based mechanism with multiprocess testing coverage, improving reliability in multi-node deployments.

  • i18n cache fingerprinting and freshness: The i18n service now tracks cache fingerprint and freshness state, enabling smarter cache invalidation and reducing stale translation delivery.

  • API contract testing: Added automated API contract tests that validate DTO tags, response fields, and endpoint metadata against project conventions.

  • SQL migration renumbering: Database migration files have been renumbered with clearer naming and better logical separation. Mock data scripts are now individually named per table for easier selective seeding.

  • Plugin management UI enhancements: The plugin management page now shows dependency summaries, upgrade modals with content previews, and lifecycle precondition dialogs. Plugin detail views display runtime upgrade state, effective vs. discovered version, and dependency check results.

  • User management improvements: Added batch edit modal for users, tenant selection options, and profile update API. The user import template endpoint is now available for bulk user provisioning.

  • Frontend tenant and platform routes: New tenant and platform route modules with tenant access guards and a tenant store for multi-tenant navigation in the management workbench.

  • Removed unimplemented pages: Removed department, post, online user, and server monitor pages that were placeholders without backend support, reducing confusion for new users.

  • Config import template: Added a config import template download endpoint, aligning with the existing dict and user import template pattern.

  • Auth refresh token: Added a dedicated token refresh endpoint for seamless session renewal without re-authentication.

  • Job management expansion: Added job group management API and job log query endpoints alongside the existing scheduled job management.

Bug Fixes

  • Tenant switcher style: Fixed layout and styling issues in the tenant switcher component that caused visual glitches on certain screen sizes.

  • Backend source readability: Addressed readability issues across backend source files, including consistent naming, clearer function signatures, and improved error message formatting.

  • API response DTO hardening: Tightened response DTO definitions to ensure all returned fields have proper types, descriptions, and example values, reducing frontend type ambiguity.

Tooling and Experience

  • Release CI pipeline: Added release-test-and-build and nightly-test-and-build workflows with reusable components for backend unit tests, frontend unit tests, E2E tests, host-only build smoke tests, Redis integration tests, Redis cluster smoke tests, SQLite smoke tests, Windows command smoke tests, make command smoke tests, plugin command smoke tests, and image publishing.

  • Controlled release tag creation: New create-release-tag workflow reads framework.version from metadata.yaml, validates the format, checks for existing tags, and creates the Git tag using a GitHub App installation token to comply with tag rulesets.

  • Monthly OpenSpec archive automation: Added multi-agent monthly OpenSpec archive workflows supporting Claude Code, Codex, and Copilot, with change detection, validation, PR finalization, and archive consolidation steps.

  • Nightly image build: Added nightly-image-build workflow for automated Docker image builds from the main branch.

  • Docker deployment reference: Added hack/deploy/ with a docker-compose.yaml and configuration template for quick local deployment reference.

  • Skill updates: Added lina-auto-archive, openspec-apply-change, and openspec-archive-change skills. Removed lina-doctor and lina-upgrade skills that were superseded by more focused tooling. Updated lina-e2e, lina-feedback, lina-review, and git-commit-push skills with improved workflows.

  • WASM builder refactoring: Reorganized the WASM builder internals with dedicated manifest, artifact, backend, runtime, and embed builder modules, plus plugin demo tests for validation.

  • Image builder improvements: Refactored the image builder into modular components (artifact, command, config, env, flags, image, platform) with test coverage.

  • E2E test suite reorganization: Expanded E2E test coverage with improved page objects, helpers, fixtures, and support infrastructure. Updated Playwright configuration and added pnpm-lock.yaml for deterministic test runs.

  • GitHub Actions: Added reusable actions for host-only artifact smoke testing, official plugin workspace verification, and monthly OpenSpec archive orchestration.

  • Documentation updates: Updated bilingual README and CONTRIBUTING files with clearer project positioning, development setup instructions, and contribution guidelines. Standardized Chinese documentation filenames from README.zh_CN.md to README.zh-CN.md across the repository.


主要亮点

  • Redis 集群协调:引入 Redis 作为集群模式下的统一分布式协调后端。单机模式继续使用 PostgreSQL 和进程缓存,保持轻量部署。集群模式通过 Redis 承载分布式锁、缓存修订号协调、跨节点事件、短 TTL 认证状态和分布式 KV cache,将主数据库从高频协调路径中解耦。

  • 插件运行时升级:新增插件运行时升级生命周期。宿主启动时扫描插件文件元数据并与数据库有效版本比对,仅标记待升级或异常状态,不自动升级也不阻断启动。新增升级 API 和管理界面,依次完成依赖预检、插件自定义升级回调、升级 SQL 执行、治理资源同步、版本切换、缓存失效和集群通知。

  • 插件依赖管理:插件清单新增依赖声明,支持框架版本约束和插件间版本约束。安装前解析依赖图,校验框架版本、依赖插件存在性和版本范围、自依赖和循环依赖,支持按拓扑顺序自动安装硬依赖。卸载保护机制防止移除仍被其他已安装插件依赖的插件。

  • 官方插件子模块解耦:官方源码插件提取到独立仓库(linaproai/official-plugins),通过 git submodule 挂载回 apps/lina-plugins。宿主服务、前端工作台、开发工具和测试套件在插件工作区缺失或为空时均可独立运行,为贡献者提供更轻量的宿主开发路径。

  • linactl CLI 工具:新增跨平台 Go CLI 工具(hack/tools/linactl),统一管理插件开发流程、构建命令、发布校验、资产管理和环境检查。包含发布标签版本门禁,在镜像构建或发布前校验 Git 标签与 metadata.yaml 版本一致性。

功能改进

  • 显式服务依赖注入:后端 Controller、Middleware、Service、插件宿主服务适配器和 WASM host service 现在通过显式构造参数接收依赖,取代隐式 service.New() 调用。认证、权限、插件状态、运行时配置、i18n 和缓存协调等高风险路径强制共享实例。

  • 数据权限与租户中间件:新增数据权限服务,支持租户级数据可见性和权限边界控制。新增租户中间件处理多租户请求上下文。

  • 集群选举租约机制:将 Leader 选举从 PostgreSQL 表协调迁移到基于租约的机制,增加多进程测试覆盖,提升多节点部署下的可靠性。

  • i18n 缓存指纹与新鲜度:i18n 服务新增缓存指纹和新鲜度追踪,实现更精准的缓存失效,减少过期翻译的分发。

  • API 契约测试:新增自动化 API 契约测试,验证 DTO 标签、响应字段和端点元数据是否符合项目规范。

  • SQL 迁移重编号:数据库迁移文件重新编号,命名更清晰、逻辑划分更合理。Mock 数据脚本按表独立命名,支持选择性数据初始化。

  • 插件管理界面增强:插件管理页面新增依赖摘要、升级预览弹窗和生命周期前置条件对话框。插件详情展示运行时升级状态、有效版本与发现版本、依赖检查结果。

  • 用户管理改进:新增用户批量编辑弹窗、租户选择和用户资料更新 API。新增用户导入模板端点,支持批量用户创建。

  • 前端租户与平台路由:新增租户和平台路由模块,包含租户访问守卫和租户状态管理,支持多租户导航。

  • 移除未实现页面:移除了部门管理、岗位管理、在线用户和服务器监控等缺少后端支持的占位页面,降低新用户困惑。

  • 配置导入模板:新增配置导入模板下载端点,与字典和用户导入模板模式保持一致。

  • 认证刷新令牌:新增专用令牌刷新端点,支持会话无感续期,无需重新认证。

  • 定时任务管理扩展:新增任务分组管理 API 和任务日志查询端点,完善定时任务管理体系。

Bug 修复

  • 租户切换器样式:修复了租户切换器组件在特定屏幕尺寸下的布局和样式问题。

  • 后端源码可读性:修复了后端源码中的可读性问题,包括统一命名、清晰函数签名和改进错误消息格式。

  • API 响应 DTO 加固:收紧了响应 DTO 定义,确保所有返回字段具有正确的类型、描述和示例值,减少前端类型歧义。

开发体验与工具链

  • 发布 CI 流水线:新增 release-test-and-buildnightly-test-and-build 工作流,包含后端单元测试、前端单元测试、E2E 测试、宿主构建冒烟测试、Redis 集成测试、Redis 集群冒烟测试、SQLite 冒烟测试、Windows 命令冒烟测试、make 命令冒烟测试、插件命令冒烟测试和镜像发布等可复用组件。

  • 受控发布标签创建:新增 create-release-tag 工作流,从 metadata.yaml 读取 framework.version,校验格式,检查标签是否已存在,并使用 GitHub App installation token 创建 Git 标签,兼容标签规则集。

  • 月度 OpenSpec 归档自动化:新增支持 Claude Code、Codex 和 Copilot 的多 Agent 月度 OpenSpec 归档工作流,包含变更检测、校验、PR 生成和归档聚合步骤。

  • 夜间镜像构建:新增 nightly-image-build 工作流,基于主分支自动构建 Docker 镜像。

  • Docker 部署参考:新增 hack/deploy/ 目录,包含 docker-compose.yaml 和配置模板,提供快速本地部署参考。

  • 技能更新:新增 lina-auto-archiveopenspec-apply-changeopenspec-archive-change 技能。移除了已被更专注工具取代的 lina-doctorlina-upgrade 技能。更新了 lina-e2elina-feedbacklina-reviewgit-commit-push 技能的工作流。

  • WASM 构建器重构:将 WASM 构建器内部重组为独立的清单、产物、后端、运行时和嵌入模块,新增插件演示测试用于验证。

  • 镜像构建器改进:将镜像构建器重构为模块化组件(产物、命令、配置、环境、标志、镜像、平台),增加测试覆盖。

  • E2E 测试套件重组:扩展了 E2E 测试覆盖,改进了页面对象、辅助函数、测试数据和支持基础设施。更新了 Playwright 配置并新增 pnpm-lock.yaml 确保测试运行确定性。

  • GitHub Actions:新增宿主产物冒烟测试、官方插件工作区验证和月度 OpenSpec 归档编排等可复用 Action。

  • 文档更新:更新了中英文 README 和 CONTRIBUTING 文件,明确了项目定位、开发环境搭建和贡献指南。将中文文档文件名从 README.zh_CN.md 统一规范为 README.zh-CN.md