halfcycle 0.4.15 → 0.4.16

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.16",
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
  {
@@ -18770,6 +18770,9 @@ ${agentLine}`;
18770
18770
  function preToolUseNoticeText(text) {
18771
18771
  return JSON.stringify({ systemMessage: text });
18772
18772
  }
18773
+ function preToolUseSavedText(text) {
18774
+ return JSON.stringify({ systemMessage: text, hookSpecificOutput: { hookEventName: "PreToolUse", additionalContext: text } });
18775
+ }
18773
18776
  function nonBlockingReply(event, text) {
18774
18777
  if (event === "SessionStart") {
18775
18778
  return JSON.stringify({
@@ -23370,6 +23373,13 @@ function couldNotFixMessage(explanations) {
23370
23373
  "Ask the agent what is in the way, or tell it how you want this handled."
23371
23374
  ].join("\n");
23372
23375
  }
23376
+ function notRunMessage(reasons) {
23377
+ if (reasons.length === 0)
23378
+ return "";
23379
+ const head = reasons.length === 1 ? "Halfcycle: 1 check could not run on this change." : `Halfcycle: ${reasons.length} checks could not run on this change.`;
23380
+ return `${head}
23381
+ ${distinctBullets(reasons)}`;
23382
+ }
23373
23383
  function blockReason(explanations) {
23374
23384
  return `Halfcycle stopped this step. Fix each of these before you carry on:
23375
23385
  ${distinctBullets(explanations)}`;
@@ -23381,7 +23391,7 @@ function detailsBlock(findings, projectFolder2) {
23381
23391
  return ` [${f.severity.toUpperCase()}] ${f.patternRef}${at}: ${f.explanation}`;
23382
23392
  });
23383
23393
  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.",
23394
+ "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
23395
  ...lines2
23386
23396
  ].join("\n");
23387
23397
  }
@@ -23541,7 +23551,9 @@ ${notRun}` : "";
23541
23551
  return;
23542
23552
  }
23543
23553
  if (envelope.blocking) {
23544
- const reason = `${blockReason(envelope.guardsFired.map((g) => g.explanation))}${notRunBlock}`;
23554
+ const personNotRun = notRunMessage((envelope.notRun ?? []).map((n) => n.reason));
23555
+ const reason = `${blockReason(envelope.guardsFired.map((g) => g.explanation))}${personNotRun ? `
23556
+ ${personNotRun}` : ""}`;
23545
23557
  reply.block(reason, stoppedMessage(blockingExplanations(envelope.guardsFired)));
23546
23558
  } else {
23547
23559
  const guardLines = envelope.guardsFired.map((g) => ` [${g.severity.toUpperCase()}] ${g.patternRef}: ${g.explanation}`).join("\n");
@@ -26728,7 +26740,8 @@ function gitRm(cmd, rest, git2) {
26728
26740
  const targets = operands(rest, /* @__PURE__ */ new Set(["--pathspec-from-file"]));
26729
26741
  if (targets.length === 0)
26730
26742
  return [];
26731
- return [{ type: "delete-files", form: "plain", program: "git rm", targets, git: git2, command: cmd }];
26743
+ const form = gitRmRecursive(cmd.words) ? "recursive" : "plain";
26744
+ return [{ type: "delete-files", form, program: "git rm", targets, git: git2, command: cmd }];
26732
26745
  }
26733
26746
  function gitReset(cmd, rest, git2) {
26734
26747
  const hard = hasLong(rest, "--hard");
@@ -27163,7 +27176,7 @@ function shellRecordMatches(cmd, found2) {
27163
27176
  for (const m of found2) {
27164
27177
  if (m.type !== "delete-files" || m.program === "find" || m.program === "git clean" || m.command !== cmd)
27165
27178
  continue;
27166
- const recursive = m.form === "recursive" || m.program === "git rm" && gitRmRecursive(cmd.words);
27179
+ const recursive = m.form === "recursive";
27167
27180
  const targets = recursive ? m.targets : m.targets.filter((w) => mayBeRecordWord(w));
27168
27181
  if (targets.length === 0)
27169
27182
  continue;
@@ -27893,7 +27906,7 @@ function deleteFilesFacts(m, env) {
27893
27906
  return cannot({ kind: "paths", paths: guarded.map((g) => toSlash(g)) });
27894
27907
  if (unseen)
27895
27908
  return cannot(null);
27896
- const plainFolderRefused = m.form === "plain" && !(m.program === "git rm" && gitRmRecursive(m.command?.words ?? []));
27909
+ const plainFolderRefused = m.form === "plain";
27897
27910
  const targets = plainFolderRefused ? inside.filter((t) => !isDirectory(t)) : inside;
27898
27911
  if (targets.length === 0)
27899
27912
  return silentDelete(m);
@@ -29984,7 +29997,7 @@ function autonomousAnswer(call, staked, sendsSaves, mode, autonomy, deps) {
29984
29997
  });
29985
29998
  if (!saved.saved)
29986
29999
  return refuse(autonomyA12(typeSentenceFor(saved.reason === AUTONOMY_COULD_NOT_TELL_REASON ? [] : staked), saved.reason));
29987
- return `${preToolUseNoticeText(autonomyA9(what, saved.id))}
30000
+ return `${preToolUseSavedText(autonomyA9(what, saved.id))}
29988
30001
  `;
29989
30002
  }
29990
30003
  default: {
@@ -30244,7 +30257,7 @@ function queueTurnEnd(words, reply) {
30244
30257
  reply.notice(words);
30245
30258
  }
30246
30259
  function actOnEnvelope3(envelope, kind, neverBlock, reply, sessionId, folder) {
30247
- const notRun = notRunReport(envelope.notRun);
30260
+ const notRun = notRunMessage((envelope.notRun ?? []).map((n) => n.reason));
30248
30261
  const outcome = {
30249
30262
  kind: "evaluated",
30250
30263
  fired: envelope.guardsFired,