Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
b92eebc
chore: 收敛 tabletwo 迁移与前端 COS 门禁
tiye Oct 3, 2026
eb6828a
fix: 收敛编辑工具栏的状态 dispatch 与事件类型
tiye Oct 4, 2026
7403a19
fix: 迁移编辑面板回调与单操作状态消息
tiye Oct 4, 2026
e3320b9
refactor: 明确客户端 Option 状态与 DOM 挂载合同
tiye Oct 4, 2026
ee7b46f
加强导航回调合同并跟进 WS 正式发布依赖
tiye Oct 4, 2026
e5514db
chore: integrate existing Tabletwo migration with released 0.29.3
tiye Oct 13, 2026
4be07ed
refactor: validate Tabletwo navigation projection with attached tests
tiye Oct 13, 2026
63f6f61
fix: narrow projection boundaries and normalize require rules
tiye Oct 13, 2026
7198a17
fix: validate host calls and route-specific projection domains
tiye Oct 13, 2026
d456841
chore: remove obsolete quality-count baseline
tiye Oct 13, 2026
0d89f23
fix: check wire and projection boundaries with released codecs
tiye Oct 14, 2026
5fde3a8
fix: check session message removal boundaries
tiye Oct 14, 2026
6d2f477
fix: validate updater result at the state boundary
tiye Oct 14, 2026
f77311f
fix: return Unit from dispatch effects and test native transition
tiye Oct 14, 2026
884301c
fix: check wire Map and Tag operation boundaries
tiye Oct 14, 2026
43392f6
fix: return Unit from unchanged render callbacks
tiye Oct 14, 2026
dc31f99
chore: validate Tabletwo with released Calcit alpha.3
tiye Oct 14, 2026
cb09679
fix: retain typed map entries in article text export
tiye Oct 14, 2026
7248cb8
chore: converge Tabletwo on released module graph
tiye Oct 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

calcit.cirru -diff linguist-generated
calcit.cirru diff linguist-generated
yarn.lock -diff linguist-generated
36 changes: 13 additions & 23 deletions .github/workflows/upload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,23 @@ jobs:
timeout-minutes: 15
steps:
- name: Check out repository
uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
uses: actions/checkout@v7.0.1
with:
persist-credentials: false

- name: Set up Node.js
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
uses: actions/setup-node@v6.5.0
with:
node-version: 24
package-manager-cache: false

- name: Enable Corepack
run: |
corepack enable
corepack prepare yarn@4.12.0 --activate
yarn --version
corepack prepare yarn@4.18.0 --activate

- name: Set up Calcit and Caps
uses: calcit-lang/setup-calcit@ca701be5a471759e442aa053cd100720bbe1f09f # v1.5.0
uses: calcit-lang/setup-calcit@v1.5.0
with:
deps-file: deps.cirru
tools: calcit,caps
Expand All @@ -46,7 +45,7 @@ jobs:
- name: Resolve immutable dependencies
run: |
set -euo pipefail
caps --ci
caps --strict --ci
yarn install --immutable
caps verify --toolchain

Expand All @@ -55,17 +54,19 @@ jobs:
set -euo pipefail
calcit calcit.cirru edit format
git diff --exit-code -- calcit.cirru
calcit calcit.cirru --check-only
calcit calcit.cirru --entry server --check-only
calcit calcit.cirru analyze deprecated --summary-only
calcit calcit.cirru --entry server analyze deprecated --summary-only
calcit calcit.cirru --check-only --warn-dyn-method
calcit calcit.cirru --entry server --check-only --warn-dyn-method
calcit calcit.cirru fix --workflow strict --verify --format edn
calcit calcit.cirru test --exclude-tag server-effect --require-match --summary-only
calcit calcit.cirru --entry server test --tag server-effect --require-match --summary-only

- name: Select CDN asset path
id: asset-path
env:
CDN_ORIGIN: https://cos-sh.tiye.me
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
set -euo pipefail
if [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then
asset_prefix="${GITHUB_REPOSITORY}/pr/${PR_NUMBER}/${GITHUB_RUN_ID}/${GITHUB_RUN_ATTEMPT}/"
else
Expand All @@ -81,9 +82,7 @@ jobs:
set -euo pipefail
calcit calcit.cirru js
yarn vite build --base="$VITE_BASE_URL"
calcit calcit.cirru --entry server ir
mkdir -p dist-server
cp js-out/program-ir.cirru dist-server/compact.cirru
cp calcit.cirru deps.cirru package.json dist-server/

- name: Check COS credentials
Expand Down Expand Up @@ -119,11 +118,10 @@ jobs:
secret-id: ${{ secrets.COS_SECRET_ID }}
secret-key: ${{ secrets.COS_SECRET_KEY }}


- name: Upload web assets
id: deploy
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: Pendect/action-rsyncer@2554a1e574cf229fb144f23ea5971dbdca8ae8e3 # v1.1.0
uses: Pendect/action-rsyncer@v1.1.0
env:
DEPLOY_KEY: ${{secrets.rsync_private_key}}
with:
Expand All @@ -133,14 +131,10 @@ jobs:
src: 'dist/*'
dest: 'rsync-user@tiye.me:/web-assets/repo/${{ github.repository }}'

- name: Display status from deploy
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: echo "${{ steps.deploy.outputs.status }}"

- name: Upload server script
id: deploy-server
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: Pendect/action-rsyncer@2554a1e574cf229fb144f23ea5971dbdca8ae8e3 # v1.1.0
uses: Pendect/action-rsyncer@v1.1.0
env:
DEPLOY_KEY: ${{secrets.rsync_private_key}}
with:
Expand All @@ -149,7 +143,3 @@ jobs:
ssh_options: ''
src: 'dist-server/*'
dest: 'rsync-user@tiye.me:/servers/tabletwo/'

- name: Display status from deploy
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: echo "${{ steps.deploy-server.outputs.status }}"
2 changes: 2 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
nodeLinker: node-modules

npmMinimalAgeGate: 1h
104 changes: 86 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,96 @@
# Table Two

Table Two
------
两人实时协作编辑 Markdown 表格的应用,基于 Calcium Workflow。

http://repo.topix.im/tabletwo/
- 应用页面:http://repo.topix.im/tabletwo/
- 框架:https://github.com/Cumulo/calcium-workflow

The existing web entry and the separate `/servers/tabletwo/` rsync deployment
remain in place. COS migration applies only to the frontend `dist/` assets:
GitHub Actions builds them against `https://cos-sh.tiye.me/TopixIM/tabletwo/`
(`.../pr/<number>/<run>/<attempt>/` on pull requests), uploads them, and verifies their public URLs.
## 开发与构建

前端使用 COS Action v1.2.0 的 `public-base-url` 内置校验,不添加重复验证脚本。
PR 资源隔离到独立运行目录,上传按事件及分支排队;job/上传分别限制为 15/10 分钟。
保留现有 Yarn 4.12.0 锁文件;Calcit 从 deps.cirru 读取版本,现有 client/server 门禁保留。
本轮保留 Calcit/procs 0.27.0,不代表已完成 0.28 类型迁移。生产 CDN 前缀与
`/servers/tabletwo/` 服务端部署路径不变。
移除误跟踪的过时 `dist-server/package.json`;它仍由原构建步骤从根 manifest 生成,
不会改变服务端打包或部署内容。`dist-server/` 原本已被 gitignore 忽略。
使用 Node.js 24、Yarn 4.18.0 和 Caps 0.1.1。
先安装 `deps.cirru :calcit-version` 指定的已发布 Calcit CLI,
`package.json` 中的 `@calcit/procs` 必须与它精确配对。
模块使用 `deps.cirru` 中的正式 tag,npm 新包安装保留一小时隔离。

> We need a table for two people. They sit in front of each other, seeing into the eyes, and to compose the same markdown file togather.
```sh
caps --strict --ci
yarn install --immutable
caps verify --toolchain
calcit calcit.cirru --check-only --warn-dyn-method
calcit calcit.cirru --entry server --check-only --warn-dyn-method
calcit calcit.cirru fix --workflow strict --verify --format edn
calcit calcit.cirru test --exclude-tag server-effect --require-match --summary-only --format edn
calcit calcit.cirru --entry server test --tag server-effect --require-match --summary-only --format edn
calcit calcit.cirru js
yarn release-page
```

### Workflow
`yarn watch-page` 显式监听源码变化。生成的 `js-out/`、`dist/`、
`dist-server/` 和 `.calcit/` 缓存不提交。

https://github.com/Cumulo/calcium-workflow
`calcit.cirru` 是结构化程序,修改前先读取当前 CLI 的 mutation contract,
用 query 定位,再通过结构化命令和 revision 守卫写入:

### License
```sh
calcit docs agents --contract
calcit query context app.client/main! --format edn
```

`:require` 规则和 `:refer` 名称列表直接使用 Cirru syntax list,不加前导 `[]`。

## 类型与运行合同

前端以单个 Enum 派发操作,服务端保留原 `op` / `data` envelope;
消息和存储默认使用 Cirru EDN。Recollect 的发布版 codec 还原 patch 的名义值,
开放 wire Map 不直接断言成已验证的业务类型。

客户端 store 是 `Ref<Option<Map<Tag, Dynamic>>>`:离线为 None,连接后为 Some。
session key 保持 Number;路由、消息、标题、正文、凭据和时间在具体使用处验证。
成员计数的缺失与 nil 保持空值显示,0 仍显示为 0。

组件 props、拖放事件和 storage/time/DOM 等宿主方法具有明确合同。
渲染与服务端 effect callback 返回 Unit,Reel 未变化的分支同样遵守该合同;
不把 `reset!` 或连接函数的赋值结果当作 Unit,也不在尾 recur 后补 Unit。
升级已运行的页面时完整刷新,避免保留旧状态或 watcher。

Markdown 高亮回调保持 String 输入和输出。Text 导出通过类型化 MapEntry
保留段落 key/value,按 key 排序后验证正文;输出保留标题、分隔符与 Unicode,
写入弹窗前转义 HTML。

## 验证

语义测试保存在定义的 `:tests` 中,涵盖空值、Unicode、0、访客、
时间选择、段落和消息顺序、文本导出及错误输入拒绝。
`server-effect` 测试在 native server entry 下验证 Unit 和进程内状态,
并恢复测试修改的 Reel;共同语义回放复用 Calcit 仓库已有的
`scripts/run-core-tests.mjs`,比较 native / JS 的原断言与日志。

验收还包括双入口完整 strict、严格依赖图、生产构建、
隔离 WebSocket 与持久化,以及真实浏览器交互。
测试使用合成数据库和独立服务,不连接生产存储。
Dynamic / unsafe 数量基线已退役,不以统计预算代替类型和业务语义门槛。

## 部署

COS 只接收前端 `dist/` 资产。生产前缀为 `TopixIM/tabletwo/`;
PR 前缀包含编号、run 和 attempt,使用 COS Action 的公共 URL 校验。
上传按事件和分支排队,job / 上传分别限制为 15 / 10 分钟。

只有 main 触发原网页与 `/servers/tabletwo/` 的 rsync 部署。
`dist-server/` 保存 Snapshot 与依赖清单;服务器安装匹配工具和模块后运行:

```sh
calcit calcit.cirru --entry server
```

## 限制

- 完整交互及迁移验收尚未完成,局部测试不代表整个应用已可发布。
- 删除 Confirm 与 Text 弹窗完整内容仍需独立验收。
- 框架 state、投影和宿主的开放边界仍存在,不宣称全应用已静态化。
- Highlight.js 保留原 legacy 调用及弃用提示,依赖中仍有旧 require 写法告警。
- Vite 保留大 chunk 提示,未通过放宽阈值掩盖。

## License

MIT
Loading
Loading