@skillcap/gdh 0.19.2 → 0.19.4
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/INSTALL-BUNDLE.json +1 -1
- package/RELEASE-SPAN-UPDATE-CONTRACTS.json +129 -0
- package/node_modules/@gdh/adapters/dist/authoring-hook-render.d.ts.map +1 -1
- package/node_modules/@gdh/adapters/dist/authoring-hook-render.js +34 -13
- package/node_modules/@gdh/adapters/dist/authoring-hook-render.js.map +1 -1
- package/node_modules/@gdh/adapters/dist/claude-settings-patch.d.ts.map +1 -1
- package/node_modules/@gdh/adapters/dist/claude-settings-patch.js +27 -5
- package/node_modules/@gdh/adapters/dist/claude-settings-patch.js.map +1 -1
- package/node_modules/@gdh/adapters/dist/index.d.ts.map +1 -1
- package/node_modules/@gdh/adapters/dist/index.js +15 -15
- package/node_modules/@gdh/adapters/dist/index.js.map +1 -1
- package/node_modules/@gdh/adapters/package.json +8 -8
- package/node_modules/@gdh/authoring/package.json +2 -2
- package/node_modules/@gdh/cli/dist/self-update.d.ts.map +1 -1
- package/node_modules/@gdh/cli/dist/self-update.js +5 -3
- package/node_modules/@gdh/cli/dist/self-update.js.map +1 -1
- package/node_modules/@gdh/cli/package.json +10 -10
- package/node_modules/@gdh/core/dist/index.d.ts +2 -2
- package/node_modules/@gdh/core/dist/index.js +2 -2
- package/node_modules/@gdh/core/package.json +1 -1
- package/node_modules/@gdh/docs/dist/guidance.js +1 -1
- package/node_modules/@gdh/docs/dist/guidance.js.map +1 -1
- package/node_modules/@gdh/docs/package.json +2 -2
- package/node_modules/@gdh/mcp/package.json +8 -8
- package/node_modules/@gdh/observability/package.json +2 -2
- package/node_modules/@gdh/runtime/package.json +2 -2
- package/node_modules/@gdh/scan/package.json +3 -3
- package/node_modules/@gdh/verify/package.json +7 -7
- package/package.json +11 -11
package/INSTALL-BUNDLE.json
CHANGED
|
@@ -1915,6 +1915,135 @@
|
|
|
1915
1915
|
}
|
|
1916
1916
|
]
|
|
1917
1917
|
}
|
|
1918
|
+
},
|
|
1919
|
+
{
|
|
1920
|
+
"version": "0.19.3",
|
|
1921
|
+
"releaseTag": "v0.19.3",
|
|
1922
|
+
"migrationStatus": "no_op",
|
|
1923
|
+
"summary": "v0.19.3 repairs the v0.19.2 monorepo update path without changing managed surface version constants. Existing v0.19.2-managed targets do not need a new release-specific migration solely for v0.19.3; projects that were blocked by stale root guidance or `--dry-run --target` parsing should rerun the normal self-update and follow any terminal-state migration instructions.",
|
|
1924
|
+
"releaseHighlights": {
|
|
1925
|
+
"summary": "v0.19.3 repairs the v0.19.2 monorepo update path. It fixes `gdh self-update --dry-run --target <path>` so the target path is not mistaken for a version argument, and it makes lifecycle status inspect the target-local generated guidance directory after nested Godot target scoping. The release also aligns the greenfield runtime bridge fixture manifest with the v0.19.2 runtime bridge surface version so migration and drift tests agree with the shipped bridge contract.",
|
|
1926
|
+
"operatorChanges": [
|
|
1927
|
+
"**`--dry-run --target` update previews work correctly.** Agents can preview an update for a monorepo root with an explicit target path without GDH parsing that path as the requested release version.",
|
|
1928
|
+
"**Nested guidance freshness checks use the configured target.** Projects that already have stale root `docs/agent/` copies from older GDH versions no longer get stuck in `migration_needed` when the current canonical guidance lives under the configured Godot target.",
|
|
1929
|
+
"**Missing target-local guidance is repairable.** `gdh migrate --apply` can recreate target-local generated guidance while ignoring stale root duplicates that are no longer canonical for nested Godot targets.",
|
|
1930
|
+
"**Runtime bridge fixture truth is aligned.** The greenfield fixture manifest declares runtime bridge surface v11, matching the v0.19.2 generated bridge files."
|
|
1931
|
+
]
|
|
1932
|
+
},
|
|
1933
|
+
"updateContract": {
|
|
1934
|
+
"summary": "v0.19.3 is a no-op managed-surface release. Use the normal self-update flow; if a target still reports follow-up work from v0.19.2, run the migration command reported by GDH and verify status/drift from the monorepo root or configured Godot target.",
|
|
1935
|
+
"steps": [
|
|
1936
|
+
{
|
|
1937
|
+
"id": "preview_update_with_target",
|
|
1938
|
+
"kind": "mechanical",
|
|
1939
|
+
"summary": "Preview the update from the monorepo root or configured target.",
|
|
1940
|
+
"detail": "Run the normal update preview. If using an explicit target path, `--dry-run --target <path>` is now parsed correctly and the path is not treated as a version.",
|
|
1941
|
+
"commands": [
|
|
1942
|
+
"gdh self-update --dry-run"
|
|
1943
|
+
],
|
|
1944
|
+
"validationCommands": [
|
|
1945
|
+
"gdh self-update --dry-run"
|
|
1946
|
+
]
|
|
1947
|
+
},
|
|
1948
|
+
{
|
|
1949
|
+
"id": "apply_self_update",
|
|
1950
|
+
"kind": "mechanical",
|
|
1951
|
+
"summary": "Apply the self-update and follow GDH terminal-state instructions.",
|
|
1952
|
+
"detail": "Run `gdh self-update`. v0.19.3 itself does not introduce new managed surface versions, but a target that still needs v0.19.2 migration may report `follow_up_required`.",
|
|
1953
|
+
"commands": [
|
|
1954
|
+
"gdh self-update"
|
|
1955
|
+
],
|
|
1956
|
+
"validationCommands": [
|
|
1957
|
+
"gdh status"
|
|
1958
|
+
]
|
|
1959
|
+
},
|
|
1960
|
+
{
|
|
1961
|
+
"id": "run_follow_up_migration_if_reported",
|
|
1962
|
+
"kind": "mechanical",
|
|
1963
|
+
"summary": "Run migration only when GDH reports follow-up work.",
|
|
1964
|
+
"detail": "If `gdh self-update` or `gdh status` reports migration follow-up, run `gdh migrate --apply`. Lifecycle checks now use the target-local guidance root and should not be blocked by stale root `docs/agent/` copies.",
|
|
1965
|
+
"commands": [
|
|
1966
|
+
"gdh migrate --apply"
|
|
1967
|
+
],
|
|
1968
|
+
"validationCommands": [
|
|
1969
|
+
"gdh status",
|
|
1970
|
+
"gdh verify drift"
|
|
1971
|
+
]
|
|
1972
|
+
},
|
|
1973
|
+
{
|
|
1974
|
+
"id": "check_stale_root_guidance_policy",
|
|
1975
|
+
"kind": "agent_reasoning",
|
|
1976
|
+
"summary": "Decide what to do with old root guidance duplicates.",
|
|
1977
|
+
"detail": "For nested Godot targets, old root `docs/agent/` copies are no longer canonical. GDH ignores them for lifecycle freshness, but repository owners should remove or archive stale tracked duplicates only when that matches their repo policy.",
|
|
1978
|
+
"commands": [
|
|
1979
|
+
"gdh guidance status"
|
|
1980
|
+
],
|
|
1981
|
+
"validationCommands": [
|
|
1982
|
+
"gdh status",
|
|
1983
|
+
"gdh verify drift"
|
|
1984
|
+
]
|
|
1985
|
+
}
|
|
1986
|
+
]
|
|
1987
|
+
}
|
|
1988
|
+
},
|
|
1989
|
+
{
|
|
1990
|
+
"version": "0.19.4",
|
|
1991
|
+
"releaseTag": "v0.19.4",
|
|
1992
|
+
"migrationStatus": "required",
|
|
1993
|
+
"summary": "v0.19.4 tightens generated authoring hooks so they only validate current-session Godot authoring files inside the configured target. Existing managed targets need `gdh migrate --apply` because GDH_GUIDANCE_UNIT_VERSION moves 12 -> 13 and GDH_UPDATE_HOOK_VERSION moves 2 -> 3.",
|
|
1994
|
+
"releaseHighlights": {
|
|
1995
|
+
"summary": "v0.19.4 tightens generated authoring hooks so GDH only validates current-session Godot authoring files inside the configured target. This fixes noisy hook runs from unrelated monorepo files while preserving validation for `.gd`, `.tscn`, `.tres`, and `project.godot`. The release also refreshes hook registration behavior for Claude and Codex so stale managed hook config is repaired during migration instead of being treated as current.",
|
|
1996
|
+
"operatorChanges": [
|
|
1997
|
+
"**Hooks ignore unrelated files.** GDH authoring hooks no longer track or validate edits outside the configured Godot target, nor target-local files outside the authoring validation set.",
|
|
1998
|
+
"**Stop validation is session-scoped.** Stop hooks still fire because agent providers trigger them, but GDH only runs final validation when the current agent session has dirty target-local authoring files.",
|
|
1999
|
+
"**`project.godot` is included.** Project config edits inside the target are tracked with `.gd`, `.tscn`, and `.tres` authoring files.",
|
|
2000
|
+
"**Legacy hook config repairs cleanly.** Migration normalizes old Claude hook settings and replaces old Codex managed hook blocks, removing misleading no-op status messages."
|
|
2001
|
+
]
|
|
2002
|
+
},
|
|
2003
|
+
"updateContract": {
|
|
2004
|
+
"summary": "Managed targets need release-specific migration for v0.19.4 because generated authoring hooks, hook registration config, and authoring guidance changed. After self-update, run `gdh migrate --apply` so GDH re-bakes hooks and guidance for the configured Godot target.",
|
|
2005
|
+
"steps": [
|
|
2006
|
+
{
|
|
2007
|
+
"id": "apply_hook_scope_migration",
|
|
2008
|
+
"kind": "mechanical",
|
|
2009
|
+
"summary": "Refresh generated hooks, hook config, and authoring guidance.",
|
|
2010
|
+
"detail": "Run `gdh migrate --apply` from the monorepo root or configured Godot target so GDH re-bakes Claude/Codex hook surfaces and guidance at the current managed surface versions.",
|
|
2011
|
+
"commands": [
|
|
2012
|
+
"gdh migrate --apply"
|
|
2013
|
+
],
|
|
2014
|
+
"validationCommands": [
|
|
2015
|
+
"gdh guidance status",
|
|
2016
|
+
"gdh adapters status",
|
|
2017
|
+
"gdh verify drift"
|
|
2018
|
+
]
|
|
2019
|
+
},
|
|
2020
|
+
{
|
|
2021
|
+
"id": "confirm_authoring_hook_scope",
|
|
2022
|
+
"kind": "mechanical",
|
|
2023
|
+
"summary": "Confirm hooks only react to target-local Godot authoring files.",
|
|
2024
|
+
"detail": "Inspect adapter status and, when dogfooding, verify edits outside the configured Godot target do not produce GDH authoring validation. Edits to `.gd`, `.tscn`, `.tres`, and `project.godot` inside the target should still be tracked.",
|
|
2025
|
+
"commands": [
|
|
2026
|
+
"gdh adapters status"
|
|
2027
|
+
],
|
|
2028
|
+
"validationCommands": [
|
|
2029
|
+
"gdh adapters status",
|
|
2030
|
+
"gdh verify drift"
|
|
2031
|
+
]
|
|
2032
|
+
},
|
|
2033
|
+
{
|
|
2034
|
+
"id": "check_stale_claude_settings",
|
|
2035
|
+
"kind": "mechanical",
|
|
2036
|
+
"summary": "Repair legacy Claude hook settings if present.",
|
|
2037
|
+
"detail": "Targets with existing `.claude/settings.json` GDH authoring hooks should be normalized by migration: PostToolUse matcher anchored, status messages removed, and sibling non-GDH hooks preserved.",
|
|
2038
|
+
"commands": [
|
|
2039
|
+
"gdh migrate --apply"
|
|
2040
|
+
],
|
|
2041
|
+
"validationCommands": [
|
|
2042
|
+
"gdh adapters status"
|
|
2043
|
+
]
|
|
2044
|
+
}
|
|
2045
|
+
]
|
|
2046
|
+
}
|
|
1918
2047
|
}
|
|
1919
2048
|
]
|
|
1920
2049
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authoring-hook-render.d.ts","sourceRoot":"","sources":["../src/authoring-hook-render.ts"],"names":[],"mappings":"AAEA,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,
|
|
1
|
+
{"version":3,"file":"authoring-hook-render.d.ts","sourceRoot":"","sources":["../src/authoring-hook-render.ts"],"names":[],"mappings":"AAEA,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,CA8KT"}
|
|
@@ -35,14 +35,13 @@ export function renderGdhAuthoringHook(input) {
|
|
|
35
35
|
"",
|
|
36
36
|
"function handlePostEdit(input, targetRoot) {",
|
|
37
37
|
" const changed = collectChangedFiles(input, targetRoot);",
|
|
38
|
-
" const authoring = changed.filter(
|
|
38
|
+
" const authoring = changed.filter(isAuthoringValidationPath);",
|
|
39
39
|
" if (authoring.length === 0) return allow();",
|
|
40
40
|
" const state = readDirtyState(targetRoot);",
|
|
41
|
-
" const
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
" const result = runGdh(targetRoot, ['authoring', 'check', '--target', targetRoot, '--mode', 'post-edit', '--format', 'compact', ...scoped.flatMap((file) => ['--changed', file])]);",
|
|
41
|
+
" const sessionState = readCurrentSessionDirtyState(state, input);",
|
|
42
|
+
" const dirtyFiles = unique([...(sessionState.dirtyFiles || []), ...authoring]);",
|
|
43
|
+
" writeCurrentSessionDirtyState(targetRoot, state, input, { dirtyFiles, updatedAt: new Date().toISOString(), lastBlockedHash: sessionState.lastBlockedHash || null });",
|
|
44
|
+
" const result = runGdh(targetRoot, ['authoring', 'check', '--target', targetRoot, '--mode', 'post-edit', '--format', 'compact', ...authoring.flatMap((file) => ['--changed', file])]);",
|
|
46
45
|
" if (!result.ok || !/Completion allowed\\./.test(result.output)) {",
|
|
47
46
|
" return block(`GDH post-edit authoring check needs attention.\\n${result.output || result.error || 'No check output.'}`);",
|
|
48
47
|
" }",
|
|
@@ -51,16 +50,17 @@ export function renderGdhAuthoringHook(input) {
|
|
|
51
50
|
"",
|
|
52
51
|
"function handleStop(input, targetRoot) {",
|
|
53
52
|
" const state = readDirtyState(targetRoot);",
|
|
54
|
-
" const
|
|
53
|
+
" const sessionState = readCurrentSessionDirtyState(state, input);",
|
|
54
|
+
" const dirtyFiles = sanitizeDirtyFiles(sessionState.dirtyFiles || []);",
|
|
55
55
|
" if (dirtyFiles.length === 0) return allow();",
|
|
56
56
|
" const result = runGdh(targetRoot, ['authoring', 'check', '--target', targetRoot, '--mode', 'final', '--format', 'compact']);",
|
|
57
57
|
" if (result.ok && /Completion allowed\\./.test(result.output)) {",
|
|
58
|
-
"
|
|
58
|
+
" clearCurrentSessionDirtyState(targetRoot, state, input);",
|
|
59
59
|
" return allow();",
|
|
60
60
|
" }",
|
|
61
61
|
" const dirtyHash = hash(JSON.stringify(dirtyFiles));",
|
|
62
|
-
" if (input.stop_hook_active === true &&
|
|
63
|
-
"
|
|
62
|
+
" if (input.stop_hook_active === true && sessionState.lastBlockedHash === dirtyHash) return allow();",
|
|
63
|
+
" writeCurrentSessionDirtyState(targetRoot, state, input, { dirtyFiles, updatedAt: new Date().toISOString(), lastBlockedHash: dirtyHash });",
|
|
64
64
|
" return block(`GDH final authoring check is not clean for changed authoring files. Continue fixing before stopping.\\n${result.output || result.error || 'No check output.'}`);",
|
|
65
65
|
"}",
|
|
66
66
|
"",
|
|
@@ -125,7 +125,7 @@ export function renderGdhAuthoringHook(input) {
|
|
|
125
125
|
"function isInside(root, candidate) { const rel = path.relative(root, path.resolve(candidate)); return rel === '' || (!rel.startsWith('..') && !path.isAbsolute(rel)); }",
|
|
126
126
|
"function canonicalPath(value) { try { return fs.realpathSync.native ? fs.realpathSync.native(value) : fs.realpathSync(value); } catch { return path.resolve(value); } }",
|
|
127
127
|
"",
|
|
128
|
-
"function
|
|
128
|
+
"function isAuthoringValidationPath(file) {",
|
|
129
129
|
" if (file === 'project.godot' || file.endsWith('/project.godot')) return true;",
|
|
130
130
|
" return AUTHORING_EXTENSIONS.has(path.extname(file).toLowerCase());",
|
|
131
131
|
"}",
|
|
@@ -139,10 +139,31 @@ export function renderGdhAuthoringHook(input) {
|
|
|
139
139
|
"}",
|
|
140
140
|
"",
|
|
141
141
|
"function dirtyStatePath(targetRoot) { return path.join(targetRoot, '.gdh-state', 'agent-hooks', 'authoring-dirty.json'); }",
|
|
142
|
-
"function readDirtyState(targetRoot) { try { return JSON.parse(fs.readFileSync(dirtyStatePath(targetRoot), 'utf8')); } catch { return {
|
|
142
|
+
"function readDirtyState(targetRoot) { try { return JSON.parse(fs.readFileSync(dirtyStatePath(targetRoot), 'utf8')); } catch { return { sessions: {} }; } }",
|
|
143
143
|
"function writeDirtyState(targetRoot, state) { const file = dirtyStatePath(targetRoot); fs.mkdirSync(path.dirname(file), { recursive: true }); fs.writeFileSync(file, `${JSON.stringify(state, null, 2)}\\n`, 'utf8'); }",
|
|
144
144
|
"function clearDirtyState(targetRoot) { try { fs.rmSync(dirtyStatePath(targetRoot), { force: true }); } catch {} }",
|
|
145
|
-
"function
|
|
145
|
+
"function readCurrentSessionDirtyState(state, input) {",
|
|
146
|
+
" const sessions = state && typeof state === 'object' && state.sessions && typeof state.sessions === 'object' ? state.sessions : {};",
|
|
147
|
+
" const current = sessions[currentSessionKey(input)];",
|
|
148
|
+
" return current && typeof current === 'object' ? current : { dirtyFiles: [], lastBlockedHash: null };",
|
|
149
|
+
"}",
|
|
150
|
+
"function writeCurrentSessionDirtyState(targetRoot, state, input, sessionState) {",
|
|
151
|
+
" const sessions = state && typeof state === 'object' && state.sessions && typeof state.sessions === 'object' ? { ...state.sessions } : {};",
|
|
152
|
+
" sessions[currentSessionKey(input)] = sessionState;",
|
|
153
|
+
" writeDirtyState(targetRoot, { sessions });",
|
|
154
|
+
"}",
|
|
155
|
+
"function clearCurrentSessionDirtyState(targetRoot, state, input) {",
|
|
156
|
+
" const sessions = state && typeof state === 'object' && state.sessions && typeof state.sessions === 'object' ? { ...state.sessions } : {};",
|
|
157
|
+
" delete sessions[currentSessionKey(input)];",
|
|
158
|
+
" if (Object.keys(sessions).length === 0) return clearDirtyState(targetRoot);",
|
|
159
|
+
" writeDirtyState(targetRoot, { sessions });",
|
|
160
|
+
"}",
|
|
161
|
+
"function currentSessionKey(input) { const id = hookSessionId(input); return `${AGENT}:${id || 'no-session'}`; }",
|
|
162
|
+
"function hookSessionId(input) {",
|
|
163
|
+
" const raw = input && (input.session_id || input.sessionId || input.conversation_id || input.conversationId);",
|
|
164
|
+
" return typeof raw === 'string' && raw.trim() ? raw.trim() : '';",
|
|
165
|
+
"}",
|
|
166
|
+
"function sanitizeDirtyFiles(values) { return unique(values).filter((file) => typeof file === 'string' && file !== '' && !file.startsWith('../') && !path.isAbsolute(file) && isAuthoringValidationPath(file)); }",
|
|
146
167
|
"function unique(values) { return [...new Set(values.filter(Boolean))].sort(); }",
|
|
147
168
|
"function hash(value) { return crypto.createHash('sha256').update(value).digest('hex'); }",
|
|
148
169
|
"function readHookInput() { try { return JSON.parse(fs.readFileSync(0, 'utf8') || '{}'); } catch { return {}; } }",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authoring-hook-render.js","sourceRoot":"","sources":["../src/authoring-hook-render.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAEpD,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;QACL,qBAAqB;QACrB,wBAAwB,uBAAuB,EAAE;QACjD,8DAA8D;QAC9D,0BAA0B,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,aAAa,CAAC,GAAG;QAChE,gCAAgC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,kBAAkB,CAAC,GAAG;QAC3E,iBAAiB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG;QAC/C,EAAE;QACF,2BAA2B;QAC3B,+BAA+B;QAC/B,mCAAmC;QACnC,iDAAiD;QACjD,EAAE;QACF,kEAAkE;QAClE,yBAAyB;QACzB,EAAE;QACF,SAAS;QACT,EAAE;QACF,mBAAmB;QACnB,kCAAkC;QAClC,gDAAgD;QAChD,0DAA0D;QAC1D,8BAA8B;QAC9B,oCAAoC;QACpC,6GAA6G;QAC7G,mEAAmE;QACnE,mBAAmB;QACnB,GAAG;QACH,EAAE;QACF,8CAA8C;QAC9C,2DAA2D;QAC3D,
|
|
1
|
+
{"version":3,"file":"authoring-hook-render.js","sourceRoot":"","sources":["../src/authoring-hook-render.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAEpD,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;QACL,qBAAqB;QACrB,wBAAwB,uBAAuB,EAAE;QACjD,8DAA8D;QAC9D,0BAA0B,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,aAAa,CAAC,GAAG;QAChE,gCAAgC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,kBAAkB,CAAC,GAAG;QAC3E,iBAAiB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG;QAC/C,EAAE;QACF,2BAA2B;QAC3B,+BAA+B;QAC/B,mCAAmC;QACnC,iDAAiD;QACjD,EAAE;QACF,kEAAkE;QAClE,yBAAyB;QACzB,EAAE;QACF,SAAS;QACT,EAAE;QACF,mBAAmB;QACnB,kCAAkC;QAClC,gDAAgD;QAChD,0DAA0D;QAC1D,8BAA8B;QAC9B,oCAAoC;QACpC,6GAA6G;QAC7G,mEAAmE;QACnE,mBAAmB;QACnB,GAAG;QACH,EAAE;QACF,8CAA8C;QAC9C,2DAA2D;QAC3D,gEAAgE;QAChE,+CAA+C;QAC/C,6CAA6C;QAC7C,oEAAoE;QACpE,kFAAkF;QAClF,wKAAwK;QACxK,yLAAyL;QACzL,qEAAqE;QACrE,8HAA8H;QAC9H,KAAK;QACL,mBAAmB;QACnB,GAAG;QACH,EAAE;QACF,0CAA0C;QAC1C,6CAA6C;QAC7C,oEAAoE;QACpE,yE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;QACzN,mHAAmH;QACnH,uDAAuD;QACvD,sIAAsI;QACtI,uDAAuD;QACvD,wGAAwG;QACxG,GAAG;QACH,kFAAkF;QAClF,6IAA6I;QAC7I,sDAAsD;QACtD,8CAA8C;QAC9C,GAAG;QACH,oEAAoE;QACpE,6IAA6I;QAC7I,8CAA8C;QAC9C,+EAA+E;QAC/E,8CAA8C;QAC9C,GAAG;QACH,iHAAiH;QACjH,iCAAiC;QACjC,gHAAgH;QAChH,mEAAmE;QACnE,GAAG;QACH,kNAAkN;QAClN,iFAAiF;QACjF,0FAA0F;QAC1F,kHAAkH;QAClH,EAAE;QACF,uCAAuC;QACvC,0BAA0B;QAC1B,kDAAkD;QAClD,oHAAoH;QACpH,0DAA0D;QAC1D,oBAAoB;QACpB,GAAG;QACH,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-settings-patch.d.ts","sourceRoot":"","sources":["../src/claude-settings-patch.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,eAAO,MAAM,6BAA6B,0BAA0B,CAAC;AAErE;;;;;;;GAOG;AACH,eAAO,MAAM,8BAA8B,2CAA2C,CAAC;AACvF,eAAO,MAAM,0BAA0B,uRAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"claude-settings-patch.d.ts","sourceRoot":"","sources":["../src/claude-settings-patch.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,eAAO,MAAM,6BAA6B,0BAA0B,CAAC;AAErE;;;;;;;GAOG;AACH,eAAO,MAAM,8BAA8B,2CAA2C,CAAC;AACvF,eAAO,MAAM,0BAA0B,uRAAgC,CAAC;AA+DxE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,qCAAqC,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,CAuCrF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,mCAAmC,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,CAQnF;AAeD,wBAAgB,uCAAuC,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,CAiDvF"}
|
|
@@ -15,6 +15,7 @@ export const CLAUDE_SETTINGS_RELATIVE_PATH = ".claude/settings.json";
|
|
|
15
15
|
*/
|
|
16
16
|
export const GDH_SESSION_START_HOOK_COMMAND = "node .claude/hooks/gdh-check-update.js";
|
|
17
17
|
export const GDH_AUTHORING_HOOK_COMMAND = CLAUDE_AUTHORING_HOOK_COMMAND;
|
|
18
|
+
const GDH_AUTHORING_POST_TOOL_USE_MATCHER = "^(Edit|Write|MultiEdit)$";
|
|
18
19
|
function hasHookCommand(groups, command) {
|
|
19
20
|
for (const group of groups) {
|
|
20
21
|
if (!group || !Array.isArray(group.hooks))
|
|
@@ -159,21 +160,25 @@ export function patchClaudeSettingsForGdhAuthoringHooks(existingContent) {
|
|
|
159
160
|
const settings = parseClaudeSettings(existingContent);
|
|
160
161
|
const existingHooks = settings.hooks;
|
|
161
162
|
const hooks = existingHooks !== null && typeof existingHooks === "object" ? { ...existingHooks } : {};
|
|
162
|
-
const postToolUse = Array.isArray(hooks.PostToolUse) ?
|
|
163
|
+
const postToolUse = normalizeGdhAuthoringHookGroups(Array.isArray(hooks.PostToolUse) ? hooks.PostToolUse : [], {
|
|
164
|
+
matcher: GDH_AUTHORING_POST_TOOL_USE_MATCHER,
|
|
165
|
+
timeout: 30,
|
|
166
|
+
});
|
|
163
167
|
if (!hasHookCommand(postToolUse, GDH_AUTHORING_HOOK_COMMAND)) {
|
|
164
168
|
postToolUse.push({
|
|
165
|
-
matcher:
|
|
169
|
+
matcher: GDH_AUTHORING_POST_TOOL_USE_MATCHER,
|
|
166
170
|
hooks: [
|
|
167
171
|
{
|
|
168
172
|
type: "command",
|
|
169
173
|
command: GDH_AUTHORING_HOOK_COMMAND,
|
|
170
174
|
timeout: 30,
|
|
171
|
-
statusMessage: "Checking GDH authoring edit",
|
|
172
175
|
},
|
|
173
176
|
],
|
|
174
177
|
});
|
|
175
178
|
}
|
|
176
|
-
const stop = Array.isArray(hooks.Stop) ?
|
|
179
|
+
const stop = normalizeGdhAuthoringHookGroups(Array.isArray(hooks.Stop) ? hooks.Stop : [], {
|
|
180
|
+
timeout: 120,
|
|
181
|
+
});
|
|
177
182
|
if (!hasHookCommand(stop, GDH_AUTHORING_HOOK_COMMAND)) {
|
|
178
183
|
stop.push({
|
|
179
184
|
hooks: [
|
|
@@ -181,7 +186,6 @@ export function patchClaudeSettingsForGdhAuthoringHooks(existingContent) {
|
|
|
181
186
|
type: "command",
|
|
182
187
|
command: GDH_AUTHORING_HOOK_COMMAND,
|
|
183
188
|
timeout: 120,
|
|
184
|
-
statusMessage: "Checking GDH final authoring validation",
|
|
185
189
|
},
|
|
186
190
|
],
|
|
187
191
|
});
|
|
@@ -191,6 +195,24 @@ export function patchClaudeSettingsForGdhAuthoringHooks(existingContent) {
|
|
|
191
195
|
settings.hooks = hooks;
|
|
192
196
|
return `${JSON.stringify(settings, null, 2)}\n`;
|
|
193
197
|
}
|
|
198
|
+
function normalizeGdhAuthoringHookGroups(groups, options) {
|
|
199
|
+
return groups.map((group) => {
|
|
200
|
+
if (!group || !Array.isArray(group.hooks))
|
|
201
|
+
return group;
|
|
202
|
+
if (!hasHookCommand([group], GDH_AUTHORING_HOOK_COMMAND))
|
|
203
|
+
return group;
|
|
204
|
+
const normalizedHooks = group.hooks.map((hook) => hook.type === "command" && hook.command === GDH_AUTHORING_HOOK_COMMAND
|
|
205
|
+
? {
|
|
206
|
+
type: "command",
|
|
207
|
+
command: GDH_AUTHORING_HOOK_COMMAND,
|
|
208
|
+
timeout: options.timeout,
|
|
209
|
+
}
|
|
210
|
+
: hook);
|
|
211
|
+
return options.matcher === undefined
|
|
212
|
+
? { ...group, hooks: normalizedHooks }
|
|
213
|
+
: { ...group, matcher: options.matcher, hooks: normalizedHooks };
|
|
214
|
+
});
|
|
215
|
+
}
|
|
194
216
|
function parseClaudeSettings(existingContent) {
|
|
195
217
|
try {
|
|
196
218
|
const trimmed = existingContent.trim();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-settings-patch.js","sourceRoot":"","sources":["../src/claude-settings-patch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAE3E;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,uBAAuB,CAAC;AAErE;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,wCAAwC,CAAC;AACvF,MAAM,CAAC,MAAM,0BAA0B,GAAG,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"claude-settings-patch.js","sourceRoot":"","sources":["../src/claude-settings-patch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAE3E;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,uBAAuB,CAAC;AAErE;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,wCAAwC,CAAC;AACvF,MAAM,CAAC,MAAM,0BAA0B,GAAG,6BAA6B,CAAC;AACxE,MAAM,mCAAmC,GAAG,0BAA0B,CAAC;AA4BvE,SAAS,cAAc,CAAC,MAAkC,EAAE,OAAe;IACzE,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC;YAAE,SAAS;QACpD,KAAK,MAAM,CAAC,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;YAC5B,IACE,CAAC,KAAK,IAAI;gBACV,OAAO,CAAC,KAAK,QAAQ;gBACpB,CAAuB,CAAC,IAAI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83ED,wBAAgB,gCAAgC,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAQ9E;AAED,wBAAgB,+BAA+B,CAC7C,eAAe,EAAE,MAAM,GAAG,IAAI,EAC9B,aAAa,EAAE,MAAM,GACpB,MAAM,CAOR;AAyvCD,iBAAS,sCAAsC,CAC7C,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,SAAS,gCAAgC,EAAE,GACpD,sCAAsC,CAmCxC;AAiPD,OAAO,EAAE,+BAA+B,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,EAAE,sCAAsC,EAAE,MAAM,gCAAgC,CAAC;AACxF,OAAO,EACL,6BAA6B,EAC7B,mCAAmC,EACnC,4BAA4B,EAC5B,kCAAkC,GACnC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,KAAK,sBAAsB,EAC3B,gBAAgB,GACjB,MAAM,4BAA4B,CAAC;AAMpC,OAAO,EAAE,sCAAsC,EAAE,CAAC"}
|
|
@@ -245,8 +245,8 @@ export async function inspectProjectLifecycleCompatibility(targetPath) {
|
|
|
245
245
|
await inspectVerificationScenarioLifecycleSurface(resolvedTargetPath),
|
|
246
246
|
await inspectRulesLifecycleSurface(resolvedTargetPath, projectConfig),
|
|
247
247
|
inspectAgentContractLifecycleSurface(resolvedTargetPath, guidanceStatus),
|
|
248
|
-
await inspectGuidanceIndexLifecycleSurface(resolvedTargetPath),
|
|
249
|
-
await inspectGuidanceUnitLifecycleSurface(
|
|
248
|
+
await inspectGuidanceIndexLifecycleSurface(guidanceStatus.guidanceRootPath, resolvedTargetPath),
|
|
249
|
+
await inspectGuidanceUnitLifecycleSurface(guidanceStatus.guidanceRootPath, projectConfig, resolvedTargetPath),
|
|
250
250
|
inspectMcpManifestLifecycleSurface(resolvedTargetPath, projectConfig.mcp.enabled, adapterStatus),
|
|
251
251
|
inspectCursorRuleLifecycleSurface(resolvedTargetPath, adapterStatus),
|
|
252
252
|
inspectRuntimeBridgeLifecycleSurface(resolvedTargetPath, bridgeStatus),
|
|
@@ -1924,19 +1924,17 @@ function renderManagedCodexAuthoringHookBlock() {
|
|
|
1924
1924
|
return [
|
|
1925
1925
|
"# BEGIN GDH managed authoring hooks",
|
|
1926
1926
|
"[[hooks.PostToolUse]]",
|
|
1927
|
-
'matcher = "apply_patch|Edit|Write"',
|
|
1927
|
+
'matcher = "^(apply_patch|Edit|Write)$"',
|
|
1928
1928
|
"[[hooks.PostToolUse.hooks]]",
|
|
1929
1929
|
'type = "command"',
|
|
1930
1930
|
`command = ${JSON.stringify(CODEX_AUTHORING_HOOK_COMMAND)}`,
|
|
1931
1931
|
"timeout = 30",
|
|
1932
|
-
'statusMessage = "Checking GDH authoring edit"',
|
|
1933
1932
|
"",
|
|
1934
1933
|
"[[hooks.Stop]]",
|
|
1935
1934
|
"[[hooks.Stop.hooks]]",
|
|
1936
1935
|
'type = "command"',
|
|
1937
1936
|
`command = ${JSON.stringify(CODEX_AUTHORING_HOOK_COMMAND)}`,
|
|
1938
1937
|
"timeout = 120",
|
|
1939
|
-
'statusMessage = "Checking GDH final authoring validation"',
|
|
1940
1938
|
"# END GDH managed authoring hooks",
|
|
1941
1939
|
"",
|
|
1942
1940
|
].join("\n");
|
|
@@ -2360,13 +2358,15 @@ function inspectAgentContractLifecycleSurface(targetPath, guidanceStatus) {
|
|
|
2360
2358
|
},
|
|
2361
2359
|
});
|
|
2362
2360
|
}
|
|
2363
|
-
async function inspectGuidanceIndexLifecycleSurface(
|
|
2361
|
+
async function inspectGuidanceIndexLifecycleSurface(guidanceRootPath, commandTargetPath = guidanceRootPath) {
|
|
2364
2362
|
const relativePath = "docs/agent/README.md";
|
|
2365
|
-
const content = await fs
|
|
2363
|
+
const content = await fs
|
|
2364
|
+
.readFile(path.join(guidanceRootPath, relativePath), "utf8")
|
|
2365
|
+
.catch(() => null);
|
|
2366
2366
|
const detectedVersion = readTaggedVersion(content, /<!-- GDH GUIDANCE INDEX VERSION: (\d+) -->/);
|
|
2367
2367
|
const probes = [
|
|
2368
2368
|
createVersionProbe({
|
|
2369
|
-
targetPath,
|
|
2369
|
+
targetPath: guidanceRootPath,
|
|
2370
2370
|
relativePath,
|
|
2371
2371
|
present: content !== null,
|
|
2372
2372
|
expectedVersion: GDH_GUIDANCE_INDEX_VERSION,
|
|
@@ -2384,7 +2384,7 @@ async function inspectGuidanceIndexLifecycleSurface(targetPath) {
|
|
|
2384
2384
|
action: {
|
|
2385
2385
|
kind: "apply_migration",
|
|
2386
2386
|
summary: "Run GDH migrate to create the default guidance index for this target.",
|
|
2387
|
-
command: migrateApplyCommand(
|
|
2387
|
+
command: migrateApplyCommand(commandTargetPath),
|
|
2388
2388
|
autoApplicable: true,
|
|
2389
2389
|
},
|
|
2390
2390
|
});
|
|
@@ -2410,20 +2410,20 @@ async function inspectGuidanceIndexLifecycleSurface(targetPath) {
|
|
|
2410
2410
|
action: {
|
|
2411
2411
|
kind: "apply_migration",
|
|
2412
2412
|
summary: "Run GDH migrate to regenerate the guidance index with updated content.",
|
|
2413
|
-
command: migrateApplyCommand(
|
|
2413
|
+
command: migrateApplyCommand(commandTargetPath),
|
|
2414
2414
|
autoApplicable: true,
|
|
2415
2415
|
},
|
|
2416
2416
|
});
|
|
2417
2417
|
}
|
|
2418
|
-
async function inspectGuidanceUnitLifecycleSurface(
|
|
2418
|
+
async function inspectGuidanceUnitLifecycleSurface(guidanceRootPath, projectConfig, commandTargetPath = guidanceRootPath) {
|
|
2419
2419
|
const expectedUnits = projectConfig === null ? [] : createDefaultGuidanceUnits(projectConfig);
|
|
2420
2420
|
const probes = [];
|
|
2421
2421
|
for (const unit of expectedUnits) {
|
|
2422
2422
|
const content = await fs
|
|
2423
|
-
.readFile(path.join(
|
|
2423
|
+
.readFile(path.join(guidanceRootPath, unit.relativePath), "utf8")
|
|
2424
2424
|
.catch(() => null);
|
|
2425
2425
|
probes.push(createVersionProbe({
|
|
2426
|
-
targetPath,
|
|
2426
|
+
targetPath: guidanceRootPath,
|
|
2427
2427
|
relativePath: unit.relativePath,
|
|
2428
2428
|
present: content !== null,
|
|
2429
2429
|
expectedVersion: GDH_GUIDANCE_UNIT_VERSION,
|
|
@@ -2467,7 +2467,7 @@ async function inspectGuidanceUnitLifecycleSurface(targetPath, projectConfig) {
|
|
|
2467
2467
|
action: {
|
|
2468
2468
|
kind: "apply_migration",
|
|
2469
2469
|
summary: "Run GDH migrate to create the missing default guidance unit files.",
|
|
2470
|
-
command: migrateApplyCommand(
|
|
2470
|
+
command: migrateApplyCommand(commandTargetPath),
|
|
2471
2471
|
autoApplicable: true,
|
|
2472
2472
|
},
|
|
2473
2473
|
});
|
|
@@ -2482,7 +2482,7 @@ async function inspectGuidanceUnitLifecycleSurface(targetPath, projectConfig) {
|
|
|
2482
2482
|
action: {
|
|
2483
2483
|
kind: "apply_migration",
|
|
2484
2484
|
summary: "Run GDH migrate to regenerate guidance units with updated content.",
|
|
2485
|
-
command: migrateApplyCommand(
|
|
2485
|
+
command: migrateApplyCommand(commandTargetPath),
|
|
2486
2486
|
autoApplicable: true,
|
|
2487
2487
|
},
|
|
2488
2488
|
});
|