init: 虚拟公司架构设计——治理、流水线、中台、token 经济与演进路径
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
node_modules/
|
||||
.gitea-token
|
||||
@@ -0,0 +1,36 @@
|
||||
# virtual-company — 虚拟公司架构设计
|
||||
|
||||
> 多代理组织的架构蓝图:从单产品线自我迭代,到内容生产流水线,再到大型虚拟公司。
|
||||
> 配套运行实例见 [temp/UI](https://gitea.yinyuanjingling.icu/temp/UI)(第一个事业部已上线运行)。
|
||||
|
||||
## 核心命题
|
||||
|
||||
无人值守持续生产的瓶颈从来不是 token 供给,而是三个再生机制:
|
||||
|
||||
| 再生机制 | 回答的问题 | 落点 |
|
||||
|---|---|---|
|
||||
| 工作再生 | 活从哪来? | 点子工厂 / 选题池持续补给 |
|
||||
| 质量再生 | 产出为何不退化? | 多级闸门 + 独立交叉评审 |
|
||||
| 价值再生 | 消耗为何值得? | 价值审计 + 方向黑名单 |
|
||||
|
||||
**公司的本质不是更多代理的堆叠,而是把「锁、心跳、门禁、留痕」四件套从单产品线升格为全公司基础设施,再用预算制与审计链给无限 token 套上价值的缰绳。**
|
||||
|
||||
## 文档导航
|
||||
|
||||
| 文档 | 内容 |
|
||||
|---|---|
|
||||
| [01-governance.md](docs/01-governance.md) | 四层公司架构、治理三权、组织拓扑选型 |
|
||||
| [02-content-pipeline.md](docs/02-content-pipeline.md) | 内容生产流水线六站 |
|
||||
| [03-product-pipeline.md](docs/03-product-pipeline.md) | 产品迭代产品线(多代理分工、质量闸门、合并队列) |
|
||||
| [04-platforms.md](docs/04-platforms.md) | 四大职能中台 |
|
||||
| [05-economy.md](docs/05-economy.md) | token 经济与价值审计 |
|
||||
| [06-roadmap.md](docs/06-roadmap.md) | 三阶段演进路径 |
|
||||
|
||||
架构图见 [docs/diagrams/](docs/diagrams/)。
|
||||
|
||||
## 设计原则
|
||||
|
||||
1. **架构即组织**(康威定律的正用):组织结构 = 沟通结构 = 系统边界,开新产品线 = 招一个部门,架构不动。
|
||||
2. **人类只做治理**:战略方向、预算审批、审计问责三权,日常零干预。
|
||||
3. **一切异步**:协作靠产物交接(任务单/审校报告/周报),不开会;留痕库即公司档案室。
|
||||
4. **复用已验证的机制**:所有公司级机制都源自运行中的单产品线实践,不发明未经验证的抽象。
|
||||
@@ -0,0 +1,60 @@
|
||||
# 01 治理与组织架构
|
||||
|
||||
## 四层架构
|
||||
|
||||
```
|
||||
治理层(人类董事会)
|
||||
│ 战略/预算/审计
|
||||
公司中枢(CEO 代理)
|
||||
│ 目标分解/预算分配/跨部门协调
|
||||
事业部层(产品线自治)
|
||||
│ 调用
|
||||
职能中台(知识/质量/数据/工具)
|
||||
│ 运行于
|
||||
基础设施(git 仓库群/代理运行时/token 预算池/调度与锁)
|
||||
```
|
||||
|
||||
### 治理层:人类董事会
|
||||
|
||||
人类只行使三权,日常零干预:
|
||||
|
||||
- **战略方向**:修改治理文档即生效,CEO 负责翻译为部门目标;
|
||||
- **预算审批**:审 CEO 的预算分配案,批/驳/调;
|
||||
- **审计问责**:抽查审计链与年报,发现系统性质量下滑时熔断全公司。
|
||||
|
||||
### 公司中枢:CEO 代理
|
||||
|
||||
- 将战略分解为各事业部季度目标与预算包;
|
||||
- 仲裁跨部门冲突(唯一上诉点);
|
||||
- 汇总各部门周报为公司年报,向董事会汇报;
|
||||
- **无权**直接改部门内部工作产物——只管目标与预算,不管实现。
|
||||
|
||||
### 事业部层
|
||||
|
||||
每个事业部 = 一条产品线 + 部门主管代理 + 内部职能岗位。内部自治(自选任务、自管进度),对上只交两样东西:周报与产物。
|
||||
|
||||
| 事业部 | 职责 | 状态 |
|
||||
|---|---|---|
|
||||
| 产品事业部 | 组件库等代码资产的迭代产品线 | 已上线(temp/UI) |
|
||||
| 内容事业部 | 内容生产流水线(见 02 文档) | 规划中 |
|
||||
| 运营事业部 | 分发渠道、数据回流、用户回声收集 | 规划中 |
|
||||
|
||||
### 职能中台
|
||||
|
||||
不许各部门重复造的横向服务,详见 [04-platforms.md](04-platforms.md)。
|
||||
|
||||
## 组织拓扑选型
|
||||
|
||||
| 维度 | 事业部制 | 职能中台制 | 混合制(采用) |
|
||||
|---|---|---|---|
|
||||
| 沟通成本 | 部门内极低,跨部门要协商 | 任务跨职能接力,链路长 | 业务线内自治,纯职能共享 |
|
||||
| 失效模式 | 各部重复造轮子 | 中台成瓶颈、响应慢 | 中台需保证服务质量 |
|
||||
| 适用 | 产品线差异大 | 职能深、标准化强 | 业务并行 + 职能复用 |
|
||||
|
||||
**采用混合制**:业务按事业部自治,质量/数据/知识/工具四类纯职能沉中台。
|
||||
|
||||
## 编制管理(虚拟 HR)
|
||||
|
||||
- **岗位 = 调度模板**:一个岗位就是一份 SOP 提示词 + 工具清单 + 权限边界,招聘 = 实例化模板,裁撤 = 删除模板;
|
||||
- **绩效 = 价值密度记账**(见 05 文档):连续低密度岗位降预算直至裁撤;
|
||||
- **晋升路径不存在**,但岗位可拆分/合并——组织调整 = 改模板清单。
|
||||
@@ -0,0 +1,43 @@
|
||||
# 02 内容生产流水线
|
||||
|
||||
内容事业部的核心流水线,六站串联 + 双回路。
|
||||
|
||||
## 六站职责
|
||||
|
||||
| 站点 | 角色 | 职责 | 产物 |
|
||||
|---|---|---|---|
|
||||
| 1 选题 | PM 代理 | 选题池排序,每条带目标读者与预期价值 | 选题单 |
|
||||
| 2 研究 | 研究员代理 | 只交带来源的事实包,**不自行创作** | 研究包(事实+引用) |
|
||||
| 3 创作 | 主笔代理 | 基于研究包出稿,不自行上网找料 | 初稿 |
|
||||
| 4 编辑 | 编辑代理 | 结构编排、排版、配图、风格手册校对 | 成稿 |
|
||||
| 5 审校 | 独立审校代理 | 只查三件事:事实准确/逻辑自洽/风格合规 | 审校报告 |
|
||||
| 6 发布 | 发布代理 | 多渠道分发 + 发布数据采集 | 发布记录 |
|
||||
|
||||
## 两条设计铁律
|
||||
|
||||
1. **研究与创作分离**:研究员不写稿,主笔不找料。杜绝「为了行文顺手牺牲事实」——主笔拿到的事实包必须带来源,无来源断言审校直接打回。
|
||||
2. **审校独立**:审校者与创作者必须是不同代理实例,审校者只看成品 + 选题单 + 风格手册,看不到创作过程,避免被实现者的自我论证带偏。
|
||||
|
||||
## 双回路
|
||||
|
||||
- **打回回路**(红色):审校不过 → 带审校报告打回创作重写;同一稿件连续 3 次不过 → 选题回炉或拉黑。
|
||||
- **数据回流**(琥珀色):发布后的阅读/转化数据回流选题池——跑得好的选题类型加权,扑街方向进黑名单。数据回流是流水线的命,没有它选题就是盲拍。
|
||||
|
||||
## 选题池的四个水源
|
||||
|
||||
1. 用户回声(运营事业部采集的反馈与问题);
|
||||
2. 代码/资产扫描(文档缺口、示例缺失);
|
||||
3. 生态对标(同类头部内容有而我们没有的);
|
||||
4. 热点窗口(时效性选题,带过期时间)。
|
||||
|
||||
## 与产品线的同构性
|
||||
|
||||
| 产品线 | 内容线 | 共享机制 |
|
||||
|---|---|---|
|
||||
| backlog 条目 | 选题单 | 验收标准前置 |
|
||||
| 工程师代理 | 主笔代理 | 独立实现 |
|
||||
| 交叉评审 | 独立审校 | 双代理制衡 |
|
||||
| qa/stable | 发布渠道 | 门禁后置合并 |
|
||||
| 价值审计 | 数据回流 | 闭环反馈 |
|
||||
|
||||
架构图:[diagrams/content-pipeline.svg](diagrams/content-pipeline.svg)
|
||||
@@ -0,0 +1,53 @@
|
||||
# 03 产品迭代产品线(多代理分工)
|
||||
|
||||
单产品线从「单代理循环」升级为「分工流水线」的完整设计。运行实例:temp/UI 仓库。
|
||||
|
||||
## 核心命题转变
|
||||
|
||||
单代理循环的瓶颈是**单点产能**;多代理产品线的瓶颈是**协调 + 质量不退化**。
|
||||
|
||||
## 五层结构
|
||||
|
||||
1. **调度中枢**:任务队列与分片 / 并发锁与心跳 / token 预算与熔断;
|
||||
2. **点子工厂(PM)**:选题 + 可验证的验收标准;
|
||||
3. **架构拆解**:任务分片 + 接口定义;
|
||||
4. **工程池 × N**:并行实现,各自独立工作区;
|
||||
5. **质检 + 发布**:交叉评审 + 合并队列。
|
||||
|
||||
## 任务分片原则(并行的前提)
|
||||
|
||||
- 按文件域切片:新增独立文件的任务可并行;
|
||||
- 公共文件(导出表、manifest、演示页)是冲突域,汇总到串行尾部统一合入;
|
||||
- 判据:两个任务的 diff 无交集才可并行。
|
||||
|
||||
## 隔离与合并队列
|
||||
|
||||
- 每个工程师代理在独立 `git worktree` 工作(同一仓库的平行工作目录),互不污染;
|
||||
- 完成品不直接进集成分支,进入**合并队列**按序 fast-forward——多车道汇入单出口;
|
||||
- 队列保证同一时刻只有一条车道在合并,冲突在队列内串行暴露、逐个解决。
|
||||
|
||||
## 三级质量闸门链
|
||||
|
||||
```
|
||||
提交(独立 probe 分支)
|
||||
→ 静态门禁(规范检查 + 类型检查)
|
||||
→ 测试门禁(冒烟断言 + 演示可运行)
|
||||
→ AI 交叉评审(独立代理,只看 diff 与验收标准)
|
||||
→ 合并队列 → 集成分支
|
||||
任意一道不过 → 淘汰池(回炉重做;同方向连续 3 次失败 → 拉黑)
|
||||
```
|
||||
|
||||
交叉评审的存在意义:解决单代理「自己检查自己必然通过」的根本缺陷。
|
||||
|
||||
## 运行模式:连续迭代 + 心跳监护
|
||||
|
||||
- 调度器**不是**迭代器,只做健康检查与中断重启(高频唤起、零成本退出);
|
||||
- 真正迭代是单次唤起内的连续循环:逐条消化任务直到清空或时间预算耗尽;
|
||||
- 并发锁 + 心跳:锁文件时间戳超时视为循环崩溃,删锁重新点火;
|
||||
- 熔断:同一任务连续 2 轮失败即放弃留痕,防止死循环烧 token。
|
||||
|
||||
## 点子再生(工作不停歇的源头)
|
||||
|
||||
PM 代理持续从四个水源补给任务:用户反馈与 issue、代码扫描(TODO/坏味道/缺口测试)、生态对标、文档与演示缺口。每条任务必须带可验证的验收标准才能入队——质量在需求端的第一道滤网。
|
||||
|
||||
架构图:[diagrams/product-pipeline.svg](diagrams/product-pipeline.svg)、[diagrams/quality-gates.svg](diagrams/quality-gates.svg)
|
||||
@@ -0,0 +1,37 @@
|
||||
# 04 职能中台
|
||||
|
||||
横向服务所有事业部的四类纯职能。判据:两个以上部门需要、且需要保持一致性的能力,沉中台。
|
||||
|
||||
## 知识中台(组织记忆)
|
||||
|
||||
| 资产 | 内容 | 实例 |
|
||||
|---|---|---|
|
||||
| 员工手册 | 编码规范、风格手册、SOP 模板 | CODING.md、ITERATION.md |
|
||||
| 项目记忆 | 每仓库长期备忘与日志 | MEMORY.md、iterations.log |
|
||||
| 公司档案 | 全部产物留痕:任务单/审校报告/周报/年报 | 留痕库 |
|
||||
| 检索服务 | 跨仓库知识检索,供各代理按需取用 | MCP/索引 |
|
||||
|
||||
原则:**规范是固定资产**——个人风格与组织经验沉淀成文档并强制执行(门禁检查),不依赖任何单个代理的记忆。
|
||||
|
||||
## 质量中台(统一审计链)
|
||||
|
||||
- 三级闸门做成全公司统一服务:静态检查、测试断言、交叉评审;
|
||||
- 每条产物经过哪些闸门、谁审的、结论如何,全部记入审计链,可追溯、可抽查;
|
||||
- 董事会问责 = 抽查审计链;系统性质量下滑 = 熔断信号。
|
||||
|
||||
## 数据中台(记账与遥测)
|
||||
|
||||
- token 消耗记账(按部门/岗位/任务三个颗粒度);
|
||||
- 价值密度计算与排行(见 05 文档);
|
||||
- 发布/运行数据采集,向点子工厂与选题池供数。
|
||||
|
||||
## 工具中台(运行时服务)
|
||||
|
||||
- 调度器与并发锁、心跳监护;
|
||||
- git worktree 工作区池;
|
||||
- 认证包装(令牌不落命令行)、API 包装;
|
||||
- MCP/CLI 工具注册表。
|
||||
|
||||
## 中台服务质量约束
|
||||
|
||||
中台自己也要过闸门:工具变更走产品线同级门禁;知识中台的手册修改需交叉评审。**中台不是法外之地。**
|
||||
@@ -0,0 +1,44 @@
|
||||
# 05 token 经济与价值审计
|
||||
|
||||
「无限消耗」的纪律:无限消耗 ≠ 无脑消耗。token 花得越多,产出价值曲线必须单调上升,否则熔断。
|
||||
|
||||
## 记账模型
|
||||
|
||||
每条任务在数据中台记账:
|
||||
|
||||
```
|
||||
价值密度 = (验收达成度 × 影响面) / token 消耗
|
||||
```
|
||||
|
||||
| 字段 | 含义 | 来源 |
|
||||
|---|---|---|
|
||||
| token 消耗 | 该任务全部代理消耗之和 | 运行时遥测 |
|
||||
| 验收达成度 | 验收标准逐条核验的通过率 | 质量中台 |
|
||||
| 影响面 | 产物被引用/使用/阅读的广度 | 发布与运行数据 |
|
||||
|
||||
## 预算制(无限供给的组织约束)
|
||||
|
||||
- CEO 每期向部门分配 **token 预算包**,部门主管在包内自主支配;
|
||||
- 超支即冻结待审,防止任何单点失控烧穿;
|
||||
- 预算向高价值密度方向倾斜——这是「审计」变成「激励」的开关。
|
||||
|
||||
## 黑名单与降权
|
||||
|
||||
- 同一方向连续 3 次进淘汰池 → 拉黑(禁止再生成同类任务);
|
||||
- 价值密度连续低于阈值的方向 → 降权(排队优先级下调);
|
||||
- 黑名单只有董事会能解除——防止代理自行「翻案」。
|
||||
|
||||
## 熔断层级
|
||||
|
||||
| 层级 | 触发 | 动作 |
|
||||
|---|---|---|
|
||||
| 任务级 | 连续 2 轮失败 | 放弃该任务,留痕 |
|
||||
| 方向级 | 连续 3 次淘汰 | 拉黑方向 |
|
||||
| 岗位级 | 价值密度持续垫底 | 降预算直至裁撤编制 |
|
||||
| 公司级 | 产出价值曲线连续下行 | 董事会熔断全公司,人工复盘 |
|
||||
|
||||
## 反面模式(本架构明确防住的)
|
||||
|
||||
1. **空转循环**:无点子再生 + 无熔断 → 代理反复做同一件事烧 token;
|
||||
2. **指标腐蚀**:为提升价值密度而降低验收标准 → 验收标准由需求端锁定,代理无权修改;
|
||||
3. **审计失效**:实现者自审 → 交叉评审强制独立实例,评审者看不到实现过程。
|
||||
@@ -0,0 +1,46 @@
|
||||
# 06 演进路径
|
||||
|
||||
三阶段演进,每阶段独立可用、从现有资产生长,不推翻重来。
|
||||
|
||||
## Phase 1:内容事业部单线跑通
|
||||
|
||||
**目标**:第二条产品线(内容流水线)落地,验证架构可复制。
|
||||
|
||||
- 把内容六站(选题→研究→创作→编辑→审校→发布)做成一套任务协议——照抄 ITERATION.md 的锁/心跳/门禁/留痕四件套;
|
||||
- 复用现有调度自动化,只换 prompt 与产物格式;
|
||||
- 验收:内容流水线无人值守连续生产 N 篇合格内容,审校打回率与数据回流闭环运转。
|
||||
|
||||
## Phase 2:中台沉淀
|
||||
|
||||
**目标**:两条产品线共用横向服务,消除重复建设。
|
||||
|
||||
- 质量闸门、token 记账、组织记忆抽成跨线共享服务;
|
||||
- 产品线协议瘦身为「业务差异部分」,公共部分引用中台;
|
||||
- 验收:新起一条产品线时,只需写业务 SOP,四件套直接引用中台。
|
||||
|
||||
## Phase 3:公司成形
|
||||
|
||||
**目标**:治理结构与多部门自治。
|
||||
|
||||
- CEO 代理上线:战略分解 + 预算分配 + 公司年报;
|
||||
- 预算制与价值密度全量运转,黑名单/熔断机制生效;
|
||||
- 此后每开一条新产品线 = 招一个部门(实例化岗位模板),架构不动;
|
||||
- 验收:人类干预频率收敛到治理层三权(方向/预算/审计),日常零干预。
|
||||
|
||||
## 阶段判据
|
||||
|
||||
| 信号 | 动作 |
|
||||
|---|---|
|
||||
| 单线稳定运转、任务供大于求 | 进入 Phase 1 |
|
||||
| 两线并存且出现重复建设 | 进入 Phase 2 |
|
||||
| 部门 ≥ 3、跨部门协调事件频发 | 进入 Phase 3 |
|
||||
| 价值密度曲线连续下行 | 停止扩张,复盘审计 |
|
||||
|
||||
## 风险清单
|
||||
|
||||
| 风险 | 缓解 |
|
||||
|---|---|
|
||||
| 协调成本随代理数平方增长 | 康威定律控制边界:组织=沟通=架构,部门间只过产物 |
|
||||
| 中台成为瓶颈 | 中台 SLA 纳入价值密度记账 |
|
||||
| 质量随吞吐下滑 | 三级闸门 + 打回率/拉黑率纳入部门周报 |
|
||||
| token 失控 | 预算包 + 四级熔断 |
|
||||
@@ -0,0 +1,46 @@
|
||||
<svg viewBox="0 0 680 520" width="100%" role="img" xmlns="http://www.w3.org/2000/svg">
|
||||
<title>大型虚拟公司四层架构</title>
|
||||
<desc>治理层、公司中枢、事业部层、职能中台层与基础设施层</desc>
|
||||
<defs>
|
||||
<marker id="arrow3" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse">
|
||||
<path d="M2 1L8 5L2 9" fill="none" stroke="context-stroke" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</marker>
|
||||
</defs>
|
||||
<rect x="40" y="40" width="600" height="60" rx="14" fill="#FAEEDA" stroke="#854F0B" stroke-width="0.5"/>
|
||||
<text class="th" x="60" y="58" fill="#633806" font-weight="500" font-family="sans-serif" font-size="14">治理层(人类董事会:你)</text>
|
||||
<text class="ts" x="60" y="80" fill="#854F0B" font-family="sans-serif" font-size="12">只管三件事:战略方向 / 预算审批 / 审计问责,日常零干预</text>
|
||||
<line x1="340" y1="100" x2="340" y2="120" stroke="#5F5E5A" stroke-width="1.5" marker-end="url(#arrow3)"/>
|
||||
<rect x="40" y="122" width="600" height="52" rx="14" fill="#E6F1FB" stroke="#185FA5" stroke-width="0.5"/>
|
||||
<text x="60" y="141" fill="#0C447C" font-weight="500" font-family="sans-serif" font-size="14">公司中枢(CEO 代理)</text>
|
||||
<text x="60" y="161" fill="#185FA5" font-family="sans-serif" font-size="12">战略分解 / 预算分配到部门 / 跨部门协调 / 向董事会交年报</text>
|
||||
<line x1="340" y1="174" x2="340" y2="194" stroke="#5F5E5A" stroke-width="1.5" marker-end="url(#arrow3)"/>
|
||||
<rect x="40" y="196" width="600" height="130" rx="14" fill="#E1F5EE" stroke="#0F6E56" stroke-width="0.5"/>
|
||||
<text x="60" y="216" fill="#085041" font-weight="500" font-family="sans-serif" font-size="14">事业部层(每部 = 一条产品线 + 部门主管)</text>
|
||||
<rect x="60" y="230" width="180" height="80" rx="10" fill="#9FE1CB" stroke="#0F6E56" stroke-width="0.5"/>
|
||||
<text x="150" y="252" text-anchor="middle" dominant-baseline="central" fill="#04342C" font-weight="500" font-family="sans-serif" font-size="14">产品事业部</text>
|
||||
<text x="150" y="272" text-anchor="middle" dominant-baseline="central" fill="#085041" font-family="sans-serif" font-size="12">组件库迭代产品线</text>
|
||||
<text x="150" y="290" text-anchor="middle" dominant-baseline="central" fill="#085041" font-family="sans-serif" font-size="12">工程池+门禁(已运行)</text>
|
||||
<rect x="255" y="230" width="180" height="80" rx="10" fill="#9FE1CB" stroke="#0F6E56" stroke-width="0.5"/>
|
||||
<text x="345" y="252" text-anchor="middle" dominant-baseline="central" fill="#04342C" font-weight="500" font-family="sans-serif" font-size="14">内容事业部</text>
|
||||
<text x="345" y="272" text-anchor="middle" dominant-baseline="central" fill="#085041" font-family="sans-serif" font-size="12">内容生产流水线</text>
|
||||
<text x="345" y="290" text-anchor="middle" dominant-baseline="central" fill="#085041" font-family="sans-serif" font-size="12">选题·研究·创作·发布</text>
|
||||
<rect x="450" y="230" width="180" height="80" rx="10" fill="#9FE1CB" stroke="#0F6E56" stroke-width="0.5"/>
|
||||
<text x="540" y="252" text-anchor="middle" dominant-baseline="central" fill="#04342C" font-weight="500" font-family="sans-serif" font-size="14">运营事业部</text>
|
||||
<text x="540" y="272" text-anchor="middle" dominant-baseline="central" fill="#085041" font-family="sans-serif" font-size="12">分发与反馈</text>
|
||||
<text x="540" y="290" text-anchor="middle" dominant-baseline="central" fill="#085041" font-family="sans-serif" font-size="12">渠道·数据·用户回声</text>
|
||||
<line x1="340" y1="326" x2="340" y2="346" stroke="#5F5E5A" stroke-width="1.5" marker-end="url(#arrow3)"/>
|
||||
<rect x="40" y="348" width="600" height="60" rx="14" fill="#EEEDFE" stroke="#534AB7" stroke-width="0.5"/>
|
||||
<text x="60" y="366" fill="#3C3489" font-weight="500" font-family="sans-serif" font-size="14">职能中台(横向服务所有事业部)</text>
|
||||
<rect x="55" y="374" width="138" height="26" rx="6" fill="#FFFFFF" stroke="#534AB7" stroke-width="0.5"/>
|
||||
<text x="124" y="387" text-anchor="middle" dominant-baseline="central" fill="#3C3489" font-family="sans-serif" font-size="12">知识中台</text>
|
||||
<rect x="203" y="374" width="138" height="26" rx="6" fill="#FFFFFF" stroke="#534AB7" stroke-width="0.5"/>
|
||||
<text x="272" y="387" text-anchor="middle" dominant-baseline="central" fill="#3C3489" font-family="sans-serif" font-size="12">质量中台</text>
|
||||
<rect x="351" y="374" width="138" height="26" rx="6" fill="#FFFFFF" stroke="#534AB7" stroke-width="0.5"/>
|
||||
<text x="420" y="387" text-anchor="middle" dominant-baseline="central" fill="#3C3489" font-family="sans-serif" font-size="12">数据中台</text>
|
||||
<rect x="499" y="374" width="126" height="26" rx="6" fill="#FFFFFF" stroke="#534AB7" stroke-width="0.5"/>
|
||||
<text x="562" y="387" text-anchor="middle" dominant-baseline="central" fill="#3C3489" font-family="sans-serif" font-size="12">工具中台</text>
|
||||
<line x1="340" y1="408" x2="340" y2="428" stroke="#5F5E5A" stroke-width="1.5" marker-end="url(#arrow3)"/>
|
||||
<rect x="40" y="430" width="600" height="52" rx="14" fill="#F1EFE8" stroke="#5F5E5A" stroke-width="0.5"/>
|
||||
<text x="60" y="449" fill="#444441" font-weight="500" font-family="sans-serif" font-size="14">基础设施</text>
|
||||
<text x="60" y="469" fill="#5F5E5A" font-family="sans-serif" font-size="12">git 仓库群 / 代理运行时与 worktree 池 / token 预算池 / 调度与锁</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 5.3 KiB |
@@ -0,0 +1,38 @@
|
||||
<svg viewBox="0 0 680 320" width="100%" role="img" xmlns="http://www.w3.org/2000/svg">
|
||||
<title>内容生产流水线六站</title>
|
||||
<desc>选题、研究、创作、编辑排版、审校、发布与数据回流闭环</desc>
|
||||
<defs>
|
||||
<marker id="arrow4" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse">
|
||||
<path d="M2 1L8 5L2 9" fill="none" stroke="context-stroke" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</marker>
|
||||
</defs>
|
||||
<rect x="40" y="70" width="88" height="64" rx="8" fill="#9FE1CB" stroke="#0F6E56" stroke-width="0.5"/>
|
||||
<text x="84" y="92" text-anchor="middle" dominant-baseline="central" fill="#04342C" font-weight="500" font-family="sans-serif" font-size="14">选题</text>
|
||||
<text x="84" y="112" text-anchor="middle" dominant-baseline="central" fill="#085041" font-family="sans-serif" font-size="12">选题池排序</text>
|
||||
<line x1="128" y1="102" x2="143" y2="102" stroke="#0F6E56" stroke-width="1.5" marker-end="url(#arrow4)"/>
|
||||
<rect x="148" y="70" width="88" height="64" rx="8" fill="#FFFFFF" stroke="#0F6E56" stroke-width="0.5"/>
|
||||
<text x="192" y="92" text-anchor="middle" dominant-baseline="central" fill="#04342C" font-weight="500" font-family="sans-serif" font-size="14">研究</text>
|
||||
<text x="192" y="112" text-anchor="middle" dominant-baseline="central" fill="#085041" font-family="sans-serif" font-size="12">资料+事实核查</text>
|
||||
<line x1="236" y1="102" x2="251" y2="102" stroke="#0F6E56" stroke-width="1.5" marker-end="url(#arrow4)"/>
|
||||
<rect x="256" y="70" width="88" height="64" rx="8" fill="#CECBF6" stroke="#534AB7" stroke-width="0.5"/>
|
||||
<text x="300" y="92" text-anchor="middle" dominant-baseline="central" fill="#26215C" font-weight="500" font-family="sans-serif" font-size="14">创作</text>
|
||||
<text x="300" y="112" text-anchor="middle" dominant-baseline="central" fill="#3C3489" font-family="sans-serif" font-size="12">主笔出稿</text>
|
||||
<line x1="344" y1="102" x2="359" y2="102" stroke="#0F6E56" stroke-width="1.5" marker-end="url(#arrow4)"/>
|
||||
<rect x="364" y="70" width="88" height="64" rx="8" fill="#FFFFFF" stroke="#0F6E56" stroke-width="0.5"/>
|
||||
<text x="408" y="92" text-anchor="middle" dominant-baseline="central" fill="#04342C" font-weight="500" font-family="sans-serif" font-size="14">编辑</text>
|
||||
<text x="408" y="112" text-anchor="middle" dominant-baseline="central" fill="#085041" font-family="sans-serif" font-size="12">编排+排版</text>
|
||||
<line x1="452" y1="102" x2="467" y2="102" stroke="#0F6E56" stroke-width="1.5" marker-end="url(#arrow4)"/>
|
||||
<rect x="472" y="70" width="88" height="64" rx="8" fill="#F5C4B3" stroke="#993C1D" stroke-width="0.5"/>
|
||||
<text x="516" y="92" text-anchor="middle" dominant-baseline="central" fill="#4A1B0C" font-weight="500" font-family="sans-serif" font-size="14">审校</text>
|
||||
<text x="516" y="112" text-anchor="middle" dominant-baseline="central" fill="#712B13" font-family="sans-serif" font-size="12">独立代理互审</text>
|
||||
<line x1="560" y1="102" x2="575" y2="102" stroke="#0F6E56" stroke-width="1.5" marker-end="url(#arrow4)"/>
|
||||
<rect x="580" y="70" width="60" height="64" rx="8" fill="#B5D4F4" stroke="#185FA5" stroke-width="0.5"/>
|
||||
<text x="610" y="92" text-anchor="middle" dominant-baseline="central" fill="#042C53" font-weight="500" font-family="sans-serif" font-size="14">发布</text>
|
||||
<text x="610" y="112" text-anchor="middle" dominant-baseline="central" fill="#0C447C" font-family="sans-serif" font-size="12">多渠道</text>
|
||||
<text x="84" y="56" fill="#085041" font-family="sans-serif" font-size="12">输入:用户回声 + 热点 + 缺口扫描</text>
|
||||
<text x="610" y="156" text-anchor="middle" fill="#0C447C" font-family="sans-serif" font-size="12">阅读/转化数据</text>
|
||||
<polyline points="610,166 610,230 84,230 84,140" fill="none" stroke="#BA7517" stroke-width="1.5" stroke-dasharray="4 3" marker-end="url(#arrow4)"/>
|
||||
<text x="347" y="248" text-anchor="middle" fill="#854F0B" font-family="sans-serif" font-size="12">数据回流:哪类选题跑得好 → 加权,扑街方向 → 黑名单</text>
|
||||
<polyline points="516,134 516,182 300,182 300,140" fill="none" stroke="#A32D2D" stroke-width="1.5" stroke-dasharray="4 3" marker-end="url(#arrow4)"/>
|
||||
<text x="408" y="176" text-anchor="middle" fill="#791F1F" font-family="sans-serif" font-size="12">审校不过 → 打回创作重写</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.3 KiB |
@@ -0,0 +1,50 @@
|
||||
<svg viewBox="0 0 680 460" width="100%" role="img" xmlns="http://www.w3.org/2000/svg">
|
||||
<title>多代理产品线架构</title>
|
||||
<desc>调度中枢、交付流水线(点子工厂、架构拆解、工程池、质检发布)与共享基座</desc>
|
||||
<defs>
|
||||
<marker id="arrowP" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse">
|
||||
<path d="M2 1L8 5L2 9" fill="none" stroke="context-stroke" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</marker>
|
||||
</defs>
|
||||
<rect x="40" y="40" width="600" height="72" rx="16" fill="#E6F1FB" stroke="#185FA5" stroke-width="0.5"/>
|
||||
<text x="60" y="58" fill="#0C447C" font-weight="500" font-family="sans-serif" font-size="14">调度中枢</text>
|
||||
<rect x="60" y="66" width="180" height="34" rx="8" fill="#FFFFFF" stroke="#185FA5" stroke-width="0.5"/>
|
||||
<text x="150" y="83" text-anchor="middle" dominant-baseline="central" fill="#185FA5" font-family="sans-serif" font-size="12">任务队列与分片</text>
|
||||
<rect x="255" y="66" width="180" height="34" rx="8" fill="#FFFFFF" stroke="#185FA5" stroke-width="0.5"/>
|
||||
<text x="345" y="83" text-anchor="middle" dominant-baseline="central" fill="#185FA5" font-family="sans-serif" font-size="12">并发锁与心跳</text>
|
||||
<rect x="450" y="66" width="180" height="34" rx="8" fill="#FFFFFF" stroke="#185FA5" stroke-width="0.5"/>
|
||||
<text x="540" y="83" text-anchor="middle" dominant-baseline="central" fill="#185FA5" font-family="sans-serif" font-size="12">token 预算与熔断</text>
|
||||
<line x1="340" y1="112" x2="340" y2="138" stroke="#5F5E5A" stroke-width="1.5" marker-end="url(#arrowP)"/>
|
||||
<rect x="40" y="140" width="600" height="190" rx="16" fill="#E1F5EE" stroke="#0F6E56" stroke-width="0.5"/>
|
||||
<text x="60" y="160" fill="#085041" font-weight="500" font-family="sans-serif" font-size="14">交付流水线</text>
|
||||
<rect x="55" y="176" width="100" height="60" rx="8" fill="#9FE1CB" stroke="#0F6E56" stroke-width="0.5"/>
|
||||
<text x="105" y="198" text-anchor="middle" dominant-baseline="central" fill="#04342C" font-weight="500" font-family="sans-serif" font-size="14">点子工厂</text>
|
||||
<text x="105" y="216" text-anchor="middle" dominant-baseline="central" fill="#085041" font-family="sans-serif" font-size="12">选题+验收标准</text>
|
||||
<line x1="155" y1="206" x2="180" y2="206" stroke="#0F6E56" stroke-width="1.5" marker-end="url(#arrowP)"/>
|
||||
<rect x="185" y="176" width="110" height="60" rx="8" fill="#9FE1CB" stroke="#0F6E56" stroke-width="0.5"/>
|
||||
<text x="240" y="198" text-anchor="middle" dominant-baseline="central" fill="#04342C" font-weight="500" font-family="sans-serif" font-size="14">架构拆解</text>
|
||||
<text x="240" y="216" text-anchor="middle" dominant-baseline="central" fill="#085041" font-family="sans-serif" font-size="12">任务分片+接口</text>
|
||||
<line x1="295" y1="206" x2="320" y2="206" stroke="#0F6E56" stroke-width="1.5" marker-end="url(#arrowP)"/>
|
||||
<rect x="325" y="170" width="150" height="134" rx="12" fill="#EEEDFE" stroke="#534AB7" stroke-width="0.5"/>
|
||||
<text x="400" y="186" text-anchor="middle" dominant-baseline="central" fill="#3C3489" font-weight="500" font-family="sans-serif" font-size="14">工程池 × N</text>
|
||||
<rect x="339" y="198" width="122" height="30" rx="6" fill="#FFFFFF" stroke="#534AB7" stroke-width="0.5"/>
|
||||
<text x="400" y="213" text-anchor="middle" dominant-baseline="central" fill="#3C3489" font-family="sans-serif" font-size="12">工程师代理 1</text>
|
||||
<rect x="339" y="232" width="122" height="30" rx="6" fill="#FFFFFF" stroke="#534AB7" stroke-width="0.5"/>
|
||||
<text x="400" y="247" text-anchor="middle" dominant-baseline="central" fill="#3C3489" font-family="sans-serif" font-size="12">工程师代理 2</text>
|
||||
<rect x="339" y="266" width="122" height="30" rx="6" fill="#FFFFFF" stroke="#534AB7" stroke-width="0.5"/>
|
||||
<text x="400" y="281" text-anchor="middle" dominant-baseline="central" fill="#3C3489" font-family="sans-serif" font-size="12">工程师代理 N</text>
|
||||
<line x1="475" y1="206" x2="500" y2="206" stroke="#0F6E56" stroke-width="1.5" marker-end="url(#arrowP)"/>
|
||||
<rect x="505" y="176" width="125" height="60" rx="8" fill="#9FE1CB" stroke="#0F6E56" stroke-width="0.5"/>
|
||||
<text x="567" y="198" text-anchor="middle" dominant-baseline="central" fill="#04342C" font-weight="500" font-family="sans-serif" font-size="14">质检+发布</text>
|
||||
<text x="567" y="216" text-anchor="middle" dominant-baseline="central" fill="#085041" font-family="sans-serif" font-size="12">交叉审·合并队列</text>
|
||||
<polyline points="567,336 567,318 105,318 105,236" fill="none" stroke="#BA7517" stroke-width="1.5" stroke-dasharray="4 3" marker-end="url(#arrowP)"/>
|
||||
<text x="336" y="314" text-anchor="middle" fill="#854F0B" font-family="sans-serif" font-size="12">价值审计反馈:低价值方向降权淘汰</text>
|
||||
<rect x="40" y="360" width="600" height="72" rx="16" fill="#F1EFE8" stroke="#5F5E5A" stroke-width="0.5"/>
|
||||
<text x="60" y="378" fill="#444441" font-weight="500" font-family="sans-serif" font-size="14">共享基座</text>
|
||||
<rect x="60" y="386" width="180" height="34" rx="8" fill="#FFFFFF" stroke="#5F5E5A" stroke-width="0.5"/>
|
||||
<text x="150" y="403" text-anchor="middle" dominant-baseline="central" fill="#444441" font-family="sans-serif" font-size="12">git worktree 工作区池</text>
|
||||
<rect x="255" y="386" width="180" height="34" rx="8" fill="#FFFFFF" stroke="#5F5E5A" stroke-width="0.5"/>
|
||||
<text x="345" y="403" text-anchor="middle" dominant-baseline="central" fill="#444441" font-family="sans-serif" font-size="12">门禁链 npm run check</text>
|
||||
<rect x="450" y="386" width="180" height="34" rx="8" fill="#FFFFFF" stroke="#5F5E5A" stroke-width="0.5"/>
|
||||
<text x="540" y="403" text-anchor="middle" dominant-baseline="central" fill="#444441" font-family="sans-serif" font-size="12">留痕库与遥测</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 5.7 KiB |
@@ -0,0 +1,37 @@
|
||||
<svg viewBox="0 0 680 300" width="100%" role="img" xmlns="http://www.w3.org/2000/svg">
|
||||
<title>多级质量闸门与淘汰去向</title>
|
||||
<desc>提交经过静态门禁、测试门禁、AI 交叉评审、合并队列四道闸,任何一道不过则落入淘汰池</desc>
|
||||
<defs>
|
||||
<marker id="arrowQ" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse">
|
||||
<path d="M2 1L8 5L2 9" fill="none" stroke="context-stroke" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</marker>
|
||||
</defs>
|
||||
<rect x="40" y="60" width="100" height="56" rx="8" fill="#B5D4F4" stroke="#185FA5" stroke-width="0.5"/>
|
||||
<text x="90" y="80" text-anchor="middle" dominant-baseline="central" fill="#042C53" font-weight="500" font-family="sans-serif" font-size="14">提交</text>
|
||||
<text x="90" y="98" text-anchor="middle" dominant-baseline="central" fill="#0C447C" font-family="sans-serif" font-size="12">qa/probe-*</text>
|
||||
<line x1="140" y1="88" x2="158" y2="88" stroke="#185FA5" stroke-width="1.5" marker-end="url(#arrowQ)"/>
|
||||
<rect x="163" y="60" width="110" height="56" rx="8" fill="#FFFFFF" stroke="#5F5E5A" stroke-width="0.5"/>
|
||||
<text x="218" y="80" text-anchor="middle" dominant-baseline="central" fill="#2C2C2A" font-weight="500" font-family="sans-serif" font-size="14">静态门禁</text>
|
||||
<text x="218" y="98" text-anchor="middle" dominant-baseline="central" fill="#5F5E5A" font-family="sans-serif" font-size="12">style + tsc</text>
|
||||
<line x1="273" y1="88" x2="291" y2="88" stroke="#185FA5" stroke-width="1.5" marker-end="url(#arrowQ)"/>
|
||||
<rect x="296" y="60" width="110" height="56" rx="8" fill="#FFFFFF" stroke="#5F5E5A" stroke-width="0.5"/>
|
||||
<text x="351" y="80" text-anchor="middle" dominant-baseline="central" fill="#2C2C2A" font-weight="500" font-family="sans-serif" font-size="14">测试门禁</text>
|
||||
<text x="351" y="98" text-anchor="middle" dominant-baseline="central" fill="#5F5E5A" font-family="sans-serif" font-size="12">smoke + demo</text>
|
||||
<line x1="406" y1="88" x2="424" y2="88" stroke="#185FA5" stroke-width="1.5" marker-end="url(#arrowQ)"/>
|
||||
<rect x="429" y="60" width="110" height="56" rx="8" fill="#CECBF6" stroke="#534AB7" stroke-width="0.5"/>
|
||||
<text x="484" y="80" text-anchor="middle" dominant-baseline="central" fill="#26215C" font-weight="500" font-family="sans-serif" font-size="14">AI 交叉评审</text>
|
||||
<text x="484" y="98" text-anchor="middle" dominant-baseline="central" fill="#3C3489" font-family="sans-serif" font-size="12">双代理互审</text>
|
||||
<line x1="539" y1="88" x2="557" y2="88" stroke="#185FA5" stroke-width="1.5" marker-end="url(#arrowQ)"/>
|
||||
<rect x="562" y="60" width="78" height="56" rx="8" fill="#9FE1CB" stroke="#0F6E56" stroke-width="0.5"/>
|
||||
<text x="601" y="80" text-anchor="middle" dominant-baseline="central" fill="#04342C" font-weight="500" font-family="sans-serif" font-size="14">合并队列</text>
|
||||
<text x="601" y="98" text-anchor="middle" dominant-baseline="central" fill="#085041" font-family="sans-serif" font-size="12">ff-only</text>
|
||||
<text x="90" y="45" fill="#0C447C" font-family="sans-serif" font-size="12">每条任务独立 probe 分支</text>
|
||||
<polyline points="218,116 218,190 346,190" fill="none" stroke="#A32D2D" stroke-width="1.5" stroke-dasharray="4 3" marker-end="url(#arrowQ)"/>
|
||||
<polyline points="351,116 351,184" fill="none" stroke="#A32D2D" stroke-width="1.5" stroke-dasharray="4 3"/>
|
||||
<polyline points="484,116 484,190 356,190" fill="none" stroke="#A32D2D" stroke-width="1.5" stroke-dasharray="4 3" marker-end="url(#arrowQ)"/>
|
||||
<rect x="240" y="190" width="222" height="56" rx="12" fill="#FCEBEB" stroke="#A32D2D" stroke-width="0.5"/>
|
||||
<text x="351" y="210" text-anchor="middle" dominant-baseline="central" fill="#501313" font-weight="500" font-family="sans-serif" font-size="14">淘汰池</text>
|
||||
<text x="351" y="228" text-anchor="middle" dominant-baseline="central" fill="#791F1F" font-family="sans-serif" font-size="12">回炉重做 / 方向黑名单</text>
|
||||
<text x="601" y="140" text-anchor="middle" fill="#085041" font-family="sans-serif" font-size="12">通过后按序</text>
|
||||
<text x="601" y="157" text-anchor="middle" fill="#085041" font-family="sans-serif" font-size="12">落 qa/stable</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.1 KiB |
@@ -0,0 +1,19 @@
|
||||
/*** 作用:Gitea REST API 调用包装器,用法 node scripts/gitea-api.mjs <METHOD> <path不带前导斜杠> [jsonBody],令牌读自 .gitea-token ***/
|
||||
import { readFileSync } from 'node:fs';
|
||||
|
||||
// 仓库与令牌
|
||||
const base = 'https://gitea.yinyuanjingling.icu/api/v1';
|
||||
const token = readFileSync(new URL('../.gitea-token', import.meta.url), 'utf8').trim();
|
||||
const [method = 'GET', path = '', body = ''] = process.argv.slice(2);
|
||||
// 卫语句:缺参数退出
|
||||
if (!method || !path) { console.error('用法: node scripts/gitea-api.mjs <METHOD> <path> [jsonBody]'); process.exit(2); }
|
||||
|
||||
// 发起请求并输出结果(path 不带前导斜杠,规避 Git Bash MSYS 路径转换篡改)
|
||||
const res = await fetch(`${base}/${path.replace(/^\//, '')}`, {
|
||||
method: method.toUpperCase(),
|
||||
headers: { 'Authorization': `token ${token}`, 'Content-Type': 'application/json' },
|
||||
body: body || undefined,
|
||||
});
|
||||
const text = await res.text();
|
||||
console.log(`HTTP ${res.status}\n${text}`);
|
||||
process.exit(res.ok ? 0 : 1);
|
||||
@@ -0,0 +1,18 @@
|
||||
/*** 作用:Gitea 认证 git 包装器,从 .gitea-token 读取令牌注入 Authorization 头,避免令牌出现在命令行 ***/
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { spawnSync } from 'node:child_process';
|
||||
|
||||
// 令牌文件路径(不入库)
|
||||
const tokenFile = new URL('../.gitea-token', import.meta.url);
|
||||
// git 子命令参数(如 push origin main)
|
||||
const args = process.argv.slice(2);
|
||||
// 卫语句:无参数直接退出
|
||||
if (args.length === 0) { console.error('用法: node scripts/gitea.mjs <git参数...>'); process.exit(2); }
|
||||
|
||||
let token = '';
|
||||
try { token = readFileSync(tokenFile, 'utf8').trim(); } catch { console.error('缺少 .gitea-token 文件'); process.exit(2); }
|
||||
if (!token) { console.error('.gitea-token 为空'); process.exit(2); }
|
||||
|
||||
// 注入认证头执行 git
|
||||
const result = spawnSync('git', ['-c', `http.extraheader=Authorization: token ${token}`, ...args], { stdio: 'inherit' });
|
||||
process.exit(result.status ?? 1);
|
||||
Reference in New Issue
Block a user