halfcycle 0.3.8 → 0.3.10

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,16 +1,43 @@
1
1
  {
2
2
  "name": "halfcycle",
3
- "version": "0.3.8",
3
+ "version": "0.3.10",
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
- { "name": "halfcycle-setup", "path": "../commands/halfcycle-setup.md" },
7
- { "name": "halfcycle-design", "path": "../commands/halfcycle-design.md" },
8
- { "name": "write-spec", "path": "../commands/write-spec.md" },
9
- { "name": "consistency-check", "path": "../commands/consistency-check.md" },
10
- { "name": "task-graph", "path": "../commands/task-graph.md" },
11
- { "name": "context-update", "path": "../commands/context-update.md" },
12
- { "name": "agent-teams-orchestration", "path": "../commands/agent-teams-orchestration.md" },
13
- { "name": "task-execution", "path": "../commands/task-execution.md" },
14
- { "name": "stack-assembly-worker", "path": "../commands/stack-assembly-worker.md" }
6
+ {
7
+ "name": "halfcycle-setup",
8
+ "path": "../commands/halfcycle-setup.md"
9
+ },
10
+ {
11
+ "name": "halfcycle-design",
12
+ "path": "../commands/halfcycle-design.md"
13
+ },
14
+ {
15
+ "name": "write-spec",
16
+ "path": "../commands/write-spec.md"
17
+ },
18
+ {
19
+ "name": "consistency-check",
20
+ "path": "../commands/consistency-check.md"
21
+ },
22
+ {
23
+ "name": "task-graph",
24
+ "path": "../commands/task-graph.md"
25
+ },
26
+ {
27
+ "name": "context-update",
28
+ "path": "../commands/context-update.md"
29
+ },
30
+ {
31
+ "name": "agent-teams-orchestration",
32
+ "path": "../commands/agent-teams-orchestration.md"
33
+ },
34
+ {
35
+ "name": "task-execution",
36
+ "path": "../commands/task-execution.md"
37
+ },
38
+ {
39
+ "name": "stack-assembly-worker",
40
+ "path": "../commands/stack-assembly-worker.md"
41
+ }
15
42
  ]
16
43
  }
package/README.md CHANGED
@@ -8,6 +8,8 @@ npx halfcycle
8
8
 
9
9
  That is the whole install. One command, in the repo you want to work in.
10
10
 
11
+ **Where it connects.** That command talks to Halfcycle at `https://control.halfcycle.ai`, to sign you in through your browser and to create the engagement your work is recorded against. It is the same address for everybody and it ships in the CLI, so there is nothing to configure, nothing to look up, and no value anyone has to give you first; the addresses for your board and for the checks come back from there too. If it cannot be reached, the install stops and writes nothing rather than setting your repository up without cover.
12
+
11
13
  ---
12
14
 
13
15
  ## What it is
@@ -5,6 +5,15 @@ var __export = (target, all) => {
5
5
  __defProp(target, name, { get: all[name], enumerable: true });
6
6
  };
7
7
 
8
+ // dist/guard-origin.js
9
+ var DEFAULT_GUARD_ORIGIN = "https://guard.halfcycle.ai";
10
+ function resolveGuardOrigin(env) {
11
+ const configured = env["GUARD_SERVICE_URL"]?.trim();
12
+ if (configured)
13
+ return { origin: configured.replace(/\/+$/, ""), source: "environment" };
14
+ return { origin: DEFAULT_GUARD_ORIGIN, source: "default" };
15
+ }
16
+
8
17
  // dist/config.js
9
18
  var EXCERPT_DEFAULTS = {
10
19
  maxCharsPerExcerpt: 200,
@@ -12,12 +21,10 @@ var EXCERPT_DEFAULTS = {
12
21
  maxExcerptsPerChangeSet: 20
13
22
  };
14
23
  function readConfig() {
15
- const guardServiceUrl = process.env["GUARD_SERVICE_URL"];
24
+ const guardServiceUrl = resolveGuardOrigin(process.env).origin;
16
25
  const guardServiceToken = process.env["GUARD_SERVICE_TOKEN"];
17
26
  const guardEngagementId = process.env["GUARD_ENGAGEMENT_ID"];
18
27
  const missing = [];
19
- if (!guardServiceUrl)
20
- missing.push("GUARD_SERVICE_URL");
21
28
  if (!guardServiceToken)
22
29
  missing.push("GUARD_SERVICE_TOKEN");
23
30
  if (!guardEngagementId)
@@ -16027,6 +16034,15 @@ function emitInfraWarning(message) {
16027
16034
  process.stdout.write(`[Halfcycle] WARNING: Guard service unavailable \u2014 ${message}. Session continues (fail-open).
16028
16035
  `);
16029
16036
  }
16037
+ function emitLocalFault(message) {
16038
+ process.stdout.write(`[Halfcycle] WARNING: Local fault \u2014 ${message}. The guard service was not contacted. Session continues (fail-open).
16039
+ `);
16040
+ }
16041
+ function emitContractFault(message) {
16042
+ process.stdout.write(`[Halfcycle] WARNING: Guard response could not be understood \u2014 ${message}
16043
+ This is not a service outage: the guard service answered. The suspect is this repository's own installed halfcycle runner, which is out of date with what the service now sends. Update it: run "npx halfcycle" in this repository, then retry. Session continues (fail-open).
16044
+ `);
16045
+ }
16030
16046
  var UNCONFIGURED_EXIT_TOOL_USE = 2;
16031
16047
  var UNCONFIGURED_EXIT_STOP_FAMILY = 1;
16032
16048
  function emitNeverConfigured(missing, exitCode) {
@@ -16238,7 +16254,7 @@ async function runPostToolUse() {
16238
16254
  return;
16239
16255
  const repoRootResult = getRepoRoot(process.cwd());
16240
16256
  if (!repoRootResult.ok) {
16241
- emitInfraWarning(`Could not find git repo root: ${repoRootResult.message}`);
16257
+ emitLocalFault(`Could not find git repo root: ${repoRootResult.message}`);
16242
16258
  return;
16243
16259
  }
16244
16260
  const repoRoot = repoRootResult.value;
@@ -16274,6 +16290,10 @@ async function runPostToolUse() {
16274
16290
  emitCredentialRejected(failure.statusCode, failure.message, CREDENTIAL_REJECTED_EXIT_TOOL_USE);
16275
16291
  return;
16276
16292
  }
16293
+ if (failure.kind === "contract") {
16294
+ emitContractFault(failure.message);
16295
+ return;
16296
+ }
16277
16297
  emitInfraWarning(failure.reason);
16278
16298
  return;
16279
16299
  }
@@ -16477,7 +16497,7 @@ function collectDiff(repoRoot, base) {
16477
16497
  async function runSessionDiff(input, kind) {
16478
16498
  const repoRootResult = getRepoRoot(process.cwd());
16479
16499
  if (!repoRootResult.ok) {
16480
- emitInfraWarning(`Could not find git repo root: ${repoRootResult.message}`);
16500
+ emitLocalFault(`Could not find git repo root: ${repoRootResult.message}`);
16481
16501
  return;
16482
16502
  }
16483
16503
  const repoRoot = repoRootResult.value;
@@ -16487,7 +16507,7 @@ async function runSessionDiff(input, kind) {
16487
16507
  const diffBase = base.kind;
16488
16508
  const collected = collectDiff(repoRoot, base);
16489
16509
  if (!collected.ok) {
16490
- emitInfraWarning(`Could not get session diff: ${collected.message}`);
16510
+ emitLocalFault(`Could not get session diff: ${collected.message}`);
16491
16511
  return;
16492
16512
  }
16493
16513
  const { files: changedFiles, getDiff } = collected;
@@ -16531,6 +16551,10 @@ async function runSessionDiff(input, kind) {
16531
16551
  emitCredentialRejected(failure.statusCode, failure.message, CREDENTIAL_REJECTED_EXIT_STOP_FAMILY);
16532
16552
  return;
16533
16553
  }
16554
+ if (failure.kind === "contract") {
16555
+ emitContractFault(failure.message);
16556
+ return;
16557
+ }
16534
16558
  emitInfraWarning(failure.reason);
16535
16559
  return;
16536
16560
  }