@ngockhoale/ukit 3.4.41 → 3.4.42

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.
package/CHANGELOG.md CHANGED
@@ -9,6 +9,13 @@ All notable changes to UKit are documented here.
9
9
  - New `/ukit:ci-check` command + `ci-check.mjs` helper (core pack): prechecks, fail-closed budget guard, local preflight, at most one dispatch per invocation, write-ahead run-id state, `status` (never dispatches), `--ref`, `--dry-run`, per-OS report. Never pushes, merges or publishes.
10
10
  - Default-branch bootstrap stub documented in `docs/design/CI-CROSS-PLATFORM-MATRIX.md` (requires separate approval).
11
11
 
12
+ ## 3.4.42 - 2026-10-13
13
+
14
+ **Completion Gate: `cd <repo>; <command>` is a checked command, so a finished release is recognized by the live Stop hook.**
15
+ - Live root cause (3.4.40/3.4.41 still blocked): agents run every Bash call as `cd <repo>; <cmd>`. The receipt classifier treated that `;` as shell masking, so `npm view`, `git ls-remote` and `git status --porcelain` minted no release/remote/clean-tree proof and Stop kept reporting `operation-verification, release-publication`. The runtime mirrors were byte-identical to the template; the evaluator was correct, the receipts never existed.
16
+ - Fix (`cron-operation-adapter.mjs`): exactly one leading `cd <dir>` followed by `;`/`&&` is dropped before classification (it prints nothing; the exit status is the next command's). Any other `;`, `||`, pipe, `echo $?` or second `cd` still masks, mints no proof, and cannot produce a false ACCEPT. A masked `npm publish > log; echo $?` still mints no publish receipt; release completion never required one: registry view == package.json version plus a tag that dereferences to HEAD plus live remote parity is the proof, so an immutable version is never republished to manufacture a receipt.
17
+ - Regressions: `tests/hooks/stopHookRelease.test.js` drives the real router, record and Stop hooks (bare, `cd ;`, `cd &&`; BLOCK then ACCEPT; wrong version, remote divergence, wrong tag, dirty tree, masked compounds, other session, runtime/template parity) and the adapter command shapes. Against the 3.4.41 adapter five of them fail.
18
+
12
19
  ## 3.4.41 - 2026-10-13
13
20
 
14
21
  **Completion Gate: a published release is recognized, and tests no longer depend on the developer's real `~/.ukit`.**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ngockhoale/ukit",
3
- "version": "3.4.41",
3
+ "version": "3.4.42",
4
4
  "description": "Install/update an index-first AI workspace for Claude Code, OpenAI Codex and omp (Oh My Pi).",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -57,12 +57,20 @@ const SERVICE_MUTATION = /^(?:docker(?:\s+compose)?|docker-compose)\s+(?:restart
57
57
  const GIT_LS_REMOTE = /^git\s+ls-remote\s+(\S+)\s+(refs\/heads\/\S+)\s*$/;
58
58
  const DRY_RUN = /(?:^|\s)(?:--dry-run|--check|--no-act|-n)(?:\s|=|$)/;
59
59
  const CURL = /^curl\s/;
60
+ // A leading `cd <dir>;` / `cd <dir> &&` only selects the working directory: it prints nothing and the shell's
61
+ // exit status is the next command's, so it must not turn an otherwise single, checked command into a "masked"
62
+ // compound. Only ONE leading cd is dropped; any other `;`, `||`, pipe or extra segment still masks.
63
+ const LEADING_CD = /^\s*cd\s+(?:"[^"\n]*"|'[^'\n]*'|[^\s;&|<>$`()]+)\s*(?:;|&&)\s*(?=\S)/;
64
+ export function stripLeadingCd(command) {
65
+ return typeof command === 'string' ? command.replace(LEADING_CD, '') : command;
66
+ }
60
67
  function requiredTargetOf(segment, required) {
61
68
  if (!required.length) return null;
62
69
  const tokens = segment.split(/\s+/);
63
70
  return required.find((name) => tokens.some((tok) => tok === name || tok.endsWith(`/${name}`))) || '(other)';
64
71
  }
65
- export function bashOperationReceipt(command, response, transportSuccess, goal, { sessionId, harness } = {}) {
72
+ export function bashOperationReceipt(rawCommand, response, transportSuccess, goal, { sessionId, harness } = {}) {
73
+ const command = stripLeadingCd(rawCommand);
66
74
  const domain = goal?.domain;
67
75
  const scope = typeof sessionId === 'string' && sessionId.trim() ? `session:${sessionId.trim()}` : null;
68
76
  if (!['git-integrity', 'service-runtime'].includes(domain) || typeof command !== 'string') return null;
@@ -134,8 +142,9 @@ export function bashOperationReceipt(command, response, transportSuccess, goal,
134
142
  const NPM_PUBLISH = /^npm\s+publish(?:\s|$)/;
135
143
  const NPM_VIEW = /^npm\s+view\s+(\S+?)(?:@\S+)?\s+version(?:\s+2>&1)?\s*$/;
136
144
  const SEMVER_LINE = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/;
137
- export function releaseReceipt(command, response, transportSuccess) {
138
- if (typeof command !== 'string') return null;
145
+ export function releaseReceipt(rawCommand, response, transportSuccess) {
146
+ if (typeof rawCommand !== 'string') return null;
147
+ const command = stripLeadingCd(rawCommand);
139
148
  const masked = /;|\n|\|/.test(command.replace(/'[^']*'|"[^"]*"/g, '""'));
140
149
  const segments = command.split('&&').map((seg) => seg.trim()).filter((seg) => seg && !/^cd\s+\S+$/.test(seg));
141
150
  if (segments.length !== 1) return null;