agent-lyceum 0.37.0 → 0.38.0

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.
package/dist/format.d.ts CHANGED
@@ -29,7 +29,7 @@ export interface DoneContract {
29
29
  }
30
30
  /**
31
31
  * The completion contract of a `done` report: frontmatter `outcome`, and `## Result` and `## Not done`;
32
- * a `completed` report must also carry `## Files` and `## Verification` and leave no checklist step unticked
32
+ * a `completed` report must also carry `## Files`, `## Verification` and `## Decisions` and leave no checklist step unticked
33
33
  * (the report's own `## Steps`, else the run's latest `stateSteps`).
34
34
  */
35
35
  export declare function doneContract(meta: Record<string, unknown>, body: string, stateSteps?: Step[]): DoneContract;
package/dist/format.js CHANGED
@@ -77,7 +77,7 @@ export function sectionText(body, name) {
77
77
  export const DECLARABLE_OUTCOMES = ["completed", "partial", "blocked", "failed"];
78
78
  /**
79
79
  * The completion contract of a `done` report: frontmatter `outcome`, and `## Result` and `## Not done`;
80
- * a `completed` report must also carry `## Files` and `## Verification` and leave no checklist step unticked
80
+ * a `completed` report must also carry `## Files`, `## Verification` and `## Decisions` and leave no checklist step unticked
81
81
  * (the report's own `## Steps`, else the run's latest `stateSteps`).
82
82
  */
83
83
  export function doneContract(meta, body, stateSteps) {
@@ -86,7 +86,7 @@ export function doneContract(meta, body, stateSteps) {
86
86
  const outcome = DECLARABLE_OUTCOMES.includes(declared) ? declared : undefined;
87
87
  if (!outcome)
88
88
  missing.push(`\`outcome: ${DECLARABLE_OUTCOMES.join("|")}\` in the frontmatter${declared ? ` (got "${declared}")` : ""}`);
89
- const need = outcome === "completed" || !outcome ? ["Result", "Files", "Verification", "Not done"] : ["Result", "Not done"];
89
+ const need = outcome === "completed" || !outcome ? ["Result", "Files", "Verification", "Decisions", "Not done"] : ["Result", "Not done"];
90
90
  const have = new Set([...body.matchAll(HEADING)].map((m) => (m[1] ?? "").trim().toLowerCase()));
91
91
  for (const h of need)
92
92
  if (!have.has(h.toLowerCase()))
package/dist/prompt.js CHANGED
@@ -130,7 +130,7 @@ export function buildSoloSystemPrompt(project, agent) {
130
130
  ? "Do the task you are given. Your final reply text is printed to the user as your answer, so end with the answer or a short report of what you did; nothing else is delivered."
131
131
  : "");
132
132
  if (!isCall) {
133
- lines.push("## Finishing", `When the job is finished, create a Markdown file (any name ending in \`.md\`) directly inside \`${outboxDir(project, agent.name)}\` with this exact shape:`, "", "```", "---", "type: done", "subject: <short subject>", "outcome: completed|partial|blocked|failed", "---", "", "## Result", "## Files", "## Verification", "## Not done", "```", "", "That ends the run. `## Result` is the actual deliverable or conclusion (not just \"done\"), `## Files` the paths you created or changed, `## Verification` what you ran or checked and what it showed, `## Not done` anything skipped or unverified (or `None`). Only `completed` means success and it needs all four headings; if work remains or is blocked say `partial`/`blocked`/`failed` (those need only `## Result` and `## Not done`). A summary in your reply text is never delivered: without a `done` mail the run ends as idle with no report. " + OPEN_PR_RULE);
133
+ lines.push("## Finishing", `When the job is finished, create a Markdown file (any name ending in \`.md\`) directly inside \`${outboxDir(project, agent.name)}\` with this exact shape:`, "", "```", "---", "type: done", "subject: <short subject>", "outcome: completed|partial|blocked|failed", "---", "", "## Result", "## Files", "## Verification", "## Not done", "```", "", "That ends the run. `## Result` is the actual deliverable or conclusion (not just \"done\"), `## Files` the paths you created or changed, `## Verification` what you ran or checked and what it showed, `## Decisions` the choices you made that the task did not specify and the assumptions you relied on (or `None`), `## Not done` anything skipped or unverified (or `None`). Only `completed` means success and it needs all five headings; if work remains or is blocked say `partial`/`blocked`/`failed` (those need only `## Result` and `## Not done`). A summary in your reply text is never delivered: without a `done` mail the run ends as idle with no report. " + OPEN_PR_RULE);
134
134
  }
135
135
  const shared = sharedDir(project);
136
136
  if (!isCall && shared)
@@ -185,7 +185,7 @@ export function buildSystemPrompt(project, agent) {
185
185
  : `Report results to the lead by mail; the lead decides what happens next.`, isLead
186
186
  ? "Each wake-up handles one message, except that several `reply`/`failure` messages waiting together are handed to you in one wake-up: weigh them together, then decide the next step once."
187
187
  : "Each wake-up handles one message, except that consecutive `reply`/`failure` messages on the same thread may be handed to you together: handle them together. Do the work it asks, then send the replies that are needed, then stop.", "Mail that repeats an earlier mail of yours to the same agent (same type, same text) is not sent again; you are told, and should wait for the answer or ask for something different instead of resending.", "", "## Message format", "The body of every `task` and `reply` must contain these `##` headings, exactly as written (write `None` under a heading if there is nothing to say).", "A `task` or `reply` missing a heading is sent back to you (at most twice per sender + type + subject); after that it is delivered with a warning flagged to the recipient.", "", `- \`task\`: ${REQUIRED_SECTIONS.task.map((h) => `\`## ${h}\``).join(", ")} (Upstream = id of the mail this task derives from, or \`None\`).`, `- \`reply\`: ${REQUIRED_SECTIONS.reply.map((h) => `\`## ${h}\``).join(", ")}.`, isLead
188
- ? "- `done`: your final report to the user (shown when the run ends, saved as `result.md`). Its frontmatter must contain `outcome: completed|partial|blocked|failed`, and the body the headings `## Result` (the actual deliverable or conclusion, not just \"done\"), `## Files` (paths created or changed), `## Verification` (what you ran or checked, and what it showed) and `## Not done` (anything skipped or unverified, or `None`). Only `completed` means success, and it needs all four headings and every checklist step ticked; if work remains or is blocked, say `partial`/`blocked`/`failed` (those need only `## Result` and `## Not done`). A `done` that breaks this is sent back to you and does not end the run. " + OPEN_PR_RULE
188
+ ? "- `done`: your final report to the user (shown when the run ends, saved as `result.md`). Its frontmatter must contain `outcome: completed|partial|blocked|failed`, and the body the headings `## Result` (the actual deliverable or conclusion, not just \"done\"), `## Files` (paths created or changed), `## Verification` (what you ran or checked, and what it showed), `## Decisions` (choices you made that the task did not specify and assumptions you relied on, or `None`) and `## Not done` (anything skipped or unverified, or `None`). Only `completed` means success, and it needs all five headings and every checklist step ticked; if work remains or is blocked, say `partial`/`blocked`/`failed` (those need only `## Result` and `## Not done`). A `done` that breaks this is sent back to you and does not end the run. " + OPEN_PR_RULE
189
189
  : "- `done` has no required headings.", ...(agent.canAskUser
190
190
  ? [
191
191
  "",
@@ -911,7 +911,7 @@ export class RunSession {
911
911
  to: project.lead,
912
912
  type: "failure",
913
913
  subject: "Your done report was not accepted",
914
- body: `The run was not ended: your \`done\` report does not meet the completion contract. Missing:\n${list}\n\nSend \`type: done\` again with the frontmatter line \`outcome: completed|partial|blocked|failed\` and the headings \`## Result\`, \`## Files\`, \`## Verification\`, \`## Not done\`. \`completed\` needs all four and every step ticked; if work remains, report \`partial\` or \`blocked\` (those need only \`## Result\` and \`## Not done\`) or \`failed\`, or send the task that continues the work. (Reminder ${state.done_rejections} of ${MAX_DONE_REJECTIONS}.)`,
914
+ body: `The run was not ended: your \`done\` report does not meet the completion contract. Missing:\n${list}\n\nSend \`type: done\` again with the frontmatter line \`outcome: completed|partial|blocked|failed\` and the headings \`## Result\`, \`## Files\`, \`## Verification\`, \`## Decisions\`, \`## Not done\`. \`completed\` needs all five and every step ticked; if work remains, report \`partial\` or \`blocked\` (those need only \`## Result\` and \`## Not done\`) or \`failed\`, or send the task that continues the work. (Reminder ${state.done_rejections} of ${MAX_DONE_REJECTIONS}.)`,
915
915
  });
916
916
  rejectDone(route.done.file);
917
917
  say(` done report sent back to ${project.lead}: missing ${contract.missing.join("; ")}`);
@@ -1279,7 +1279,7 @@ export class RunSession {
1279
1279
  to: project.lead,
1280
1280
  type: "failure",
1281
1281
  subject: "No done message sent",
1282
- body: `All mailboxes are empty and you have not sent a \`done\` message, so the run would end without a final report. If the job is finished and verified, send \`type: done\` now (with \`outcome: completed|partial|blocked|failed\` in the frontmatter and \`## Result\`, \`## Files\`, \`## Verification\`, \`## Not done\`${state.steps ? " and the full `## Steps` checklist" : ""}). If work remains, send the \`task\` that continues it. Writing a summary in your reply text does not count: only mail is delivered.`,
1282
+ body: `All mailboxes are empty and you have not sent a \`done\` message, so the run would end without a final report. If the job is finished and verified, send \`type: done\` now (with \`outcome: completed|partial|blocked|failed\` in the frontmatter and \`## Result\`, \`## Files\`, \`## Verification\`, \`## Decisions\`, \`## Not done\`${state.steps ? " and the full `## Steps` checklist" : ""}). If work remains, send the \`task\` that continues it. Writing a summary in your reply text does not count: only mail is delivered.`,
1283
1283
  });
1284
1284
  pending = this.pendingAgents();
1285
1285
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-lyceum",
3
- "version": "0.37.0",
3
+ "version": "0.38.0",
4
4
  "description": "Config + dispatcher for teams of Claude Code / Codex agents with scoped context and file-based mailboxes",
5
5
  "keywords": [
6
6
  "ai",