@skillcap/gdh 0.23.0 → 0.24.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 (128) hide show
  1. package/INSTALL-BUNDLE.json +1 -1
  2. package/RELEASE-SPAN-UPDATE-CONTRACTS.json +64 -0
  3. package/node_modules/@gdh/adapters/dist/authoring-hook-render.d.ts.map +1 -1
  4. package/node_modules/@gdh/adapters/dist/authoring-hook-render.js +2 -1
  5. package/node_modules/@gdh/adapters/dist/authoring-hook-render.js.map +1 -1
  6. package/node_modules/@gdh/adapters/dist/claude-statusline-render.d.ts.map +1 -1
  7. package/node_modules/@gdh/adapters/dist/claude-statusline-render.js +2 -1
  8. package/node_modules/@gdh/adapters/dist/claude-statusline-render.js.map +1 -1
  9. package/node_modules/@gdh/adapters/dist/claude-update-hook-render.d.ts.map +1 -1
  10. package/node_modules/@gdh/adapters/dist/claude-update-hook-render.js +2 -1
  11. package/node_modules/@gdh/adapters/dist/claude-update-hook-render.js.map +1 -1
  12. package/node_modules/@gdh/adapters/dist/claude-update-worker-render.d.ts.map +1 -1
  13. package/node_modules/@gdh/adapters/dist/claude-update-worker-render.js +2 -1
  14. package/node_modules/@gdh/adapters/dist/claude-update-worker-render.js.map +1 -1
  15. package/node_modules/@gdh/adapters/dist/deferred-actions-advisory.d.ts +71 -0
  16. package/node_modules/@gdh/adapters/dist/deferred-actions-advisory.d.ts.map +1 -0
  17. package/node_modules/@gdh/adapters/dist/deferred-actions-advisory.js +89 -0
  18. package/node_modules/@gdh/adapters/dist/deferred-actions-advisory.js.map +1 -0
  19. package/node_modules/@gdh/adapters/dist/durable-backup.d.ts +209 -0
  20. package/node_modules/@gdh/adapters/dist/durable-backup.d.ts.map +1 -0
  21. package/node_modules/@gdh/adapters/dist/durable-backup.js +346 -0
  22. package/node_modules/@gdh/adapters/dist/durable-backup.js.map +1 -0
  23. package/node_modules/@gdh/adapters/dist/index.d.ts +10 -1
  24. package/node_modules/@gdh/adapters/dist/index.d.ts.map +1 -1
  25. package/node_modules/@gdh/adapters/dist/index.js +24 -2
  26. package/node_modules/@gdh/adapters/dist/index.js.map +1 -1
  27. package/node_modules/@gdh/adapters/dist/inventory-sweep.d.ts +53 -0
  28. package/node_modules/@gdh/adapters/dist/inventory-sweep.d.ts.map +1 -0
  29. package/node_modules/@gdh/adapters/dist/inventory-sweep.js +98 -0
  30. package/node_modules/@gdh/adapters/dist/inventory-sweep.js.map +1 -0
  31. package/node_modules/@gdh/adapters/dist/process-orchestration.d.ts +223 -0
  32. package/node_modules/@gdh/adapters/dist/process-orchestration.d.ts.map +1 -0
  33. package/node_modules/@gdh/adapters/dist/process-orchestration.js +368 -0
  34. package/node_modules/@gdh/adapters/dist/process-orchestration.js.map +1 -0
  35. package/node_modules/@gdh/adapters/dist/self-update-mechanics.d.ts +157 -14
  36. package/node_modules/@gdh/adapters/dist/self-update-mechanics.d.ts.map +1 -1
  37. package/node_modules/@gdh/adapters/dist/self-update-mechanics.js +570 -89
  38. package/node_modules/@gdh/adapters/dist/self-update-mechanics.js.map +1 -1
  39. package/node_modules/@gdh/adapters/dist/skill-rendering.d.ts.map +1 -1
  40. package/node_modules/@gdh/adapters/dist/skill-rendering.js +25 -0
  41. package/node_modules/@gdh/adapters/dist/skill-rendering.js.map +1 -1
  42. package/node_modules/@gdh/adapters/package.json +8 -8
  43. package/node_modules/@gdh/authoring/package.json +2 -2
  44. package/node_modules/@gdh/cli/dist/index.d.ts +9 -0
  45. package/node_modules/@gdh/cli/dist/index.d.ts.map +1 -1
  46. package/node_modules/@gdh/cli/dist/index.js +244 -2
  47. package/node_modules/@gdh/cli/dist/index.js.map +1 -1
  48. package/node_modules/@gdh/cli/dist/migrate.d.ts +152 -1
  49. package/node_modules/@gdh/cli/dist/migrate.d.ts.map +1 -1
  50. package/node_modules/@gdh/cli/dist/migrate.js +290 -6
  51. package/node_modules/@gdh/cli/dist/migrate.js.map +1 -1
  52. package/node_modules/@gdh/cli/dist/self-update.d.ts +14 -0
  53. package/node_modules/@gdh/cli/dist/self-update.d.ts.map +1 -1
  54. package/node_modules/@gdh/cli/dist/self-update.js +197 -15
  55. package/node_modules/@gdh/cli/dist/self-update.js.map +1 -1
  56. package/node_modules/@gdh/cli/package.json +10 -10
  57. package/node_modules/@gdh/core/dist/index.d.ts +97 -5
  58. package/node_modules/@gdh/core/dist/index.d.ts.map +1 -1
  59. package/node_modules/@gdh/core/dist/index.js +23 -5
  60. package/node_modules/@gdh/core/dist/index.js.map +1 -1
  61. package/node_modules/@gdh/core/dist/migrations/entries/s2c2_to_s2c3_rules_schema_v2_to_v3.d.ts +3 -0
  62. package/node_modules/@gdh/core/dist/migrations/entries/s2c2_to_s2c3_rules_schema_v2_to_v3.d.ts.map +1 -0
  63. package/node_modules/@gdh/core/dist/migrations/entries/s2c2_to_s2c3_rules_schema_v2_to_v3.js +247 -0
  64. package/node_modules/@gdh/core/dist/migrations/entries/s2c2_to_s2c3_rules_schema_v2_to_v3.js.map +1 -0
  65. package/node_modules/@gdh/core/dist/migrations/entries/s3c8_to_s3c9_register_runtime_bridge_autoload.d.ts +3 -0
  66. package/node_modules/@gdh/core/dist/migrations/entries/s3c8_to_s3c9_register_runtime_bridge_autoload.d.ts.map +1 -0
  67. package/node_modules/@gdh/core/dist/migrations/entries/s3c8_to_s3c9_register_runtime_bridge_autoload.js +152 -0
  68. package/node_modules/@gdh/core/dist/migrations/entries/s3c8_to_s3c9_register_runtime_bridge_autoload.js.map +1 -0
  69. package/node_modules/@gdh/core/dist/migrations/envelopes/envelope-output-validator.d.ts +3 -0
  70. package/node_modules/@gdh/core/dist/migrations/envelopes/envelope-output-validator.d.ts.map +1 -0
  71. package/node_modules/@gdh/core/dist/migrations/envelopes/envelope-output-validator.js +67 -0
  72. package/node_modules/@gdh/core/dist/migrations/envelopes/envelope-output-validator.js.map +1 -0
  73. package/node_modules/@gdh/core/dist/migrations/envelopes/index.d.ts +37 -0
  74. package/node_modules/@gdh/core/dist/migrations/envelopes/index.d.ts.map +1 -0
  75. package/node_modules/@gdh/core/dist/migrations/envelopes/index.js +60 -0
  76. package/node_modules/@gdh/core/dist/migrations/envelopes/index.js.map +1 -0
  77. package/node_modules/@gdh/core/dist/migrations/envelopes/types.d.ts +121 -0
  78. package/node_modules/@gdh/core/dist/migrations/envelopes/types.d.ts.map +1 -0
  79. package/node_modules/@gdh/core/dist/migrations/envelopes/types.js +2 -0
  80. package/node_modules/@gdh/core/dist/migrations/envelopes/types.js.map +1 -0
  81. package/node_modules/@gdh/core/dist/migrations/golden-harness.d.ts +40 -0
  82. package/node_modules/@gdh/core/dist/migrations/golden-harness.d.ts.map +1 -0
  83. package/node_modules/@gdh/core/dist/migrations/golden-harness.js +71 -0
  84. package/node_modules/@gdh/core/dist/migrations/golden-harness.js.map +1 -0
  85. package/node_modules/@gdh/core/dist/migrations/managed-surface-classes.d.ts +322 -0
  86. package/node_modules/@gdh/core/dist/migrations/managed-surface-classes.d.ts.map +1 -0
  87. package/node_modules/@gdh/core/dist/migrations/managed-surface-classes.js +384 -0
  88. package/node_modules/@gdh/core/dist/migrations/managed-surface-classes.js.map +1 -0
  89. package/node_modules/@gdh/core/dist/migrations/probes.d.ts +58 -0
  90. package/node_modules/@gdh/core/dist/migrations/probes.d.ts.map +1 -0
  91. package/node_modules/@gdh/core/dist/migrations/probes.js +112 -0
  92. package/node_modules/@gdh/core/dist/migrations/probes.js.map +1 -0
  93. package/node_modules/@gdh/core/dist/migrations/registry.d.ts +205 -0
  94. package/node_modules/@gdh/core/dist/migrations/registry.d.ts.map +1 -0
  95. package/node_modules/@gdh/core/dist/migrations/registry.js +214 -0
  96. package/node_modules/@gdh/core/dist/migrations/registry.js.map +1 -0
  97. package/node_modules/@gdh/core/dist/state/atomic-write.d.ts +19 -0
  98. package/node_modules/@gdh/core/dist/state/atomic-write.d.ts.map +1 -0
  99. package/node_modules/@gdh/core/dist/state/atomic-write.js +34 -0
  100. package/node_modules/@gdh/core/dist/state/atomic-write.js.map +1 -0
  101. package/node_modules/@gdh/core/dist/state/migration-state.d.ts +135 -0
  102. package/node_modules/@gdh/core/dist/state/migration-state.d.ts.map +1 -0
  103. package/node_modules/@gdh/core/dist/state/migration-state.js +186 -0
  104. package/node_modules/@gdh/core/dist/state/migration-state.js.map +1 -0
  105. package/node_modules/@gdh/core/dist/state/processes-snapshot.d.ts +72 -0
  106. package/node_modules/@gdh/core/dist/state/processes-snapshot.d.ts.map +1 -0
  107. package/node_modules/@gdh/core/dist/state/processes-snapshot.js +113 -0
  108. package/node_modules/@gdh/core/dist/state/processes-snapshot.js.map +1 -0
  109. package/node_modules/@gdh/core/dist/state/render-inventory.d.ts +54 -0
  110. package/node_modules/@gdh/core/dist/state/render-inventory.d.ts.map +1 -0
  111. package/node_modules/@gdh/core/dist/state/render-inventory.js +77 -0
  112. package/node_modules/@gdh/core/dist/state/render-inventory.js.map +1 -0
  113. package/node_modules/@gdh/core/package.json +1 -1
  114. package/node_modules/@gdh/docs/dist/agent-contract.d.ts.map +1 -1
  115. package/node_modules/@gdh/docs/dist/agent-contract.js +2 -1
  116. package/node_modules/@gdh/docs/dist/agent-contract.js.map +1 -1
  117. package/node_modules/@gdh/docs/dist/guidance.d.ts.map +1 -1
  118. package/node_modules/@gdh/docs/dist/guidance.js +3 -1
  119. package/node_modules/@gdh/docs/dist/guidance.js.map +1 -1
  120. package/node_modules/@gdh/docs/package.json +2 -2
  121. package/node_modules/@gdh/mcp/package.json +8 -8
  122. package/node_modules/@gdh/observability/package.json +2 -2
  123. package/node_modules/@gdh/runtime/dist/bridge-surface.js +63 -2
  124. package/node_modules/@gdh/runtime/dist/bridge-surface.js.map +1 -1
  125. package/node_modules/@gdh/runtime/package.json +2 -2
  126. package/node_modules/@gdh/scan/package.json +3 -3
  127. package/node_modules/@gdh/verify/package.json +7 -7
  128. package/package.json +11 -11
@@ -0,0 +1,384 @@
1
+ /**
2
+ * Managed-surface drift classification manifest.
3
+ *
4
+ * Single source of truth for assigning every GDH-managed render call site to
5
+ * one of three drift classes: `"deterministic"`, `"user-data"`, or
6
+ * `"project-native"`. Required by GOV-03 (.planning/REQUIREMENTS.md) and
7
+ * locked by Phase 70 decisions D-05, D-06, D-08, D-13..D-24 in
8
+ * .planning/phases/70-governance-and-managed-surface-drift-classification/70-CONTEXT.md.
9
+ *
10
+ * Consumers:
11
+ * - Migration registry (Phase 72)
12
+ * - Chain matrix (Phase 71)
13
+ * - Migration verifier (Phase 74)
14
+ * - Renderer-side load-time guards (Plan 70-05) via `assertClassRegistered`
15
+ * - `validate:docs` manifest-covers-renderers check (Plan 70-06)
16
+ *
17
+ * Out of classification scope per D-23: every path under `.gdh-state/` is
18
+ * machine-local state owned entirely by GDH; it is intentionally not a
19
+ * managed surface in the migration sense and is therefore absent from this
20
+ * manifest. The renderer `renderLocalPathHints` (which writes
21
+ * `.gdh-state/local-paths.json`) is the canonical example of an excluded
22
+ * surface.
23
+ *
24
+ * Three-class lock (D-24): the union below has exactly three members. No
25
+ * fourth class. No subclasses. Project-native surfaces declare a narrow op
26
+ * allowlist instead of a subclass.
27
+ */
28
+ /**
29
+ * The classification manifest. Every render call site discovered during the
30
+ * Phase 70 audit appears here exactly once. The `as const satisfies` form
31
+ * preserves literal-string typing (downstream narrowing) while shape-checking
32
+ * each entry against `GdhManagedSurfaceClassEntry`.
33
+ */
34
+ export const GDH_MANAGED_SURFACE_CLASSES = [
35
+ // ---------------------------------------------------------------
36
+ // Skills — 24 entries (3 agents × 8 skill IDs). All deterministic per D-20.
37
+ // Rendered by `renderGdhSkill(agent, skillId, version)` in
38
+ // packages/adapters/src/skill-rendering.ts. The per-target output path
39
+ // varies by agent (.claude/skills/gdh-<id>/SKILL.md,
40
+ // .codex/skills/gdh-<id>/SKILL.md, .cursor/skills/gdh-<id>/SKILL.md) so
41
+ // relativePath is null for every skill entry.
42
+ // ---------------------------------------------------------------
43
+ {
44
+ surfaceId: "skill.claude.onboard",
45
+ relativePath: null,
46
+ class: "deterministic",
47
+ notes: "Generated agent skill rendered by renderGdhSkill('claude', 'onboard', version). Per-target path: .claude/skills/gdh-onboard/SKILL.md.",
48
+ },
49
+ {
50
+ surfaceId: "skill.claude.status",
51
+ relativePath: null,
52
+ class: "deterministic",
53
+ notes: "Generated agent skill rendered by renderGdhSkill('claude', 'status', version). Per-target path: .claude/skills/gdh-status/SKILL.md.",
54
+ },
55
+ {
56
+ surfaceId: "skill.claude.scan",
57
+ relativePath: null,
58
+ class: "deterministic",
59
+ notes: "Generated agent skill rendered by renderGdhSkill('claude', 'scan', version). Per-target path: .claude/skills/gdh-scan/SKILL.md.",
60
+ },
61
+ {
62
+ surfaceId: "skill.claude.migrate",
63
+ relativePath: null,
64
+ class: "deterministic",
65
+ notes: "Generated agent skill rendered by renderGdhSkill('claude', 'migrate', version). Per-target path: .claude/skills/gdh-migrate/SKILL.md.",
66
+ },
67
+ {
68
+ surfaceId: "skill.claude.update",
69
+ relativePath: null,
70
+ class: "deterministic",
71
+ notes: "Generated agent skill rendered by renderGdhSkill('claude', 'update', version). Per-target path: .claude/skills/gdh-update/SKILL.md.",
72
+ },
73
+ {
74
+ surfaceId: "skill.claude.check",
75
+ relativePath: null,
76
+ class: "deterministic",
77
+ notes: "Generated agent skill rendered by renderGdhSkill('claude', 'check', version). Per-target path: .claude/skills/gdh-check/SKILL.md.",
78
+ },
79
+ {
80
+ surfaceId: "skill.claude.prepare",
81
+ relativePath: null,
82
+ class: "deterministic",
83
+ notes: "Generated agent skill rendered by renderGdhSkill('claude', 'prepare', version). Per-target path: .claude/skills/gdh-prepare/SKILL.md.",
84
+ },
85
+ {
86
+ surfaceId: "skill.claude.run-game",
87
+ relativePath: null,
88
+ class: "deterministic",
89
+ notes: "Generated agent skill rendered by renderGdhSkill('claude', 'run-game', version). Per-target path: .claude/skills/gdh-run-game/SKILL.md.",
90
+ },
91
+ {
92
+ surfaceId: "skill.codex.onboard",
93
+ relativePath: null,
94
+ class: "deterministic",
95
+ notes: "Generated agent skill rendered by renderGdhSkill('codex', 'onboard', version). Per-target path: .codex/skills/gdh-onboard/SKILL.md.",
96
+ },
97
+ {
98
+ surfaceId: "skill.codex.status",
99
+ relativePath: null,
100
+ class: "deterministic",
101
+ notes: "Generated agent skill rendered by renderGdhSkill('codex', 'status', version). Per-target path: .codex/skills/gdh-status/SKILL.md.",
102
+ },
103
+ {
104
+ surfaceId: "skill.codex.scan",
105
+ relativePath: null,
106
+ class: "deterministic",
107
+ notes: "Generated agent skill rendered by renderGdhSkill('codex', 'scan', version). Per-target path: .codex/skills/gdh-scan/SKILL.md.",
108
+ },
109
+ {
110
+ surfaceId: "skill.codex.migrate",
111
+ relativePath: null,
112
+ class: "deterministic",
113
+ notes: "Generated agent skill rendered by renderGdhSkill('codex', 'migrate', version). Per-target path: .codex/skills/gdh-migrate/SKILL.md.",
114
+ },
115
+ {
116
+ surfaceId: "skill.codex.update",
117
+ relativePath: null,
118
+ class: "deterministic",
119
+ notes: "Generated agent skill rendered by renderGdhSkill('codex', 'update', version). Per-target path: .codex/skills/gdh-update/SKILL.md.",
120
+ },
121
+ {
122
+ surfaceId: "skill.codex.check",
123
+ relativePath: null,
124
+ class: "deterministic",
125
+ notes: "Generated agent skill rendered by renderGdhSkill('codex', 'check', version). Per-target path: .codex/skills/gdh-check/SKILL.md.",
126
+ },
127
+ {
128
+ surfaceId: "skill.codex.prepare",
129
+ relativePath: null,
130
+ class: "deterministic",
131
+ notes: "Generated agent skill rendered by renderGdhSkill('codex', 'prepare', version). Per-target path: .codex/skills/gdh-prepare/SKILL.md.",
132
+ },
133
+ {
134
+ surfaceId: "skill.codex.run-game",
135
+ relativePath: null,
136
+ class: "deterministic",
137
+ notes: "Generated agent skill rendered by renderGdhSkill('codex', 'run-game', version). Per-target path: .codex/skills/gdh-run-game/SKILL.md.",
138
+ },
139
+ {
140
+ surfaceId: "skill.cursor.onboard",
141
+ relativePath: null,
142
+ class: "deterministic",
143
+ notes: "Generated agent skill rendered by renderGdhSkill('cursor', 'onboard', version). Per-target path: .cursor/skills/gdh-onboard/SKILL.md.",
144
+ },
145
+ {
146
+ surfaceId: "skill.cursor.status",
147
+ relativePath: null,
148
+ class: "deterministic",
149
+ notes: "Generated agent skill rendered by renderGdhSkill('cursor', 'status', version). Per-target path: .cursor/skills/gdh-status/SKILL.md.",
150
+ },
151
+ {
152
+ surfaceId: "skill.cursor.scan",
153
+ relativePath: null,
154
+ class: "deterministic",
155
+ notes: "Generated agent skill rendered by renderGdhSkill('cursor', 'scan', version). Per-target path: .cursor/skills/gdh-scan/SKILL.md.",
156
+ },
157
+ {
158
+ surfaceId: "skill.cursor.migrate",
159
+ relativePath: null,
160
+ class: "deterministic",
161
+ notes: "Generated agent skill rendered by renderGdhSkill('cursor', 'migrate', version). Per-target path: .cursor/skills/gdh-migrate/SKILL.md.",
162
+ },
163
+ {
164
+ surfaceId: "skill.cursor.update",
165
+ relativePath: null,
166
+ class: "deterministic",
167
+ notes: "Generated agent skill rendered by renderGdhSkill('cursor', 'update', version). Per-target path: .cursor/skills/gdh-update/SKILL.md.",
168
+ },
169
+ {
170
+ surfaceId: "skill.cursor.check",
171
+ relativePath: null,
172
+ class: "deterministic",
173
+ notes: "Generated agent skill rendered by renderGdhSkill('cursor', 'check', version). Per-target path: .cursor/skills/gdh-check/SKILL.md.",
174
+ },
175
+ {
176
+ surfaceId: "skill.cursor.prepare",
177
+ relativePath: null,
178
+ class: "deterministic",
179
+ notes: "Generated agent skill rendered by renderGdhSkill('cursor', 'prepare', version). Per-target path: .cursor/skills/gdh-prepare/SKILL.md.",
180
+ },
181
+ {
182
+ surfaceId: "skill.cursor.run-game",
183
+ relativePath: null,
184
+ class: "deterministic",
185
+ notes: "Generated agent skill rendered by renderGdhSkill('cursor', 'run-game', version). Per-target path: .cursor/skills/gdh-run-game/SKILL.md.",
186
+ },
187
+ // ---------------------------------------------------------------
188
+ // Non-skill renderers in packages/adapters/src/index.ts (12 entries).
189
+ // All deterministic per D-20/D-21/D-22. NOTE: renderLocalPathHints (line
190
+ // 3271) writes to .gdh-state/local-paths.json and is intentionally
191
+ // EXCLUDED per D-23.
192
+ // ---------------------------------------------------------------
193
+ {
194
+ surfaceId: "cursor_rule",
195
+ relativePath: ".cursor/rules/gdh-agent.mdc",
196
+ class: "deterministic",
197
+ notes: "Cursor rule file rendered by renderCursorRule() in packages/adapters/src/index.ts (line 555). Path constant CURSOR_RULE_RELATIVE_PATH (line 171) defines the workspace-relative location.",
198
+ },
199
+ {
200
+ surfaceId: "claude_onboard_command",
201
+ relativePath: null,
202
+ class: "deterministic",
203
+ notes: "Legacy Claude command shim rendered by renderClaudeOnboardCommand() (packages/adapters/src/index.ts line 573); delegates to renderClaudeOnboardSkill. Per-target path under .claude/commands/gdh/ (legacy command-file location, retained for backwards compatibility).",
204
+ },
205
+ {
206
+ surfaceId: "claude_status_command",
207
+ relativePath: null,
208
+ class: "deterministic",
209
+ notes: "Legacy Claude command shim rendered by renderClaudeStatusCommand() (packages/adapters/src/index.ts line 577); delegates to renderClaudeStatusSkill. Per-target path under .claude/commands/gdh/.",
210
+ },
211
+ {
212
+ surfaceId: "claude_scan_command",
213
+ relativePath: null,
214
+ class: "deterministic",
215
+ notes: "Legacy Claude command shim rendered by renderClaudeScanCommand() (packages/adapters/src/index.ts line 581); delegates to renderClaudeScanSkill. Per-target path under .claude/commands/gdh/.",
216
+ },
217
+ {
218
+ surfaceId: "claude_migrate_command",
219
+ relativePath: null,
220
+ class: "deterministic",
221
+ notes: "Legacy Claude command shim rendered by renderClaudeMigrateCommand() (packages/adapters/src/index.ts line 585); delegates to renderClaudeMigrateSkill. Per-target path under .claude/commands/gdh/.",
222
+ },
223
+ {
224
+ surfaceId: "claude_update_command",
225
+ relativePath: null,
226
+ class: "deterministic",
227
+ notes: "Legacy Claude command shim rendered by renderClaudeUpdateCommand() (packages/adapters/src/index.ts line 589); delegates to renderClaudeUpdateSkill. Per-target path under .claude/commands/gdh/.",
228
+ },
229
+ {
230
+ surfaceId: "claude_check_command",
231
+ relativePath: null,
232
+ class: "deterministic",
233
+ notes: "Legacy Claude command shim rendered by renderClaudeCheckCommand() (packages/adapters/src/index.ts line 593); delegates to renderClaudeCheckSkill. Per-target path under .claude/commands/gdh/.",
234
+ },
235
+ {
236
+ surfaceId: "claude_prepare_command",
237
+ relativePath: null,
238
+ class: "deterministic",
239
+ notes: "Legacy Claude command shim rendered by renderClaudePrepareCommand() (packages/adapters/src/index.ts line 597); delegates to renderClaudePrepareSkill. Per-target path under .claude/commands/gdh/.",
240
+ },
241
+ {
242
+ surfaceId: "claude_run_game_command",
243
+ relativePath: null,
244
+ class: "deterministic",
245
+ notes: "Legacy Claude command shim rendered by renderClaudeRunGameCommand() (packages/adapters/src/index.ts line 601); delegates to renderClaudeRunGameSkill. Per-target path under .claude/commands/gdh/.",
246
+ },
247
+ {
248
+ surfaceId: "mcp_config_entry",
249
+ relativePath: null,
250
+ class: "deterministic",
251
+ notes: "Managed `gdh` MCP server entry rendered by renderManagedMcpConfig() (packages/adapters/src/index.ts line 3061). Per D-21 the entry GDH owns by marker is deterministic; the surrounding user MCP config (.mcp.json or .cursor/mcp.json) is project-native and not classified — GDH only operates on the entry it owns.",
252
+ },
253
+ {
254
+ surfaceId: "codex_project_mcp_section",
255
+ relativePath: ".codex/config.toml",
256
+ class: "deterministic",
257
+ notes: "Managed `[mcp_servers.gdh]` section in .codex/config.toml rendered by renderManagedCodexProjectSection() (packages/adapters/src/index.ts line 3096) and stitched into the file via renderManagedCodexProjectConfig() (line 3106). Path constant CODEX_PROJECT_CONFIG_RELATIVE_PATH (line 231).",
258
+ },
259
+ {
260
+ surfaceId: "codex_authoring_hook_block",
261
+ relativePath: ".codex/config.toml",
262
+ class: "deterministic",
263
+ notes: "Managed `# BEGIN GDH managed authoring hooks` block in .codex/config.toml rendered by renderManagedCodexAuthoringHookBlock() (packages/adapters/src/index.ts line 3193). Marker-bounded; deterministic per D-22.",
264
+ },
265
+ // ---------------------------------------------------------------
266
+ // Dedicated *-render.ts files in packages/adapters/src/ (4 entries).
267
+ // All deterministic per D-22.
268
+ // ---------------------------------------------------------------
269
+ {
270
+ surfaceId: "authoring_hook",
271
+ relativePath: null,
272
+ class: "deterministic",
273
+ notes: "Authoring validation hook rendered by renderGdhAuthoringHook() in packages/adapters/src/authoring-hook-render.ts (line 10). Per-agent paths: .claude/hooks/gdh-authoring-guard.js (CLAUDE_AUTHORING_HOOK_RELATIVE_PATH) and .codex/hooks/gdh-authoring-guard.js (CODEX_AUTHORING_HOOK_RELATIVE_PATH).",
274
+ },
275
+ {
276
+ surfaceId: "claude_update_hook",
277
+ relativePath: ".claude/hooks/gdh-check-update.js",
278
+ class: "deterministic",
279
+ notes: "Claude SessionStart parent hook rendered by renderClaudeCheckUpdateHook() in packages/adapters/src/claude-update-hook-render.ts. Path constant CLAUDE_CHECK_UPDATE_HOOK_RELATIVE_PATH.",
280
+ },
281
+ {
282
+ surfaceId: "claude_update_worker",
283
+ relativePath: ".claude/hooks/gdh-check-update-worker.js",
284
+ class: "deterministic",
285
+ notes: "Claude background update-check worker rendered by the renderer in packages/adapters/src/claude-update-worker-render.ts. Path constant CLAUDE_CHECK_UPDATE_WORKER_RELATIVE_PATH.",
286
+ },
287
+ {
288
+ surfaceId: "claude_statusline",
289
+ relativePath: ".claude/hooks/gdh-statusline.js",
290
+ class: "deterministic",
291
+ notes: "Optional Claude statusline script rendered by the renderer in packages/adapters/src/claude-statusline-render.ts. Path constant CLAUDE_STATUSLINE_RELATIVE_PATH. GDH bakes the file but does not auto-register it in .claude/settings.json (single-slot conflict); registration is opt-in.",
292
+ },
293
+ // ---------------------------------------------------------------
294
+ // Renderers in packages/docs/src/ (3 entries).
295
+ // All deterministic per D-18 / D-19.
296
+ // ---------------------------------------------------------------
297
+ {
298
+ surfaceId: "agents_md_managed_block",
299
+ relativePath: "AGENTS.md",
300
+ class: "deterministic",
301
+ notes: "Managed BEGIN/END-marker block in AGENTS.md rendered by renderManagedAgentContractBlock() (packages/docs/src/agent-contract.ts line 24) and stitched in by upsertManagedAgentContract() (line 70). Path constant AGENT_CONTRACT_RELATIVE_PATH (line 12). Per D-18 the managed block specifically is deterministic; surrounding user content in AGENTS.md is project-native and not classified — GDH operates only on the marker-bounded region.",
302
+ },
303
+ {
304
+ surfaceId: "guidance_unit_set",
305
+ relativePath: null,
306
+ class: "deterministic",
307
+ notes: "Managed guidance unit files (multiple) under docs/agent/ rendered by createDefaultGuidanceUnits() in packages/docs/src/guidance.ts (line 27). Each unit is GDH-rendered with metadata + body; relativePath is null because the surface emits multiple files. Class deterministic per D-19 (Session 9 nested-monorepo migration is the canonical drift mode).",
308
+ },
309
+ {
310
+ surfaceId: "guidance_index",
311
+ relativePath: "docs/agent/README.md",
312
+ class: "deterministic",
313
+ notes: "Managed guidance index file rendered by createDefaultGuidanceIndex() in packages/docs/src/guidance.ts (line 391). Path constant GUIDANCE_INDEX_RELATIVE_PATH (line 19). Class deterministic per D-19.",
314
+ },
315
+ // ---------------------------------------------------------------
316
+ // User-data class entries (4 entries) — D-14, D-15, D-16.
317
+ // These surfaces are not RENDERED at install/update time the way
318
+ // deterministic surfaces are; they are migrated by registry transforms
319
+ // (Phase 72). They appear in the manifest because GOV-03 says "every
320
+ // existing managed surface is classified" and downstream consumers
321
+ // (registry) bind to these stable surface IDs.
322
+ // ---------------------------------------------------------------
323
+ {
324
+ surfaceId: "gdh_project_yaml",
325
+ relativePath: ".gdh/project.yaml",
326
+ class: "user-data",
327
+ notes: "Schema is GDH-shape; field values (especially gdh_version pin) are user-installed truth. This file defines the schema being migrated and is the canonical source of 'current schema version' when computing the migration plan. Per D-14.",
328
+ },
329
+ {
330
+ surfaceId: "gdh_rules_yaml",
331
+ relativePath: ".gdh/rules.yaml",
332
+ class: "user-data",
333
+ notes: "Default boilerplate from a prior version is byte-equal-matched against registry-stored prior-version default and auto-migrated; non-byte-equal content is treated as user-customized and routes through the conflict policy. Per D-15.",
334
+ },
335
+ {
336
+ surfaceId: "run_configuration_set",
337
+ relativePath: null,
338
+ class: "user-data",
339
+ notes: "Multiple files under .gdh/run-configurations/ created via `gdh run-config`. User owns content; GDH owns shape; semantic schema changes route through subagent envelope. Per D-16.",
340
+ },
341
+ {
342
+ surfaceId: "verification_scenario_set",
343
+ relativePath: null,
344
+ class: "user-data",
345
+ notes: "Multiple files under .gdh/verification-scenarios/ created via `gdh verification-scenario`. User owns content; GDH owns shape; semantic schema changes route through subagent envelope. Per D-16.",
346
+ },
347
+ // ---------------------------------------------------------------
348
+ // Project-native class entry (1 entry) — D-17.
349
+ // ---------------------------------------------------------------
350
+ {
351
+ surfaceId: "project_godot",
352
+ relativePath: "project.godot",
353
+ class: "project-native",
354
+ notes: "Owned by the Godot project. Anything outside projectNativeAllowlist is rejected at audit-time. Adding an op requires a registry entry that declares it explicitly. Per D-17.",
355
+ projectNativeAllowlist: [
356
+ {
357
+ op: "edit_editor_plugins_array",
358
+ summary: "Add or remove entries in the [editor_plugins] section.",
359
+ },
360
+ {
361
+ op: "register_autoload",
362
+ summary: "Register or unregister an autoload entry.",
363
+ },
364
+ ],
365
+ },
366
+ ];
367
+ /**
368
+ * Load-time guard used by renderer modules (Plan 70-05) to assert their
369
+ * surface is registered in the manifest under the expected class. Throws
370
+ * loudly on drift — module init aborts before any write can happen.
371
+ *
372
+ * Mirrors the throw-on-violation discipline of
373
+ * packages/core/src/release-span-update-contract.ts (lines 60-83).
374
+ */
375
+ export function assertClassRegistered(surfaceId, expectedClass) {
376
+ const entry = GDH_MANAGED_SURFACE_CLASSES.find((candidate) => candidate.surfaceId === surfaceId);
377
+ if (entry === undefined) {
378
+ throw new Error(`Managed surface "${surfaceId}" is not registered in GDH_MANAGED_SURFACE_CLASSES.`);
379
+ }
380
+ if (entry.class !== expectedClass) {
381
+ throw new Error(`Managed surface "${surfaceId}" is registered as "${entry.class}" but renderer asserts class "${expectedClass}".`);
382
+ }
383
+ }
384
+ //# sourceMappingURL=managed-surface-classes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"managed-surface-classes.js","sourceRoot":"","sources":["../../src/migrations/managed-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,EACjB,aAAqC;IAErC,MAAM,KAAK,GAAG,2BAA2B,CAAC,IAAI,CAC5C,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,SAAS,KAAK,SAAS,CACjD,CAAC;IACF,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CACb,oBAAoB,SAAS,qDAAqD,CACnF,CAAC;IACJ,CAAC;IACD,IAAI,KAAK,CAAC,KAAK,KAAK,aAAa,EAAE,CAAC;QAClC,MAAM,IAAI,KAAK,CACb,oBAAoB,SAAS,uBAAuB,KAAK,CAAC,KAAK,iCAAiC,aAAa,IAAI,CAClH,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,58 @@
1
+ import type { GdhDeferredAction, GdhDeferredActionStatus } from "../state/migration-state.js";
2
+ /**
3
+ * Result of running a deferred-action probe (D-12 / D-27).
4
+ *
5
+ * `status` is the closed enumeration from {@link GdhDeferredActionStatus}.
6
+ * `reason` is a free-form discriminator string (not a translation key) — it
7
+ * names the failure mode for diagnostics; the advisory gate consumes only
8
+ * `status`. `last_checked_at` is the ISO timestamp of this probe call.
9
+ */
10
+ export interface GdhDeferredActionProbeResult {
11
+ readonly status: GdhDeferredActionStatus;
12
+ readonly reason?: string;
13
+ readonly last_checked_at: string;
14
+ }
15
+ /**
16
+ * Host-harness introspection adapter — caller injects this so the probe runner
17
+ * remains pure-data and testable.
18
+ *
19
+ * Returns the latest reload timestamp (ISO 8601) for the given skill id, or
20
+ * `null` if the skill is not registered in the host. `null` for the entire
21
+ * adapter means the host cannot be introspected; the probe runner downgrades
22
+ * to `pending` with reason `host_harness_not_introspectable`.
23
+ */
24
+ export type GdhHostHarnessIntrospect = ((skillId: string) => Promise<string | null>) | null;
25
+ /**
26
+ * Process probe adapter — caller injects this so the probe runner does not
27
+ * depend on Plan 06's process orchestration directly.
28
+ *
29
+ * Returns `true` if every snapshot row referenced in `payload` is currently
30
+ * running, `false` if any are not, and `null` when the probe cannot be
31
+ * evaluated (e.g. no processes-snapshot.json on disk yet). `null` for the
32
+ * entire adapter means the process probe is unavailable (e.g. Plan 06 not
33
+ * yet integrated); the probe runner downgrades to `pending` with reason
34
+ * `process_probe_not_available`.
35
+ */
36
+ export type GdhProcessRestartProbe = ((payload: Record<string, unknown>) => Promise<boolean | null>) | null;
37
+ export interface GdhDeferredActionProbeRunInput {
38
+ readonly targetPath: string;
39
+ readonly hostHarnessIntrospect: GdhHostHarnessIntrospect;
40
+ readonly processProbe: GdhProcessRestartProbe;
41
+ /** Optional ISO-timestamp injector for deterministic tests. */
42
+ readonly nowIso?: () => string;
43
+ }
44
+ /**
45
+ * Run the probe for a single deferred action (closed-kind dispatch).
46
+ *
47
+ * Threat mitigations:
48
+ * - T-72-05-01 (shell injection): no shells, no eval, no child_process; the
49
+ * `verify.payload` is structured data only. The dispatch is a `switch`
50
+ * over the closed `verify.kind` enum.
51
+ * - T-72-05-06 (unknown kind passes through as clean): the default branch
52
+ * returns `status: "stale"`, never `clean`. The advisory gate (Task 05-03)
53
+ * refuses to emit when any probe is stale.
54
+ * - probe never throws — host failure is captured into `status: "stale"` so
55
+ * that the advisory layer cannot crash on a misbehaving adapter.
56
+ */
57
+ export declare function runDeferredActionProbe(action: GdhDeferredAction, input: GdhDeferredActionProbeRunInput): Promise<GdhDeferredActionProbeResult>;
58
+ //# sourceMappingURL=probes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"probes.d.ts","sourceRoot":"","sources":["../../src/migrations/probes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,uBAAuB,EAExB,MAAM,6BAA6B,CAAC;AAErC;;;;;;;GAOG;AACH,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,MAAM,EAAE,uBAAuB,CAAC;IACzC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;CAClC;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,wBAAwB,GAChC,CAAC,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,GAC7C,IAAI,CAAC;AAET;;;;;;;;;;GAUG;AACH,MAAM,MAAM,sBAAsB,GAC9B,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC,GAC/D,IAAI,CAAC;AAET,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,qBAAqB,EAAE,wBAAwB,CAAC;IACzD,QAAQ,CAAC,YAAY,EAAE,sBAAsB,CAAC;IAC9C,+DAA+D;IAC/D,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,MAAM,CAAC;CAChC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,iBAAiB,EACzB,KAAK,EAAE,8BAA8B,GACpC,OAAO,CAAC,4BAA4B,CAAC,CAuBvC"}
@@ -0,0 +1,112 @@
1
+ /**
2
+ * Run the probe for a single deferred action (closed-kind dispatch).
3
+ *
4
+ * Threat mitigations:
5
+ * - T-72-05-01 (shell injection): no shells, no eval, no child_process; the
6
+ * `verify.payload` is structured data only. The dispatch is a `switch`
7
+ * over the closed `verify.kind` enum.
8
+ * - T-72-05-06 (unknown kind passes through as clean): the default branch
9
+ * returns `status: "stale"`, never `clean`. The advisory gate (Task 05-03)
10
+ * refuses to emit when any probe is stale.
11
+ * - probe never throws — host failure is captured into `status: "stale"` so
12
+ * that the advisory layer cannot crash on a misbehaving adapter.
13
+ */
14
+ export async function runDeferredActionProbe(action, input) {
15
+ const nowIso = (input.nowIso ?? (() => new Date().toISOString()))();
16
+ try {
17
+ const kind = action.verify.kind;
18
+ switch (kind) {
19
+ case "agent_skill_metadata_reload":
20
+ return await probeAgentSkillMetadataReload(action, input, nowIso);
21
+ case "process_restart":
22
+ return await probeProcessRestart(action, input, nowIso);
23
+ default:
24
+ return {
25
+ status: "stale",
26
+ reason: "unknown_verify_kind",
27
+ last_checked_at: nowIso,
28
+ };
29
+ }
30
+ }
31
+ catch (error) {
32
+ return {
33
+ status: "stale",
34
+ reason: `probe_threw:${error instanceof Error ? error.message : String(error)}`,
35
+ last_checked_at: nowIso,
36
+ };
37
+ }
38
+ }
39
+ async function probeAgentSkillMetadataReload(action, input, nowIso) {
40
+ if (input.hostHarnessIntrospect === null) {
41
+ return {
42
+ status: "pending",
43
+ reason: "host_harness_not_introspectable",
44
+ last_checked_at: nowIso,
45
+ };
46
+ }
47
+ const payload = action.verify.payload;
48
+ const requiredSkillsRaw = payload["required_skills"];
49
+ const minObservedAfterRaw = payload["min_observed_after"];
50
+ if (!Array.isArray(requiredSkillsRaw) ||
51
+ !requiredSkillsRaw.every((s) => typeof s === "string") ||
52
+ typeof minObservedAfterRaw !== "string") {
53
+ return {
54
+ status: "stale",
55
+ reason: "agent_skill_metadata_reload_payload_malformed",
56
+ last_checked_at: nowIso,
57
+ };
58
+ }
59
+ const minObservedAfter = new Date(minObservedAfterRaw).getTime();
60
+ if (Number.isNaN(minObservedAfter)) {
61
+ return {
62
+ status: "stale",
63
+ reason: "agent_skill_metadata_reload_min_observed_after_invalid",
64
+ last_checked_at: nowIso,
65
+ };
66
+ }
67
+ const requiredSkills = requiredSkillsRaw;
68
+ for (const skillId of requiredSkills) {
69
+ const reloadIso = await input.hostHarnessIntrospect(skillId);
70
+ if (reloadIso === null) {
71
+ return {
72
+ status: "pending",
73
+ reason: `skill_missing:${skillId}`,
74
+ last_checked_at: nowIso,
75
+ };
76
+ }
77
+ const reloadTs = new Date(reloadIso).getTime();
78
+ if (Number.isNaN(reloadTs) || reloadTs < minObservedAfter) {
79
+ return {
80
+ status: "pending",
81
+ reason: `skill_metadata_not_reloaded:${skillId}`,
82
+ last_checked_at: nowIso,
83
+ };
84
+ }
85
+ }
86
+ return { status: "clean", last_checked_at: nowIso };
87
+ }
88
+ async function probeProcessRestart(action, input, nowIso) {
89
+ if (input.processProbe === null) {
90
+ return {
91
+ status: "pending",
92
+ reason: "process_probe_not_available",
93
+ last_checked_at: nowIso,
94
+ };
95
+ }
96
+ const allRunning = await input.processProbe(action.verify.payload);
97
+ if (allRunning === null) {
98
+ return {
99
+ status: "pending",
100
+ reason: "process_probe_indeterminate",
101
+ last_checked_at: nowIso,
102
+ };
103
+ }
104
+ return allRunning
105
+ ? { status: "clean", last_checked_at: nowIso }
106
+ : {
107
+ status: "pending",
108
+ reason: "process_not_running",
109
+ last_checked_at: nowIso,
110
+ };
111
+ }
112
+ //# sourceMappingURL=probes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"probes.js","sourceRoot":"","sources":["../../src/migrations/probes.ts"],"names":[],"mappings":"AAwDA;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,MAAyB,EACzB,KAAqC;IAErC,MAAM,MAAM,GAAG,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC;IACpE,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,IAA4C,CAAC;QACxE,QAAQ,IAAI,EAAE,CAAC;YACb,KAAK,6BAA6B;gBAChC,OAAO,MAAM,6BAA6B,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;YACpE,KAAK,iBAAiB;gBACpB,OAAO,MAAM,mBAAmB,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;YAC1D;gBACE,OAAO;oBACL,MAAM,EAAE,OAAO;oBACf,MAAM,EAAE,qBAAqB;oBAC7B,eAAe,EAAE,MAAM;iBACxB,CAAC;QACN,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAA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