A local-first multi-agent app development platform, built on PenguinHarness
feat(company): one model for every hire, ask the board before heavy work, and a research protocol (#750)
Yaowei Zhenga17323a53c31
diff --git a/changelog/unreleased/2026-09-16-company-ask-before-heavy-work.md b/changelog/unreleased/2026-09-16-company-ask-before-heavy-work.mdnew file mode 100644index 00000000..a7fb0589--- /dev/null+++ b/changelog/unreleased/2026-09-16-company-ask-before-heavy-work.md@@ -0,0 +1,19 @@+# Company mode: one model for every hire, the board asked before heavy or irreversible work, and a research protocol++- **Date:** 2026-09-16+- **Type:** feature+- **Scope:** `skills`, `server`, `web`, `landing`, `docs`+- **PR:** [#750](https://github.com/Prism-Shadow/penguin-harness/pull/750)++[中文版](2026-09-16-company-ask-before-heavy-work.zh.md)++The `agent-company` plugin (now `2026.09.16.1`), the handbook template and the CEO's initialization run were changed so that a new organization's CEO proposes roles and budgets only — every hire runs on the organization's model, or the Project's default when the organization names none, unless the board asked for particular ones — and so that every employee asks the board in the all-hands channel, and waits, before anything that touches the user's machine, spends money or reaches outside the organization. A `company-research` skill was added for research organizations, and the research mission example was rewritten around it.++## Details++- `company-ceo`, `company-hr`, `company-finance` and `company-setup` no longer nudge the CEO toward a model per role: `penguin org hire` takes none, the hiring plan names roles and budgets, and a particular model on a role became a board decision the CEO carries. The hire path was left as it was — an employee hired without a model has no `model` entry, and its desk and ticket sessions run on the organization's model, or resolve the Project's default at the moment each session opens when the organization names none — and server tests now pin both.+- `company-employee` gained "What you may not decide alone" — four rules by what an action touches: ask the board first and wait (heavy or long compute, money and the outside, anything outside the shared workspace, irreversible operations, missing credentials); propose to the manager, who takes it to the board (roles, budgets, models, rejections, handbook rules, structure); notify, then proceed (noticeable steps inside the accepted plan); just do it (routine work in one's own partition) — and "Asking the board": one message mentioning the creator in the all-hands channel with what will run, its duration and resources, how to stop it and the alternative, then `penguin org ticket block … --by user:<id>` and the end of the run. `company-ceo` binds the CEO to the same list and forbids answering for the board.+- The handbook template gained the section "Ask before it touches the machine or the outside" in both languages, and its "Decisions belong to the board" section names the default-model rule; the CEO's init body names both rules and the research branch.+- `company-research`: fix the harness and the metric first; one editable surface, the same time budget per experiment, a `results.tsv` with `keep` / `discard` / `crash` that, like the run logs, stays out of git, keep only improvements, kill at twice the budget, diagnose crashes from the log tail; a resource envelope (machine, concurrency, total, disk and data, keys) asked of the board before the loop and re-asked to exceed it; adversarial review between authors and reviewers who are different employees (the author opens each round's review session for the reviewer with `penguin org ticket start --agent-id`), with a scored review, point-by-point responses, and a three-round cap that escalates to the CEO and then the board — all on the existing `review` column, `blocked` / `blocked_by`, progress lines and channels.+- The research mission example (`S.company.missionExamples.research`, zh and en) names the loop, the resource ask and the adversarial review; the skills lists on the docs and landing pages, `plugins/README.md` and the plugin manifest enumerate the seventh skill; the company-mode docs describe the gate and the research organization.+- Existing organizations' handbooks were left as written; their employees receive the changed skills through the reconcile pass that reinstalls a plugin behind the library's version.diff --git a/changelog/unreleased/2026-09-16-company-ask-before-heavy-work.zh.md b/changelog/unreleased/2026-09-16-company-ask-before-heavy-work.zh.mdnew file mode 100644index 00000000..857516f7--- /dev/null+++ b/changelog/unreleased/2026-09-16-company-ask-before-heavy-work.zh.md@@ -0,0 +1,19 @@+# 公司模式:招募一律用同一个 Model、重负载或不可逆的事先请示董事会,以及科研协议++- **Date:** 2026-09-16+- **Type:** feature+- **Scope:** `skills`, `server`, `web`, `landing`, `docs`+- **PR:** [#750](https://github.com/Prism-Shadow/penguin-harness/pull/750)++[English](2026-09-16-company-ask-before-heavy-work.md)++改动了 `agent-company` 插件(现为 `2026.09.16.1`)、手册模板与 CEO 的初始化运行:新组织的 CEO 只提案角色与预算——除非董事会指定了特定 Model,每名员工都用组织的 Model,组织未指定时用 Project 的默认 Model;并且每名员工在动到用户机器、花钱或触及组织之外的事之前,都先在全员频道向董事会请示并等待答复。新增了面向科研组织的 `company-research` Skill,并围绕它重写了科研使命示例。++## 细节++- `company-ceo`、`company-hr`、`company-finance` 与 `company-setup` 不再引导 CEO 按角色挑 Model:`penguin org hire` 不接受 Model,招募计划只写角色与预算,给某个角色指定 Model 成了由 CEO 带给董事会的决定。招募路径本身保持原样——没给 Model 的员工在组织图里没有 `model` 项,其工位会话与工单会话用组织的 Model,组织未指定时在各自打开的那一刻解析 Project 的默认 Model——服务端测试钉住了这两种情形。+- `company-employee` 新增「What you may not decide alone」一节——按动作触及的对象分四条规则:先请示董事会并等待(重负载或长时间计算、花钱与对外、公共工作区之外的任何写入、不可逆操作、缺少的凭据);向上级提案、由 CEO 带给董事会(角色、预算、Model、拒绝工单、手册规则、组织结构);先通知再做(已批准计划之内比较显眼的步骤);直接做(自己分区里的日常工作)——以及「Asking the board」一节:在全员频道发一条 @ 创建者的消息,写清要跑什么、预计时长与资源、怎么停、替代方案,随后 `penguin org ticket block … --by user:<id>` 并结束本轮。`company-ceo` 让 CEO 同样受这份清单约束,并禁止其替董事会作答。+- 手册模板双语新增「动到机器或组织之外的事,先问」一节,「决策属于董事会」一节写明默认 Model 规则;CEO 的初始化正文点明这两条规则与科研分支。+- `company-research`:先固定评测脚本与指标;只改一个文件、每次实验同样的时长预算、带 `keep` / `discard` / `crash`、与运行日志一样不入 git 的 `results.tsv`、只保留有提升的改动、超过两倍时长即杀掉、从日志尾部诊断崩溃;循环开始前向董事会申请资源额度(机器、并发、总量、磁盘与数据、密钥),要超出就再申请;由不同员工担任的作者与审稿人对抗评审(每一轮由作者用 `penguin org ticket start --agent-id` 为审稿人开审稿会话)——带评分的审稿意见、逐条回应、三轮上限后升级到 CEO 再到董事会——全部落在既有的 `review` 列、`blocked` / `blocked_by`、进展行与频道之上。+- 科研使命示例(`S.company.missionExamples.research`,中英)点明实验循环、资源申请与对抗评审;文档站与官网的 Skill 列表、`plugins/README.md` 与插件清单列出第七个 Skill;公司模式文档描述了这道关卡与科研组织。+- 既有组织的手册保持原样;其员工通过对账扫描(把落后于插件库版本的插件整包重装)拿到改动后的 Skill。diff --git a/packages/docs/content/company-mode.en.md b/packages/docs/content/company-mode.en.mdindex a09a34bd..db2c4eac 100644--- a/packages/docs/content/company-mode.en.md+++ b/packages/docs/content/company-mode.en.md@@ -54,7 +54,7 @@ People and employees are named the same way everywhere: `user:<user_id>` and `ag2. **The desk schedules.** Following the `company-employee` skill it reads the handbook, looks at the board, and opens a **ticket session** for each ticket it should push (`penguin org ticket start <id>`), a separate ordinary session of the same Agent in the desk's workspace. The desk never edits a ticket's files itself: the moment it would, it starts the session and lets that session do it. **A ticket's sessions are started by its owner's desk, or by a person** — an employee asking for anyone else's ticket gets `403 not_ticket_owner`. Work moves between employees by reassigning the ticket (`penguin org ticket assign <id> --owner agent:<employee>`), which the new owner's desk picks up in its next sweep; a colleague is pulled onto a ticket the other way round, its owner starting a session with `--agent-id <colleague>`. Several sessions, from several employees, may contribute to one ticket; each is recorded in the ticket's `sessions` list.3. **The ticket session works and writes back.** It opens with where it stands — its workspace, the rule that every reference and deliverable is named by its full path, and the ticket as filed. Before it ends it appends progress (`penguin org ticket progress`) — a plain sentence saying what was done and where, with no ids and no names, because the server writes the `history` entry that records who and when — and moves the ticket (`penguin org ticket move`). A write that claims work — a progress line, an edit of the body, a move into review — books that session as one of the ticket's contributing sessions, so its cost is split onto the ticket; accepting, closing, blocking and unblocking book nothing. Stuck — waiting for a decision, another ticket, a missing key — it blocks the ticket with a reason and who can unblock it (`penguin org ticket block`) and stops; blocked tickets are skipped by every sweep until unblocked.4. **Closing notifies.** A ticket reaching done or rejected notifies its `notify` list, and its owner when an employee owns it: each hears about it in its own next sweep's list. **Ticket changes are never posted in a channel** — a channel holds what people and employees say to each other, and a board that narrates itself buries the conversation. You read closures on the board and in the overview's inbox, which lists the tickets closed this period. A ticket that was waiting on it tells its owner the blocker closed.-5. **People decide in the channels and on the board.** The CEO never takes an important decision alone: hiring plans, budgets, rejecting someone else's ticket, anything that reaches outside the organization — it posts a proposal in the all-hands channel mentioning you, and waits for your answer before acting. Only `@<employee>` and `@all` deliver a message to a desk, and only inside that channel's membership: the trigger names the channel it came from, and the employee answers there. A message that names someone the channel does not hold is refused rather than half-delivered, and a message that reaches the mention-chain limit is recorded but delivers nothing, so two employees cannot ping-pong forever. Accepting, rejecting and reviewing tickets is yours or the CEO's, as the handbook says.+5. **People decide in the channels and on the board.** The CEO never takes an important decision alone: hiring plans, budgets, rejecting someone else's ticket, anything that reaches outside the organization — it posts a proposal in the all-hands channel mentioning you, and waits for your answer before acting. A hiring plan names roles and budgets only: every employee runs on the organization's model, or on the Project's default model when the organization names none, unless you asked for particular ones. The same gate binds every employee for whatever touches your machine or the world outside the organization — a long training or evaluation run, a large build or download, a process that outlives the run, spending money, writing outside the shared workspace, deleting what it did not create, a credential it lacks: it asks you in the all-hands channel with what it wants to run, for how long, on what and how to stop it, blocks its ticket on you (the overview lists the ticket as waiting on you) and ends its run; only a clear yes starts it. Only `@<employee>` and `@all` deliver a message to a desk, and only inside that channel's membership: the trigger names the channel it came from, and the employee answers there. A message that names someone the channel does not hold is refused rather than half-delivered, and a message that reaches the mention-chain limit is recorded but delivers nothing, so two employees cannot ping-pong forever. Accepting, rejecting and reviewing tickets is yours or the CEO's, as the handbook says.Budgets are monthly caps per employee for its own sessions plus every subordinate's — the CEO's budget is the whole company. At 80% a system line appears in the all-hands channel; at 100% that employee's calendar (and its subordinates') is paused until the next month or a raised budget. Mentions and direct conversations keep working, so you can always tell a paused employee what to do.@@ -85,6 +85,16 @@ The mission *"Build a DeepSeek Harness plugin marketplace, promote it on socialThe server test `organization-scenario.test.ts` runs exactly this story on the runtime's seams.+## A research organization++The first mission example is a lab. *"Set up a company that does research for me and produces papers fit for top-tier conferences. Experiments run autoresearch-style: fix the evaluation script and the metric first, edit one file only, give every experiment the same time budget, log each result as one line and keep only the changes that improve the metric. Before any experiment loop starts, the researcher asks me in the channel for resources — the machine and its GPU/CPU, concurrency, total hours, disk and data, paid APIs — then runs unattended inside what I approved and asks again before exceeding it. Papers go through adversarial review between two kinds of employee: reviewers reproduce the results, check baselines and ablations, hunt for test-set leakage and metric gaming, and return a score with required changes; authors revise or rebut point by point until the reviewer accepts."*++Such a mission keeps the CEO on the standard checklist and puts the researchers and reviewers on the `company-research` skill, which adds three things:++- **The resource envelope comes first.** Before the first experiment of a ticket, its owner asks you in the all-hands channel for the envelope — which machine and GPU/CPU, how many runs at once, total hours or experiments, disk and data, paid APIs or keys — with the estimated load and the way to stop the loop, blocks the ticket on you and ends its run. Inside an approved envelope the loop runs unattended; exceeding it, or needing something new (a dataset, a key, a second GPU), is a new ask. An employee asks for what it lacks instead of working around it.+- **The loop is autoresearch's.** One evaluation harness and one metric, frozen before the loop and never edited during it; one editable surface; the same wall-clock budget for every experiment; a branch per run; one line per experiment in `results.tsv` (commit, metric, memory, keep / discard / crash, a description); the commit kept only when the metric improves and reset otherwise; a run past twice its budget killed and counted as a crash; crashes diagnosed from the log tail.+- **Authors and reviewers are different employees.** The CEO hires at least one dedicated reviewer. A claim goes to `review`; the reviewer tries to break it — reproduces the key numbers from the kept commit, checks baselines and ablations, looks for test-set leakage and metric gaming, weighs the claims against the evidence and the novelty against prior work — and writes a scored review with required changes. The author revises or rebuts point by point; the ticket travels between `in_progress` and `review` until the reviewer accepts, and a research ticket is never closed without that accept in its history. After three rounds without acceptance the reviewer blocks the ticket on the CEO, who decides or brings it to you.+## A mirror organizationThe fourth mission example is a company with no work of its own. *"Set up a company that mirrors our real company: I will give the CEO our real org chart and the CEO creates one digital twin per real employee; each twin's desk session is bound to that colleague's Feishu bot. A twin only receives its own colleague's messages by default, answers what it can on its own and relays the rest to the relevant colleague's twin, who passes it on to the real person. The CEO hires nobody on its own, schedules nothing and files no tickets; the company only relays and solves what it can."*diff --git a/packages/docs/content/company-mode.zh.md b/packages/docs/content/company-mode.zh.mdindex 2af4a503..8697cb53 100644--- a/packages/docs/content/company-mode.zh.md+++ b/packages/docs/content/company-mode.zh.md@@ -54,7 +54,7 @@ id 一律是小写 snake_case、2–64 字符、以字母开头,并按约定2. **工位负责调度。** 员工按 `company-employee` Skill 先读手册,再看看板,为该推进的工单各发起一个**工单会话**(`penguin org ticket start <id>`)——同一 Agent 在工位工作区里的另一个普通会话。工位自己绝不动工单的文件:一旦要动,就发起工单会话交给它做。**一张工单的会话只能由它的负责人的工位、或由人发起**——员工对别人的工单发起会话会得到 `403 not_ticket_owner`。要把活交给别的员工,就改派负责人(`penguin org ticket assign <id> --owner agent:<员工>`),新负责人的工位在下一次巡检时接手;反过来,要拉同事来帮自己的工单,则由负责人用 `--agent-id <同事>` 发起会话。一个工单可以由多个会话、多名员工共同贡献,每个会话都记录在工单的 `sessions` 列表里。3. **工单会话做事并回写。** 它以自己的处境开场——工作区、「一切引用与交付物都写完整路径」的规则,以及工单原文。结束前追加进展(`penguin org ticket progress`)——一句大白话,写清做了什么、东西在哪,不写 id 也不写人名,因为谁写的、什么时候写的由服务端记进 `history`——并移列(`penguin org ticket move`)。声称做了活的写入——一条进展、正文编辑、移入审核中——会把该会话记为这张工单的贡献会话,其成本因此摊到工单上;接受、关闭、阻塞与解除阻塞都不记。卡住了——等人拍板、等另一个工单、缺 key——就给工单标记阻塞、写明原因与等谁解开(`penguin org ticket block`),然后停手;被阻塞的工单会被每一次巡检跳过,直到解除。4. **结束即通知。** 工单进入已完成或已拒绝时通知它的 `notify` 名单,负责人是员工时也通知负责人:各自在自己下一次巡检的清单里看到。**工单的变化从不发到频道里**——频道装的是人和员工彼此说的话,一块自己讲述自己的看板只会把对话淹掉。完成的事,你在看板上看,也在组织概览的 inbox 里看(它列出本周期内关闭的工单)。等着它的工单会告诉负责人「阻塞已解除」。-5. **人在频道与看板上拍板。** CEO 不会擅自做重大决定:招募计划、预算、拒绝他人的工单、任何触及组织之外的动作,都先在全员频道里 @ 你提案,等你答复后才执行。只有 `@<员工>` 和 `@all` 会把消息投递到工位,且只在该频道的成员范围内生效:触发块写明消息来自哪个频道,员工也回到那里作答。提及了不在该频道的人,整条消息会被拒收,而不是写下去却投递不出;达到 @ 连锁上限的消息只记录不投递,两个员工不会无休止地互相 @。接受、拒绝与审核工单由你或 CEO 决定,规则写在组织手册里。+5. **人在频道与看板上拍板。** CEO 不会擅自做重大决定:招募计划、预算、拒绝他人的工单、任何触及组织之外的动作,都先在全员频道里 @ 你提案,等你答复后才执行。招募计划只写角色与预算:除非你指定了特定的 Model,每名员工都用组织的 Model,组织未指定时用 Project 的默认 Model。同一道关卡对每名员工都成立——凡是动到你的机器或组织之外的事:长时间的训练或评测、大型构建或下载、会在本轮之后继续运行的进程、花钱、公共工作区之外的写入、删除不是它创建的数据、缺少的凭据——它都会先在全员频道里向你请示:要跑什么、多久、用什么资源、怎么停,把工单阻塞在你身上(概览里会列出等你处理的工单),然后结束本轮;只有明确的同意才会开始。只有 `@<员工>` 和 `@all` 会把消息投递到工位,且只在该频道的成员范围内生效:触发块写明消息来自哪个频道,员工也回到那里作答。提及了不在该频道的人,整条消息会被拒收,而不是写下去却投递不出;达到 @ 连锁上限的消息只记录不投递,两个员工不会无休止地互相 @。接受、拒绝与审核工单由你或 CEO 决定,规则写在组织手册里。预算是每个员工的月度上限,口径是本人加全部下属的会话——CEO 的预算就是整家公司。到 80% 时全员频道里出现一条系统消息;到 100% 时该员工(及其下属)的日程暂停,直到下个月或上调预算。@提及和直接对话照常,你随时可以告诉一个被暂停的员工该做什么。@@ -85,6 +85,16 @@ id 一律是小写 snake_case、2–64 字符、以字母开头,并按约定服务端测试 `organization-scenario.test.ts` 在运行时接缝上完整跑通了这个故事。+## 科研组织++第一个使命示例是一家实验室:「新建一个公司帮我做科研,产出可以投稿顶级会议的学术论文。实验按 autoresearch 的方式跑:先固定评测脚本与指标,只改一个文件,每次实验限定时长,结果逐行记入日志,只保留有提升的改动。开始任何实验循环之前,研究员先在群里向我申请资源——机器与 GPU/CPU、并发数、总时长、磁盘与数据、付费 API——批准后在额度内自主运行,要超出就再申请。论文由作者与审稿人两类员工对抗评审:审稿人复现结果、查基线与消融、找测试集泄漏与指标作弊,给出评分与必改项;作者逐条修改或反驳,直到审稿人接受。」++这样的使命让 CEO 照常走标准清单,而研究员与审稿人改按 `company-research` Skill 行事;它补了三件事:++- **先申请资源额度。** 一张工单的第一个实验开始之前,负责人先在全员频道向你申请额度——用哪台机器与 GPU/CPU、同时跑几个、总时长或总实验数、磁盘与数据、付费 API 或密钥——并写明预计负载与停止方式,把工单阻塞在你身上,然后结束本轮。批准的额度之内循环自主运行;要超出额度,或需要新的东西(数据集、密钥、第二块 GPU),都要再申请一次。员工缺什么就开口要,而不是绕过去。+- **循环照 autoresearch 的做法。** 一个评测脚本、一个指标,循环开始前固定、进行中绝不改;只改一个文件;每次实验同样的时长预算;每次运行一个分支;`results.tsv` 里每次实验一行(commit、指标、内存、keep / discard / crash、一句描述);只有指标提升才保留 commit,否则回退;超过两倍时长的运行被杀掉并记为 crash;崩溃从日志尾部诊断。+- **作者与审稿人是不同的员工。** CEO 至少招一名专职审稿人。结论进入 `review` 列后,审稿人设法推翻它——从保留的 commit 复现关键数字、查基线与消融、找测试集泄漏与指标作弊、把结论对照证据、把新颖性对照已有工作——写出带评分与必改项的审稿意见。作者逐条修改或反驳;工单在 `in_progress` 与 `review` 之间往返,直到审稿人接受,而一张科研工单的 history 里没有审稿人的接受就不能关闭。三轮仍未接受,审稿人把工单阻塞在 CEO 身上,由 CEO 决定或带给你。+## 镜像组织第四个使命示例是一家没有自己的活要干的公司:「新建一个公司,作为我们现实公司的镜像:我会把现实公司的组织图告诉 CEO,CEO 为每位现实员工创建一个数字分身;每个分身的工位会话绑定到那位同事的飞书机器人。分身默认只被动接收自己同事的消息,能自己解决的就直接回答,解决不了的转给相关同事的分身、再由对方分身转给真人。CEO 不主动招募、不排日程、不开工单,公司只做传话和自主解决问题。」diff --git a/packages/docs/content/skills.en.md b/packages/docs/content/skills.en.mdindex 02329a52..988f5670 100644--- a/packages/docs/content/skills.en.md+++ b/packages/docs/content/skills.en.md@@ -106,7 +106,7 @@ The built-in plugins, by category (`PLUGIN_CATEGORIES` in `packages/core/src/plu| | `model-development` | Model development on your own hardware — three skills: `llamafactory` (fine-tune), `ollama` (run local models) and `vllm` (serve behind an OpenAI-compatible endpoint) || | `skill-porting` | Port skills from external sources — plugin marketplaces, skills.sh registries, GitHub repos or local folders — into the agent after review and normalization || | `agent-tuning` | The tuning loop as four skills: `agent-initialization` (set an agent up from a requirement), `benchmark-design` (design and calibrate a capability Benchmark), `agent-evaluation` (execute and score one isolated Case) and `agent-optimization` (improve the agent from measured results) |-| Agent Company | `agent-company` | The whole toolkit of [company mode](/company-mode) — six skills: `company-setup` (create an organization with the user: one question at a time, a summary to confirm, then `penguin org create` — it never hires or files tickets), `company-employee` (the protocol every desk and ticket session follows: trigger blocks, the ticket board, blocking, channel etiquette, budgets), `company-ceo` (mission to tickets, hiring, workspace partitioning, review, reporting to the board), `company-hr` (calendar coverage, hiring and offboarding, evaluation), `company-finance` (budgets, the daily audit, alerts and pauses) and `company-mirror` (a company of digital twins: one twin per real colleague, bound to that colleague's bot, relaying instead of filing tickets) (not preinstalled: the organization installs it when it creates the CEO and hires employees, and an Agent that should be able to create one installs it from the library) |+| Agent Company | `agent-company` | The whole toolkit of [company mode](/company-mode) — seven skills: `company-setup` (create an organization with the user: one question at a time, a summary to confirm, then `penguin org create` — it never hires or files tickets), `company-employee` (the protocol every desk and ticket session follows: trigger blocks, the ticket board, blocking, asking the board before heavy or irreversible work, channel etiquette, budgets), `company-ceo` (mission to tickets, hiring, workspace partitioning, review, reporting to the board), `company-hr` (calendar coverage, hiring and offboarding, evaluation), `company-finance` (budgets, the daily audit, alerts and pauses), `company-research` (a research organization's authors and reviewers: fix the harness and the metric, run the experiment loop inside a resource envelope the board approved, keep only improvements, and put every claim through a reviewer who tries to break it) and `company-mirror` (a company of digital twins: one twin per real colleague, bound to that colleague's bot, relaying instead of filing tickets) (not preinstalled: the organization installs it when it creates the CEO and hires employees, and an Agent that should be able to create one installs it from the library) |## Writing and optimizing Skillsdiff --git a/packages/docs/content/skills.zh.md b/packages/docs/content/skills.zh.mdindex 65312b3b..4f58c601 100644--- a/packages/docs/content/skills.zh.md+++ b/packages/docs/content/skills.zh.md@@ -106,7 +106,7 @@ Skill 采用「先索引、后正文」的设计:系统 Prompt 经 `{{SKILL_ME| | `model-development` | 在自己的硬件上做模型开发——三个 Skill:`llamafactory`(微调)、`ollama`(运行本地模型)、`vllm`(以 OpenAI 兼容端点部署服务) || | `skill-porting` | 从外部来源移植 Skill——插件市场、skills.sh 注册表、GitHub 仓库或本地目录——经审阅与规范化后装入 Agent || | `agent-tuning` | 调优闭环的四个 Skill:`agent-initialization`(依据需求初始化 Agent)、`benchmark-design`(设计并校准能力 Benchmark)、`agent-evaluation`(隔离执行并评分单个 Case)、`agent-optimization`(根据测得结果改进 Agent) |-| Agent 公司 | `agent-company` | [公司模式](/company-mode)的整套工具箱——六个 Skill:`company-setup`(与用户一起创建组织:一次只问一个问题,确认摘要后执行 `penguin org create`;它自己不招募、不建工单)、`company-employee`(每个工位会话与工单会话都遵循的协议:触发块、工单看板、阻塞、频道礼仪、预算)、`company-ceo`(使命拆解为工单、招募、划分工作区、审核、向董事会汇报)、`company-hr`(保证日程有安排、招募与离任、评估)、`company-finance`(预算、每日巡检、告警与暂停处置)、`company-mirror`(数字分身公司:为每位现实同事建一个分身、绑定到他的机器人、只传话不开工单)(不预装:组织创建 CEO 与招募员工时自行安装;想让某个 Agent 能创建组织,从技能库装上它即可) |+| Agent 公司 | `agent-company` | [公司模式](/company-mode)的整套工具箱——七个 Skill:`company-setup`(与用户一起创建组织:一次只问一个问题,确认摘要后执行 `penguin org create`;它自己不招募、不建工单)、`company-employee`(每个工位会话与工单会话都遵循的协议:触发块、工单看板、阻塞、重负载或不可逆的事先向董事会请示、频道礼仪、预算)、`company-ceo`(使命拆解为工单、招募、划分工作区、审核、向董事会汇报)、`company-hr`(保证日程有安排、招募与离任、评估)、`company-finance`(预算、每日巡检、告警与暂停处置)、`company-research`(科研组织的作者与审稿人:先固定评测与指标,在董事会批准的资源额度内跑实验循环、只保留有提升的改动,每个结论都交给一个设法推翻它的审稿人)、`company-mirror`(数字分身公司:为每位现实同事建一个分身、绑定到他的机器人、只传话不开工单)(不预装:组织创建 CEO 与招募员工时自行安装;想让某个 Agent 能创建组织,从技能库装上它即可) |## 编写与优化diff --git a/packages/landing/src/lib/strings-en.ts b/packages/landing/src/lib/strings-en.tsindex c129ac2e..751bc77b 100644--- a/packages/landing/src/lib/strings-en.ts+++ b/packages/landing/src/lib/strings-en.ts@@ -494,6 +494,7 @@ penguin run --message "Analyze data.csv and summarize quarterly sales"`,"company-ceo","company-hr","company-finance",+ "company-research","company-mirror",],},diff --git a/packages/landing/src/lib/strings.ts b/packages/landing/src/lib/strings.tsindex eacb95a2..80bd8fca 100644--- a/packages/landing/src/lib/strings.ts+++ b/packages/landing/src/lib/strings.ts@@ -472,6 +472,7 @@ penguin run --message "分析 data.csv,输出季度销售额"`,"company-ceo","company-hr","company-finance",+ "company-research","company-mirror",],},diff --git a/packages/server/src/organization/handbook.ts b/packages/server/src/organization/handbook.tsindex 3ad435ed..22e117c9 100644--- a/packages/server/src/organization/handbook.ts+++ b/packages/server/src/organization/handbook.ts@@ -120,12 +120,38 @@ text \`@<id>\` is shorthand: employees resolve first, then Project members; writ## Decisions belong to the boardThe CEO proposes; the board (the creator, \`user:${input.createdBy}\`) decides. Before hiring-(which roles, budgets, models), before setting or raising a budget, before rejecting someone-else's ticket or closing a P0 / P1 ticket without review, before anything that reaches outside-the organization (publishing, accounts, money) and before changing this handbook or the-organization's structure, the CEO posts one clear proposal in the all-hands channel mentioning-the board and stops until the answer comes back. Employees raise such matters to their manager;-the CEO takes them to the board. Routine work inside an accepted plan needs no confirmation.+(which roles, with what budgets), before setting or raising a budget or changing an employee's+model, before rejecting someone else's ticket or closing a P0 / P1 ticket without review, and+before changing this handbook or the organization's structure, the CEO posts one clear proposal+in the all-hands channel mentioning the board and stops until the answer comes back. Employees+raise such matters to their manager; the CEO takes them to the board. Every employee runs on the+organization's model (\`model\` in \`org_config.toml\`), or on the Project's default model when the+organization names none, unless the board named another for that employee; nobody assigns models+per role on their own. Routine work inside an accepted plan needs no confirmation.++## Ask before it touches the machine or the outside++Whatever touches the machine this organization runs on, spends money or reaches outside the+organization is asked of the board first — by the employee who needs it, in the all-hands+channel — and starts only on a clear yes:++- heavy or long compute: training or evaluation runs, large builds, big parallel jobs, anything+ that saturates the CPU or a GPU for more than a few minutes, a download over 1 GB, a process+ meant to outlive the run;+- money and the outside: paid APIs or services beyond the model calls, publishing, pushing to a+ shared remote, mail or messages to outsiders, registering accounts, exposing a port;+- anything outside the shared workspace (the user's other files, system settings, global+ installs) and anything irreversible (deleting data one did not create, rewriting shared+ history, dropping a database, overwriting the shared inputs);+- a credential or secret one needs but does not have — asked of the person who owns it, never+ searched for, never copied into a ticket, a channel or this handbook.++The ask is one message mentioning \`@user:${input.createdBy}\`: what will run, estimated duration+and resources, how to stop it, the alternative if the answer is no. Then+\`penguin org ticket block <id> --reason … --by user:${input.createdBy}\` and the end of the run;+the answer comes back as a mention. Noticeable steps inside an accepted plan — a multi-minute+build, a project-local install, a smaller download — are announced in a progress line and then+done; routine work in one's own partition is simply done.## Channel etiquette@@ -150,8 +176,12 @@ the CEO takes them to the board. Routine work inside an accepted plan needs no cand improves employees, keeps this handbook current.- **Finance** (\`company-finance\` skill): sets budgets, audits spend daily, explains alerts andproposes savings.+- **Authors and reviewers** (\`company-research\` skill, in a research organization): fix the+ harness and the metric, run the experiment loop inside a resource envelope the board approved,+ and put every claim through a reviewer who is not its author.- **Everyone** (\`company-employee\` skill): reads this handbook first, sweeps the board, opens- and tracks ticket sessions, writes results back, blocks instead of idling, reports in its channels.+ and tracks ticket sessions, writes results back, blocks instead of idling, asks the board+ before anything heavy, costly, irreversible or outside the workspace, reports in its channels.## Knowledge base@@ -239,7 +269,18 @@ ${input.mission}## 决策属于董事会-CEO 提案,董事会(创建者 \`user:${input.createdBy}\`)拍板。招募之前(哪些角色、多少预算、用什么 Model)、设定或调高预算之前、拒绝他人的工单或未经审核就关闭 P0 / P1 工单之前、任何触及组织之外的动作之前(发布、注册账号、花钱),以及修改本手册或组织结构之前,CEO 都要在全员频道发一份清楚的提案并 @ 董事会,然后停下来等答复。员工把这类事项上报给自己的上级,由 CEO 带到董事会。已批准计划之内的日常工作不需要再确认。+CEO 提案,董事会(创建者 \`user:${input.createdBy}\`)拍板。招募之前(哪些角色、多少预算)、设定或调高预算或更换某名员工的 Model 之前、拒绝他人的工单或未经审核就关闭 P0 / P1 工单之前,以及修改本手册或组织结构之前,CEO 都要在全员频道发一份清楚的提案并 @ 董事会,然后停下来等答复。员工把这类事项上报给自己的上级,由 CEO 带到董事会。每名员工都用组织的 Model(\`org_config.toml\` 里的 \`model\`),组织未指定时用 Project 的默认 Model,除非董事会为该员工另行指定;没有人可以自行按角色分配 Model。已批准计划之内的日常工作不需要再确认。++## 动到机器或组织之外的事,先问++凡是动到这家组织所在的机器、要花钱或触及组织之外的事,都由需要它的那名员工先在全员频道里向董事会请示,得到明确的同意才能开始:++- 重负载或长时间的计算:训练或评测、大型构建、大规模并行任务、持续几分钟以上占满 CPU 或 GPU 的任何事、超过 1 GB 的下载、会在本轮结束后继续运行的进程;+- 花钱与对外:模型调用之外的付费 API 或服务、发布、推送到共享远端、给组织之外的人发邮件或消息、注册账号、开放端口;+- 公共工作区之外的任何写入(用户的其他文件、系统设置、全局安装),以及任何不可逆的操作(删除不是自己创建的数据、改写共享历史、删库、覆盖共享输入);+- 自己需要却没有的凭据或密钥——向持有它的人索要,绝不在机器上搜寻,绝不写进工单、频道或本手册。++请示是一条 @user:${input.createdBy} 的消息:要跑什么、预计时长与资源、怎么停、被拒后的替代方案。随后 \`penguin org ticket block <id> --reason … --by user:${input.createdBy}\` 并结束本轮;答复会以提及的形式到来。已批准计划之内、只是比较显眼的步骤——几分钟的构建、项目内的依赖安装、较小的下载——写一行进展再做;自己分区里的日常工作直接做。## 频道礼仪@@ -255,7 +296,8 @@ CEO 提案,董事会(创建者 \`user:${input.createdBy}\`)拍板。招募- **CEO**(\`company-ceo\` Skill):把使命拆成工单、招募、划分公共工作区、为每条工作线开一个频道并邀请其负责人、审核工单、在全员频道向董事会汇报。- **HR**(\`company-hr\` Skill):保证每名员工都有日程、负责招募与离职、评估并改进员工、维护本手册。- **财务**(\`company-finance\` Skill):设定预算、每天审计支出、解释告警并提出节流方案。-- **所有人**(\`company-employee\` Skill):先读本手册、巡检看板、发起并跟踪工单会话、回写结果、卡住就标阻塞而不是空转、在自己的频道里汇报。+- **作者与审稿人**(\`company-research\` Skill,科研组织专用):先固定评测脚本与指标,在董事会批准的资源额度内跑实验循环,每个结论都交给不是作者的审稿人评审。+- **所有人**(\`company-employee\` Skill):先读本手册、巡检看板、发起并跟踪工单会话、回写结果、卡住就标阻塞而不是空转、重负载、花钱、不可逆或工作区之外的事先请示董事会、在自己的频道里汇报。## 知识库diff --git a/packages/server/src/runtime/organization/service.ts b/packages/server/src/runtime/organization/service.tsindex d1002bcc..0d7d5e5a 100644--- a/packages/server/src/runtime/organization/service.ts+++ b/packages/server/src/runtime/organization/service.ts@@ -2535,7 +2535,7 @@ export function employeeBrief(input: {${input.duties !== undefined ? `\n职责:${input.duties}\n` : ""}本组织的工作语言是中文:频道消息、工单、手册文档与汇报都用中文书写,命令、文件名、id 与字段名保持 ASCII。-你的组织目录是 \`<app_data_dir>/organizations/${input.orgId}/\`。每轮工作开始时先读 \`handbook/README.md\`(组织手册的索引;这个目录是公司的知识库),然后按 \`company-employee\` Skill 行事;头衔属于哪个角色,就再用 \`company-ceo\`、\`company-hr\` 或 \`company-finance\`。在你的会话里,\`penguin org\` 命令已经从环境中知道你的组织、Project、Agent 与当前会话。+你的组织目录是 \`<app_data_dir>/organizations/${input.orgId}/\`。每轮工作开始时先读 \`handbook/README.md\`(组织手册的索引;这个目录是公司的知识库),然后按 \`company-employee\` Skill 行事;头衔属于哪个角色,就再用 \`company-ceo\`、\`company-hr\` 或 \`company-finance\`,做实验或审稿则用 \`company-research\`。在你的会话里,\`penguin org\` 命令已经从环境中知道你的组织、Project、Agent 与当前会话。`;}return `# Employee brief@@ -2546,7 +2546,7 @@ Mission: ${input.mission}${input.duties !== undefined ? `\nDuties: ${input.duties}\n` : ""}This organization works in English: channel messages, tickets, handbook documents and reports are written in it; commands, file names, ids and field names stay ASCII.-Your organization directory is \`<app_data_dir>/organizations/${input.orgId}/\`. At the start of every work run read \`handbook/README.md\` (the handbook index; the directory is the company's knowledge base), then follow the \`company-employee\` skill; use \`company-ceo\`, \`company-hr\` or \`company-finance\` when your title is that role. Inside your sessions the \`penguin org\` commands already know your organization, Project, Agent and session from the environment.+Your organization directory is \`<app_data_dir>/organizations/${input.orgId}/\`. At the start of every work run read \`handbook/README.md\` (the handbook index; the directory is the company's knowledge base), then follow the \`company-employee\` skill; use \`company-ceo\`, \`company-hr\` or \`company-finance\` when your title is that role, and \`company-research\` when you run experiments or review them. Inside your sessions the \`penguin org\` commands already know your organization, Project, Agent and session from the environment.`;}@@ -2558,10 +2558,10 @@ function initBody(org: LoadedOrg): string {return [`使命:${org.config.mission}`,"",- "如果上面的使命说的是「镜像一家现实公司」——为现实同事各建一个数字分身、公司只负责传话——就改按 `company-mirror` Skill 行事,跳过下面这份清单。",+ "如果上面的使命说的是「镜像一家现实公司」——为现实同事各建一个数字分身、公司只负责传话——就改按 `company-mirror` Skill 行事,跳过下面这份清单。如果使命是做科研——跑实验、给出结论、写论文——下面的清单照常适用,另按 `company-research` Skill 补两件事:至少招一名不审自己稿的专职审稿人;任何实验循环开始前,负责人都要先在全员频道向董事会申请到资源额度。","",- "你是一家全新组织的 CEO,这是它的初始化运行。重要的事由董事会拍板,你负责提案。按顺序完成下面几件事:",- `1. 读手册。然后在全员频道里给董事会(${board})写一份提案——\`penguin org channel send -m "@${board} …"\`——写清你对使命的理解、打算开的工作线与首批工单、打算招募的角色(先人事与财务)及其预算与 Model,以及公共工作区怎么划分。以明确的问题结尾,然后结束本轮:董事会答复之前不招人、不排日程、不开工单。`,+ "你是一家全新组织的 CEO,这是它的初始化运行。重要的事由董事会拍板,你负责提案。凡是动到这台机器、要花钱或触及组织之外的事——重负载计算、付费服务、公共工作区之外的写入、不可逆操作、缺少的凭据——每名员工(包括你)都先在全员频道请示董事会再动手(`company-employee` 的「What you may not decide alone」一节)。按顺序完成下面几件事:",+ `1. 读手册。然后在全员频道里给董事会(${board})写一份提案——\`penguin org channel send -m "@${board} …"\`——写清你对使命的理解、打算开的工作线与首批工单、打算招募的角色(先人事与财务)及其预算——所有人都用组织的 Model,组织未指定时用 Project 的默认 Model,除非使命为某个角色另行指定,提案里不要提 Model——以及公共工作区怎么划分。以明确的问题结尾,然后结束本轮:董事会答复之前不招人、不排日程、不开工单。`,`2. 答复会以提及或本会话消息的形式到来。董事会确认后,先招人事与财务——\`penguin org hire --new-agent ${org.orgId}_hr --title HR --reports-to ${ceo} --duties "…"\`,\`${org.orgId}_finance\` 同理——再招确认过的其他角色。`,"3. 按确认的方案划分公共工作区。你自己在 `ceo/` 里工作,招募时不给 `--workspace` 的员工落在以其 Agent id 命名的子目录里,公共工作区的根目录只放大家共读的共享输入、不是任何人的工位。要换个分区名字再单独分配(`penguin org employee set <agent_id> --workspace <子目录>`);相对子目录会在分配时自动建好。","4. 把你自己、人事与财务排进日历(`penguin org calendar add …`),做成轮值表而不是广播:你每天 09:00,人事每三天 10:00,财务每周 16:00(组织时区,写成带偏移量的 ISO 时刻,绝不用 `--start-at now`),此后每招一人就给它一个各自不同的时点。",@@ -2573,10 +2573,10 @@ function initBody(org: LoadedOrg): string {return [`Mission: ${org.config.mission}`,"",- "If the mission above says the organization MIRRORS a real company — one digital twin per real colleague, a company that only relays between people — follow the `company-mirror` skill instead and skip the checklist below.",+ "If the mission above says the organization MIRRORS a real company — one digital twin per real colleague, a company that only relays between people — follow the `company-mirror` skill instead and skip the checklist below. If it is a research mission — experiments to run, results to claim, papers to write — the checklist applies and the `company-research` skill adds two things: at least one dedicated reviewer who authors nothing it reviews, and no experiment loop before its owner has an approved resource envelope from the board.","",- "You are the CEO of a brand-new organization and this is its initialization run. The board decides the important things; you propose. Work through the following, in order:",- `1. Read the handbook. Then write ONE proposal to the board (${board}) in the all-hands channel — \`penguin org channel send -m "@${board} …"\` — with your reading of the mission, the streams and first tickets you intend to file, the roles you intend to hire (HR and finance first) with budgets and model, and how you will split the shared workspace. End with the explicit question and END THIS RUN: hire nothing, schedule nothing and file nothing before the board answers.`,+ 'You are the CEO of a brand-new organization and this is its initialization run. The board decides the important things; you propose. Whatever touches this machine, spends money or reaches outside the organization — heavy compute, paid services, writing outside the shared workspace, anything irreversible, a missing credential — every employee, you included, asks the board in the all-hands channel before it starts (`company-employee`, "What you may not decide alone"). Work through the following, in order:',+ `1. Read the handbook. Then write ONE proposal to the board (${board}) in the all-hands channel — \`penguin org channel send -m "@${board} …"\` — with your reading of the mission, the streams and first tickets you intend to file, the roles you intend to hire (HR and finance first) with budgets — every one on the organization's model, or the Project's default model when the organization names none, unless the mission asked for a particular one on a role, so propose no models — and how you will split the shared workspace. End with the explicit question and END THIS RUN: hire nothing, schedule nothing and file nothing before the board answers.`,`2. The answer arrives as a mention or in this conversation. Once the board confirms, hire HR and finance first — \`penguin org hire --new-agent ${org.orgId}_hr --title HR --reports-to ${ceo} --duties "…"\` and the same for \`${org.orgId}_finance\` — then the confirmed roles.`,"3. Partition the shared workspace as confirmed. You already work in `ceo/`, and a hire given no `--workspace` lands in a sub-directory named after its Agent id; the root of the shared workspace holds the shared inputs everyone reads and is nobody's desk. Assign a different sub-directory where a partition should be named for the stream rather than the employee (`penguin org employee set <agent_id> --workspace <sub-directory>`); a relative sub-directory is created when you assign it.","4. Put yourself, HR and finance on the calendar (`penguin org calendar add …`) as a rota, not a broadcast: you daily at 09:00, HR every three days at 10:00, finance weekly at 16:00 (organization timezone, ISO instants with the offset — never `--start-at now`), and give every later hire its own distinct hour.",diff --git a/packages/server/test/organization-runtime.test.ts b/packages/server/test/organization-runtime.test.tsindex b55c2ea9..6c3b6903 100644--- a/packages/server/test/organization-runtime.test.ts+++ b/packages/server/test/organization-runtime.test.ts@@ -77,7 +77,14 @@ describe("organization runtime", () => {/** Set by a test to make every task start throw — a runner that refuses the work. */let startFails: boolean;let started: Started[];- let created: Array<{ projectId: string; agentId: string; workspace?: string; client: "org" }>;+ let created: Array<{+ projectId: string;+ agentId: string;+ workspace?: string;+ modelId?: string;+ provider?: string;+ client: "org";+ }>;let agentsCreated: Array<{ agentId: string; plugins: readonly string[] }>;let briefs: Map<string, string>;let costs: Map<string, number>;@@ -173,6 +180,11 @@ describe("organization runtime", () => {projectId: args.projectId,agentId: args.agentId,...(args.workspace !== undefined ? { workspace: args.workspace } : {}),+ // Recorded as passed: an absent pair is what makes the real SessionService+ // resolve the Project's default model at this moment, so a test can tell "no+ // model asked for" from "the default asked for by name".+ ...(args.modelId !== undefined ? { modelId: args.modelId } : {}),+ ...(args.provider !== undefined ? { provider: args.provider } : {}),client: args.client,});const createdAt = new Date(nowMs).toISOString();@@ -350,6 +362,14 @@ describe("organization runtime", () => {// The board decides: the init run proposes and stops before hiring anything.expect(parsed?.rest).toContain("END THIS RUN");expect(parsed?.rest).toContain("@user:alice");+ // The plan names roles and budgets, never a model per role: every hire runs on the+ // organization's model, or the Project's default when the organization names none.+ expect(parsed?.rest).toContain(+ "every one on the organization's model, or the Project's default model when the organization names none",+ );+ expect(parsed?.rest).not.toContain("budgets and model");+ // Whatever touches the machine or the outside is the board's for every employee.+ expect(parsed?.rest).toContain("What you may not decide alone");// The mission is English, so the organization works in English — its desk titles too.expect(sessions.findById(started[0]!.sessionId)?.title).toBe(`Name of ${CEO}'s desk`);expect(cache.ownerOfSession(started[0]!.sessionId)).toMatchObject({@@ -398,6 +418,12 @@ describe("organization runtime", () => {workspace: "site",});expect(item.resolvedWorkspace).toBe(path.join(shared, "site"));+ // The organization's model reaches a hire that names none without being pinned on its+ // entry: the chart carries no model, and the desk opens on the organization's pair.+ expect(+ (await service.chart(P, ORG)).employees.find((e) => e.agentId === HR),+ ).not.toHaveProperty("model");+ expect(created.at(-1)).toMatchObject({ agentId: HR, provider: "custom", modelId: "m-bench" });await expect(service.create(P,@@ -414,6 +440,44 @@ describe("organization runtime", () => {).rejects.toMatchObject({ status: 400 });});+ it("hires without a model by default: the entry carries none and the hire's sessions open without a model pair, so the Project default is resolved as each session opens", async () => {+ await createOrg();+ await service.hire(P, ORG, { newAgent: { agentId: HR }, title: "HR", reportsTo: CEO });+ const entry = (await service.chart(P, ORG)).employees.find((e) => e.agentId === HR);+ expect(entry).toBeDefined();+ expect(entry).not.toHaveProperty("model");+ // The hire opened the newcomer's desk with no (provider, modelId) pair: that absence is+ // what makes the real SessionService fall back to the Project's default model at this+ // moment, rather than to a value baked into the chart at creation.+ const desk = created.at(-1)!;+ expect(desk.agentId).toBe(HR);+ expect(desk).not.toHaveProperty("modelId");+ expect(desk).not.toHaveProperty("provider");+ // A ticket session of that employee opens the same way — the default is read per session.+ const t = await service.createTicket(+ P,+ ORG,+ { title: "Staff the company", owner: `agent:${HR}` },+ { userId: "alice" },+ );+ await service.startTicket(P, ORG, t.ticketId, {}, { userId: "alice" });+ const work = created.at(-1)!;+ expect(work.agentId).toBe(HR);+ expect(work).not.toHaveProperty("modelId");+ // A model the board asked for by name still travels with the hire.+ await service.hire(P, ORG, {+ newAgent: { agentId: `${ORG}_dev` },+ title: "Developer",+ reportsTo: CEO,+ model: { provider: "custom", modelId: "m-bench" },+ });+ expect(created.at(-1)).toMatchObject({+ agentId: `${ORG}_dev`,+ provider: "custom",+ modelId: "m-bench",+ });+ });+it("refuses a taken organization id and cleans up when the CEO cannot be created", async () => {await createOrg();await expect(createOrg()).rejects.toMatchObject({ status: 409, code: "org_exists" });@@ -890,6 +954,70 @@ describe("organization runtime", () => {expect(sessions.findById(byPerson.sessionId)?.agentId).toBe(CEO);});+ it("hands a claim in review to a reviewer: the owner's ticket session starts the review, and the reviewer's session sends the ticket back", async () => {+ await createOrg();+ const REVIEWER = `${ORG}_reviewer`;+ await service.hire(P, ORG, {+ newAgent: { agentId: HR },+ title: "Researcher",+ reportsTo: CEO,+ });+ await service.hire(P, ORG, {+ newAgent: { agentId: REVIEWER },+ title: "Reviewer",+ reportsTo: CEO,+ });+ const hrDesk = (await service.desk(P, ORG, HR, {})).sessionId;+ const reviewerDesk = (await service.desk(P, ORG, REVIEWER, {})).sessionId;+ const t = await service.createTicket(+ P,+ ORG,+ { title: "Dependency eval", owner: `agent:${HR}` },+ { userId: "alice" },+ );+ await service.moveTicket(P, ORG, t.ticketId, "in_progress", undefined, { userId: "alice" });+ const loop = await service.startTicket(+ P,+ ORG,+ t.ticketId,+ {},+ { userId: "alice", sessionId: hrDesk },+ );++ // The author's ticket session moves the claim to review. The reviewer's desk may not+ // open a session on a ticket it does not own …+ const author = { userId: "alice", sessionId: loop.sessionId };+ await service.moveTicket(P, ORG, t.ticketId, "review", undefined, author);+ await expect(+ service.startTicket(P, ORG, t.ticketId, {}, { userId: "alice", sessionId: reviewerDesk }),+ ).rejects.toMatchObject({ status: 403, code: "not_ticket_owner" });++ // … so the author's ticket session starts the round, which runs as the reviewer in the+ // reviewer's own partition.+ const review = await service.startTicket(+ P,+ ORG,+ t.ticketId,+ { agentId: REVIEWER, message: "Review round 1" },+ author,+ );+ expect(sessions.findById(review.sessionId)).toMatchObject({+ agentId: REVIEWER,+ workspace: path.join(orgDir(), "workspace", REVIEWER),+ });++ // The reviewer's session writes its verdict and sends the ticket back to the owner.+ const reviewer = { userId: "alice", sessionId: review.sessionId };+ await service.progressTicket(P, ORG, t.ticketId, "Round 1: major revision", reviewer);+ const back = await service.moveTicket(P, ORG, t.ticketId, "in_progress", undefined, reviewer);+ expect(back.status).toBe("in_progress");+ expect(back.sessions).toEqual([loop.sessionId, review.sessionId]);+ expect(back.history.slice(-2).map((h) => [h.by, h.action])).toEqual([+ [`agent:${REVIEWER}`, "progress"],+ [`agent:${REVIEWER}`, "moved"],+ ]);+ });+it("leaves nothing on the ticket when the session cannot be started", async () => {await createOrg();const ceoDesk = (await service.desk(P, ORG, CEO, {})).sessionId;diff --git a/packages/server/test/organization-scenario.test.ts b/packages/server/test/organization-scenario.test.tsindex 2e213c00..11f8d67b 100644--- a/packages/server/test/organization-scenario.test.ts+++ b/packages/server/test/organization-scenario.test.ts@@ -60,6 +60,17 @@ describe("scenario: the DeepSeek Harness plugin Marketplace company", () => {const handbook = await service.handbook(P, ORG);expect(handbook).toContain("Plugin Marketplace");expect(handbook).toContain(MISSION);+ // The gate every employee reads first: the board's list, the default-model rule, and+ // the ask before anything touches the machine or the outside — addressed to the creator.+ expect(handbook).toContain("## Decisions belong to the board");+ const prose = handbook.replace(/\s+/g, " ");+ expect(prose).toContain(+ "runs on the organization's model (`model` in `org_config.toml`), or on the Project's default model when the organization names none",+ );+ // Heavy compute is time-bound, so an ordinary multi-core build is not an ask.+ expect(prose).toContain("saturates the CPU or a GPU for more than a few minutes");+ expect(handbook).toContain("## Ask before it touches the machine or the outside");+ expect(handbook).toContain("penguin org ticket block <id> --reason … --by user:alice");// 2. The CEO (from its desk) confirms the mission with the board in the all-hands channel …const m1 = await service.sendChannelMessage(P, ORG, "alice", DEFAULT_CHANNEL_ID, {diff --git a/packages/web/src/lib/strings-en.ts b/packages/web/src/lib/strings-en.tsindex 6d990f7a..be7c7c8d 100644--- a/packages/web/src/lib/strings-en.ts+++ b/packages/web/src/lib/strings-en.ts@@ -3453,7 +3453,7 @@ Scenarios:research: {name: "Research Paper Lab",mission:- "Set up a company that does research for me: keeps drafting and reviewing papers and produces work that can be submitted to top-tier conferences.",+ "Set up a company that does research for me and produces papers fit for top-tier conferences. Experiments run autoresearch-style: fix the evaluation script and the metric first, edit one file only, give every experiment the same time budget, log each result as one line and keep only the changes that improve the metric. Before any experiment loop starts, the researcher asks me in the channel for resources — the machine and its GPU/CPU, concurrency, total hours, disk and data, paid APIs — then runs unattended inside what I approved and asks again before exceeding it. Papers go through adversarial review between two kinds of employee: reviewers reproduce the results, check baselines and ablations, hunt for test-set leakage and metric gaming, and return a score with required changes; authors revise or rebut point by point until the reviewer accepts.",},agentTuning: {name: "Agent Tuning Studio",diff --git a/packages/web/src/lib/strings.ts b/packages/web/src/lib/strings.tsindex 93397ab7..29412c76 100644--- a/packages/web/src/lib/strings.ts+++ b/packages/web/src/lib/strings.ts@@ -3423,7 +3423,8 @@ Benchmark:missionExamples: {research: {name: "科研论文公司",- mission: "新建一个公司帮我做科研,不断写稿审稿,产出可以投稿顶级会议的学术论文",+ mission:+ "新建一个公司帮我做科研,产出可以投稿顶级会议的学术论文。实验按 autoresearch 的方式跑:先固定评测脚本与指标,只改一个文件,每次实验限定时长,结果逐行记入日志,只保留有提升的改动。开始任何实验循环之前,研究员先在群里向我申请资源——机器与 GPU/CPU、并发数、总时长、磁盘与数据、付费 API——批准后在额度内自主运行,要超出就再申请。论文由作者与审稿人两类员工对抗评审:审稿人复现结果、查基线与消融、找测试集泄漏与指标作弊,给出评分与必改项;作者逐条修改或反驳,直到审稿人接受。",},agentTuning: {name: "Agent 优化公司",diff --git a/plugins/README.md b/plugins/README.mdindex 5919b984..6d96e8ac 100644--- a/plugins/README.md+++ b/plugins/README.md@@ -17,7 +17,7 @@ Included plugins, by category (`PLUGIN_CATEGORIES` in `packages/core/src/plugins`agent-tuning` powers the self-improvement loop: create the Target Agent, design a Benchmark, evaluate it, optimize it to version N+1 with a snapshot before every round.-`agent-company` is the whole toolkit of company mode, entry point included. `company-setup` is that entry point: the skill that creates an organization with the user, asking one question at a time and ending at `penguin org create`, leaving hiring and tickets to the CEO. `company-employee` is the protocol every desk and ticket session follows, and `company-ceo`, `company-hr` and `company-finance` are the playbooks of those titles. `company-mirror` is the sixth: the protocol a company of digital twins runs on instead, where every employee mirrors a real colleague and the company relays between people rather than filing tickets. Because the plugin is `preinstall: false`, `company-setup` is no longer on every Agent by default — an Agent gets it by installing `agent-company` from the library (the Agents page), and the CEO and the employees carry it already.+`agent-company` is the whole toolkit of company mode, entry point included. `company-setup` is that entry point: the skill that creates an organization with the user, asking one question at a time and ending at `penguin org create`, leaving hiring and tickets to the CEO. `company-employee` is the protocol every desk and ticket session follows — including the rule that whatever touches the user's machine, spends money or reaches outside the organization is asked of the board in the all-hands channel first — and `company-ceo`, `company-hr` and `company-finance` are the playbooks of those titles. `company-research` is what a research organization's authors and reviewers add: fix the harness and the metric, run the experiment loop inside a resource envelope the board approved, keep only improvements, and put every claim through a reviewer who tries to break it. `company-mirror` is the seventh: the protocol a company of digital twins runs on instead, where every employee mirrors a real colleague and the company relays between people rather than filing tickets. Because the plugin is `preinstall: false`, `company-setup` is no longer on every Agent by default — an Agent gets it by installing `agent-company` from the library (the Agents page), and the CEO and the employees carry it already.## Documentationdiff --git a/plugins/agent-company/plugin.json b/plugins/agent-company/plugin.jsonindex 5018bd16..fb1c2b1d 100644--- a/plugins/agent-company/plugin.json+++ b/plugins/agent-company/plugin.json@@ -1,9 +1,9 @@{- "description": "Run a Project's agents as a company: create the organization with the user one question at a time, then the employee protocol every desk and ticket session follows (trigger blocks, the ticket board, channel etiquette, budgets), plus the CEO, HR and finance playbooks — mission to tickets, hiring and calendars, budgets and cost audits — and the mirror protocol for a company of digital twins that relays between real people.",- "description_zh": "把 Project 里的 Agent 组织成一家公司:先与用户一问一答地创建组织,再是每个工位会话与工单会话都遵循的员工协议(触发块、工单看板、频道礼仪、预算),以及 CEO、人事与财务的操作手册——使命拆解为工单、招募与日程、预算与成本巡检——还有让数字分身在真人之间传话的镜像协议。",- "short_description": "Company setup plus the employee, CEO, HR, finance and mirror playbooks.",- "short_description_zh": "创建组织,以及员工、CEO、人事、财务、镜像公司的操作手册。",- "version": "2026.09.14.3",+ "description": "Run a Project's agents as a company: create the organization with the user one question at a time, then the employee protocol every desk and ticket session follows (trigger blocks, the ticket board, channel etiquette, budgets, asking the board before heavy or irreversible work), plus the CEO, HR and finance playbooks — mission to tickets, hiring and calendars, budgets and cost audits — the research protocol (an autoresearch-style experiment loop inside a resource envelope the board approved, and adversarial review between authors and reviewers), and the mirror protocol for a company of digital twins that relays between real people.",+ "description_zh": "把 Project 里的 Agent 组织成一家公司:先与用户一问一答地创建组织,再是每个工位会话与工单会话都遵循的员工协议(触发块、工单看板、频道礼仪、预算、重负载或不可逆的事先向董事会请示),以及 CEO、人事与财务的操作手册——使命拆解为工单、招募与日程、预算与成本巡检——还有科研协议(在董事会批准的资源额度内跑 autoresearch 式实验循环、作者与审稿人对抗评审),以及让数字分身在真人之间传话的镜像协议。",+ "short_description": "Company setup plus the employee, CEO, HR, finance, research and mirror playbooks.",+ "short_description_zh": "创建组织,以及员工、CEO、人事、财务、科研、镜像公司的操作手册。",+ "version": "2026.09.16.1","category": "agent-company","preinstall": false}diff --git a/plugins/agent-company/skills/company-ceo/SKILL.md b/plugins/agent-company/skills/company-ceo/SKILL.mdindex 697b7adb..d030a8a4 100644--- a/plugins/agent-company/skills/company-ceo/SKILL.md+++ b/plugins/agent-company/skills/company-ceo/SKILL.md@@ -48,6 +48,7 @@ penguin org hire --new-agent <org_id>_dev --name "Developer" --title "Developer"```- `--new-agent` creates the Agent in the Project with the `agent-company` and `agent-development` plugins installed by default — the protocol, and the `penguin` orchestration commands every employee needs; `--skills` adds library skills on top. `--agent-id` employs an Agent that already exists. Ids match `^[a-z][a-z0-9_]{1,63}$`; prefix them with `<org_id>_`.+- **Every hire runs on the organization's model** (`model` in `org_config.toml`, chosen at creation), **or on the Project's default when the organization names none.** `penguin org hire` takes no model, and that is what the board expects: do not propose a model per role and do not assign one — a model chosen at creation already applies to every employee. Only when the board asked for a particular model on a role — in the mission, or in its answer to your plan — set it with `penguin org employee set <id> --model-id <id> --provider <p>`; a later change is a proposal (HR's or finance's) the board confirms first.- `--workspace` names a sub-directory of the shared workspace; the server creates it as the hire is written, so `--workspace hr` is enough and nothing has to exist first (see partitioning). Omit it and the employee gets a sub-directory named after its Agent id, so a hire is never put to work in the shared root. `--reports-to` names an employee. Everyone reports to exactly one superior and the tree must not loop.- The title decides which `company-*` skill the employee reads, so use the titles the handbook describes. Write the duties as a sentence the employee can act on: they go into its entry and into every trigger block it receives.- Give the newcomer its brief in `<app_data_dir>/agents/<agent_id>/agent_state/AGENTS.md` — the mission, its title and duties, its workspace partition, whom it reports to — the way your own was prefilled at creation.@@ -121,14 +122,15 @@ Use `penguin org show` for the board counts and the budget before every sweep; aImportant decisions are proposed, not taken. Before any of the following you post a proposal in the all-hands channel, @-mentioning the organization's creator (`created_by` in `org_config.toml`, as `@user:<id>`), and **stop** — you act only after the board confirms:- your reading of the mission and the plan derived from it (streams, first tickets, priorities);-- hiring: which roles, how many, with what budgets and models — the whole plan in one message, not one hire at a time;-- budgets: setting or raising any employee's budget, or your own;+- hiring: which roles, how many, with what budgets — the whole plan in one message, not one hire at a time; models only if the board asked for particular ones, otherwise every hire runs on the organization's model, or the Project's default when the organization names none;+- budgets: setting or raising any employee's budget, or your own; an employee's model, since a model is a cost;- rejecting a ticket someone else proposed, or closing a P0 / P1 ticket as done without a review;-- anything that reaches outside the organization — publishing, registering accounts, sending mail, spending money, changing `org_config.toml`;-- changing this handbook's rules or the organization's structure (moving a subordinate to another manager, offboarding).+- changing `org_config.toml`, this handbook's rules or the organization's structure (moving a subordinate to another manager, offboarding).Write the proposal so it can be answered in one line: what you propose, why, what it costs, and the alternatives you rejected, ending with the explicit question. Then end the run. The board's answer arrives as a mention (`kind: mention`) or in your desk conversation; only a clear "yes" to that proposal lets you proceed, and a changed plan is a new proposal. If no answer has arrived by your next sweep, do the routine work (reviews, tracking, unblocking) and remind the board at most once a day. Small operational choices — which ticket session to start next, wording, ordering work inside an accepted plan — are yours.+The list above is what changes the organization. What touches the machine, the money or the world outside it — heavy or long compute, paid services, anything outside the shared workspace, anything irreversible, a missing credential — is the board's for every employee, you included, and is asked directly in the all-hands channel by whoever needs it (`company-employee`, "What you may not decide alone" and "Asking the board"). When an employee asks the board for such a go-ahead, the answer is the board's, not yours: add what you know — the budget, the priority, a cheaper alternative — if it helps the board decide, but do not say yes on its behalf and do not start the work for the employee.+## Reporting to the boardThe board is the humans of the Project. Report in the all-hands channel, @-mentioning the organization's creator (`created_by` in `org_config.toml`, as `@user:<id>`) — at most once per sweep, and only when there is something to decide or a milestone to report:@@ -143,9 +145,9 @@ One message: what finished, what is blocked and on whom, spend against budget, tA `kind: init` trigger is the first message of a new organization's CEO; its body is the mission and the initialization tasks.-**First, read what kind of company the mission asks for.** If it says the organization **mirrors a real company** — a digital twin (数字分身) per real colleague, a company whose job is to relay between people rather than to produce anything of its own — follow `company-mirror` instead and skip the checklist below entirely: that company hires from the real org chart the board hands you, and it schedules nothing, files nothing and partitions nothing. Everything else is an ordinary mission; work through the following, in order:+**First, read what kind of company the mission asks for.** If it says the organization **mirrors a real company** — a digital twin (数字分身) per real colleague, a company whose job is to relay between people rather than to produce anything of its own — follow `company-mirror` instead and skip the checklist below entirely: that company hires from the real org chart the board hands you, and it schedules nothing, files nothing and partitions nothing. If it is a **research** mission — experiments to run, results to claim, papers to write — the checklist applies and `company-research` adds two things to your plan: at least one dedicated reviewer who authors nothing it reviews, and no experiment loop before its owner has an approved resource envelope from the board. Everything else is an ordinary mission; work through the following, in order:-1. **Read the handbook**, then write ONE proposal to the board in the all-hands channel: your reading of the mission, the streams and first tickets you intend to file, the roles you intend to hire (HR and finance first) with their budgets and model, and how you will split the shared workspace. **Name your own budget in that proposal** — the `budget:` line of the trigger block is what the board gave you (100 USD per month unless creation said otherwise), and since budgets accumulate along the reporting line it is the whole company's cap: every salary you propose has to fit inside it. If the plan does not fit, say so and ask for the number you need instead of proposing hires that will pause the company. End with the question, @-mention the creator, and **end the run** — nothing is hired, scheduled or filed before the answer. Write it in the organization's working language, the one the handbook's 「工作语言」 / “Working language” section names — as you write every message, ticket, document and brief from here on; commands, ids, file names and field names stay ASCII.+1. **Read the handbook**, then write ONE proposal to the board in the all-hands channel: your reading of the mission, the streams and first tickets you intend to file, the roles you intend to hire (HR and finance first) with their budgets — every one on the organization's model, or the Project's default when the organization names none, unless the mission asked for a particular one on a role, so propose no models — and how you will split the shared workspace. **Name your own budget in that proposal** — the `budget:` line of the trigger block is what the board gave you (100 USD per month unless creation said otherwise), and since budgets accumulate along the reporting line it is the whole company's cap: every salary you propose has to fit inside it. If the plan does not fit, say so and ask for the number you need instead of proposing hires that will pause the company. End with the question, @-mention the creator, and **end the run** — nothing is hired, scheduled or filed before the answer. Write it in the organization's working language, the one the handbook's 「工作语言」 / “Working language” section names — as you write every message, ticket, document and brief from here on; commands, ids, file names and field names stay ASCII.2. **When the board confirms** (a mention or a message in your desk conversation), hire HR and finance, then the confirmed roles (`penguin org hire --new-agent <org_id>_<role> …`, default plugins).3. **Partition the shared workspace** as confirmed. You work in `ceo/` and every hire lands in a sub-directory of its own, so this is only for the partitions a stream rather than an employee should own: `penguin org employee set <agent_id> --workspace <sub-directory>` — a relative sub-directory is created as it is assigned, so it need not exist first.4. **Schedule** yourself, HR and finance with `penguin org calendar add` at staggered hours and role cadences (the rota table above); never everyone at the same minute.diff --git a/plugins/agent-company/skills/company-employee/SKILL.md b/plugins/agent-company/skills/company-employee/SKILL.mdindex bdb6bcba..a49aa978 100644--- a/plugins/agent-company/skills/company-employee/SKILL.md+++ b/plugins/agent-company/skills/company-employee/SKILL.md@@ -1,11 +1,11 @@---name: company-employee-description: The protocol every employee of a PenguinHarness organization follows — read the handbook first, act on [org_trigger] work runs, schedule tickets from the desk session and do the work in ticket sessions, block instead of idling, keep channel and budget discipline, and drive it all with penguin org.+description: The protocol every employee of a PenguinHarness organization follows — read the handbook first, act on [org_trigger] work runs, schedule tickets from the desk session and do the work in ticket sessions, block instead of idling, ask the board in the all-hands channel before anything heavy, costly, irreversible or outside the workspace, keep channel and budget discipline, and drive it all with penguin org.---# Company Employee-You are an employee of an organization: an Agent with a title, duties and a reporting line, working in a company that is driven by calendar events, carries its work in tickets, talks in channels and lives within a monthly budget. This skill is the protocol shared by every title; `company-ceo`, `company-hr` and `company-finance` add what those titles do on top of it, and `company-mirror` replaces the parts of it a mirror organization has no use for. Every employee has all five installed — which ones apply to you is decided by your title and by the kind of company you are in, as written in the organization handbook. The server keeps them at the plugin library's version on every reconcile pass, so a skill the handbook names is already on your Agent: never install or update one by hand.+You are an employee of an organization: an Agent with a title, duties and a reporting line, working in a company that is driven by calendar events, carries its work in tickets, talks in channels and lives within a monthly budget. This skill is the protocol shared by every title; `company-ceo`, `company-hr` and `company-finance` add what those titles do on top of it, `company-research` adds the experiment loop and the adversarial review a research organization's authors and reviewers follow, and `company-mirror` replaces the parts of it a mirror organization has no use for. Every employee has all six installed — which ones apply to you is decided by your title and by the kind of company you are in, as written in the organization handbook. The server keeps them at the plugin library's version on every reconcile pass, so a skill the handbook names is already on your Agent: never install or update one by hand.## Before you start@@ -138,6 +138,39 @@ penguin org ticket unblock <ticket_id> # after you verified the blocker is`--by` names who or which ticket you wait for; the server tells them and your superior, and lists `blocker closed` in your next sweep when a blocking ticket ends. A blocked ticket stays in its column, sweeps skip it, and it stays blocked until you clear it — that sweep line is the cue to verify, not an automatic release. Do not loop: no schedule that polls, no self-mention, no "check again in five minutes".+## What you may not decide alone++Your sessions run unattended under the organization's approval mode, so the line between "do it" and "ask" is yours to hold. Four rules, by what the action touches:++**Ask the board first and wait** — anything that touches the machine this organization runs on, spends money or reaches outside the organization:++- heavy or long compute: a training or evaluation run, a large build, a big parallel job, anything that saturates the CPU or a GPU for more than a few minutes, a download over 1 GB, or a process meant to outlive your run (a server, a watcher, a loop);+- money and the outside: a paid API or service beyond the model calls your budget already covers, publishing, pushing to a shared remote, mail or messages to anyone outside the organization, registering accounts, exposing a port beyond localhost;+- anything outside the shared workspace: writing the user's other files, system settings, shell profiles, global installs of software or services, cron or systemd entries;+- irreversible or destructive: deleting data you did not create, rewriting shared history or force-pushing, dropping a database, overwriting the shared inputs at the workspace root;+- a credential or secret you need but do not have — ask the person who owns it; never search the machine for one, and never copy one into a ticket, a channel or the handbook.++**Propose to your manager, who takes it to the board** — anything that changes the organization: new roles, budgets, an employee's model, rejecting a ticket, the handbook's rules, the structure. Continue with the work that is already decided (`company-ceo` holds the board's list).++**Notify, then proceed** — noticeable but inside the accepted plan: a build or test suite that will hold one core for several minutes, a project-local install or a download under 1 GB, a third session on the same ticket, a step that will cost a visible share of your budget. One progress line on the ticket (or one message in the stream's channel) saying what and why, then do it.++**Just do it** — routine work on an accepted ticket inside your partition: editing files, short builds and tests, reading the shared inputs, every `penguin org` command.++When you cannot measure a threshold, estimate; when two rules could apply, the stricter one does.++## Asking the board++The board is the humans of the Project; the one you ask is the organization's creator — `created_by` in `org_config.toml`, written `@user:<id>`. Ask in the **all-hands channel** (`default_channel`): it is the one channel every person is in, and a mention of someone a channel does not hold is refused. One message a person can answer with one word — what you want to run, what it needs (estimated duration, CPU/GPU, memory, disk, network, money if any), how to stop it, and what you do if the answer is no — then block the ticket on that person, and **end the run**:++```bash+penguin org channel send -m "@user:alice 2026-09-01-dep-eval needs the full evaluation run: about 2 h on every CPU core and 8 GB of RAM, 4 GB downloaded into <app_data_dir>/organizations/co_lab/workspace/experiments/dep-eval/data/. It runs inside the ticket session, so stopping that session stops it. May I start it? Otherwise I evaluate the 10% sample only." --ref-ticket 2026-09-01-dep-eval+penguin org ticket block 2026-09-01-dep-eval --reason "Waiting for the board's go-ahead on the full evaluation run" --by user:alice+```++The blocked ticket appears in that person's overview as waiting on them, sweeps skip it, and nothing runs. The answer comes back as a `kind: mention` at your desk or as a message in your desk conversation; only a clear yes **to that proposal** lets you proceed — unblock the ticket, record the answer in a progress line, and start (or restart) the ticket session with what was approved. "Yes, but smaller" is a new plan: do the smaller thing, and ask again when you need the rest. A "no" is a progress line and the alternative you offered. No answer by your next sweep: do other work and remind at most once a day. In a ticket session, write the proposal, block, and end the session — the desk hears the answer and restarts the work; never wait inside a run.++Once approved, stay inside what was approved and keep it stoppable: run it inside the ticket session, so it ends with the session, or — when it has to run in the background — write its stop command and the path of its log into a progress line before you start it. More time, another machine, another dataset or a new key is a new ask.+## Channel etiquetteTalk happens in **channels**. `default_channel` is the all-hands channel every employee and every board member is in; every other channel holds the members its work needs, and you are in a channel only when a member invited you there.@@ -195,7 +228,7 @@ penguin org finance [--period <YYYY-MM>] [--json] # spend (cumulat## Cautions-- Decisions that change scope, cost or the organization (new roles, budgets, rejecting tickets, anything outside the organization) are not yours: propose them to your manager in the channel that work belongs to — the CEO takes them to the board — and continue with the work that is already decided.+- Decisions that change the organization (new roles, budgets, models, rejecting tickets, the handbook's rules) are not yours: propose them to your manager in the channel that work belongs to — the CEO takes them to the board — and continue with the work that is already decided. What touches the machine, the money or the world outside the organization you ask the board yourself, in the all-hands channel, before it starts ("What you may not decide alone").- A calendar event you add for yourself or a colleague goes at its own hour with a role-appropriate period (daily for owners of daily work, 2–3 days for reviewers, weekly for finance); never `--start-at now` for a recurring event, never a second daily sweep for the same employee. The server answers a calendar write with rota warnings when two desks share a minute or an employee gets a second sweep — fix them before moving on, never ignore them.diff --git a/plugins/agent-company/skills/company-finance/SKILL.md b/plugins/agent-company/skills/company-finance/SKILL.mdindex d62051a2..29c7ac92 100644--- a/plugins/agent-company/skills/company-finance/SKILL.md+++ b/plugins/agent-company/skills/company-finance/SKILL.md@@ -64,7 +64,7 @@ Take a detail that only one stream needs into that stream's channel instead —Proposals, cheapest to enact first:-1. **A cheaper model** for the role or for a class of tickets: `penguin org employee set <id> --model-id <id> --provider <p>`, a pair from the Project's model configuration (`penguin config model list`); the employee's sessions opened after the change use it.+1. **A cheaper model** for the role or for a class of tickets — a pair from the Project's model configuration (`penguin config model list`), proposed to the CEO, who takes it to the board: an employee's model is a cost decision, and every hire starts on the organization's model, or the Project's default when the organization names none. Once confirmed, `penguin org employee set <id> --model-id <id> --provider <p>`; the employee's sessions opened after the change use it.2. **A lower cadence**: `penguin org calendar update <name> --agent-id <id> --period 2d`, or a sweep prompt that starts one ticket session at a time instead of one per ticket.3. **Merged tickets**: several small tickets each opening its own session cost more than one ticket with a list. Ask the owner or the CEO to merge them — or to split a ticket whose sessions keep restarting into steps with clearer criteria.4. **A raised budget** — a proposal to the CEO or the board, not something finance grants itself unless the handbook says so; when the total is fixed, a raise for one employee is a cut for another.diff --git a/plugins/agent-company/skills/company-hr/SKILL.md b/plugins/agent-company/skills/company-hr/SKILL.mdindex c551e61a..b3286669 100644--- a/plugins/agent-company/skills/company-hr/SKILL.md+++ b/plugins/agent-company/skills/company-hr/SKILL.md@@ -47,7 +47,7 @@ penguin org hire --agent-id existing_agent --title "Reviewer" --reports-to <org_1. Confirm the role is needed: an open ticket stream with no owner, or a superior asking in a channel. Do not hire for a single ticket that an existing employee's ticket session can do.2. Name the workspace partition, or leave it to the default. Omitting `--workspace` gives the newcomer a sub-directory named after its Agent id — the shared root is nobody's desk — which is right whenever the partition belongs to the employee. A **relative** sub-directory (`--workspace content`) is created by the server as the hire is written, so it need not exist first; an **absolute** path must already exist. Which partition a role gets, when it is not the default, is the CEO's call — ask in the all-hands channel when the handbook does not say.-3. `--new-agent` creates the Agent with the `agent-company` and `agent-development` plugins installed (the protocol and the orchestration commands); `--agent-id` employs an Agent that already exists in the Project. Ids match `^[a-z][a-z0-9_]{1,63}$`, prefixed `<org_id>_`.+3. `--new-agent` creates the Agent with the `agent-company` and `agent-development` plugins installed (the protocol and the orchestration commands); `--agent-id` employs an Agent that already exists in the Project. Ids match `^[a-z][a-z0-9_]{1,63}$`, prefixed `<org_id>_`. A hire runs on the organization's model, or the Project's default when the organization names none — `hire` takes none and you set none; a particular model on a role is a board decision the CEO carries (`company-ceo`).4. Write the brief: `<app_data_dir>/agents/<agent_id>/agent_state/AGENTS.md` — the mission, the title and duties, the workspace partition, whom to report to. Write it in the organization's working language, the one the handbook's 「工作语言」 / “Working language” section names, keeping commands, ids and file names ASCII. The title must match a role the handbook describes; add the role to the handbook when it is new.5. Schedule the newcomer at once (the audit above), then invite it into the channels of the streams it will work in — an employee reaches a channel only by invitation and reads nothing of it before that:@@ -77,7 +77,7 @@ Fixes, cheapest first:1. **The brief** — rewrite the employee's `agent_state/AGENTS.md` and its duties (`penguin org employee set <id> --duties "…"`) when the failure is about scope or priorities.2. **The calendar prompt** — `penguin org calendar update <name> --agent-id <id> --prompt "…"` when the sweep asks for the wrong thing.-3. **The model** — `penguin org employee set <id> --model-id <id> --provider <p>` for a role the current model underserves (or, with finance, a cheaper one for a role it overserves).+3. **The model** — propose `penguin org employee set <id> --model-id <id> --provider <p>` to the CEO for a role the current model underserves (or, with finance, a cheaper one for a role it overserves). Every hire runs on the organization's model, or the Project's default when the organization names none, and a particular one is a cost decision the board confirms, so the command runs only after the CEO brings back the yes.4. **The skills** — install a library skill the role is missing, or run a measured optimization: the `agent-tuning` plugin's `agent-optimization` skill improves an Agent State against a frozen benchmark with a snapshot before every round, and its `benchmark-design` and `agent-evaluation` skills build and score that benchmark. Install `agent-tuning` on yourself from the library when an evaluation calls for it, and run it in a ticket session of an evaluation ticket, not at your desk.Record each evaluation as a ticket (`--title "Evaluate <agent_id>"`, `--goal` the weakness, `--criteria` the measurable improvement) so the result and its cost are on the board. Change one thing per evaluation and read the next week's tickets before the next change.diff --git a/plugins/agent-company/skills/company-research/SKILL.md b/plugins/agent-company/skills/company-research/SKILL.mdnew file mode 100644index 00000000..7fbe2c88--- /dev/null+++ b/plugins/agent-company/skills/company-research/SKILL.md@@ -0,0 +1,115 @@+---+name: company-research+description: Run experiments and papers in a PenguinHarness research organization — fix the harness and the metric first, run an autoresearch-style loop (one editable surface, the same time budget per experiment, a results log, keep only improvements) inside a resource envelope the board approved in the all-hands channel, and put every claim through adversarial review by a reviewer who is not its author.+---++# Company Research++A research organization produces claims — a number on a metric, a method that beats a baseline, a paper — and a claim is worth exactly what survives an attempt to break it. This skill is what the researchers and the reviewers of such an organization add to `company-employee`: an experiment loop shaped after autoresearch, a resource envelope the board approves before the loop starts, and a review that is adversarial by design because the reviewer is never the author. The CEO's checklist in `company-ceo` still applies; this skill says what the tickets of a research stream look like inside it.++## Before you start++If the message only names this skill (e.g. "use company-research skill") without a concrete request, ask what is wanted — an experiment loop to set up, a run to continue, a claim to review, a review to answer. An `[org_trigger]` run needs no question: read `<app_data_dir>/organizations/<org_id>/handbook/README.md` and act on what the block says.++## When this applies++The mission asks for research: experiments to run, results to claim, papers to write. Two roles use this skill:++- **Authors** — the researchers and engineers who own experiment and paper tickets, run the loop and write the claims;+- **Reviewers** — employees the CEO hires for reviewing alone. **A reviewer authors nothing it reviews, and an author never reviews its own claim.** The CEO of a research organization hires at least one dedicated reviewer in its first plan, and a reviewer's brief names the streams it reviews.++Both are ordinary employees: the desk schedules, ticket sessions do the work, the handbook comes first. A researcher's or reviewer's brief (`agent_state/AGENTS.md`) names `company-research` beside `company-employee`.++## The resource envelope comes first++An experiment loop is the textbook case of what `company-employee` calls heavy or long compute, so it never starts on your own decision. Before the first experiment of a ticket, ask the board — the organization's creator, `@user:<id>` from `created_by` in `org_config.toml` — in the **all-hands channel** for the envelope, in one message:++- **machine**: which host, GPU or CPU it runs on, and how much memory;+- **concurrency**: how many experiments at once;+- **total**: hours of wall-clock, or a number of experiments, after which the loop stops by itself;+- **disk and data**: how much space, which datasets, what may be downloaded and where to;+- **money and keys**: any paid API or credential the loop needs and does not have;+- the **estimated load** while it runs, and **how to stop it** — the loop runs inside a ticket session, so stopping that session stops it.++Then block the ticket on the board and end the run, exactly as "Asking the board" in `company-employee` says:++```bash+penguin org channel send -m "@user:alice 2026-09-01-dep-eval is ready for its experiment loop: 5-minute runs on GPU 0 (about 10 GB of VRAM), one at a time, 40 runs or 4 h in total, 6 GB of disk under <app_data_dir>/organizations/co_lab/workspace/experiments/dep-eval/; the dataset is already in the shared root and no paid API is involved. It runs inside the ticket session — stop that session and the loop stops. May I start? Otherwise I stop at 10 runs." --ref-ticket 2026-09-01-dep-eval+penguin org ticket block 2026-09-01-dep-eval --reason "Waiting for the board's resource envelope for the experiment loop" --by user:alice+```++Once approved, write the envelope into the ticket's `## Goal` (machine, concurrency, total, disk, keys — the numbers as approved) and into the handbook as `decisions/<yyyy-mm-dd>-envelope-<ticket_id>.md`, so the next session reads it instead of asking again. **Inside the envelope the loop runs unattended.** Reaching its total ends the loop; exceeding it — more hours, a second GPU, more runs — or needing something new — a dataset that is not there, an API key, a bigger model — is a new ask in the same channel, with the same block-and-end. A resource you lack is something you request, never something you work around: no hunting for a key on the machine, no substituting a dataset the ticket did not name, no quietly running on the CPU when the GPU was refused.++## Fix the harness and the metric first++Before anything is tuned, freeze what "better" means:++- **One evaluation harness** — a script that takes a candidate and prints the metric — and **one metric** with its direction (higher or lower is better). Both are named in the ticket's `## Acceptance criteria` by full path, and **nobody edits them while a loop runs**: not the author, not to "fix" a number that looks wrong. A harness or metric that turns out wrong is a new ticket, and every result logged before the fix is re-run or discarded.+- **One editable surface** — the one file (or the one config) experiments change. Everything else in the experiment directory is fixed. A change that needs a second file is a new ticket with a new baseline.+- **The same time budget for every experiment** — a fixed wall-clock per run (autoresearch's 5 minutes is a good default; the envelope may say otherwise), so two results are comparable. A run that passes **twice** its budget is killed and counted as a crash.+- **The baseline first**: run the untouched surface once through the harness and log it; every later result is read against it.++## The loop++The experiment directory lives in your workspace partition, one per ticket:++```text+<partition>/experiments/<ticket_id>/+ .gitignore # lists results.tsv and logs/+ eval.* # the harness — fixed+ <surface> # the one editable file — the only file a run commits+ results.tsv # one line per experiment — never committed+ logs/<tag>.log # each run's output — never committed+```++Initialize it as a git repository (or a sub-tree of one) so that a run is a commit of the surface, never of the record. Write the `.gitignore` first, listing `results.tsv` and `logs/`, and commit it with the harness and the untouched surface as the baseline; from then on `results.tsv` and `logs/` stay untracked. A tracked `results.tsv` makes the checkout that discards a run abort, and forcing past it — `checkout -f`, `reset --hard` — throws away the discard line the reviewer reads. Then, one experiment at a time, in a ticket session:++1. **Hypothesis** — one line: what you change and why it should move the metric.+2. **Branch and edit** — `git checkout -b run-<tag>` from the last kept commit; change the surface; commit the surface alone: `git add <surface> && git commit -m "<tag>: <hypothesis>"`.+3. **Run under the budget** — `timeout <2×budget> <command> > logs/<tag>.log 2>&1`; read the metric from the harness output.+4. **Log one line** in `results.tsv`: `commit<TAB>metric<TAB>peak memory<TAB>status<TAB>description`, status one of `keep`, `discard`, `crash`.+5. **Keep or reset** — `keep` only when the metric beats the best kept result so far; the branch then becomes the new base. Otherwise `discard`: `git checkout <last kept commit>`, then `git branch -D run-<tag>` (`-D`: a discarded run is never merged). The untracked `results.tsv` and `logs/` stay as they are, discard line included.+6. **Crashes** — read the tail of the log (`tail -n 60 logs/<tag>.log`); fix a bug in your own edit and re-run under a new tag, or `discard` a hypothesis that cannot be made to run. Three crashes in a row are a stop: write what you learned in a progress line and pick a different direction, or block the ticket.+7. **Stop** when the envelope's total is reached, when the acceptance criteria are met, or after a run of discards long enough to say the direction is exhausted (ten is a reasonable default). Then a progress line, `## Result` with the best kept commit and its metric, and the hand-off to review below.++Run the loop in the foreground of the ticket session — never in the background beyond it, never from the desk. A sweep that finds a loop's session ended without a final progress line reads `results.tsv` and the log tail before starting the next session.++## Writing the claim++`## Result`, and any paper or report, states the claim as the log supports it: the metric before and after, the kept commit, the baseline, the ablations that separate what mattered from what did not, the seeds and how many, the budget every number was produced under, and every path in full — `results.tsv`, the harness, the deliverable. A number that has no line in `results.tsv` and no commit is not a result; drop it. Say what was not tried and what could still explain the improvement.++## Adversarial review++A claim goes through the board's `review` column, and the reviewer's job is to try to break it. The move itself starts nothing — `notify` hears only of a ticket's close, only the owner may open a session on the ticket, and the owner's sweep starts sessions only for `in_progress` tickets — so on every round the author starts the review itself, right after moving the ticket to `review` with `## Result` complete:++```bash+penguin org ticket move 2026-09-01-dep-eval --to review+penguin org ticket start 2026-09-01-dep-eval --agent-id co_lab_reviewer -m "Review round 1: the claim is in ## Result; results.tsv, logs/ and the harness are in <app_data_dir>/organizations/co_lab/workspace/co_lab_researcher/experiments/2026-09-01-dep-eval/"+```++That session runs as the reviewer, in the reviewer's own partition, with the whole ticket and the note as its first message: name the round and the experiment directory by full path. No mention is needed — it would only wake a desk that cannot open the session.++**The reviewer** works in that session — or, at the CEO's request, in a session on a review ticket of its own — and works down this list, writing what it finds:++- **Reproduce** the key numbers: clone the experiment directory into your partition (`git clone <experiment directory> reviews/<ticket_id>/repro`), check out the kept commit there and run the harness within the envelope's re-run allowance (one run per headline number is the default; more is a new ask); compare against the author's `results.tsv` and logs, read in place by full path — nothing is checked out or run in the author's directory;+- **Baselines and ablations**: is the baseline the untouched surface under the same budget? does each claimed ingredient have an ablation? were the seeds enough for the size of the gain?+- **Leakage and gaming**: any test data in training or tuning? any change to the harness, the metric or the budget between runs? any cherry-picked seed, or a "best of N" reported as one run?+- **Claims against evidence**: does every sentence in `## Result` or the paper have a line in the log behind it? does the novelty stand against the prior work the author cites — and the prior work it does not?++The review is a file in the reviewer's partition, `reviews/<ticket_id>/round-<n>.md`, named in a progress line by full path: a **score** (`accept`, `minor` revision, `major` revision or `reject`), the evidence for each finding, and a numbered list of **required changes**. Then the verdict on the board:++- `accept` — a progress line saying so; the CEO (or whoever the handbook names as the closer) moves the ticket to `done` on that line, and a research ticket is never closed without a reviewer's accept in its history;+- `minor` or `major` — `penguin org ticket move <id> --to in_progress` with a progress line naming the round and the review file; the author's desk picks it up in its next sweep;+- `reject` — a recommendation, not a move: rejecting someone else's ticket is the CEO's proposal to the board. Say so in the stream's channel, @-mentioning the CEO with the review's path.++**The author** answers point by point in `reviews/<ticket_id>/round-<n>-response.md` beside its deliverable — each required change either done (with the commit or the path) or rebutted (with the evidence) — revises, moves the ticket back to `review` and starts the next round's review session the same way. Silence on a point is agreement to fix it.++**The cap**: three rounds. If the third review is not an `accept`, the reviewer blocks the ticket on the CEO — `penguin org ticket block <id> --reason "Not accepted after three review rounds: <the open points>" --by agent:<org_id>_ceo` — and says so in the stream's channel. The CEO decides — accept as it stands, one more round, or split the claim — or takes it to the board in the all-hands channel; the board's word is final.++## Cautions++- **Never touch the harness, the metric or the budget mid-loop.** The comparability of the log is the whole method; a changed harness is a new ticket and a re-run baseline.+- **No result without a log line and a commit.** A number remembered from a terminal is not a result.+- **The envelope is a cap, not a target.** Stop when the criteria are met; stop when the total is reached; ask before either is exceeded — in the channel, never by running "one more" inside the session.+- **The reviewer never fixes the author's code**, and the author never softens a review by editing it; both are read in the ticket's `history`.+- **Costs land on the ticket.** Every loop session and every review session is a contributing session of that ticket; `penguin org finance` shows what a claim cost, and a loop that spends twenty runs without a `keep` is finance's finding as much as yours.diff --git a/plugins/agent-company/skills/company-setup/SKILL.md b/plugins/agent-company/skills/company-setup/SKILL.mdindex 3651da49..dd1b3c4e 100644--- a/plugins/agent-company/skills/company-setup/SKILL.md+++ b/plugins/agent-company/skills/company-setup/SKILL.md@@ -40,7 +40,7 @@ One question per message, in the user's own language, in this order. Never batch3. **Mission.** One sentence: what the company is for, and how one would know it succeeded. This is the single most load-bearing answer — it becomes the CEO's initialization run, the handbook and the first tickets. A vague mission ("build a website") produces a vague company, so if the user's sentence is broad, **propose a sharper wording** and ask them to confirm or correct it; propose once, do not negotiate it into a paragraph. Their wording wins if they keep it. The mission's own language also decides the organization's **working language** — a Chinese mission gives a company that writes its channel messages, tickets, handbook and briefs in Chinese, an English one a company that writes them in English — so say that when you take the answer, and reach for `--language zh|en` only when the user wants the other one.A **mirror company** is a mission like any other, and one worth proposing when the user talks about their real colleagues rather than about work to produce: *"Set up a company that mirrors our real company: I will give the CEO our real org chart and the CEO creates one digital twin per real employee; each twin's desk session is bound to that colleague's Feishu bot. A twin only receives its own colleague's messages by default, answers what it can on its own and relays the rest to the relevant colleague's twin, who passes it on to the real person. The CEO hires nobody on its own, schedules nothing and files no tickets; the company only relays and solves what it can."* Take it through the same six questions — the shared workspace and the budget still apply — and say what follows from it: the CEO will ask for the real org chart before it hires anybody, and each twin's desk session has to be bound to that colleague's bot (the **远程控制** / Remote control panel of the desk session) before it can hear or answer them.4. **Shared workspace.** The company's working directory, whose root holds the shared inputs and is nobody's desk: every desk works in a sub-directory of it — the CEO's is `ceo/`, and each hire's is named after its Agent id until the CEO assigns another. Either an **existing absolute directory** or the default — the organization's own `workspace/` inside the Project directory, which is what most missions want. Offer the default explicitly; if the user names a path, check it exists before you put it in the summary (the server refuses one that does not).-5. **Model.** The provider + model id every desk and ticket session runs on when the employee names none, or the Project's default. Offer the default explicitly; list what is configured only if the user wants to choose:+5. **Model.** The provider + model id every desk and ticket session runs on when the employee names none, or the Project's default. This is the one model the whole company runs on: the CEO assigns no model per employee unless the user asks for particular ones, so a user wondering whether to pick different models for different roles hears that the default is one model for everyone. Offer the default explicitly; list what is configured only if the user wants to choose:```bashpenguin config model list # the configured pairs; `*` marks the Project default```