@skillcap/gdh 0.26.2 → 0.26.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.
Files changed (27) hide show
  1. package/INSTALL-BUNDLE.json +1 -1
  2. package/RELEASE-SPAN-UPDATE-CONTRACTS.json +58 -0
  3. package/node_modules/@gdh/adapters/dist/authoring-hook-render.d.ts +13 -0
  4. package/node_modules/@gdh/adapters/dist/authoring-hook-render.d.ts.map +1 -1
  5. package/node_modules/@gdh/adapters/dist/authoring-hook-render.js +1 -0
  6. package/node_modules/@gdh/adapters/dist/authoring-hook-render.js.map +1 -1
  7. package/node_modules/@gdh/adapters/dist/authoring-hook-state-path.d.ts +17 -0
  8. package/node_modules/@gdh/adapters/dist/authoring-hook-state-path.d.ts.map +1 -0
  9. package/node_modules/@gdh/adapters/dist/authoring-hook-state-path.js +23 -0
  10. package/node_modules/@gdh/adapters/dist/authoring-hook-state-path.js.map +1 -0
  11. package/node_modules/@gdh/adapters/dist/index.d.ts.map +1 -1
  12. package/node_modules/@gdh/adapters/dist/index.js +36 -0
  13. package/node_modules/@gdh/adapters/dist/index.js.map +1 -1
  14. package/node_modules/@gdh/adapters/dist/templates/authoring-hook.js.tpl +332 -88
  15. package/node_modules/@gdh/adapters/package.json +8 -8
  16. package/node_modules/@gdh/authoring/package.json +2 -2
  17. package/node_modules/@gdh/cli/package.json +10 -10
  18. package/node_modules/@gdh/core/dist/index.d.ts +1 -1
  19. package/node_modules/@gdh/core/dist/index.js +1 -1
  20. package/node_modules/@gdh/core/package.json +1 -1
  21. package/node_modules/@gdh/docs/package.json +2 -2
  22. package/node_modules/@gdh/mcp/package.json +8 -8
  23. package/node_modules/@gdh/observability/package.json +2 -2
  24. package/node_modules/@gdh/runtime/package.json +2 -2
  25. package/node_modules/@gdh/scan/package.json +3 -3
  26. package/node_modules/@gdh/verify/package.json +7 -7
  27. package/package.json +11 -11
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "product": "GDH",
3
- "version": "0.26.2",
3
+ "version": "0.26.3",
4
4
  "installMode": "packaged_install"
5
5
  }
@@ -3061,6 +3061,64 @@
3061
3061
  }
3062
3062
  ]
3063
3063
  }
3064
+ },
3065
+ {
3066
+ "version": "0.26.3",
3067
+ "releaseTag": "v0.26.3",
3068
+ "migrationStatus": "required",
3069
+ "summary": "v0.26.3 bumps GDH_UPDATE_HOOK_VERSION 11 -> 12 to land the embedded broker-snapshot reader in the managed authoring-hook.js. handlePostEdit, handlePostToolBatch, and handleStop now read .gdh-state/authoring/lsp-instance.json + diagnostics-broker/snapshot.json directly instead of shelling out to `npx -y @skillcap/gdh@PINNED authoring check` synchronously, eliminating the ~9.32 s npx bootstrap tax that was making every hook event time out at the 2500 ms default budget. Detached warmup spawn still uses npx (fire-and-forget). Class-1 deterministic re-bake (D-09 / D-03 exempt — GDH_UPDATE_HOOK_VERSION is in CLASS_ONE_REBAKE_EXEMPT). Managed targets re-bake via gdh self-update or gdh migrate --apply. No surface-schema changes; no AGENTS.md contract bump; no broker schema bump.",
3070
+ "releaseHighlights": {
3071
+ "summary": "v0.26.3 is a patch release that eliminates the per-edit `npx` tax in the managed authoring hook. Dogfooding on monorepo targets measured `npx -y @skillcap/gdh@0.25.5 --version` alone at ~9.32 s on cold cache; the hook's default check budget is 2500 ms (env-cap 10 000 ms), so every PostToolUse, PostToolBatch, and Stop event timed out before GDH could produce diagnostics. The hook now embeds the broker-snapshot fast-path read directly — `<integrationRoot>/.gdh-state/authoring/lsp-instance.json` + `diagnostics-broker/snapshot.json` are read in the hook process (sub-100 ms warm), validated against `lspInstanceId` and utf8 SHA-256 `contentHash`, and rendered into the same bracketed-token vocabulary the existing dispatch consumes.",
3072
+ "operatorChanges": [
3073
+ "**Embedded broker-snapshot reader on the hot path.** `handlePostEdit`, `handlePostToolBatch`, and `handleStop` now route through a shared `runEmbeddedDiagnosticsRead(stateRoot, changedFiles)` helper rendered into the hook template. The synchronous `runGdh(['authoring','check',...])` call site (and its `npx -y @skillcap/gdh@PINNED` shellout) is deleted.",
3074
+ "**Detached warmup spawn unchanged.** `spawnDetachedWarmup` still uses `child_process.spawn('npx', ['-y', '@skillcap/gdh@PINNED', 'lsp', 'warmup', ...])` because it is fire-and-forget (`detached: true`, `stdio: 'ignore'`, `.unref()`); the npx tax there does not block hook return. Eliminating it is future work.",
3075
+ "**New render-time input `stateRelativePathFromHook`.** Computed at install-plan time per call site so monorepo nesting works: a hook installed at `<root>/.codex/hooks/gdh-authoring-guard.js` and a hook installed at `<root>/apps/game/.claude/hooks/gdh-authoring-guard.js` both resolve to the same `<integrationRoot>/.gdh-state/` at runtime via `path.resolve(__dirname, STATE_RELATIVE_PATH_FROM_HOOK)`.",
3076
+ "**Stop hook contract relaxation.** Stop no longer synchronously launches Godot via `gdh authoring check --mode final`. When the broker is cold (no `lsp-instance.json` / no `snapshot.json`), Stop returns `additionalContext` recommending `gdh authoring check --mode final` manually and spawns detached warmup so the next session benefits. The never-block invariant from Phase 82 / LSP-03 is preserved; the existing `hasAuthoringWorkInTarget` (GF3) git-gate noop is preserved. RFC 0009 carries an addendum recording the relaxation.",
3077
+ "**`GDH_UPDATE_HOOK_VERSION` 11 → 12.** Forces deterministic re-bake on the existing class-1 deterministic surface mechanism. No agentContract bump, no `MIGRATION_REGISTRY_ENTRIES` entry, no schema change."
3078
+ ]
3079
+ },
3080
+ "updateContract": {
3081
+ "summary": "Managed targets must re-bake the managed authoring-hook.js so the embedded broker-snapshot reader replaces the synchronous npx shellout in PostEdit / PostToolBatch / Stop. Re-render is deterministic; no manual editor steps. Operators see the largest behavior delta as wallclock — every authoring-file edit's hook event returns sub-100 ms warm instead of timing out after 2500 ms. Stop hook contract relaxes intentionally: cold-broker Stop now reports a recommendation and spawns warmup rather than synchronously launching Godot.",
3082
+ "steps": [
3083
+ {
3084
+ "id": "install_v0_26_3",
3085
+ "kind": "mechanical",
3086
+ "summary": "Install the v0.26.3 GDH package.",
3087
+ "detail": "Run gdh self-update so the target uses the new managed authoring-hook.js fingerprint (hook version 12) with the embedded broker-snapshot reader.",
3088
+ "commands": [
3089
+ "gdh self-update --apply"
3090
+ ],
3091
+ "validationCommands": [
3092
+ "gdh status",
3093
+ "gdh adapters status"
3094
+ ]
3095
+ },
3096
+ {
3097
+ "id": "rebake_authoring_hook",
3098
+ "kind": "mechanical",
3099
+ "summary": "Re-bake managed authoring-hook.js via gdh migrate --apply.",
3100
+ "detail": "If gdh self-update reports pending lifecycle work, run gdh migrate --apply. The migrate path re-renders the managed Codex authoring hook and the Claude authoring hook templates with hook version 12 and the new STATE_RELATIVE_PATH_FROM_HOOK constant baked per install location. The new behavior is opaque to AGENTS.md contract surfaces, settings, and skill bodies; no other re-bake required for this release.",
3101
+ "commands": [
3102
+ "gdh migrate --apply"
3103
+ ],
3104
+ "validationCommands": [
3105
+ "gdh adapters status"
3106
+ ]
3107
+ },
3108
+ {
3109
+ "id": "confirm_embedded_reader",
3110
+ "kind": "agent_reasoning",
3111
+ "summary": "Confirm the embedded broker-snapshot reader is active and the npx tax is gone.",
3112
+ "detail": "Inspect the rendered authoring-hook.js header for `gdh-hook-version: 12` and confirm `STATE_RELATIVE_PATH_FROM_HOOK` and `runEmbeddedDiagnosticsRead` (or equivalent symbol) appear in the script. Optionally exercise: edit a `.gd` file in the configured Godot target; the PostToolUse hook should return within ~100 ms once warmup has primed the broker (first edit is bound by warmup latency, subsequent edits read directly). Cold-broker Stop should report `broker not yet primed; run gdh authoring check --mode final manually` rather than synchronously launching Godot.",
3113
+ "commands": [
3114
+ "gdh adapters status"
3115
+ ],
3116
+ "validationCommands": [
3117
+ "gdh adapters status"
3118
+ ]
3119
+ }
3120
+ ]
3121
+ }
3064
3122
  }
3065
3123
  ]
3066
3124
  }
@@ -6,5 +6,18 @@ export declare function renderGdhAuthoringHook(input: {
6
6
  readonly pinnedVersion: string;
7
7
  readonly targetRelativePath: string;
8
8
  readonly agent: "codex" | "claude";
9
+ /**
10
+ * POSIX-normalised relative path from the directory containing the rendered
11
+ * hook (`__dirname` at runtime) to the integration root's `.gdh-state/`
12
+ * directory. The hook's embedded broker-snapshot reader resolves
13
+ * `path.resolve(__dirname, STATE_RELATIVE_PATH_FROM_HOOK)` to find the
14
+ * authoring state files (`lsp-instance.json`,
15
+ * `diagnostics-broker/snapshot.json`).
16
+ *
17
+ * Computed at install-plan time as
18
+ * `path.relative(hookDirAbsolute, path.join(integrationRootAbsolute, ".gdh-state"))`
19
+ * with separators converted to `/`.
20
+ */
21
+ readonly stateRelativePathFromHook: string;
9
22
  }): string;
10
23
  //# sourceMappingURL=authoring-hook-render.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"authoring-hook-render.d.ts","sourceRoot":"","sources":["../src/authoring-hook-render.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,mCAAmC,yCAAyC,CAAC;AAC1F,eAAO,MAAM,kCAAkC,wCAAwC,CAAC;AACxF,eAAO,MAAM,6BAA6B,uRAC4O,CAAC;AACvR,eAAO,MAAM,4BAA4B,qRAC2O,CAAC;AAErR,wBAAgB,sBAAsB,CAAC,KAAK,EAAE;IAC5C,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,CAAC;CACpC,GAAG,MAAM,CAOT"}
1
+ {"version":3,"file":"authoring-hook-render.d.ts","sourceRoot":"","sources":["../src/authoring-hook-render.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,mCAAmC,yCAAyC,CAAC;AAC1F,eAAO,MAAM,kCAAkC,wCAAwC,CAAC;AACxF,eAAO,MAAM,6BAA6B,uRAC4O,CAAC;AACvR,eAAO,MAAM,4BAA4B,qRAC2O,CAAC;AAErR,wBAAgB,sBAAsB,CAAC,KAAK,EAAE;IAC5C,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,CAAC;IACnC;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,yBAAyB,EAAE,MAAM,CAAC;CAC5C,GAAG,MAAM,CAQT"}
@@ -11,6 +11,7 @@ export function renderGdhAuthoringHook(input) {
11
11
  pinnedVersionJson: JSON.stringify(input.pinnedVersion),
12
12
  targetRelativePathJson: JSON.stringify(input.targetRelativePath),
13
13
  agentJson: JSON.stringify(input.agent),
14
+ stateRelativePathFromHookJson: JSON.stringify(input.stateRelativePathFromHook),
14
15
  });
15
16
  }
16
17
  //# sourceMappingURL=authoring-hook-render.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"authoring-hook-render.js","sourceRoot":"","sources":["../src/authoring-hook-render.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAE3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,qBAAqB,CAAC,gBAAgB,EAAE,eAAe,CAAC,CAAC;AAEzD,MAAM,CAAC,MAAM,mCAAmC,GAAG,sCAAsC,CAAC;AAC1F,MAAM,CAAC,MAAM,kCAAkC,GAAG,qCAAqC,CAAC;AACxF,MAAM,CAAC,MAAM,6BAA6B,GACxC,oRAAoR,CAAC;AACvR,MAAM,CAAC,MAAM,4BAA4B,GACvC,kRAAkR,CAAC;AAErR,MAAM,UAAU,sBAAsB,CAAC,KAItC;IACC,OAAO,qBAAqB,CAAC,uBAAuB,EAAE;QACpD,WAAW,EAAE,MAAM,CAAC,uBAAuB,CAAC;QAC5C,iBAAiB,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,aAAa,CAAC;QACtD,sBAAsB,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,kBAAkB,CAAC;QAChE,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC;KACvC,CAAC,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"authoring-hook-render.js","sourceRoot":"","sources":["../src/authoring-hook-render.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAE3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,qBAAqB,CAAC,gBAAgB,EAAE,eAAe,CAAC,CAAC;AAEzD,MAAM,CAAC,MAAM,mCAAmC,GAAG,sCAAsC,CAAC;AAC1F,MAAM,CAAC,MAAM,kCAAkC,GAAG,qCAAqC,CAAC;AACxF,MAAM,CAAC,MAAM,6BAA6B,GACxC,oRAAoR,CAAC;AACvR,MAAM,CAAC,MAAM,4BAA4B,GACvC,kRAAkR,CAAC;AAErR,MAAM,UAAU,sBAAsB,CAAC,KAiBtC;IACC,OAAO,qBAAqB,CAAC,uBAAuB,EAAE;QACpD,WAAW,EAAE,MAAM,CAAC,uBAAuB,CAAC;QAC5C,iBAAiB,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,aAAa,CAAC;QACtD,sBAAsB,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,kBAAkB,CAAC;QAChE,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC;QACtC,6BAA6B,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,yBAAyB,CAAC;KAC/E,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Compute the POSIX-normalised relative path from the directory of an installed
3
+ * authoring hook to the integration root's `.gdh-state/` directory. Used to
4
+ * bake `STATE_RELATIVE_PATH_FROM_HOOK` into the rendered hook so its embedded
5
+ * broker-snapshot reader can resolve `path.resolve(__dirname, …)` to the state
6
+ * files at runtime regardless of `process.cwd()`.
7
+ *
8
+ * @param installRoot Absolute directory at which the hook file's relative path
9
+ * is anchored (Codex install: `integrationRootPath`; Claude same-repo target
10
+ * install: `targetPath`).
11
+ * @param hookRelativePath Hook path relative to `installRoot` (e.g.
12
+ * `.codex/hooks/gdh-authoring-guard.js`).
13
+ * @param integrationRootAbsolute Absolute integration-root path containing the
14
+ * shared `.gdh-state/` directory.
15
+ */
16
+ export declare function computeStateRelativePathFromHook(installRoot: string, hookRelativePath: string, integrationRootAbsolute: string): string;
17
+ //# sourceMappingURL=authoring-hook-state-path.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authoring-hook-state-path.d.ts","sourceRoot":"","sources":["../src/authoring-hook-state-path.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gCAAgC,CAC9C,WAAW,EAAE,MAAM,EACnB,gBAAgB,EAAE,MAAM,EACxB,uBAAuB,EAAE,MAAM,GAC9B,MAAM,CAKR"}
@@ -0,0 +1,23 @@
1
+ import path from "node:path";
2
+ /**
3
+ * Compute the POSIX-normalised relative path from the directory of an installed
4
+ * authoring hook to the integration root's `.gdh-state/` directory. Used to
5
+ * bake `STATE_RELATIVE_PATH_FROM_HOOK` into the rendered hook so its embedded
6
+ * broker-snapshot reader can resolve `path.resolve(__dirname, …)` to the state
7
+ * files at runtime regardless of `process.cwd()`.
8
+ *
9
+ * @param installRoot Absolute directory at which the hook file's relative path
10
+ * is anchored (Codex install: `integrationRootPath`; Claude same-repo target
11
+ * install: `targetPath`).
12
+ * @param hookRelativePath Hook path relative to `installRoot` (e.g.
13
+ * `.codex/hooks/gdh-authoring-guard.js`).
14
+ * @param integrationRootAbsolute Absolute integration-root path containing the
15
+ * shared `.gdh-state/` directory.
16
+ */
17
+ export function computeStateRelativePathFromHook(installRoot, hookRelativePath, integrationRootAbsolute) {
18
+ const stateAbsolute = path.join(integrationRootAbsolute, ".gdh-state");
19
+ const hookDirAbsolute = path.dirname(path.join(installRoot, hookRelativePath));
20
+ const relative = path.relative(hookDirAbsolute, stateAbsolute) || ".";
21
+ return relative.split(path.sep).join("/");
22
+ }
23
+ //# sourceMappingURL=authoring-hook-state-path.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authoring-hook-state-path.js","sourceRoot":"","sources":["../src/authoring-hook-state-path.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,gCAAgC,CAC9C,WAAmB,EACnB,gBAAwB,EACxB,uBAA+B;IAE/B,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,uBAAuB,EAAE,YAAY,CAAC,CAAC;IACvE,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAC/E,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,eAAe,EAAE,aAAa,CAAC,IAAI,GAAG,CAAC;IACtE,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC5C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAgBA,OAAO,EAeL,KAAK,6BAA6B,EAClC,KAAK,4BAA4B,EACjC,KAAK,cAAc,EAInB,KAAK,sCAAsC,EAE3C,KAAK,gCAAgC,EAKrC,KAAK,eAAe,EACpB,KAAK,iBAAiB,EAIvB,MAAM,WAAW,CAAC;AAyBnB,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,gCAAgC,CAAC;AAyCxC,OAAO,EACL,8BAA8B,EAC9B,qBAAqB,EACrB,aAAa,EACb,cAAc,EACd,wBAAwB,EACxB,wBAAwB,EACxB,wBAAwB,EACxB,wBAAwB,EACxB,wBAAwB,EACxB,qBAAqB,EACrB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB,EACpB,sBAAsB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BAAiB,GAClB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,6BAA6B,EAC7B,oBAAoB,EACpB,4BAA4B,EAC5B,uBAAuB,EACvB,8BAA8B,EAC9B,kBAAkB,EAClB,wBAAwB,EACxB,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,qBAAqB,EACrB,iBAAiB,EACjB,oBAAoB,EACpB,yBAAyB,EACzB,2BAA2B,EAC3B,yBAAyB,EACzB,yBAAyB,EACzB,0BAA0B,EAC1B,iCAAiC,EACjC,0BAA0B,EAC1B,2BAA2B,EAC3B,4BAA4B,GAC7B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,8BAA8B,GAC/B,MAAM,gCAAgC,CAAC;AACxC,YAAY,EACV,iBAAiB,EACjB,4BAA4B,EAC5B,gCAAgC,EAChC,sBAAsB,GACvB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,gCAAgC,EAChC,gCAAgC,EAChC,oCAAoC,EACpC,sBAAsB,EACtB,sCAAsC,EACtC,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,4BAA4B,CAAC;AACpC,YAAY,EACV,+BAA+B,EAC/B,0BAA0B,EAC1B,uBAAuB,EACvB,kCAAkC,EAClC,+BAA+B,EAC/B,mBAAmB,EACnB,4BAA4B,EAC5B,eAAe,EACf,8BAA8B,EAC9B,+BAA+B,GAChC,MAAM,4BAA4B,CAAC;AAMpC,OAAO,EAAE,sCAAsC,EAAE,CAAC;AAElD;;;;;GAKG;AACH,eAAO,MAAM,WAAW;;;CAGvB,CAAC"}
@@ -13,6 +13,7 @@ import { readInventoryCacheOrScan } from "@gdh/scan";
13
13
  import { CLAUDE_SETTINGS_RELATIVE_PATH, patchClaudeSettingsForGdhAuthoringHooks, patchClaudeSettingsForGdhSessionStart, patchClaudeSettingsForGdhStatusline, } from "./claude-settings-patch.js";
14
14
  import { computeDeferredActionsAdvisory, } from "./deferred-actions-advisory.js";
15
15
  import { CLAUDE_AUTHORING_HOOK_RELATIVE_PATH, CODEX_AUTHORING_HOOK_COMMAND, CODEX_AUTHORING_HOOK_RELATIVE_PATH, renderGdhAuthoringHook, } from "./authoring-hook-render.js";
16
+ import { computeStateRelativePathFromHook } from "./authoring-hook-state-path.js";
16
17
  import { CLAUDE_STATUSLINE_RELATIVE_PATH, renderClaudeUpdateStatusline, } from "./claude-statusline-render.js";
17
18
  import { CLAUDE_CHECK_UPDATE_HOOK_RELATIVE_PATH, CLAUDE_CHECK_UPDATE_WORKER_RELATIVE_PATH, renderClaudeCheckUpdateHook, } from "./claude-update-hook-render.js";
18
19
  import { renderClaudeCheckUpdateWorker } from "./claude-update-worker-render.js";
@@ -852,6 +853,7 @@ async function inspectCodexAdapter(targetPath, guidance, projectMcp, pinnedVersi
852
853
  pinnedVersion,
853
854
  targetRelativePath: path.relative(projectMcp.integrationRootPath, targetPath) || ".",
854
855
  agent: "codex",
856
+ stateRelativePathFromHook: computeStateRelativePathFromHook(projectMcp.integrationRootPath, CODEX_AUTHORING_HOOK_RELATIVE_PATH, projectMcp.integrationRootPath),
855
857
  });
856
858
  const surfaces = [
857
859
  createSurfaceStatus({
@@ -983,6 +985,10 @@ async function inspectClaudeAdapter(targetPath, guidance, projectMcp, pinnedVers
983
985
  pinnedVersion,
984
986
  targetRelativePath: ".",
985
987
  agent: "claude",
988
+ // inspectClaudeAdapter previews the same-repo install: hook lives at
989
+ // `<targetPath>/.claude/hooks/gdh-authoring-guard.js`; state lives at
990
+ // `<targetPath>/.gdh-state/`. Compute the relative from the hook dir.
991
+ stateRelativePathFromHook: computeStateRelativePathFromHook(targetPath, CLAUDE_AUTHORING_HOOK_RELATIVE_PATH, targetPath),
986
992
  });
987
993
  const expectedClaudeStatusCommand = pinnedVersion === null ? null : renderClaudeStatusCommand(pinnedVersion);
988
994
  const expectedClaudeMigrateCommand = pinnedVersion === null ? null : renderClaudeMigrateCommand(pinnedVersion);
@@ -1398,6 +1404,21 @@ function planSharedRepoInstallActions(targetPath, projectMcp, agent, effectiveDe
1398
1404
  }
1399
1405
  return actions;
1400
1406
  }
1407
+ /**
1408
+ * Compute the POSIX-normalised relative path from the directory of an installed
1409
+ * authoring hook to the integration root's `.gdh-state/` directory. Used to
1410
+ * bake `STATE_RELATIVE_PATH_FROM_HOOK` into the rendered hook so its embedded
1411
+ * broker-snapshot reader can resolve `path.resolve(__dirname, …)` to the state
1412
+ * files at runtime regardless of `process.cwd()`.
1413
+ *
1414
+ * @param installRoot Absolute directory at which the hook file's relative path
1415
+ * is anchored (Codex install: `integrationRootPath`; Claude same-repo target
1416
+ * install: `targetPath`).
1417
+ * @param hookRelativePath Hook path relative to `installRoot` (e.g.
1418
+ * `.codex/hooks/gdh-authoring-guard.js`).
1419
+ * @param integrationRootAbsolute Absolute integration-root path containing the
1420
+ * shared `.gdh-state/` directory.
1421
+ */
1401
1422
  function planSkillInstallAction(agent, targetPath, adapter, relativePath, renderFn, skillName, pinnedVersion) {
1402
1423
  const surface = adapter.surfaces.find((s) => s.relativePath === relativePath);
1403
1424
  if (!surface || surface.state === "ready") {
@@ -1508,6 +1529,9 @@ function planCodexRepoInstallActions(targetPath, adapter, pinnedVersion, project
1508
1529
  pinnedVersion: version,
1509
1530
  targetRelativePath: path.relative(integrationRootPath, targetPath) || ".",
1510
1531
  agent: "codex",
1532
+ // Codex install-action: hook installed at integrationRootPath; state
1533
+ // root lives at integrationRootPath/.gdh-state.
1534
+ stateRelativePathFromHook: computeStateRelativePathFromHook(integrationRootPath, CODEX_AUTHORING_HOOK_RELATIVE_PATH, integrationRootPath),
1511
1535
  }), "authoring guard", pinnedVersion),
1512
1536
  ];
1513
1537
  if (projectMcp.enabled && projectMcp.codexProjectFile.state !== "ready") {
@@ -1812,6 +1836,14 @@ function planClaudeInstallActions(targetPath, adapter, pinnedVersion, integratio
1812
1836
  pinnedVersion: version,
1813
1837
  targetRelativePath: ".",
1814
1838
  agent: "claude",
1839
+ // Claude install-action target install: hook lives at
1840
+ // `<targetPath>/.claude/hooks/...`; state root lives at
1841
+ // `<integrationRootPath>/.gdh-state/`. In the same-repo case,
1842
+ // integrationRootPath equals targetPath; in the monorepo nested-target
1843
+ // case (where this same hook is also installed at the target alongside
1844
+ // a separate root-launched hook from site #5), the state remains at
1845
+ // integrationRootPath/.gdh-state, so use integrationRootPath here.
1846
+ stateRelativePathFromHook: computeStateRelativePathFromHook(targetPath, CLAUDE_AUTHORING_HOOK_RELATIVE_PATH, integrationRootPath),
1815
1847
  }), "authoring guard", pinnedVersion));
1816
1848
  if (path.resolve(integrationRootPath) !== path.resolve(targetPath)) {
1817
1849
  const rootTargetRelativePath = path.relative(integrationRootPath, targetPath) || ".";
@@ -1831,6 +1863,10 @@ function planClaudeInstallActions(targetPath, adapter, pinnedVersion, integratio
1831
1863
  pinnedVersion,
1832
1864
  targetRelativePath: rootTargetRelativePath,
1833
1865
  agent: "claude",
1866
+ // Root-launched Claude install in monorepo nested-target case: hook
1867
+ // lives at `<integrationRootPath>/.claude/hooks/...`; state lives at
1868
+ // `<integrationRootPath>/.gdh-state/`.
1869
+ stateRelativePathFromHook: computeStateRelativePathFromHook(integrationRootPath, CLAUDE_AUTHORING_HOOK_RELATIVE_PATH, integrationRootPath),
1834
1870
  }),
1835
1871
  readySummary: "Root-launched Claude authoring hook already matches the managed target-scoped hook.",
1836
1872
  createSummary: "Create the root-launched Claude authoring hook with target-scoped filtering.",