halfcycle 0.4.15 → 0.4.17

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "halfcycle",
3
- "version": "0.4.15",
3
+ "version": "0.4.17",
4
4
  "description": "Halfcycle Method bundle — resolution-stub slash commands, remote method-delivery registration, and governance-hook wiring for a Halfcycle engagement repo. It ships NO worker role files: a project's roles are authored from that project's own recorded decisions at orchestration kickoff (FX-2, W3-F-27).",
5
5
  "commands": [
6
6
  {
@@ -15715,12 +15715,25 @@ var seatCoverageSchema = external_exports.object({
15715
15715
  message: "conformant cannot exceed enrolled",
15716
15716
  path: ["conformant"]
15717
15717
  });
15718
+ var LEFT_FOR_OWNER_TEXT_MAX = 300;
15719
+ var LEFT_FOR_OWNER_ENTRIES_MAX = 500;
15720
+ var leftForOwnerDecisionSchema = external_exports.object({
15721
+ item: plainText(LEFT_FOR_OWNER_TEXT_MAX),
15722
+ question: plainText(LEFT_FOR_OWNER_TEXT_MAX)
15723
+ }).strict();
15724
+ var leftForOwnerSchema = external_exports.object({
15725
+ tasks: external_exports.array(plainText(LEFT_FOR_OWNER_TEXT_MAX)).max(LEFT_FOR_OWNER_ENTRIES_MAX),
15726
+ waiting: external_exports.array(leftForOwnerDecisionSchema).max(LEFT_FOR_OWNER_ENTRIES_MAX)
15727
+ }).strict().refine((v) => v.tasks.length + v.waiting.length > 0, {
15728
+ message: "is sent only when some work was left for the owner"
15729
+ });
15718
15730
  var observedCloseSchema = external_exports.object({
15719
15731
  sequence: external_exports.number().int().min(1),
15720
15732
  closedAt: utcIso8601,
15721
15733
  closedBy: closedBySchema,
15722
15734
  crossed: crossedSchema,
15723
- seatCoverage: seatCoverageSchema.nullable()
15735
+ seatCoverage: seatCoverageSchema.nullable(),
15736
+ leftForOwner: leftForOwnerSchema.optional()
15724
15737
  }).strict();
15725
15738
  var couldNotRunCheckSchema = external_exports.object({
15726
15739
  check: plainText(),
@@ -18411,7 +18424,7 @@ var ownerWaitDeclarationSchema = external_exports.object({
18411
18424
  path: ["fixedItem"]
18412
18425
  });
18413
18426
  var ownerWaitDeclarationsSchema = external_exports.object({ declarations: external_exports.array(ownerWaitDeclarationSchema) }).strict();
18414
- var OWNER_WAIT_TOO_MANY = `This project already has ${String(OWNER_WAIT_ADDITIONS_MAX)} things added to what waits for the owner. Ask the owner to take one off in the console first.`;
18427
+ var OWNER_WAIT_TOO_MANY = `This project already has ${String(OWNER_WAIT_ADDITIONS_MAX)} things added to what waits for the owner. Ask the owner to take one off on their settings page in the console first; it cannot be done by typing in chat.`;
18415
18428
 
18416
18429
  // ../events/dist/pacing.js
18417
18430
  var CLAUDE_PLANS = Object.freeze([
@@ -18770,6 +18783,9 @@ ${agentLine}`;
18770
18783
  function preToolUseNoticeText(text) {
18771
18784
  return JSON.stringify({ systemMessage: text });
18772
18785
  }
18786
+ function preToolUseSavedText(text) {
18787
+ return JSON.stringify({ systemMessage: text, hookSpecificOutput: { hookEventName: "PreToolUse", additionalContext: text } });
18788
+ }
18773
18789
  function nonBlockingReply(event, text) {
18774
18790
  if (event === "SessionStart") {
18775
18791
  return JSON.stringify({
@@ -23341,7 +23357,7 @@ function distinctBullets(explanations) {
23341
23357
  return bullets([...new Set(explanations)]);
23342
23358
  }
23343
23359
  function foundLine(count) {
23344
- return count === 1 ? "Halfcycle found 1 small thing to fix in this turn's work. The agent gets the details with your next message and will fix it; there is nothing for you to do." : `Halfcycle found ${count} small things to fix in this turn's work. The agent gets the details with your next message and will fix them; there is nothing for you to do.`;
23360
+ return count === 1 ? `Halfcycle found 1 small thing to fix in this turn's work. The agent gets the details with your next message and will fix it; there is nothing for you to do. Say "fix it" to have it fixed.` : `Halfcycle found ${count} small things to fix in this turn's work. The agent gets the details with your next message and will fix them; there is nothing for you to do. Say "fix them" to have them fixed.`;
23345
23361
  }
23346
23362
  function fixedLine(count, all) {
23347
23363
  if (all)
@@ -23351,7 +23367,7 @@ function fixedLine(count, all) {
23351
23367
  function stillOpenMessage(explanations) {
23352
23368
  const n = explanations.length;
23353
23369
  const head = n === 1 ? "Halfcycle: 1 thing it found is still not fixed after the agent's last turn." : `Halfcycle: ${n} things it found are still not fixed after the agent's last turn.`;
23354
- const tail = n === 1 ? "Ask the agent to fix it, or tell it to leave it as it is if that is what you want." : "Ask the agent to fix them, or tell it to leave them as they are if that is what you want.";
23370
+ const tail = n === 1 ? 'Ask the agent to fix it, or tell it to leave it as it is if that is what you want. Say "fix it" to have it fixed.' : 'Ask the agent to fix them, or tell it to leave them as they are if that is what you want. Say "fix them" to have them fixed.';
23355
23371
  return `${head}
23356
23372
  ${bullets(explanations)}
23357
23373
  ${tail}`;
@@ -23370,6 +23386,13 @@ function couldNotFixMessage(explanations) {
23370
23386
  "Ask the agent what is in the way, or tell it how you want this handled."
23371
23387
  ].join("\n");
23372
23388
  }
23389
+ function notRunMessage(reasons) {
23390
+ if (reasons.length === 0)
23391
+ return "";
23392
+ const head = reasons.length === 1 ? "Halfcycle: 1 check could not run on this change." : `Halfcycle: ${reasons.length} checks could not run on this change.`;
23393
+ return `${head}
23394
+ ${distinctBullets(reasons)}`;
23395
+ }
23373
23396
  function blockReason(explanations) {
23374
23397
  return `Halfcycle stopped this step. Fix each of these before you carry on:
23375
23398
  ${distinctBullets(explanations)}`;
@@ -23381,7 +23404,7 @@ function detailsBlock(findings, projectFolder2) {
23381
23404
  return ` [${f.severity.toUpperCase()}] ${f.patternRef}${at}: ${f.explanation}`;
23382
23405
  });
23383
23406
  return [
23384
- "Halfcycle's checks found these in this session's own changes at the end of an earlier turn. Fix each one as part of this turn. If one is intended, tell the person in one plain sentence. When you mention them to the person, use plain words, not the labels in brackets.",
23407
+ "Halfcycle's checks found these in this session's own changes at the end of an earlier turn. Fix each one now, as part of this turn, before anything else; then carry on with what the person asks. Do not ask the person whether to fix them, and do not end your turn with a question before they are fixed. If the person later tells you to keep one, that is their call. When you mention them to the person, use plain words, not the labels in brackets.",
23385
23408
  ...lines2
23386
23409
  ].join("\n");
23387
23410
  }
@@ -23541,7 +23564,9 @@ ${notRun}` : "";
23541
23564
  return;
23542
23565
  }
23543
23566
  if (envelope.blocking) {
23544
- const reason = `${blockReason(envelope.guardsFired.map((g) => g.explanation))}${notRunBlock}`;
23567
+ const personNotRun = notRunMessage((envelope.notRun ?? []).map((n) => n.reason));
23568
+ const reason = `${blockReason(envelope.guardsFired.map((g) => g.explanation))}${personNotRun ? `
23569
+ ${personNotRun}` : ""}`;
23545
23570
  reply.block(reason, stoppedMessage(blockingExplanations(envelope.guardsFired)));
23546
23571
  } else {
23547
23572
  const guardLines = envelope.guardsFired.map((g) => ` [${g.severity.toUpperCase()}] ${g.patternRef}: ${g.explanation}`).join("\n");
@@ -26728,7 +26753,8 @@ function gitRm(cmd, rest, git2) {
26728
26753
  const targets = operands(rest, /* @__PURE__ */ new Set(["--pathspec-from-file"]));
26729
26754
  if (targets.length === 0)
26730
26755
  return [];
26731
- return [{ type: "delete-files", form: "plain", program: "git rm", targets, git: git2, command: cmd }];
26756
+ const form = gitRmRecursive(cmd.words) ? "recursive" : "plain";
26757
+ return [{ type: "delete-files", form, program: "git rm", targets, git: git2, command: cmd }];
26732
26758
  }
26733
26759
  function gitReset(cmd, rest, git2) {
26734
26760
  const hard = hasLong(rest, "--hard");
@@ -27163,7 +27189,7 @@ function shellRecordMatches(cmd, found2) {
27163
27189
  for (const m of found2) {
27164
27190
  if (m.type !== "delete-files" || m.program === "find" || m.program === "git clean" || m.command !== cmd)
27165
27191
  continue;
27166
- const recursive = m.form === "recursive" || m.program === "git rm" && gitRmRecursive(cmd.words);
27192
+ const recursive = m.form === "recursive";
27167
27193
  const targets = recursive ? m.targets : m.targets.filter((w) => mayBeRecordWord(w));
27168
27194
  if (targets.length === 0)
27169
27195
  continue;
@@ -27893,7 +27919,7 @@ function deleteFilesFacts(m, env) {
27893
27919
  return cannot({ kind: "paths", paths: guarded.map((g) => toSlash(g)) });
27894
27920
  if (unseen)
27895
27921
  return cannot(null);
27896
- const plainFolderRefused = m.form === "plain" && !(m.program === "git rm" && gitRmRecursive(m.command?.words ?? []));
27922
+ const plainFolderRefused = m.form === "plain";
27897
27923
  const targets = plainFolderRefused ? inside.filter((t) => !isDirectory(t)) : inside;
27898
27924
  if (targets.length === 0)
27899
27925
  return silentDelete(m);
@@ -29984,7 +30010,7 @@ function autonomousAnswer(call, staked, sendsSaves, mode, autonomy, deps) {
29984
30010
  });
29985
30011
  if (!saved.saved)
29986
30012
  return refuse(autonomyA12(typeSentenceFor(saved.reason === AUTONOMY_COULD_NOT_TELL_REASON ? [] : staked), saved.reason));
29987
- return `${preToolUseNoticeText(autonomyA9(what, saved.id))}
30013
+ return `${preToolUseSavedText(autonomyA9(what, saved.id))}
29988
30014
  `;
29989
30015
  }
29990
30016
  default: {
@@ -30244,7 +30270,7 @@ function queueTurnEnd(words, reply) {
30244
30270
  reply.notice(words);
30245
30271
  }
30246
30272
  function actOnEnvelope3(envelope, kind, neverBlock, reply, sessionId, folder) {
30247
- const notRun = notRunReport(envelope.notRun);
30273
+ const notRun = notRunMessage((envelope.notRun ?? []).map((n) => n.reason));
30248
30274
  const outcome = {
30249
30275
  kind: "evaluated",
30250
30276
  fired: envelope.guardsFired,
@@ -1 +1 @@
1
- {"version":3,"file":"render-v2.d.ts","sourceRoot":"","sources":["../../src/build-record/render-v2.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,EAmBL,KAAK,WAAW,EAQjB,MAAM,mBAAmB,CAAC;AA8J3B;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAepD;AAKD;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CASpD;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAOvD;AA2MD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAO/D;AAwVD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAgFvE"}
1
+ {"version":3,"file":"render-v2.d.ts","sourceRoot":"","sources":["../../src/build-record/render-v2.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,EAmBL,KAAK,WAAW,EAQjB,MAAM,mBAAmB,CAAC;AA8J3B;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAepD;AAKD;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CASpD;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAOvD;AA2PD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAO/D;AA2WD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAgFvE"}