@skillcap/gdh 2.0.1 → 3.0.0

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 (85) hide show
  1. package/INSTALL-BUNDLE.json +1 -1
  2. package/RELEASE-SPAN-UPDATE-CONTRACTS.json +56 -0
  3. package/node_modules/@gdh/adapters/dist/authoring-hook-render.d.ts +3 -18
  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 +11 -6
  6. package/node_modules/@gdh/adapters/dist/authoring-hook-render.js.map +1 -1
  7. package/node_modules/@gdh/adapters/dist/claude-settings-patch.d.ts +15 -3
  8. package/node_modules/@gdh/adapters/dist/claude-settings-patch.d.ts.map +1 -1
  9. package/node_modules/@gdh/adapters/dist/claude-settings-patch.js +14 -2
  10. package/node_modules/@gdh/adapters/dist/claude-settings-patch.js.map +1 -1
  11. package/node_modules/@gdh/adapters/dist/claude-statusline-render.d.ts +18 -9
  12. package/node_modules/@gdh/adapters/dist/claude-statusline-render.d.ts.map +1 -1
  13. package/node_modules/@gdh/adapters/dist/claude-statusline-render.js +18 -9
  14. package/node_modules/@gdh/adapters/dist/claude-statusline-render.js.map +1 -1
  15. package/node_modules/@gdh/adapters/dist/claude-update-hook-render.d.ts +8 -2
  16. package/node_modules/@gdh/adapters/dist/claude-update-hook-render.d.ts.map +1 -1
  17. package/node_modules/@gdh/adapters/dist/claude-update-hook-render.js +8 -2
  18. package/node_modules/@gdh/adapters/dist/claude-update-hook-render.js.map +1 -1
  19. package/node_modules/@gdh/adapters/dist/claude-update-worker-render.d.ts +2 -2
  20. package/node_modules/@gdh/adapters/dist/claude-update-worker-render.js +2 -2
  21. package/node_modules/@gdh/adapters/dist/index.d.ts +2 -5
  22. package/node_modules/@gdh/adapters/dist/index.d.ts.map +1 -1
  23. package/node_modules/@gdh/adapters/dist/index.js +10 -72
  24. package/node_modules/@gdh/adapters/dist/index.js.map +1 -1
  25. package/node_modules/@gdh/adapters/dist/templates/authoring-hook.js.tpl +49 -43
  26. package/node_modules/@gdh/adapters/package.json +8 -8
  27. package/node_modules/@gdh/authoring/dist/project.d.ts.map +1 -1
  28. package/node_modules/@gdh/authoring/dist/project.js +39 -12
  29. package/node_modules/@gdh/authoring/dist/project.js.map +1 -1
  30. package/node_modules/@gdh/authoring/package.json +2 -2
  31. package/node_modules/@gdh/cli/dist/index.d.ts.map +1 -1
  32. package/node_modules/@gdh/cli/dist/index.js +121 -80
  33. package/node_modules/@gdh/cli/dist/index.js.map +1 -1
  34. package/node_modules/@gdh/cli/dist/self-update.d.ts.map +1 -1
  35. package/node_modules/@gdh/cli/dist/self-update.js +62 -1
  36. package/node_modules/@gdh/cli/dist/self-update.js.map +1 -1
  37. package/node_modules/@gdh/cli/dist/setup.d.ts +7 -0
  38. package/node_modules/@gdh/cli/dist/setup.d.ts.map +1 -1
  39. package/node_modules/@gdh/cli/dist/setup.js +43 -11
  40. package/node_modules/@gdh/cli/dist/setup.js.map +1 -1
  41. package/node_modules/@gdh/cli/package.json +10 -10
  42. package/node_modules/@gdh/core/dist/git-root.d.ts +8 -0
  43. package/node_modules/@gdh/core/dist/git-root.d.ts.map +1 -0
  44. package/node_modules/@gdh/core/dist/git-root.js +39 -0
  45. package/node_modules/@gdh/core/dist/git-root.js.map +1 -0
  46. package/node_modules/@gdh/core/dist/index.d.ts +15 -18
  47. package/node_modules/@gdh/core/dist/index.d.ts.map +1 -1
  48. package/node_modules/@gdh/core/dist/index.js +13 -2
  49. package/node_modules/@gdh/core/dist/index.js.map +1 -1
  50. package/node_modules/@gdh/core/dist/migrations/entries/s3c21_to_s3c22_canonical_hook_paths.d.ts +3 -0
  51. package/node_modules/@gdh/core/dist/migrations/entries/s3c21_to_s3c22_canonical_hook_paths.d.ts.map +1 -0
  52. package/node_modules/@gdh/core/dist/migrations/entries/s3c21_to_s3c22_canonical_hook_paths.js +336 -0
  53. package/node_modules/@gdh/core/dist/migrations/entries/s3c21_to_s3c22_canonical_hook_paths.js.map +1 -0
  54. package/node_modules/@gdh/core/dist/migrations/managed-surface-classes.d.ts +13 -11
  55. package/node_modules/@gdh/core/dist/migrations/managed-surface-classes.d.ts.map +1 -1
  56. package/node_modules/@gdh/core/dist/migrations/managed-surface-classes.js +13 -11
  57. package/node_modules/@gdh/core/dist/migrations/managed-surface-classes.js.map +1 -1
  58. package/node_modules/@gdh/core/dist/migrations/registry.d.ts +1 -1
  59. package/node_modules/@gdh/core/dist/migrations/registry.d.ts.map +1 -1
  60. package/node_modules/@gdh/core/dist/migrations/registry.js +2 -0
  61. package/node_modules/@gdh/core/dist/migrations/registry.js.map +1 -1
  62. package/node_modules/@gdh/core/dist/state/codex-retrust-reminder.d.ts +40 -0
  63. package/node_modules/@gdh/core/dist/state/codex-retrust-reminder.d.ts.map +1 -0
  64. package/node_modules/@gdh/core/dist/state/codex-retrust-reminder.js +66 -0
  65. package/node_modules/@gdh/core/dist/state/codex-retrust-reminder.js.map +1 -0
  66. package/node_modules/@gdh/core/dist/state/migration-trace.d.ts +61 -0
  67. package/node_modules/@gdh/core/dist/state/migration-trace.d.ts.map +1 -0
  68. package/node_modules/@gdh/core/dist/state/migration-trace.js +103 -0
  69. package/node_modules/@gdh/core/dist/state/migration-trace.js.map +1 -0
  70. package/node_modules/@gdh/core/dist/update-probe.d.ts +1 -2
  71. package/node_modules/@gdh/core/dist/update-probe.d.ts.map +1 -1
  72. package/node_modules/@gdh/core/dist/update-probe.js +1 -2
  73. package/node_modules/@gdh/core/dist/update-probe.js.map +1 -1
  74. package/node_modules/@gdh/core/package.json +1 -1
  75. package/node_modules/@gdh/docs/package.json +2 -2
  76. package/node_modules/@gdh/mcp/package.json +8 -8
  77. package/node_modules/@gdh/observability/package.json +2 -2
  78. package/node_modules/@gdh/runtime/package.json +2 -2
  79. package/node_modules/@gdh/scan/package.json +3 -3
  80. package/node_modules/@gdh/verify/package.json +7 -7
  81. package/package.json +11 -11
  82. package/node_modules/@gdh/adapters/dist/authoring-hook-state-path.d.ts +0 -17
  83. package/node_modules/@gdh/adapters/dist/authoring-hook-state-path.d.ts.map +0 -1
  84. package/node_modules/@gdh/adapters/dist/authoring-hook-state-path.js +0 -23
  85. package/node_modules/@gdh/adapters/dist/authoring-hook-state-path.js.map +0 -1
@@ -12,8 +12,7 @@ import { inspectRuntimeBridgeBroker, inspectRuntimeBridgeSurface, inspectRuntime
12
12
  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
- import { CLAUDE_AUTHORING_HOOK_RELATIVE_PATH, CODEX_AUTHORING_HOOK_RELATIVE_PATH, renderGdhAuthoringHook, } from "./authoring-hook-render.js";
16
- import { computeStateRelativePathFromHook } from "./authoring-hook-state-path.js";
15
+ import { GDH_AUTHORING_HOOK_RELATIVE_PATH, renderGdhAuthoringHook, } from "./authoring-hook-render.js";
17
16
  import { removeManagedCodexAuthoringHookBlock, renderManagedCodexAuthoringHookBlock, } from "./codex-authoring-hook-block.js";
18
17
  import { CLAUDE_STATUSLINE_RELATIVE_PATH, renderClaudeUpdateStatusline, } from "./claude-statusline-render.js";
19
18
  import { CLAUDE_CHECK_UPDATE_HOOK_RELATIVE_PATH, CLAUDE_CHECK_UPDATE_WORKER_RELATIVE_PATH, renderClaudeCheckUpdateHook, } from "./claude-update-hook-render.js";
@@ -340,42 +339,6 @@ function summarizeRuntimeBridgeBrokerLifecycleForStatus(lifecycle) {
340
339
  }
341
340
  return "Runtime bridge broker state is unavailable; inspect with `gdh bridge session doctor`.";
342
341
  }
343
- export async function createGsdSnapshot(targetPath, options = {}) {
344
- const context = await buildAuthoringContext(targetPath);
345
- const effectiveRepoState = deriveRepoState(context);
346
- const files = normalizeChangedFiles(options.files ?? []);
347
- const guidance = await getGuidanceStatus(context.targetPath);
348
- const [audit, guidanceResolve] = await Promise.all([
349
- inspectGuidanceAudit(context.targetPath),
350
- resolveGuidanceQuery(context.targetPath, {
351
- taskTypes: ["authoring"],
352
- capabilities: context.status.effectiveCapabilities,
353
- repoState: effectiveRepoState,
354
- keywords: [],
355
- }),
356
- ]);
357
- const guidanceStatus = {
358
- targetPath: context.targetPath,
359
- projectConfigPresent: context.projectConfig !== null,
360
- authoringReadiness: context.status.readiness,
361
- effectiveRepoState,
362
- guidance,
363
- audit,
364
- };
365
- return {
366
- targetPath: context.targetPath,
367
- adapter: {
368
- adapter: "gsd",
369
- enabledByDefault: false,
370
- state: "disabled_by_default",
371
- summary: "The GSD bridge is an optional read-mostly adapter over stable GDH outputs and is not required for core GDH behavior.",
372
- },
373
- files,
374
- status: context.status,
375
- guidanceStatus,
376
- guidanceResolve,
377
- };
378
- }
379
342
  function normalizePortableRelativePath(relativePath) {
380
343
  const normalized = relativePath.split(path.sep).join("/");
381
344
  return normalized === "" ? "." : normalized.replace(/\/+$/, "");
@@ -643,7 +606,7 @@ function inspectCodexAuthoringHookConfig(targetPath, content, enabled) {
643
606
  const ready = content !== null &&
644
607
  /^\s*codex_hooks\s*=\s*true\s*$/m.test(content) &&
645
608
  content.includes("# BEGIN GDH managed authoring hooks") &&
646
- content.includes(CODEX_AUTHORING_HOOK_RELATIVE_PATH);
609
+ content.includes(GDH_AUTHORING_HOOK_RELATIVE_PATH);
647
610
  return createSurfaceStatus({
648
611
  kind: "hook_config",
649
612
  scope: "repo",
@@ -742,7 +705,7 @@ async function inspectCodexAdapter(targetPath, guidance, projectMcp, pinnedVersi
742
705
  .readFile(path.resolve(targetPath, CODEX_RUN_GAME_SKILL_RELATIVE_PATH), "utf8")
743
706
  .catch(() => null);
744
707
  const codexAuthoringHookContent = await fs
745
- .readFile(path.join(projectMcp.integrationRootPath, CODEX_AUTHORING_HOOK_RELATIVE_PATH), "utf8")
708
+ .readFile(path.join(projectMcp.integrationRootPath, GDH_AUTHORING_HOOK_RELATIVE_PATH), "utf8")
746
709
  .catch(() => null);
747
710
  const codexProjectConfigContent = await fs
748
711
  .readFile(path.join(projectMcp.integrationRootPath, CODEX_PROJECT_CONFIG_RELATIVE_PATH), "utf8")
@@ -758,8 +721,6 @@ async function inspectCodexAdapter(targetPath, guidance, projectMcp, pinnedVersi
758
721
  : renderGdhAuthoringHook({
759
722
  pinnedVersion,
760
723
  targetRelativePath: path.relative(projectMcp.integrationRootPath, targetPath) || ".",
761
- agent: "codex",
762
- stateRelativePathFromHook: computeStateRelativePathFromHook(projectMcp.integrationRootPath, CODEX_AUTHORING_HOOK_RELATIVE_PATH, projectMcp.integrationRootPath),
763
724
  });
764
725
  const surfaces = [
765
726
  createSurfaceStatus({
@@ -807,7 +768,7 @@ async function inspectCodexAdapter(targetPath, guidance, projectMcp, pinnedVersi
807
768
  ...inspectCodexSkillSurface(targetPath, CODEX_UPDATE_SKILL_RELATIVE_PATH, codexUpdateContent, expectedCodexUpdateSkill, "gdh-update"),
808
769
  ...inspectCodexSkillSurface(targetPath, CODEX_PREPARE_SKILL_RELATIVE_PATH, codexPrepareContent, expectedCodexPrepareSkill, "gdh-prepare"),
809
770
  ...inspectCodexSkillSurface(targetPath, CODEX_RUN_GAME_SKILL_RELATIVE_PATH, codexRunGameContent, expectedCodexRunGameSkill, "gdh-run-game"),
810
- inspectManagedHookSurface("codex", projectMcp.integrationRootPath, CODEX_AUTHORING_HOOK_RELATIVE_PATH, codexAuthoringHookContent, expectedCodexAuthoringHook, "authoring guard"),
771
+ inspectManagedHookSurface("codex", projectMcp.integrationRootPath, GDH_AUTHORING_HOOK_RELATIVE_PATH, codexAuthoringHookContent, expectedCodexAuthoringHook, "authoring guard"),
811
772
  inspectCodexAuthoringHookConfig(projectMcp.integrationRootPath, codexProjectConfigContent, projectMcp.enabled),
812
773
  ];
813
774
  if (projectMcp.enabled) {
@@ -871,7 +832,7 @@ async function inspectClaudeAdapter(targetPath, guidance, projectMcp, pinnedVers
871
832
  .readFile(path.join(targetPath, CLAUDE_STATUSLINE_RELATIVE_PATH), "utf8")
872
833
  .catch(() => null);
873
834
  const claudeAuthoringHookContent = await fs
874
- .readFile(path.join(targetPath, CLAUDE_AUTHORING_HOOK_RELATIVE_PATH), "utf8")
835
+ .readFile(path.join(targetPath, GDH_AUTHORING_HOOK_RELATIVE_PATH), "utf8")
875
836
  .catch(() => null);
876
837
  let detectedTarget = null;
877
838
  if (lstat?.isSymbolicLink()) {
@@ -886,11 +847,6 @@ async function inspectClaudeAdapter(targetPath, guidance, projectMcp, pinnedVers
886
847
  : renderGdhAuthoringHook({
887
848
  pinnedVersion,
888
849
  targetRelativePath: ".",
889
- agent: "claude",
890
- // inspectClaudeAdapter previews the same-repo install: hook lives at
891
- // `<targetPath>/.claude/hooks/gdh-authoring-guard.js`; state lives at
892
- // `<targetPath>/.gdh-state/`. Compute the relative from the hook dir.
893
- stateRelativePathFromHook: computeStateRelativePathFromHook(targetPath, CLAUDE_AUTHORING_HOOK_RELATIVE_PATH, targetPath),
894
850
  });
895
851
  const expectedClaudeStatusCommand = pinnedVersion === null ? null : renderClaudeStatusCommand(pinnedVersion);
896
852
  const expectedClaudeMigrateCommand = pinnedVersion === null ? null : renderClaudeMigrateCommand(pinnedVersion);
@@ -948,7 +904,7 @@ async function inspectClaudeAdapter(targetPath, guidance, projectMcp, pinnedVers
948
904
  inspectManagedHookSurface("claude", targetPath, CLAUDE_CHECK_UPDATE_HOOK_RELATIVE_PATH, claudeCheckUpdateHookContent, expectedClaudeCheckUpdateHook, "gdh-check-update-hook"),
949
905
  inspectManagedHookSurface("claude", targetPath, CLAUDE_CHECK_UPDATE_WORKER_RELATIVE_PATH, claudeCheckUpdateWorkerContent, expectedClaudeCheckUpdateWorker, "gdh-check-update-worker"),
950
906
  inspectManagedHookSurface("claude", targetPath, CLAUDE_STATUSLINE_RELATIVE_PATH, claudeStatuslineContent, expectedClaudeStatusline, "gdh-statusline"),
951
- inspectManagedHookSurface("claude", targetPath, CLAUDE_AUTHORING_HOOK_RELATIVE_PATH, claudeAuthoringHookContent, expectedClaudeAuthoringHook, "authoring guard"),
907
+ inspectManagedHookSurface("claude", targetPath, GDH_AUTHORING_HOOK_RELATIVE_PATH, claudeAuthoringHookContent, expectedClaudeAuthoringHook, "authoring guard"),
952
908
  ];
953
909
  if (path.resolve(projectMcp.integrationRootPath) !== path.resolve(targetPath)) {
954
910
  surfaces.push(...(await inspectRootSymlinkSurfaces({
@@ -1319,13 +1275,9 @@ function planCodexRepoInstallActions(targetPath, adapter, pinnedVersion, project
1319
1275
  planSkillInstallAction("codex", targetPath, adapter, CODEX_UPDATE_SKILL_RELATIVE_PATH, renderCodexUpdateSkill, "gdh-update", pinnedVersion),
1320
1276
  planSkillInstallAction("codex", targetPath, adapter, CODEX_PREPARE_SKILL_RELATIVE_PATH, renderCodexPrepareSkill, "gdh-prepare", pinnedVersion),
1321
1277
  planSkillInstallAction("codex", targetPath, adapter, CODEX_RUN_GAME_SKILL_RELATIVE_PATH, renderCodexRunGameSkill, "gdh-run-game", pinnedVersion),
1322
- planSkillInstallAction("codex", integrationRootPath, adapter, CODEX_AUTHORING_HOOK_RELATIVE_PATH, (version) => renderGdhAuthoringHook({
1278
+ planSkillInstallAction("codex", integrationRootPath, adapter, GDH_AUTHORING_HOOK_RELATIVE_PATH, (version) => renderGdhAuthoringHook({
1323
1279
  pinnedVersion: version,
1324
1280
  targetRelativePath: path.relative(integrationRootPath, targetPath) || ".",
1325
- agent: "codex",
1326
- // Codex install-action: hook installed at integrationRootPath; state
1327
- // root lives at integrationRootPath/.gdh-state.
1328
- stateRelativePathFromHook: computeStateRelativePathFromHook(integrationRootPath, CODEX_AUTHORING_HOOK_RELATIVE_PATH, integrationRootPath),
1329
1281
  }), "authoring guard", pinnedVersion),
1330
1282
  ];
1331
1283
  if (projectMcp.enabled && projectMcp.codexProjectFile.state !== "ready") {
@@ -1663,18 +1615,9 @@ function planClaudeInstallActions(targetPath, adapter, pinnedVersion, integratio
1663
1615
  // statusLine slot automatically because that would shadow user/global
1664
1616
  // statusline content. Users can manually point their config at
1665
1617
  // gdh-statusline.js later; the baked file is a no-op until wired.
1666
- planHookInstallAction("claude", targetPath, adapter, CLAUDE_STATUSLINE_RELATIVE_PATH, renderClaudeUpdateStatusline, "gdh-statusline", pinnedVersion), planHookInstallAction("claude", targetPath, adapter, CLAUDE_AUTHORING_HOOK_RELATIVE_PATH, (version) => renderGdhAuthoringHook({
1618
+ planHookInstallAction("claude", targetPath, adapter, CLAUDE_STATUSLINE_RELATIVE_PATH, renderClaudeUpdateStatusline, "gdh-statusline", pinnedVersion), planHookInstallAction("claude", targetPath, adapter, GDH_AUTHORING_HOOK_RELATIVE_PATH, (version) => renderGdhAuthoringHook({
1667
1619
  pinnedVersion: version,
1668
1620
  targetRelativePath: ".",
1669
- agent: "claude",
1670
- // Claude install-action target install: hook lives at
1671
- // `<targetPath>/.claude/hooks/...`; state root lives at
1672
- // `<integrationRootPath>/.gdh-state/`. In the same-repo case,
1673
- // integrationRootPath equals targetPath; in the monorepo nested-target
1674
- // case (where this same hook is also installed at the target alongside
1675
- // a separate root-launched hook from site #5), the state remains at
1676
- // integrationRootPath/.gdh-state, so use integrationRootPath here.
1677
- stateRelativePathFromHook: computeStateRelativePathFromHook(targetPath, CLAUDE_AUTHORING_HOOK_RELATIVE_PATH, integrationRootPath),
1678
1621
  }), "authoring guard", pinnedVersion));
1679
1622
  if (path.resolve(integrationRootPath) !== path.resolve(targetPath)) {
1680
1623
  const rootTargetRelativePath = path.relative(integrationRootPath, targetPath) || ".";
@@ -1689,15 +1632,10 @@ function planClaudeInstallActions(targetPath, adapter, pinnedVersion, integratio
1689
1632
  }), planDirectWriteFileAction({
1690
1633
  agent: "claude",
1691
1634
  targetPath: integrationRootPath,
1692
- relativePath: CLAUDE_AUTHORING_HOOK_RELATIVE_PATH,
1635
+ relativePath: GDH_AUTHORING_HOOK_RELATIVE_PATH,
1693
1636
  content: renderGdhAuthoringHook({
1694
1637
  pinnedVersion,
1695
1638
  targetRelativePath: rootTargetRelativePath,
1696
- agent: "claude",
1697
- // Root-launched Claude install in monorepo nested-target case: hook
1698
- // lives at `<integrationRootPath>/.claude/hooks/...`; state lives at
1699
- // `<integrationRootPath>/.gdh-state/`.
1700
- stateRelativePathFromHook: computeStateRelativePathFromHook(integrationRootPath, CLAUDE_AUTHORING_HOOK_RELATIVE_PATH, integrationRootPath),
1701
1639
  }),
1702
1640
  readySummary: "Root-launched Claude authoring hook already matches the managed target-scoped hook.",
1703
1641
  createSummary: "Create the root-launched Claude authoring hook with target-scoped filtering.",
@@ -3335,7 +3273,7 @@ function normalizeChangedFiles(files) {
3335
3273
  }
3336
3274
  export { CLAUDE_STATUSLINE_RELATIVE_PATH } from "./claude-statusline-render.js";
3337
3275
  export { CLAUDE_CHECK_UPDATE_HOOK_RELATIVE_PATH } from "./claude-update-hook-render.js";
3338
- export { CLAUDE_AUTHORING_HOOK_COMMAND, CLAUDE_AUTHORING_HOOK_RELATIVE_PATH, CODEX_AUTHORING_HOOK_COMMAND, CODEX_AUTHORING_HOOK_RELATIVE_PATH, } from "./authoring-hook-render.js";
3276
+ export { CLAUDE_AUTHORING_HOOK_COMMAND, CODEX_AUTHORING_HOOK_COMMAND, GDH_AUTHORING_HOOK_RELATIVE_PATH, } from "./authoring-hook-render.js";
3339
3277
  export { bumpAndRebakePin, } from "./self-update-mechanics.js";
3340
3278
  export { deriveExpectedRenderSet, runInventorySweep, } from "./inventory-sweep.js";
3341
3279
  export { BACKUP_MANIFEST_RELATIVE_PATH, BACKUP_RELATIVE_PATH, BACKUP_STAGING_RELATIVE_PATH, detectClass1MarkerDrift, driftResultToPreservationNotes, readBackupManifest, restoreFromDurableBackup, writeDurableBackup, } from "./durable-backup.js";