@evandu/super-pi 0.1.188 → 0.1.190

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -316,8 +316,8 @@ const extension = (pi: ExtensionApi): void => {
316
316
  action: Type.Union(["create", "start", "get", "list", "add_task", "dispatch", "submit", "request_review", "review", "update_task", "report", "escalate", "resolve_escalation", "correct", "complete", "cancel", "export"].map((value) => Type.Literal(value))),
317
317
  projectId: Type.Optional(Type.String()), taskId: Type.Optional(Type.String()),
318
318
  parentTaskId: Type.Optional(Type.String()), role: Type.Optional(Type.Union([Type.Literal("leader"), Type.Literal("executor")])),
319
- title: Type.Optional(Type.String({ description: "Required for action=\"create\" (and add_task): short project or task title." })),
320
- objective: Type.Optional(Type.String({ description: "Required for action=\"create\" (and add_task): what the project or task should achieve." })),
319
+ title: Type.Optional(Type.String({ description: "Required for action=\"create\" (and add_task): short project or task title. For action=\"create\" this and objective are the ONLY two fields you must send; every other field may be omitted." })),
320
+ objective: Type.Optional(Type.String({ description: "Required for action=\"create\" (and add_task): what the project or task should achieve. For action=\"create\" this and title are the ONLY two fields you must send." })),
321
321
  deliverables: Type.Optional(Type.Array(Type.String(), { description: "Optional deliverables list. Omit if not needed; does not block starting." })),
322
322
  acceptanceCriteria: Type.Optional(Type.Array(Type.String(), { description: "Optional acceptance criteria list. Omit if not needed; does not block starting." })),
323
323
  constraints: Type.Optional(Type.Array(Type.String(), { description: "Optional constraints list. Omit if not needed; does not block starting." })),
@@ -1,5 +1,5 @@
1
1
  {
2
- "hash": "c12077bfd29fc123bf28d42e71483e56c7f496bdcc23e5cff5a98ebfe9d7a682",
2
+ "hash": "6424fb1180b1abf97982cd18b4b280d0336d3fa6246bd8083df8419b5f97b495",
3
3
  "files": {
4
4
  "src/client/App.tsx": "4e9bcb3e0987b741dd721c7c9e2ad84a7c1ba79202b38092fda568f9b484d4c0",
5
5
  "src/client/CodeMirrorEditor.tsx": "b6b6479effa1482eda710f04a26f3af843515526e129ca5bc70692cca9074b09",
@@ -12,7 +12,7 @@
12
12
  "src/client/KnowledgePanel.tsx": "4f7230cfe610cd86d63aa143c82f6195b3c4208ef0bea703f92104ef27237704",
13
13
  "src/client/MarkdownView.tsx": "4f04a8f3c9381946e5d2f957ac4fb74a6b16272e90375fb4dc6bd3a43d7c744d",
14
14
  "src/client/MemoryPanel.tsx": "59a74f5789f43708245b6f62ba3b873ad91804f64c1e352403d5b7dffd478fdc",
15
- "src/client/ProjectControlPanel.tsx": "9607edde75540bc02031c82e9d75af84c0d55a231a08f01b2d0aa4935925303c",
15
+ "src/client/ProjectControlPanel.tsx": "7a72153048c439fc15fd76df494b753e3fe8e0eb3ad1c9a41fbfda742006d89b",
16
16
  "src/client/ProjectExecutionTools.tsx": "56e2868633bfb50d1921b4813b7428ddfa19098d0b8e17a9ed9c61e3b33b0b39",
17
17
  "src/client/ScheduledTasksPanel.tsx": "74f8bea76cbe540b4eb22163ba28ed56920643de5948d1c5c8c37604f52368c3",
18
18
  "src/client/SlashCommandMenu.tsx": "69cd0a9d5e35f41f703e91a845e5bd750c952d2957be03b5528e156e60bf6ecb",
@@ -40,5 +40,5 @@
40
40
  "src/client/types.ts": "ef0586e206d0f229ed0e81e72397e1ddfd82c00ae7133d06d20892605e6f1ff4",
41
41
  "src/client/vite-env.d.ts": "65996936fbb042915f7b74a200fcdde7e410f32a669b1ab9597cfaa4b0faddb5"
42
42
  },
43
- "recordedAt": "2026-11-11T16:43:47.484Z"
43
+ "recordedAt": "2026-11-11T19:54:12.422Z"
44
44
  }
@@ -1218,8 +1218,17 @@ export class ProjectService {
1218
1218
  this.admission(p);
1219
1219
  if (!this.orchestrator)
1220
1220
  throw new Error("会话编排服务未就绪");
1221
- if (p.ownerConversationId && busy(this.store.conversation(p.ownerConversationId)?.status))
1222
- throw new Error("项目负责人正在执行,请勿重复启动");
1221
+ /* STARTING A PROJECT THAT IS ALREADY RUNNING IS NOT AN ERROR. `create` starts the project in
1222
+ one call - that is what the ceremony-free project is for - so the natural next call is
1223
+ `start`, and it used to answer 「项目负责人正在执行,请勿重复启动」. A model that created a
1224
+ project and then started it was doing exactly what the tool's own contract says it may do,
1225
+ and the refusal taught it nothing except that the tool lies. So the project is returned as
1226
+ it is: no second leader is spawned (the spawn below only happens when there is no owner),
1227
+ and the caller learns the state it asked about. */
1228
+ if (p.ownerConversationId && busy(this.store.conversation(p.ownerConversationId)?.status)) {
1229
+ this.event(p, "start_skipped", "项目已经在执行中,重复启动被忽略", undefined, actor);
1230
+ return p;
1231
+ }
1223
1232
  if (!p.ownerConversationId) {
1224
1233
  const effective = p.defaultLeaderProfile;
1225
1234
  p.ownerConversationId = (await this.orchestrator.spawn({
@@ -1245,6 +1254,14 @@ export class ProjectService {
1245
1254
  ...(effective?.thinkingLevel ? { thinkingLevel: effective.thinkingLevel } : {}),
1246
1255
  ...(effective?.watchdogTimeoutSeconds ? { watchdogTimeoutSeconds: effective.watchdogTimeoutSeconds } : {}),
1247
1256
  })).conversationId;
1257
+ // A LEADER WITHOUT A PROFILE LANDS ON THE WORKSPACE DEFAULT, AND THAT IS NOT A DECISION.
1258
+ // The default agent is whatever the workspace happens to run - it may well be another PMO,
1259
+ // which is how a project's leader became "one more pmo" once. The silent part was the
1260
+ // problem: the project looked started and the timeline never said what the leader is.
1261
+ // So the fallback is written down, where the people reading the project can see it.
1262
+ if (!effective?.agentId) {
1263
+ this.event(p, "leader-profile-missing", "未指定 Leader 的 agentId,负责人会话落在工作区默认 agent 上;请用 defaultLeaderProfile 明确指定", undefined, actor);
1264
+ }
1248
1265
  }
1249
1266
  for (const task of p.tasks) {
1250
1267
  if (!task.parentTaskId && (!task.accountableConversationId || task.accountableConversationId === p.initiatorConversationId)) {
@@ -1386,6 +1403,14 @@ export class ProjectService {
1386
1403
  /* THE MOMENT THE TASK WENT OUT IS WRITTEN DOWN. It is what tells a session that died BEFORE
1387
1404
  this dispatch from one that died AFTER it: only the second one interrupted the task, and
1388
1405
  only the second one may turn it into 「已中断」. */
1406
+ /* THE STATUS IS CHECKED AGAIN AT THE MOMENT OF THE WRITE, and it is checked against the
1407
+ STORE, not against the snapshot this operation started with. The spawn above is an await:
1408
+ while it was in flight the project could have been closed - every task delivered, the
1409
+ reconcile marked it done - and a dispatch that writes into a closed project is a duplicate
1410
+ delivery, not a delivery. The door check is not enough, because the door and the write are
1411
+ separated by exactly the length of a spawn, and the object in hand is the state from the
1412
+ door. So the fresh copy is read here, and the refusal happens before anything is written. */
1413
+ this.live(this.raw(id, workspaceId));
1389
1414
  t.status = "in_progress";
1390
1415
  t.updatedAt = stamp();
1391
1416
  t.dispatchedAt = t.updatedAt;
@@ -2072,6 +2097,19 @@ export class ProjectService {
2072
2097
  const running = this.store.projects().filter((p) => p.initiatorConversationId === actor && !closed(p));
2073
2098
  if (running.length >= 3)
2074
2099
  throw new Error("你同时进行的项目超过上限(3 个),先完成或停止一个再新建。");
2100
+ // ONLY TWO FIELDS ARE ASKED FOR, AND SAYING SO IS PART OF THE CONTRACT. The schema marks
2101
+ // `title` and `objective` optional - they are optional for the other actions of this tool -
2102
+ // so a model that reads the schema alone can send a project with neither, and then it meets
2103
+ // a bare "项目标题 不能为空". That message names a field the model never sent. So the
2104
+ // refusal names what IS needed, in one sentence, the first time.
2105
+ const missing = [];
2106
+ if (typeof body.title !== "string" || !body.title.trim())
2107
+ missing.push("title(项目标题)");
2108
+ if (typeof body.objective !== "string" || !body.objective.trim())
2109
+ missing.push("objective(项目目标)");
2110
+ if (missing.length) {
2111
+ throw new Error(`起项目只需要 title 和 objective,缺 ${missing.join(" 和 ")}。其余参数(risk、mode、deliverables 等)都可以不填。`);
2112
+ }
2075
2113
  const { tasks: batch, ...input } = body;
2076
2114
  const plan = this.planTopLevelTasks(batch);
2077
2115
  const project = await this.create({ ...input, workspaceId }, actor);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evandu/super-pi",
3
- "version": "0.1.188",
3
+ "version": "0.1.190",
4
4
  "description": "Web control plane and companion for Pi",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -95,6 +95,7 @@
95
95
  "scripts/session-orchestrator-tools.test.mjs",
96
96
  "scripts/project-service.test.mjs",
97
97
  "scripts/project-ceremony-free.test.mjs",
98
+ "scripts/project-mechanism-guards.test.mjs",
98
99
  "scripts/dead-end-decision.test.mjs",
99
100
  "scripts/project-report-exception-title.test.mjs",
100
101
  "scripts/project-report-decision-layout.test.mjs",
@@ -265,7 +266,9 @@
265
266
  "scripts/session-reporting.test.mjs",
266
267
  "scripts/project-panel-reporting.test.mjs",
267
268
  "scripts/session-row-escalation.test.mjs",
268
- "scripts/mutation-lock-coverage.test.mjs"
269
+ "scripts/mutation-lock-coverage.test.mjs",
270
+ "scripts/real-context-window.test.mjs",
271
+ "scripts/session-reminder-pmo-rights.test.mjs"
269
272
  ],
270
273
  "check:browser": [
271
274
  "scripts/update-button-browser.test.mjs",