cleargate 0.11.1 → 0.11.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,20 @@
3
3
  All notable changes to this project are documented in this file.
4
4
  Format: [Common Changelog](https://common-changelog.org/) — most-recent version first.
5
5
 
6
+ ## [0.11.3] — 2026-05-05
7
+
8
+ Hotfix.
9
+
10
+ ### Fixed
11
+ - **`cleargate upgrade` no longer strips the executable bit from `.sh` hook scripts** — `cleargate-cli/src/commands/upgrade.ts` `writeAtomic()` now `chmod 0o755` after writing any `.sh` target. `fs.writeFile` defaults to 0o644; init solved this in `copy-payload.ts` (BUG-018) but upgrade's write path bypassed that fix. Result: every Claude Code hook in target repos failed with `Permission denied` after upgrade until manually re-chmod'd. Observed today on `markdown_file_renderer` after the SPRINT-02 PostToolUse:Edit hook fired.
12
+
13
+ ## [0.11.2] — 2026-05-05
14
+
15
+ Hotfix.
16
+
17
+ ### Fixed
18
+ - **`cleargate upgrade` and `cleargate init` now warn when session-loaded configs change** — `cleargate-cli/src/commands/upgrade.ts` tracks modifications to `.claude/settings.json` and `.mcp.json` during the run and prints a `⚠ Restart Claude Code in this repo` block at the end if either changed. `init.ts` adds the same "restart Claude Code if already open" suffix to its `Updated .claude/settings.json` log line (parallels the existing `.mcp.json` message). Without this, hook wiring + MCP-server changes silently fail to load until the user happens to restart their session — observed today when SPRINT-02 drafts in `markdown_file_renderer` did not trigger `stamp-and-gate.sh` after upgrade because the running session held a pre-upgrade settings snapshot.
19
+
6
20
  ## [0.11.1] — 2026-05-05
7
21
 
8
22
  Hotfix.
@@ -1,6 +1,6 @@
1
1
  {
2
- "cleargate_version": "0.11.1",
3
- "generated_at": "2026-05-04T22:23:50.738Z",
2
+ "cleargate_version": "0.11.3",
3
+ "generated_at": "2026-05-04T23:10:17.763Z",
4
4
  "files": [
5
5
  {
6
6
  "path": ".claude/agents/architect.md",
package/dist/cli.cjs CHANGED
@@ -696,7 +696,7 @@ var import_commander = require("commander");
696
696
  // package.json
697
697
  var package_default = {
698
698
  name: "cleargate",
699
- version: "0.11.1",
699
+ version: "0.11.3",
700
700
  private: false,
701
701
  type: "module",
702
702
  description: "Planning framework for Claude Code agents \u2014 sprint/epic/story protocol, five-role agent team (architect/developer/qa/devops/reporter), Karpathy-style awareness wiki.",
@@ -3353,7 +3353,7 @@ async function initHandler(opts = {}) {
3353
3353
  const mergedSettings = mergeSettings(existingSettings, HOOK_ADDITION);
3354
3354
  fs17.mkdirSync(path18.dirname(settingsPath), { recursive: true });
3355
3355
  writeAtomic(settingsPath, JSON.stringify(mergedSettings, null, 2) + "\n");
3356
- stdout(`[cleargate init] Updated .claude/settings.json: merged PostToolUse hook
3356
+ stdout(`[cleargate init] Updated .claude/settings.json: merged PostToolUse hook \u2014 restart Claude Code if already open.
3357
3357
  `);
3358
3358
  const claudeMdPath = path18.join(cwd, "CLAUDE.md");
3359
3359
  const claudeMdSrcPath = path18.join(payloadDir, "CLAUDE.md");
@@ -8934,6 +8934,9 @@ async function writeAtomic2(filePath, content) {
8934
8934
  const tmpPath = filePath + ".tmp." + Date.now();
8935
8935
  await fsp.writeFile(tmpPath, content, "utf-8");
8936
8936
  await fsp.rename(tmpPath, filePath);
8937
+ if (filePath.endsWith(".sh")) {
8938
+ await fsp.chmod(filePath, 493);
8939
+ }
8937
8940
  }
8938
8941
  async function updateSnapshotEntry(projectRoot, filePath, newSha) {
8939
8942
  const snapshotPath = path41.join(projectRoot, ".cleargate", ".install-manifest.json");
@@ -9164,6 +9167,8 @@ async function upgradeHandler(flags, cli) {
9164
9167
  }
9165
9168
  const packageRoot = cli?.packageRoot ?? cwd;
9166
9169
  const driftMap = {};
9170
+ const SESSION_LOAD_PATHS = /* @__PURE__ */ new Set([".claude/settings.json", ".mcp.json"]);
9171
+ const sessionRestartFiles = [];
9167
9172
  for (const item of workItems) {
9168
9173
  const { entry, currentSha, installSha, action } = item;
9169
9174
  switch (action) {
@@ -9196,9 +9201,19 @@ async function upgradeHandler(flags, cli) {
9196
9201
  current_sha: postSha,
9197
9202
  package_sha: entry.sha256
9198
9203
  };
9204
+ if (SESSION_LOAD_PATHS.has(entry.path) && postSha !== currentSha) {
9205
+ sessionRestartFiles.push(entry.path);
9206
+ }
9199
9207
  }
9200
9208
  await writeDriftState(cwd, driftMap, { lastRefreshed: now.toISOString() });
9201
9209
  stdout("[upgrade] complete.");
9210
+ if (sessionRestartFiles.length > 0) {
9211
+ stdout("");
9212
+ stdout(`\u26A0 Restart Claude Code in this repo to load the new ${sessionRestartFiles.length === 1 ? "config" : "configs"}:`);
9213
+ for (const f of sessionRestartFiles) {
9214
+ stdout(` ${f} (loaded once at session start)`);
9215
+ }
9216
+ }
9202
9217
  }
9203
9218
 
9204
9219
  // src/commands/uninstall.ts