halfcycle 0.4.2 → 0.4.3

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.
@@ -69,11 +69,12 @@
69
69
  * silence back permanently and for every future question this CLI asks.
70
70
  *
71
71
  * So what this population gets instead is a record that does not live in scrollback.
72
- * The account id settled on here is RETURNED to the caller, which writes it into the
73
- * committed `.halfcycle/bundle.json` (`writeBundlePin` in `install.ts`) — the id and
74
- * never the email, because that file is committed into the client's repository. A
75
- * wrong-identity install is then discoverable afterwards, from the repository, by the
76
- * person whose repository it is. Printing is not recording.
72
+ * The account id settled on here is RETURNED to the caller, which on a CREATE writes it
73
+ * into the committed `.halfcycle/bundle.json` as `createdByAccountId` (`writeBundlePin`
74
+ * in `install.ts`; only the create writes it — E1, #1598) — the id and never the email,
75
+ * because that file is committed into the client's repository. A wrong-identity install
76
+ * is then discoverable afterwards, from the repository, by the person whose repository
77
+ * it is. Printing is not recording.
77
78
  *
78
79
  * The measurement is `isInteractiveRun` (a TTY plus the absence of a CI marker), whose
79
80
  * one home is `device-signin.ts`. It is never inferred from anything else. (The
@@ -132,8 +133,9 @@ export interface ConfirmIdentityDeps extends ResolveOptions {
132
133
  * every run and it is the wrong thing to put beside the value the reader is being
133
134
  * asked to check: a person cannot verify a uuid, and thirty-eight characters of one
134
135
  * pushed the email they CAN verify leftward into a longer line. It is not lost —
135
- * `.halfcycle/bundle.json` records the account this install acted as, which is the
136
- * copy a support conversation can actually be pointed at once the terminal is gone.
136
+ * `.halfcycle/bundle.json` records the account that created the project, which is
137
+ * the copy a support conversation can be pointed at once the terminal is gone.
138
+ * The account a later run acted as is not recorded there (E1, #1598).
137
139
  */
138
140
  verbose?: boolean;
139
141
  /**
@@ -228,9 +230,10 @@ export declare function describeAccount(serviceUrl: string, credential: string,
228
230
  * and a human needs the email. The first half of that is true and the conclusion was
229
231
  * wrong: this label's reader is a person deciding whether a project should belong to
230
232
  * this account, they cannot verify a uuid, and a uuid printed beside the one value they
231
- * CAN verify buries it. The id has a better home already — `writeBundlePin` records it
232
- * in `.halfcycle/bundle.json`, which outlives the scrollback — and `--verbose` puts it
233
- * back on screen for the run that wants it.
233
+ * CAN verify buries it. The creating account's id has a better home already —
234
+ * `writeBundlePin` records it in `.halfcycle/bundle.json`, which outlives the
235
+ * scrollback — and `--verbose` puts this run's id back on screen for the run that
236
+ * wants it.
234
237
  *
235
238
  * WITH NO EMAIL the id is all there is, and it is printed: an unnamed account named by
236
239
  * its row is better than an unnamed account.
@@ -239,13 +242,20 @@ export declare function describeAccount(serviceUrl: string, credential: string,
239
242
  * signed in as'` is a true sentence about an unnamed account; `'unknown'` printed where
240
243
  * a name goes reads as a name.
241
244
  *
242
- * `confirmed` (onboarding fix wave T-16, #1567) is false only for the re-use arm's
243
- * offline report: `askAccount` was asked and got no response at all, so "no email on
244
- * record for it" would be a claim this run never actually confirmed, printed beside a
245
- * raw account id with nothing true to say about why there is no email. `false` takes
246
- * neither branch below and says plainly that this run could not confirm who signed in.
245
+ * THE CALLER DECIDES WHETHER TO PRINT AT ALL, not this function. `bin.ts`'s final
246
+ * report (E8, the wording batch, onboarding fix wave 2) only calls this when `GET
247
+ * /account` actually answered with an account — a network error, a timeout, a 5xx
248
+ * and a reached-but-unidentifiable answer (a 401/403) are all withheld there, rather
249
+ * than printed through a `confirmed` flag here (onboarding fix wave T-16, #1567's
250
+ * original shape, since removed: the flag's one caller was that same report line,
251
+ * and the line it produced — "this run could not reach the service to confirm who
252
+ * that is" — is now simply never printed, which is the more honest of the two). A
253
+ * `storedAccountId` with no `identity` can still reach the "no email" branch below
254
+ * through `confirm-identity.ts`'s OWN prompt line, a different surface with a
255
+ * different, still-true claim: a stored or environment credential's cached id,
256
+ * named while this run's own fresh identity read is still pending.
247
257
  */
248
- export declare function accountLabel(identity: AccountIdentity | undefined, storedAccountId: string | undefined, verbose?: boolean, confirmed?: boolean): string;
258
+ export declare function accountLabel(identity: AccountIdentity | undefined, storedAccountId: string | undefined, verbose?: boolean): string;
249
259
  /**
250
260
  * Read one line from the terminal. Kept out of the decision so the decision is testable.
251
261
  * Also the Git for Windows offer's prompt (`pre-create-checks.ts`), so the terminal is
@@ -311,7 +321,7 @@ export declare function identitySwitchRemedy(home: string | undefined, interacti
311
321
  *
312
322
  * Returns the credential to use, which is a DIFFERENT one from the one passed in when
313
323
  * the person switched account, and which carries the ACCOUNT ID this run acts as so the
314
- * caller can record it on disk (`writeBundlePin`). Throws `SignInRefused` when they
324
+ * caller can record it on disk when it creates the project (`writeBundlePin`). Throws `SignInRefused` when they
315
325
  * stop, which the CLI already prints as a refusal rather than as a crash: nothing has
316
326
  * been created and nothing has been written at the point this is called, and that is
317
327
  * what makes stopping a real option rather than an apology.
@@ -1 +1 @@
1
- {"version":3,"file":"confirm-identity.d.ts","sourceRoot":"","sources":["../src/confirm-identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmGG;AAGH,OAAO,EAAmD,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAI1G,OAAO,EAAiB,KAAK,cAAc,EAAE,KAAK,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAKtG,uFAAuF;AACvF,eAAO,MAAM,iBAAiB,sBAAsB,CAAC;AAErD,6CAA6C;AAC7C,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,gBAAgB,GAAG,MAAM,CAAC;AAErE,6FAA6F;AAC7F,MAAM,MAAM,UAAU,GAClB;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GACxD;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;C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B,MAAM,CAC1B,UAAU,EAAE,MAAM,EAClB,IAAI,GAAE,UAAU,GAAG;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAA;CAAO,GAClD,OAAO,CAAC,QAAQ,CAAC,CA0GnB"}
package/dist/index.d.ts CHANGED
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * INV-001: imports only from @halfcycle/core, @halfcycle/events, or Node builtins.
10
10
  */
11
- export { install, checkDrift, readBundlePin, ZONE_B_DIR } from './install.js';
11
+ export { install, checkDrift, readBundlePin, pinCreatedByAccountId, ZONE_B_DIR } from './install.js';
12
12
  export type { InstallOptions, InstallResult, BundlePin, EngagementType, DeviceCredential } from './install.js';
13
13
  export { mintOrReadIdentity, readRootCommit, readRemote } from './identity.js';
14
14
  export type { ProjectIdentity } from './identity.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC9E,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC/G,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC/E,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACnF,YAAY,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAyBhE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClF,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AACnG,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAI1F,cAAc,kBAAkB,CAAC;AAKjC,cAAc,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACrG,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC/G,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC/E,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACnF,YAAY,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAyBhE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClF,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AACnG,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAI1F,cAAc,kBAAkB,CAAC;AAKjC,cAAc,yBAAyB,CAAC"}
package/dist/index.js CHANGED
@@ -1650,8 +1650,20 @@ function projectPageUrl(engagementId) {
1650
1650
  }
1651
1651
 
1652
1652
  // dist/merge-settings.js
1653
+ function isHalfcycleCommand(hook, halfcycleCommands) {
1654
+ if (typeof hook !== "object" || hook === null)
1655
+ return false;
1656
+ const command = hook.command;
1657
+ return typeof command === "string" && halfcycleCommands.has(command);
1658
+ }
1653
1659
  function isHalfcycleEntry(entry, halfcycleCommands) {
1654
- return entry.hooks.some((h) => halfcycleCommands.has(h.command));
1660
+ return entry.hooks.some((h) => isHalfcycleCommand(h, halfcycleCommands));
1661
+ }
1662
+ function withoutHalfcycleCommands(entry, halfcycleCommands) {
1663
+ if (!isHalfcycleEntry(entry, halfcycleCommands))
1664
+ return entry;
1665
+ const remaining = entry.hooks.filter((h) => !isHalfcycleCommand(h, halfcycleCommands));
1666
+ return remaining.length > 0 ? { ...entry, hooks: remaining } : null;
1655
1667
  }
1656
1668
  function mergeSettings(existing, generated) {
1657
1669
  const merged = { ...existing };
@@ -1670,7 +1682,7 @@ function mergeSettings(existing, generated) {
1670
1682
  const mergedHooks = {};
1671
1683
  const events = /* @__PURE__ */ new Set([...Object.keys(existingHooks), ...Object.keys(generatedHooks)]);
1672
1684
  for (const event of events) {
1673
- const developerEntries = (existingHooks[event] ?? []).filter((entry) => !isHalfcycleEntry(entry, halfcycleCommands));
1685
+ const developerEntries = (existingHooks[event] ?? []).flatMap((entry) => withoutHalfcycleCommands(entry, halfcycleCommands) ?? []);
1674
1686
  const halfcycleEntries = generatedHooks[event] ?? [];
1675
1687
  mergedHooks[event] = [...developerEntries, ...halfcycleEntries];
1676
1688
  }
@@ -1846,6 +1858,7 @@ function closedWriteSet() {
1846
1858
  ownedDirs,
1847
1859
  hookCommands: new Set(HALFCYCLE_HOOK_COMMANDS),
1848
1860
  denyRuleSha256: new Set([...DENY_PATTERNS, ...RETIRED_DENY_PATTERNS].map((rule) => sha256Hex(rule))),
1861
+ settingsSchema: SETTINGS_SCHEMA,
1849
1862
  gitignoreLines: /* @__PURE__ */ new Set([GITIGNORE_HEADER, ...REQUIRED_GITIGNORE_ENTRIES, LEGACY_ENV_LOCAL_REL]),
1850
1863
  gitattributesLines: /* @__PURE__ */ new Set([
1851
1864
  GITATTRIBUTES_HEADER,
@@ -2034,6 +2047,8 @@ function copyManifestCommands(manifest, targetRepo, report, draft, writeSet) {
2034
2047
  record(report, outcome, rel);
2035
2048
  if (replacedExisting)
2036
2049
  report.replacedPaths.push(rel);
2050
+ if (outcome === "collided" && recorded !== void 0)
2051
+ report.editedCollidedPaths.push(rel);
2037
2052
  noteFile(draft, targetRepo, rel, outcome);
2038
2053
  }
2039
2054
  }
@@ -2157,6 +2172,7 @@ function settingsParseRefusal(targetRepo, err) {
2157
2172
  }
2158
2173
  return `${file} could not be read as JSON${where} \u2014 fix it and run "npx halfcycle" again.`;
2159
2174
  }
2175
+ var SETTINGS_SCHEMA = "https://json.schemastore.org/claude-code-settings.json";
2160
2176
  function generateSettingsJson() {
2161
2177
  const hooks = {};
2162
2178
  for (const { event, matcher, timeout, command } of HALFCYCLE_HOOK_WIRING) {
@@ -2166,7 +2182,7 @@ function generateSettingsJson() {
2166
2182
  });
2167
2183
  }
2168
2184
  const settings = {
2169
- $schema: "https://json.schemastore.org/claude-code-settings.json",
2185
+ $schema: SETTINGS_SCHEMA,
2170
2186
  permissions: {
2171
2187
  // deny ONLY. See DENY_PATTERNS — an allow list evaporates under bypass mode
2172
2188
  // and is the machine owner's grant to make, not ours.
@@ -2466,19 +2482,27 @@ function adoptBlockUnderHeader(before, header, claimable) {
2466
2482
  let underHeader = false;
2467
2483
  const lines = before.split("\n");
2468
2484
  for (const [i, line] of lines.entries()) {
2469
- if (line === header) {
2470
- if (i > 0 && lines[i - 1] === "")
2471
- claimed.push("");
2485
+ const key = lineKey(line);
2486
+ if (key === header) {
2487
+ if (i > 0 && lineKey(lines[i - 1]) === "")
2488
+ claimed.push(lines[i - 1]);
2472
2489
  claimed.push(line);
2473
2490
  underHeader = true;
2474
- } else if (line.trim() === "") {
2491
+ } else if (key.trim() === "") {
2475
2492
  underHeader = false;
2476
- } else if (underHeader && claimable.has(line)) {
2493
+ } else if (underHeader && claimable.has(key)) {
2477
2494
  claimed.push(line);
2478
2495
  }
2479
2496
  }
2480
2497
  return claimed.length > 0 ? claimed.join("\n") + "\n" : "";
2481
2498
  }
2499
+ function lineKey(line) {
2500
+ return line.endsWith("\r") ? line.slice(0, -1) : line;
2501
+ }
2502
+ function lineEndingOf(text) {
2503
+ const at = text.indexOf("\n");
2504
+ return at > 0 && text[at - 1] === "\r" ? "\r\n" : "\n";
2505
+ }
2482
2506
  function gitignoreCovers(content) {
2483
2507
  const lines = new Set(content.split("\n").map((l) => l.trim()));
2484
2508
  return REQUIRED_GITIGNORE_ENTRIES.every((entry) => lines.has(entry));
@@ -2497,9 +2521,8 @@ function reconcileGitignore(targetRepo) {
2497
2521
  return "skipped";
2498
2522
  const existingLines = new Set(existing.split("\n").map((l) => l.trim()));
2499
2523
  const toAdd = REQUIRED_GITIGNORE_ENTRIES.filter((entry) => !existingLines.has(entry));
2500
- const suffix = (existing.endsWith("\n") ? "" : "\n") + `
2501
- ${header}
2502
- ` + toAdd.join("\n") + "\n";
2524
+ const eol = lineEndingOf(existing);
2525
+ const suffix = (existing.endsWith("\n") ? "" : eol) + eol + [header, ...toAdd].join(eol) + eol;
2503
2526
  writeFileSync4(gitignorePath, existing + suffix, "utf-8");
2504
2527
  return "written";
2505
2528
  } catch {
@@ -2534,8 +2557,9 @@ function reconcileGitattributes(targetRepo) {
2534
2557
  const toAdd = rules.filter((rule) => !present.has(rule));
2535
2558
  if (toAdd.length === 0)
2536
2559
  return "skipped";
2537
- const separator = existing === "" ? "" : existing.endsWith("\n") ? "\n" : "\n\n";
2538
- const suffix = separator + [GITATTRIBUTES_HEADER, ...toAdd].join("\n") + "\n";
2560
+ const eol = lineEndingOf(existing);
2561
+ const separator = existing === "" ? "" : existing.endsWith("\n") ? eol : eol + eol;
2562
+ const suffix = separator + [GITATTRIBUTES_HEADER, ...toAdd].join(eol) + eol;
2539
2563
  writeAllowlisted(path, targetRepo, existing + suffix, routed);
2540
2564
  return "written";
2541
2565
  } catch {
@@ -2555,9 +2579,9 @@ function previousPinForEngagement(targetRepoRoot, engagementId) {
2555
2579
  function nonEmpty(value) {
2556
2580
  return typeof value === "string" && value.trim() !== "" ? value : void 0;
2557
2581
  }
2558
- function writeBundlePin(targetRepoRoot, version, engagementId, engagementType, accountId, methodVersion, writtenPaths) {
2582
+ function writeBundlePin(targetRepoRoot, version, engagementId, engagementType, createdByAccountId, methodVersion, writtenPaths) {
2559
2583
  const previous = previousPinForEngagement(targetRepoRoot, engagementId);
2560
- const carried = nonEmpty(accountId) ?? nonEmpty(previous?.accountId);
2584
+ const carried = pinCreatedByAccountId(previous) ?? nonEmpty(createdByAccountId);
2561
2585
  const carriedMethodVersion = nonEmpty(methodVersion) ?? nonEmpty(previous?.methodVersion);
2562
2586
  const installedAt = nonEmpty(previous?.installedAt) ?? (/* @__PURE__ */ new Date()).toISOString();
2563
2587
  const projectPage = projectPageUrl(engagementId);
@@ -2566,7 +2590,7 @@ function writeBundlePin(targetRepoRoot, version, engagementId, engagementType, a
2566
2590
  engagementId,
2567
2591
  engagementType,
2568
2592
  installedAt,
2569
- ...carried !== void 0 ? { accountId: carried } : {},
2593
+ ...carried !== void 0 ? { createdByAccountId: carried } : {},
2570
2594
  ...carriedMethodVersion !== void 0 ? { methodVersion: carriedMethodVersion } : {},
2571
2595
  ...projectPage !== void 0 ? { projectPage } : {}
2572
2596
  };
@@ -2583,6 +2607,9 @@ function writeCrewRoster(targetRepoRoot, report) {
2583
2607
  const crewPath = join5(targetRepoRoot, CREW_ROSTER_REL);
2584
2608
  return recordOwned(report, crewPath, targetRepoRoot, rendered, CREW_ROSTER_REL);
2585
2609
  }
2610
+ function pinCreatedByAccountId(pin) {
2611
+ return nonEmpty(pin?.createdByAccountId) ?? nonEmpty(pin?.accountId);
2612
+ }
2586
2613
  function readBundlePin(targetRepoRoot) {
2587
2614
  const pinPath = join5(targetRepoRoot, BUNDLE_PIN_REL);
2588
2615
  if (!existsSync3(pinPath))
@@ -2683,7 +2710,7 @@ function migrateLegacyEnvLocal(targetRepo, stored) {
2683
2710
  }
2684
2711
  }
2685
2712
  async function install(options) {
2686
- const { targetRepo, engagementId, engagementType, credential, home, accountId } = options;
2713
+ const { targetRepo, engagementId, engagementType, credential, home, createdByAccountId } = options;
2687
2714
  assertEngagementId(engagementId);
2688
2715
  if (!existsSync3(targetRepo)) {
2689
2716
  throw new Error(`[halfcycle] Target repo does not exist: ${targetRepo}`);
@@ -2694,6 +2721,7 @@ async function install(options) {
2694
2721
  skippedPaths: [],
2695
2722
  mergedPaths: [],
2696
2723
  collidedPaths: [],
2724
+ editedCollidedPaths: [],
2697
2725
  replacedPaths: []
2698
2726
  };
2699
2727
  const writeSet = closedWriteSet();
@@ -2821,7 +2849,7 @@ async function install(options) {
2821
2849
  case "absent":
2822
2850
  break;
2823
2851
  }
2824
- writeBundlePin(targetRepo, manifest.version, engagementId, engagementType, accountId, credential?.methodVersion, report.writtenPaths);
2852
+ writeBundlePin(targetRepo, manifest.version, engagementId, engagementType, createdByAccountId, credential?.methodVersion, report.writtenPaths);
2825
2853
  noteFile(draft, targetRepo, BUNDLE_PIN_REL, "written");
2826
2854
  noteFile(draft, targetRepo, CREW_ROSTER_REL, writeCrewRoster(targetRepo, report));
2827
2855
  const scanResult = runBootstrapScan(targetRepo);
@@ -2841,6 +2869,7 @@ async function install(options) {
2841
2869
  skippedPaths: report.skippedPaths,
2842
2870
  mergedPaths: report.mergedPaths,
2843
2871
  collidedPaths: report.collidedPaths,
2872
+ editedCollidedPaths: report.editedCollidedPaths,
2844
2873
  replacedPaths: report.replacedPaths,
2845
2874
  bootstrapScanRan: scanResult.ran,
2846
2875
  legacyCredentialKept: migration.outcome === "kept" ? { keys: migration.unbacked, missing: migration.missingForAdoption } : null,
@@ -4090,6 +4119,7 @@ export {
4090
4119
  mergeWithRecords,
4091
4120
  mintOrReadIdentity,
4092
4121
  obtainBuildRecord,
4122
+ pinCreatedByAccountId,
4093
4123
  questionsToPut,
4094
4124
  readBundlePin,
4095
4125
  readRemote,