Skip to content

Commit 7132a0f

Browse files
committed
merge: promote beta release 2026-04-27
# Conflicts: # README.md # docs/releases/release-notes.md
2 parents 521d842 + 0f0514e commit 7132a0f

300 files changed

Lines changed: 36722 additions & 2923 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.env.example‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,20 @@ PORT=3000
99
HOST=localhost
1010
ALLOW_LAN=false
1111
CORS_ORIGIN=http://localhost:5173
12-
DATABASE_URL=file:./dev.db
12+
# 默认使用 SQLite;如需 PostgreSQL,取消下一行注释并填写连接串。
13+
# DATABASE_URL=postgresql://postgres:postgres@127.0.0.1:5432/ai_novel
1314
API_JSON_LIMIT=20mb
15+
16+
# 图片资产存储:默认使用 beta 本地文件存储。仅在显式选择 s3/minio 时启用 MinIO/S3。
17+
# IMAGE_STORAGE_DRIVER=local
18+
# IMAGE_STORAGE_ROOT=storage/generated-images
19+
# IMAGE_STORAGE_DRIVER=minio
20+
# IMAGE_STORAGE_S3_ENDPOINT=http://127.0.0.1:9000
21+
# IMAGE_STORAGE_S3_REGION=us-east-1
22+
# IMAGE_STORAGE_S3_BUCKET=ai-novel-images
23+
# IMAGE_STORAGE_S3_ACCESS_KEY_ID=
24+
# IMAGE_STORAGE_S3_SECRET_ACCESS_KEY=
25+
# IMAGE_STORAGE_S3_FORCE_PATH_STYLE=true
1426
BOOK_ANALYSIS_LLM_TIMEOUT_MS=90000
1527

1628
OPENAI_API_KEY=

‎AGENTS.md‎

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -55,25 +55,35 @@
5555
## Development Branch Workflow
5656

5757
- When developing a new feature that may affect the end-to-end product flow, default workflow, shared contracts, or other major system links, do not develop directly on `main`.
58-
- In these cases, first create or switch to a dedicated `dev` branch for that feature, complete implementation and functional verification there, and merge back to `main` only after the feature is tested and stable enough.
59-
- After the feature branch has been successfully merged back into `main`, clean up that development branch so old feature branches do not accumulate indefinitely.
58+
- In these cases, first create or switch to a dedicated feature development branch, complete implementation and functional verification there, then merge into the pre-release `beta` branch for integration verification. Merge back to `main` only after `beta` has been tested and stable enough for release.
59+
- After the feature branch has been successfully merged into `beta` and no longer needs follow-up work, clean up that development branch so old feature branches do not accumulate indefinitely.
6060
- This rule applies in particular to changes that touch cross-stage workflows, shared runtime/prompting/context contracts, automatic director chains, chapter execution chains, data migration behavior, or other changes that can impact the overall chain.
61-
- Small isolated fixes, copy changes, low-risk UI polish, or documentation-only updates can still be handled without requiring a separate feature `dev` branch unless the user explicitly asks otherwise.
62-
63-
### Temporary Desktop Branch Policy
64-
65-
- Until desktopization work is completed and `desktop-dev` has been merged back into `main`, treat `desktop-dev` as the long-lived integration branch for desktop-related development.
66-
- During this temporary phase, `main` remains the stable branch for already verified work, small isolated fixes, documentation changes, and low-risk updates that do not need to wait for desktopization to finish.
67-
- Do not merge every new `main` commit into `desktop-dev` immediately by default. Sync in batches when it is actually useful, instead of creating unnecessary merge noise.
68-
- You must sync `main` into `desktop-dev` when any of the following is true:
69-
- `main` changed shared contracts, shared runtime/state logic, build/dependency setup, or any other code that `desktop-dev` also depends on;
70-
- a new `desktop-dev` work slice is about to start and it should build on the latest stable base;
71-
- `desktop-dev` is about to enter integration testing, release verification, or merge-back into `main`;
72-
- `desktop-dev` has drifted far enough from `main` that conflict risk is starting to rise.
73-
- If `main` only contains clearly unrelated small fixes, copy edits, or other low-risk changes that do not affect desktopization, it is acceptable to delay the sync and merge them into `desktop-dev` later as a batch.
74-
- If a new change is expected to affect both the normal web flow and the ongoing desktopization work, prefer implementing it on a dedicated short-lived feature branch or directly on `desktop-dev`, instead of landing it on `main` first and forcing immediate back-merges.
75-
- When syncing `main` into `desktop-dev`, prefer `merge` if the branch is shared by multiple collaborators. Only use `rebase` when the branch is effectively single-owner and history rewriting will not disrupt anyone else.
76-
- Once desktopization has been completed, merged into `main`, and the `desktop-dev` branch has been retired, this temporary policy should be considered expired and the repository should fall back to the normal feature-branch workflow above.
61+
- Small isolated fixes, copy changes, low-risk UI polish, or documentation-only updates can still be handled without requiring a separate feature development branch unless the user explicitly asks otherwise. If the change is release-facing, still prefer passing through `beta` before `main`.
62+
63+
### Pre-release Beta Branch Workflow
64+
65+
- Use `beta` as the stable pre-release integration branch between feature development branches and `main`.
66+
- The normal release path is: feature branch -> self-test / targeted verification -> merge into `beta` -> integration testing / regression checks / packaging verification -> merge into `main` -> public release or packaging upload.
67+
- `main` is the stable release branch. Do not merge a feature branch directly into `main` when the change affects product flow, shared contracts, runtime behavior, data migration, desktop packaging, or other end-to-end links.
68+
- `beta` should represent the next candidate release. Keep it buildable, runnable, and suitable for acceptance testing; do not use it as a dumping ground for unfinished experiments.
69+
- If multiple feature branches are merged into `beta`, test the combined behavior on `beta` before promoting the batch to `main`, especially around automatic director flow, chapter execution, prompt/runtime contracts, migrations, and desktop startup or packaging.
70+
- If `beta` validation fails, fix the issue on the original feature branch when the fault is isolated, or on a short-lived `beta-fix` branch when the failure is caused by integration between multiple features. Merge the fix back into `beta` and rerun the failed checks before promoting.
71+
- Only promote `beta` to `main` when the release candidate has passed the required functional checks, build checks, and any packaging verification relevant to the release. After promotion, keep `beta` aligned with `main` so the next pre-release cycle starts from the released state.
72+
- For urgent production hotfixes, it is acceptable to branch from `main`, verify narrowly, merge back to `main`, and then immediately merge or cherry-pick the hotfix into `beta` so the pre-release branch does not lose the production fix.
73+
- Public desktop packaging and release upload should be performed from `main` or from a release tag created after `beta` has been promoted to `main`, not directly from a feature branch or an unverified `beta` state.
74+
- The branch name is `beta`. Do not create a separate `bate` branch; if such a typo branch appears, migrate any useful work to `beta` and remove the typo branch after confirming nothing is lost.
75+
76+
### Desktop Branch Completion Workflow
77+
78+
- Desktop feature development on `desktop-dev` is considered complete. Do not start new desktop feature work directly on `desktop-dev` unless the user explicitly reopens desktopization as an active development phase.
79+
- Treat `desktop-dev` as a completion candidate that must move through stabilization, pre-release verification, and branch retirement.
80+
- Before promoting desktop work, sync any required stable changes from `main` into `desktop-dev` when they affect shared contracts, runtime/state logic, build/dependency setup, desktop startup, packaging, or release verification.
81+
- Run desktop-focused verification on `desktop-dev` first, including development startup, first-run configuration, core web flow compatibility, build checks, and packaging checks relevant to the target release.
82+
- After `desktop-dev` passes its focused verification, merge it into `beta` for combined pre-release testing with the rest of the next release candidate.
83+
- Do not promote desktop work from `desktop-dev` directly to `main`. `beta` must pass integration testing and release packaging verification before the desktop work reaches `main`.
84+
- If `beta` exposes desktop integration failures, fix them on a short-lived desktop stabilization branch or directly on `desktop-dev` if the desktop branch has not yet been retired, then merge the fix back into `beta` and rerun the failed checks.
85+
- Once `beta` has been promoted to `main` and the released `main` contains the completed desktop work, retire `desktop-dev` so future desktop changes follow the normal feature branch -> `beta` -> `main` workflow.
86+
- After retirement, `desktop-dev` should not be reused as a long-lived integration branch. Create short-lived feature branches for future desktop fixes or improvements, and promote them through `beta`.
7787

7888
## Desktop Packaging Upload Rules
7989

‎Dockerfile.api‎

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
ARG NODE_IMAGE=node:20-bookworm-slim
2+
FROM ${NODE_IMAGE} AS base
3+
ENV PNPM_HOME=/pnpm
4+
ENV PATH=${PNPM_HOME}:${PATH}
5+
ENV NODE_ENV=development
6+
USER root
7+
RUN apt-get update \
8+
&& apt-get install -y --no-install-recommends python3 make g++ openssl \
9+
&& rm -rf /var/lib/apt/lists/* \
10+
&& corepack enable
11+
12+
FROM base AS deps
13+
WORKDIR /app
14+
RUN rm -rf /app/* /app/.[!.]* /app/..?* || true
15+
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml tsconfig.base.json .npmrc ./
16+
COPY client/package.json ./client/package.json
17+
COPY server/package.json ./server/package.json
18+
COPY shared/package.json ./shared/package.json
19+
RUN pnpm install --frozen-lockfile
20+
21+
FROM deps AS build
22+
WORKDIR /app
23+
ENV AI_NOVEL_DATABASE_MODE=postgresql
24+
COPY shared/package.json shared/tsconfig.json ./shared/
25+
COPY shared/*.ts ./shared/
26+
COPY shared/types ./shared/types
27+
COPY server/package.json server/tsconfig.json server/prisma.config.ts ./server/
28+
COPY server/src ./server/src
29+
RUN pnpm --filter @ai-novel/shared build \
30+
&& pnpm --filter @ai-novel/server prisma:generate \
31+
&& pnpm --filter @ai-novel/server build
32+
33+
FROM base AS prod-deps
34+
WORKDIR /app
35+
RUN rm -rf /app/* /app/.[!.]* /app/..?* || true
36+
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml tsconfig.base.json .npmrc ./
37+
COPY client/package.json ./client/package.json
38+
COPY server/package.json ./server/package.json
39+
COPY shared/package.json ./shared/package.json
40+
COPY server/prisma.config.ts ./server/prisma.config.ts
41+
COPY server/src/config/database.ts ./server/src/config/database.ts
42+
COPY server/src/prisma ./server/src/prisma
43+
ENV AI_NOVEL_DATABASE_MODE=postgresql
44+
RUN pnpm install --frozen-lockfile \
45+
&& pnpm --filter @ai-novel/server prisma:generate
46+
47+
ARG NODE_IMAGE
48+
FROM ${NODE_IMAGE} AS runtime
49+
USER root
50+
WORKDIR /app
51+
ENV NODE_ENV=production
52+
RUN rm -rf /app/* /app/.[!.]* /app/..?* || true
53+
COPY --from=build --chown=node:node /app/package.json ./package.json
54+
COPY --from=build --chown=node:node /app/pnpm-workspace.yaml ./pnpm-workspace.yaml
55+
COPY --from=prod-deps --chown=node:node /app/node_modules ./node_modules
56+
COPY --from=build --chown=node:node /app/server ./server
57+
COPY --from=build --chown=node:node /app/shared ./shared
58+
RUN mkdir -p /app/storage/generated-images /app/node_modules/.bin \
59+
&& printf '%s\n' '#!/bin/sh' 'exec node /app/server/node_modules/prisma/build/index.js --config /app/server/prisma.config.ts "$@"' > /app/node_modules/.bin/prisma \
60+
&& chmod +x /app/node_modules/.bin/prisma \
61+
&& chown -R node:node /app
62+
USER node
63+
EXPOSE 3000
64+
CMD ["node", "./server/dist/app.js"]

‎Dockerfile.web‎

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
ARG NODE_IMAGE=node:20-bookworm-slim
2+
ARG NGINX_IMAGE=nginxinc/nginx-unprivileged:1.27-alpine
3+
FROM ${NODE_IMAGE} AS base
4+
ENV PNPM_HOME=/pnpm
5+
ENV PATH=${PNPM_HOME}:${PATH}
6+
ENV NODE_ENV=development
7+
USER root
8+
RUN corepack enable
9+
10+
FROM base AS deps
11+
WORKDIR /app
12+
RUN rm -rf /app/* /app/.[!.]* /app/..?* || true
13+
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml tsconfig.base.json .npmrc ./
14+
COPY client/package.json ./client/package.json
15+
COPY shared/package.json ./shared/package.json
16+
RUN pnpm install --frozen-lockfile --filter @ai-novel/shared --filter @ai-novel/client
17+
18+
FROM deps AS build
19+
WORKDIR /app
20+
ARG VITE_API_BASE_URL=
21+
ENV VITE_API_BASE_URL=${VITE_API_BASE_URL}
22+
COPY shared/package.json shared/tsconfig.json ./shared/
23+
COPY shared/*.ts ./shared/
24+
COPY shared/types ./shared/types
25+
COPY client/package.json client/tsconfig.json client/vite.config.ts client/tailwind.config.ts client/postcss.config.js client/components.json client/index.html ./client/
26+
COPY client/public ./client/public
27+
COPY client/src ./client/src
28+
RUN pnpm --filter @ai-novel/shared build \
29+
&& pnpm --filter @ai-novel/client build
30+
31+
FROM ${NGINX_IMAGE} AS runtime
32+
USER root
33+
RUN rm -rf /usr/share/nginx/html/*
34+
COPY --from=build --chown=101:101 /app/client/dist/ /usr/share/nginx/html/
35+
COPY --chown=101:101 infra/nginx/ai-novel-web.conf /etc/nginx/conf.d/default.conf
36+
USER 101
37+
EXPOSE 8080

‎README.md‎

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,7 @@
3232
- 最新版本页:[Latest Release](https://github.com/ExplosiveCoderflome/AI-Novel-Writing-Assistant/releases/latest)
3333
- 建议优先下载 `Setup.exe` 安装版;如果你不想安装,或者想放在 U 盘 / 临时目录里直接运行,再选择 `portable` 版本
3434

35-
## Beta 预发体验
3635

37-
新功能会优先发布到 `beta` 分支,完成预发验证并稳定后再合入 `main`。如果你想提前体验最新能力,可以切换到 `beta` 分支运行源码版;如果你更看重稳定使用,建议继续使用 `main` 分支或 Releases 中的正式版本。
38-
39-
```bash
40-
git fetch origin
41-
git switch beta
42-
git pull
43-
```
44-
45-
如果本地还没有 `beta` 分支,可以使用:
46-
47-
```bash
48-
git fetch origin
49-
git switch -c beta origin/beta
50-
```
5136

5237
## 项目定位
5338

@@ -139,13 +124,12 @@ git switch -c beta origin/beta
139124

140125
完整历史更新见 [docs/releases/release-notes.md](./docs/releases/release-notes.md)。
141126

142-
### 2026-04-26
127+
### 2026-04-27
143128

144-
项目授权口径已调整为 AGPLv3 + 商业授权说明。
129+
自动导演前三章连续生成和接管配置继续补稳。新手把小说交给 AI 自动推进时,章节正文与配套资产会更稳地保存,恢复任务或重新打开弹窗时也更不容易被配置回跳打断。
145130

146-
- 项目默认采用 GNU AGPLv3 授权,继续保留可学习、可修改、可按开源协议合规使用的路径。
147-
- 服务型商用口径已明确:将本项目或修改版本作为后端,以 SaaS、托管或其他形式向第三方提供服务,需要先取得作者商业授权。
148-
- 贡献者许可协议已补齐,外部贡献者提交 PR 时可以明确确认自己有权提交内容,并同意贡献可用于项目开源版本和维护者另行提供的商业授权版本。
131+
- 自动导演连续生成前三章的链路更稳,章节正文和配套资产同步会避开重复保存,并在本地数据库短暂繁忙时自动等待重试。
132+
- 开书和已有项目接管弹窗里的模型选择、自动审批偏好更稳定,恢复任务或重新打开弹窗时会减少重复刷新和配置回跳。
149133

150134
## 功能预览
151135
### 功能概览中的95%以上编写都是AI完成

‎TASK.md‎

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# AI 长篇成书当前执行计划(小白用户导向)
22

3-
更新时间:2026-04-18
3+
更新时间:2026-04-26
44
适用范围:当前 `AI-Novel-Writing-Assistant2` 代码库现状
55
目标用户:完全不懂写作、希望通过 AI 引导或全自动规划完成整本小说创作的用户
66
当前定位:强辅助型 AI 小说工作台
@@ -1036,4 +1036,54 @@ P2 重点解决:
10361036
- 2026-04-10 00:45 [已计划] 已记录后续优化方向:先做常见错误预修复,再增强 AI 修复失败原因分类与模型切换提示。
10371037
- 2026-04-24 10:51 [开发中] 已吸收 PR #22 中可安全并入主线的部分:对“对象 schema + 单元素数组包裹”增加 schema-aware 本地解包,对中转站 / Relay 返回的 HTML 错页改判为 `transport_error`,并补充 markdown fenced JSON、字段缺失、AI 修复后仍缺字段、HTML 错页与单元素数组包裹的 targeted regression tests;更细粒度的字段缺失提示合同仍待继续收口。
10381038
<!-- task-md-sync:item:task-3b8c9c2f4a:end -->
1039+
<!-- task-md-sync:item:task-65a7562c11:start -->
1040+
### 角色资源账本与背包系统
1041+
- 标识:`task-65a7562c11`
1042+
- 状态:已完成
1043+
- 最近更新:2026-04-25 08:41
1044+
- 概要:完成角色背包剩余闭环:任务抽屉待确认入口、卷级资源承诺视图、旧项目最近章节资源回填,以及资源复查/回填的独立提交路径。
1045+
1046+
计划清单:
1047+
- [x] 小说任务抽屉展示资源变更待确认,并支持来源跳转、确认、忽略
1048+
- [x] 卷战略页展示本卷关键资源承诺,帮助规划本卷行动边界和后续兑现
1049+
- [x] 角色准备页提供最近章节资源回填入口,用于已有正文或旧项目轻量补账
1050+
- [x] 资源复查/回填跳过通用章节事实提取,只提交角色资源 proposal
1051+
- [x] 完成 shared/server/client build 与 targeted tests 验证
1052+
1053+
进度记录:
1054+
- 2026-04-25 08:41 [已完成] 2026-04-25: 完成角色背包剩余闭环;待确认资源进入小说任务抽屉,卷战略可查看本卷资源承诺,旧项目可手动回填最近章节资源。
1055+
<!-- task-md-sync:item:task-65a7562c11:end -->
1056+
<!-- task-md-sync:item:task-a9206e4ae1:start -->
1057+
### 预发 beta 分支发布流程规则
1058+
- 标识:`task-a9206e4ae1`
1059+
- 状态:已完成
1060+
- 最近更新:2026-04-25 00:35
1061+
- 概要:已在 AGENTS.md 写入 beta 预发分支规则,并将已完成的 desktop-dev 调整为收尾验证、合入 beta/main、退休分支的流程。
1062+
1063+
计划清单:
1064+
- [ ] 确认 AGENTS.md 现有开发分支、desktop-dev、打包发布规则之间的关系
1065+
- [ ] 新增 beta 预发分支工作流,明确功能分支、自测、预发集成、发布回 main 的顺序
1066+
- [ ] 将 desktop-dev 从长期集成分支调整为已完成功能的收尾验证、合入 beta/main、退休流程
1067+
- [ ] 补充发布与桌面打包前必须基于 beta 验证稳定的约束
1068+
1069+
进度记录:
1070+
- 2026-04-25 00:35 [已完成] 已完成 AGENTS.md 分支规则更新:功能分支先入 beta 预发验证,desktop-dev 作为完成候选进入 beta/main 后退休。
1071+
<!-- task-md-sync:item:task-a9206e4ae1:end -->
1072+
<!-- task-md-sync:item:task-3ae84511d6:start -->
1073+
### 角色库与小说角色同步系统
1074+
- 标识:`task-3ae84511d6`
1075+
- 状态:开发中
1076+
- 最近更新:2026-04-26 14:27
1077+
- 概要:首轮后端闭环已落地,并补充角色系统长期升级文档:后续围绕角色叙事岗位、关系张力和章节角色上下文包继续推进。
1078+
1079+
计划清单:
1080+
- [ ] 第一期开发角色叙事岗位 MVP:为小说角色生成本书职责、读者收益、剧情发动方式和红线
1081+
- [ ] 第一期开发章节角色上下文包 MVP:让章节生成、审稿、修复消费角色任务而不是只读角色列表
1082+
- [ ] 第一期接入关系张力摘要:输出本章需要推进或避免写崩的核心关系变化
1083+
- [ ] 为角色同步工作台接入前端入口:角色库引入、保存到角色库、同步建议列表
1084+
- [ ] 扩展端到端测试,覆盖同一角色被多本小说引用时的应用、忽略、分叉路径
1085+
1086+
进度记录:
1087+
- 2026-04-26 14:27 [开发中] 已新增角色系统升级长期方案文档和第一期开发方案,并与角色资源账本文档建立互链
1088+
<!-- task-md-sync:item:task-3ae84511d6:end -->
10391089
<!-- task-md-sync:end -->

0 commit comments

Comments
 (0)