halfcycle 0.3.32 → 0.3.34

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.3.32",
3
+ "version": "0.3.34",
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
  {
@@ -14721,6 +14721,31 @@ var HALFCYCLE_HOOK_WIRING_PATHS = [
14721
14721
  .../* @__PURE__ */ new Set([SETTINGS_REL, ...HALFCYCLE_HOOK_WIRING.map((entry) => entry.script), VENDORED_BIN_REL])
14722
14722
  ];
14723
14723
 
14724
+ // ../core/dist/secret-shape.js
14725
+ var SECRET_SHAPE_PATTERNS = [
14726
+ // Assignment to a credential-named identifier: `apiKey = "..."`, `secret: '...'`,
14727
+ // `password=...`, `token = ...`, `access_key: ...` — the value need not be quoted.
14728
+ /\b(?:api[_-]?key|secret|password|passwd|token|access[_-]?key|private[_-]?key|client[_-]?secret|auth[_-]?token|bearer)\b\s*[:=]\s*\S+/i,
14729
+ // Connection strings that embed credentials: `scheme://user:pass@host`.
14730
+ /\b[a-z][a-z0-9+.-]*:\/\/[^\s:/@]+:[^\s:/@]+@/i,
14731
+ // Bearer / authorization header values.
14732
+ /\bauthorization\b\s*[:=]\s*['"]?\s*bearer\s+\S+/i,
14733
+ // PEM / private-key block headers.
14734
+ /-----BEGIN\s+(?:RSA\s+|EC\s+|OPENSSH\s+|DSA\s+)?PRIVATE\s+KEY-----/,
14735
+ // JWT shape: three base64url segments separated by dots.
14736
+ /\beyJ[A-Za-z0-9_-]{6,}\.[A-Za-z0-9_-]{6,}\.[A-Za-z0-9_-]{6,}\b/,
14737
+ // A long high-entropy hex/base64 run adjacent to a credential-ish word on the
14738
+ // same line — a raw key literal. Kept last (broadest, most likely false-drop).
14739
+ /\b(?:key|token|secret|credential)\b[\s\S]{0,40}[A-Za-z0-9+/_-]{32,}/i
14740
+ ];
14741
+ function looksLikeSecret(text) {
14742
+ for (const pattern of SECRET_SHAPE_PATTERNS) {
14743
+ if (pattern.test(text))
14744
+ return true;
14745
+ }
14746
+ return false;
14747
+ }
14748
+
14724
14749
  // dist/control-origin.js
14725
14750
  var DEFAULT_CONTROL_ORIGIN = "https://control.halfcycle.ai";
14726
14751
  function resolveControlOrigin(env) {
@@ -15169,8 +15194,16 @@ var stateRecordSchema = external_exports.discriminatedUnion("recordKind", [
15169
15194
  interventionRecordSchema
15170
15195
  ]);
15171
15196
 
15197
+ // ../events/dist/control-characters.js
15198
+ var CONTROL_CHARACTER_CLASS = "\\p{Cc}";
15199
+ var CONTROL_CHARACTER = new RegExp(CONTROL_CHARACTER_CLASS, "u");
15200
+ function hasControlCharacter(text) {
15201
+ return CONTROL_CHARACTER.test(text);
15202
+ }
15203
+
15172
15204
  // ../events/dist/phase-identity.js
15173
15205
  var PHASE_SEGMENT_PREFIX = "phase-";
15206
+ var PHASE_NAME_MAX_BYTES = 200;
15174
15207
  function isValidPhaseIdentity(identity) {
15175
15208
  if (typeof identity === "number")
15176
15209
  return Number.isInteger(identity) && identity >= 0;
@@ -15182,12 +15215,22 @@ function isValidPhaseIdentity(identity) {
15182
15215
  return false;
15183
15216
  if (identity.includes("\\"))
15184
15217
  return false;
15185
- if (identity.includes("\0"))
15186
- return false;
15187
15218
  if (identity.startsWith("."))
15188
15219
  return false;
15220
+ if (hasControlCharacter(identity))
15221
+ return false;
15222
+ if (utf8ByteLength(identity) > PHASE_NAME_MAX_BYTES)
15223
+ return false;
15189
15224
  return true;
15190
15225
  }
15226
+ function utf8ByteLength(text) {
15227
+ let bytes = 0;
15228
+ for (const ch of text) {
15229
+ const cp = ch.codePointAt(0);
15230
+ bytes += cp < 128 ? 1 : cp < 2048 ? 2 : cp < 65536 ? 3 : 4;
15231
+ }
15232
+ return bytes;
15233
+ }
15191
15234
  var InvalidPhaseIdentityError = class extends Error {
15192
15235
  /** The value that was refused, exactly as supplied. */
15193
15236
  identity;
@@ -15771,29 +15814,6 @@ function getWiringStatus(pathspecs, cwd) {
15771
15814
  }
15772
15815
 
15773
15816
  // dist/screen/secret-shape.js
15774
- var SECRET_SHAPE_PATTERNS = [
15775
- // Assignment to a credential-named identifier: `apiKey = "..."`, `secret: '...'`,
15776
- // `password=...`, `token = ...`, `access_key: ...` — the value need not be quoted.
15777
- /\b(?:api[_-]?key|secret|password|passwd|token|access[_-]?key|private[_-]?key|client[_-]?secret|auth[_-]?token|bearer)\b\s*[:=]\s*\S+/i,
15778
- // Connection strings that embed credentials: `scheme://user:pass@host`.
15779
- /\b[a-z][a-z0-9+.-]*:\/\/[^\s:/@]+:[^\s:/@]+@/i,
15780
- // Bearer / authorization header values.
15781
- /\bauthorization\b\s*[:=]\s*['"]?\s*bearer\s+\S+/i,
15782
- // PEM / private-key block headers.
15783
- /-----BEGIN\s+(?:RSA\s+|EC\s+|OPENSSH\s+|DSA\s+)?PRIVATE\s+KEY-----/,
15784
- // JWT shape: three base64url segments separated by dots.
15785
- /\beyJ[A-Za-z0-9_-]{6,}\.[A-Za-z0-9_-]{6,}\.[A-Za-z0-9_-]{6,}\b/,
15786
- // A long high-entropy hex/base64 run adjacent to a credential-ish word on the
15787
- // same line — a raw key literal. Kept last (broadest, most likely false-drop).
15788
- /\b(?:key|token|secret|credential)\b[\s\S]{0,40}[A-Za-z0-9+/_-]{32,}/i
15789
- ];
15790
- function looksLikeSecret(text) {
15791
- for (const pattern of SECRET_SHAPE_PATTERNS) {
15792
- if (pattern.test(text))
15793
- return true;
15794
- }
15795
- return false;
15796
- }
15797
15817
  function screenExcerpts(excerpts) {
15798
15818
  return excerpts.filter((e) => !looksLikeSecret(e.text));
15799
15819
  }
package/dist/bin.d.ts CHANGED
@@ -8,7 +8,7 @@
8
8
  * Subcommands:
9
9
  * halfcycle [install] [target-repo] — install into target (default: cwd)
10
10
  * halfcycle check-drift <target> — report bundle drift for the re-sync gate
11
- * halfcycle build-record <phase> — assemble the phase Build Record (D1)
11
+ * halfcycle build-record <phase> — fetch a closed phase's Build Record and write it
12
12
  * halfcycle open-phase <phase> — open a phase, with its entry decision
13
13
  * halfcycle close-phase <phase> — record a phase's acceptance and close it
14
14
  * halfcycle uninstall [--remove-credential] — take back what the installer wrote here