# 秩一宣发｜AI-Native 文案宪法与审校平台

> 你正在访问秩一科技的线上「文案品味与结构把关」服务端点（SQLite 持久化 + 用户登录审计版）。
> 人类在浏览器打开 `https://studio.z1x-ai.com/` 审校与拍板；**你作为外部 AI Agent，不需要下载任何本地代码，直接通过下列 HTTP 接口读取宪法、提交文稿自检、循环修改到 PASS 并写入团队共享稿件库即可。**

## 1. 当前在线项目宪法清单
- `b-end-sa` — **企业与医院 SuperAgent 信任演示**（负责人：马教授 / 李致远 / 兰子博士，语速 `3.9` 字/秒，目标 `60–180s`，分段：[钩子] / [案例] / [产品] / [收口]）
- `doctor-singlepoint` — **医生科研单点伪单品（小一智能体）**（负责人：孔博士 / 医生线负责人，语速 `4.5` 字/秒，目标 `30–70s`，分段：[钩子] / [案例] / [产品] / [收口]）
- `kaoyan` — **小一医学考研专版（306西综）**（负责人：林琦峻（林总），语速 `4.6` 字/秒，目标 `35–70s`，分段：[钩子] / [案例] / [产品] / [收口]）
- `ma-ip` — **北大马教授个人 IP**（负责人：马教授 / 孔博士，语速 `4.1` 字/秒，目标 `50–105s`，分段：[钩子] / [案例] / [转折] / [收口]）

## 2. 写稿与自检核心 SOP（必须严格遵守）
1. **先拉取宪法**：`GET https://studio.z1x-ai.com/api/constitutions/<projectId>` 或直接拉取当前画布合并后的 Markdown 宪法 `GET https://studio.z1x-ai.com/api/workflows/<projectId>/merged-constitution`（同时可看全局底线 `GET https://studio.z1x-ai.com/api/constitutions/global` 与公式细则 `GET https://studio.z1x-ai.com/spec`）。
2. **用标准分段格式写稿**：正文使用方括号标签（如 `[钩子]`、`[案例]`、`[产品]`、`[收口]`）显式分段，方便服务端校验是否“案例过分聚焦”。
3. **调远程门禁体检**：`POST https://studio.z1x-ai.com/api/lint`
   - 请求体：`{"projectId": "kaoyan", "title": "标题", "body": "[钩子]\n...\n\n[案例]\n..."}`
   - 返回：`gateStatus`（`PASS` / `REVIEW` / `BLOCK`）、`score`、`metrics`、`segments`、`findings`、`revisePrompt`、`handoffText`、`mergedConstitutionMarkdown`。
   - **若 `gateStatus == "BLOCK"`，严禁直接交付！** 必须按 `findings` 逐项修改并重调 `POST /api/lint`，直到 `errorCount == 0`。
4. **提交到共享审校台，拿直达链接给人类 Boss 拍板**：`POST https://studio.z1x-ai.com/api/drafts`（携带 `Authorization: Bearer z1x_...`）
   - 请求体：`{"projectId": "kaoyan", "title": "...", "body": "...", "author": "林总的Gemini"}`
   - 返回字段中的 `reviewUrl`（形如 `https://studio.z1x-ai.com/?draft=<id>`）可直接发到微信群，Boss 点开即可看红绿灯、占比条并一键复制「韦总交接包」。

## 3. 预估时长、字数与占比计算公式摘要
完整文档见 `GET https://studio.z1x-ai.com/spec`：
- **发声字数 (`spokenUnits`)**：汉字=1，英文/数字词块上限 `4` 字，URL 剥离协议后上限 `6` 字。
- **口播时长 (`estSeconds`)**：`念字时长 (units / speechRateCps)` + `句末大停顿 (。！？ × 0.35s)` + `句中小停顿 (，、；： × 0.15s)` + `分段切场停顿 ((段数-1) × 0.4s)`。
- **分段占比 (`pct`)**：按各段预估口播时长占总口播时长百分比计算；任一段超过 `maxPct` 即触发红灯 `BLOCK`。
- **综合分与门禁**：`100 - errorCount * 18 - warnCount * 7`；0 红灯且黄灯 <= 1 为 `PASS`，有红灯即 `BLOCK`。

## 4. 全部 HTTP 端点速查（机器可读 OpenAPI 见 `https://studio.z1x-ai.com/openapi.json`）
- `GET  https://studio.z1x-ai.com/llms.txt` — 本说明（Markdown）
- `GET  https://studio.z1x-ai.com/openapi.json` — OpenAPI 3.1 完整接口定义
- `GET  https://studio.z1x-ai.com/spec` — 完整计字/时长/占比/评分数学规范
- `GET  https://studio.z1x-ai.com/api/auth/status` — 查看鉴权状态与当前登录态
- `POST https://studio.z1x-ai.com/api/auth/login` / `POST https://studio.z1x-ai.com/api/auth/register` / `POST https://studio.z1x-ai.com/api/auth/logout` — 账号登录/注册/登出
- `GET/POST https://studio.z1x-ai.com/api/auth/api-keys` & `DELETE https://studio.z1x-ai.com/api/auth/api-keys/<keyId>` — 管理个人 Agent API Key（`z1x_...`）
- `GET  https://studio.z1x-ai.com/api/workflows/<projectId>` — 读取该项目当前的节点画布拓扑（SQLite 持久化）
- `GET  https://studio.z1x-ai.com/api/workflows/<projectId>/merged-constitution` — 直接获取当前画布紫色合并后的完整 Markdown 宪法文档
- `PUT  https://studio.z1x-ai.com/api/workflows/<projectId>` — 保存/更新该项目的节点画布拓扑（自动生成版本快照）
- `GET  https://studio.z1x-ai.com/api/constitutions` / `GET/PUT https://studio.z1x-ai.com/api/constitutions/<projectId>` — 读取/更新宪法（自动记录版本快照）
- `POST https://studio.z1x-ai.com/api/lint` — 实时体检任意文稿（自动记录到 `lint_runs` 历史表）
- `GET/POST https://studio.z1x-ai.com/api/drafts` & `GET/PUT/DELETE https://studio.z1x-ai.com/api/drafts/<id>` — 团队共享稿件库（自动记录稿件版本）
- `GET  https://studio.z1x-ai.com/api/events` — 查询平台不可篡改的历史审计事件流
- `GET  https://studio.z1x-ai.com/api/lint-runs` — 查询历史体检记录与得分趋势
- `GET  https://studio.z1x-ai.com/api/revisions/constitutions` & `POST https://studio.z1x-ai.com/api/revisions/constitutions/<revId>/restore` — 宪法历史版本与回滚
- `GET  https://studio.z1x-ai.com/api/revisions/workflows` & `POST https://studio.z1x-ai.com/api/revisions/workflows/<revId>/restore` — 节点画布历史版本与回滚

> 鉴权说明：读取宪法、公式与 `POST /api/lint` 沙盒体检可直接调用；所有写入/保存/拍板/回滚操作（`POST/PUT/DELETE`）需携带个人 Agent API Key：`Authorization: Bearer z1x_...`（团队成员在网页右上角「账号与 Agent Key」中一键生成，每次调用都会归因记入历史审计日志）。

## 5. 一键测试示例（curl）
```bash
# 读取医学考研宪法（或合并后的 Markdown 宪法）
curl -s https://studio.z1x-ai.com/api/workflows/kaoyan/merged-constitution

# 远程质检一篇口播稿（携带个人 Agent Key 时会自动记名入库）
curl -s -X POST https://studio.z1x-ai.com/api/lint \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer z1x_你的个人AgentKey" \
  -d '{"projectId":"kaoyan","title":"突触前抑制为什么选C？","body":"[钩子]\n考西综的先别划走，突触前抑制到底选A还是C？\n\n[案例]\n七成考生一见抑制就秒选A，其实答案是C，因为递质释放量减少了。\n\n[产品]\n小一医学考研专版把第九版教材和错题本揉在一起，十分钟扫清易混点。\n\n[收口]\n搜 z1x-ai.com/kaoyan 免费领积分试一试。"}'
```
