@skillcap/gdh 2.0.1 → 3.0.1
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 +121 -0
- package/node_modules/@gdh/adapters/dist/authoring-hook-render.d.ts +3 -18
- package/node_modules/@gdh/adapters/dist/authoring-hook-render.d.ts.map +1 -1
- package/node_modules/@gdh/adapters/dist/authoring-hook-render.js +11 -6
- package/node_modules/@gdh/adapters/dist/authoring-hook-render.js.map +1 -1
- package/node_modules/@gdh/adapters/dist/claude-settings-patch.d.ts +15 -3
- package/node_modules/@gdh/adapters/dist/claude-settings-patch.d.ts.map +1 -1
- package/node_modules/@gdh/adapters/dist/claude-settings-patch.js +14 -2
- package/node_modules/@gdh/adapters/dist/claude-settings-patch.js.map +1 -1
- package/node_modules/@gdh/adapters/dist/claude-statusline-render.d.ts +18 -9
- package/node_modules/@gdh/adapters/dist/claude-statusline-render.d.ts.map +1 -1
- package/node_modules/@gdh/adapters/dist/claude-statusline-render.js +18 -9
- package/node_modules/@gdh/adapters/dist/claude-statusline-render.js.map +1 -1
- package/node_modules/@gdh/adapters/dist/claude-update-hook-render.d.ts +8 -2
- package/node_modules/@gdh/adapters/dist/claude-update-hook-render.d.ts.map +1 -1
- package/node_modules/@gdh/adapters/dist/claude-update-hook-render.js +8 -2
- package/node_modules/@gdh/adapters/dist/claude-update-hook-render.js.map +1 -1
- package/node_modules/@gdh/adapters/dist/claude-update-worker-render.d.ts +2 -2
- package/node_modules/@gdh/adapters/dist/claude-update-worker-render.js +2 -2
- package/node_modules/@gdh/adapters/dist/index.d.ts +2 -5
- package/node_modules/@gdh/adapters/dist/index.d.ts.map +1 -1
- package/node_modules/@gdh/adapters/dist/index.js +19 -75
- package/node_modules/@gdh/adapters/dist/index.js.map +1 -1
- package/node_modules/@gdh/adapters/dist/skill-rendering.d.ts.map +1 -1
- package/node_modules/@gdh/adapters/dist/skill-rendering.js +1 -0
- package/node_modules/@gdh/adapters/dist/skill-rendering.js.map +1 -1
- package/node_modules/@gdh/adapters/dist/templates/authoring-hook.js.tpl +49 -43
- package/node_modules/@gdh/adapters/package.json +8 -8
- package/node_modules/@gdh/authoring/dist/project.d.ts.map +1 -1
- package/node_modules/@gdh/authoring/dist/project.js +39 -12
- package/node_modules/@gdh/authoring/dist/project.js.map +1 -1
- package/node_modules/@gdh/authoring/package.json +2 -2
- package/node_modules/@gdh/cli/dist/index.d.ts.map +1 -1
- package/node_modules/@gdh/cli/dist/index.js +121 -80
- package/node_modules/@gdh/cli/dist/index.js.map +1 -1
- package/node_modules/@gdh/cli/dist/self-update.d.ts.map +1 -1
- package/node_modules/@gdh/cli/dist/self-update.js +62 -1
- package/node_modules/@gdh/cli/dist/self-update.js.map +1 -1
- package/node_modules/@gdh/cli/dist/setup.d.ts +7 -0
- package/node_modules/@gdh/cli/dist/setup.d.ts.map +1 -1
- package/node_modules/@gdh/cli/dist/setup.js +43 -11
- package/node_modules/@gdh/cli/dist/setup.js.map +1 -1
- package/node_modules/@gdh/cli/package.json +10 -10
- package/node_modules/@gdh/core/dist/git-root.d.ts +8 -0
- package/node_modules/@gdh/core/dist/git-root.d.ts.map +1 -0
- package/node_modules/@gdh/core/dist/git-root.js +39 -0
- package/node_modules/@gdh/core/dist/git-root.js.map +1 -0
- package/node_modules/@gdh/core/dist/index.d.ts +19 -18
- package/node_modules/@gdh/core/dist/index.d.ts.map +1 -1
- package/node_modules/@gdh/core/dist/index.js +17 -2
- package/node_modules/@gdh/core/dist/index.js.map +1 -1
- package/node_modules/@gdh/core/dist/migrations/entries/s3c21_to_s3c22_canonical_hook_paths.d.ts +3 -0
- package/node_modules/@gdh/core/dist/migrations/entries/s3c21_to_s3c22_canonical_hook_paths.d.ts.map +1 -0
- package/node_modules/@gdh/core/dist/migrations/entries/s3c21_to_s3c22_canonical_hook_paths.js +336 -0
- package/node_modules/@gdh/core/dist/migrations/entries/s3c21_to_s3c22_canonical_hook_paths.js.map +1 -0
- package/node_modules/@gdh/core/dist/migrations/managed-surface-classes.d.ts +13 -11
- package/node_modules/@gdh/core/dist/migrations/managed-surface-classes.d.ts.map +1 -1
- package/node_modules/@gdh/core/dist/migrations/managed-surface-classes.js +13 -11
- package/node_modules/@gdh/core/dist/migrations/managed-surface-classes.js.map +1 -1
- package/node_modules/@gdh/core/dist/migrations/registry.d.ts +1 -1
- package/node_modules/@gdh/core/dist/migrations/registry.d.ts.map +1 -1
- package/node_modules/@gdh/core/dist/migrations/registry.js +2 -0
- package/node_modules/@gdh/core/dist/migrations/registry.js.map +1 -1
- package/node_modules/@gdh/core/dist/state/codex-retrust-reminder.d.ts +40 -0
- package/node_modules/@gdh/core/dist/state/codex-retrust-reminder.d.ts.map +1 -0
- package/node_modules/@gdh/core/dist/state/codex-retrust-reminder.js +66 -0
- package/node_modules/@gdh/core/dist/state/codex-retrust-reminder.js.map +1 -0
- package/node_modules/@gdh/core/dist/state/migration-trace.d.ts +61 -0
- package/node_modules/@gdh/core/dist/state/migration-trace.d.ts.map +1 -0
- package/node_modules/@gdh/core/dist/state/migration-trace.js +103 -0
- package/node_modules/@gdh/core/dist/state/migration-trace.js.map +1 -0
- package/node_modules/@gdh/core/dist/update-probe.d.ts +1 -2
- package/node_modules/@gdh/core/dist/update-probe.d.ts.map +1 -1
- package/node_modules/@gdh/core/dist/update-probe.js +1 -2
- package/node_modules/@gdh/core/dist/update-probe.js.map +1 -1
- package/node_modules/@gdh/core/package.json +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/node_modules/@gdh/adapters/dist/authoring-hook-state-path.d.ts +0 -17
- package/node_modules/@gdh/adapters/dist/authoring-hook-state-path.d.ts.map +0 -1
- package/node_modules/@gdh/adapters/dist/authoring-hook-state-path.js +0 -23
- package/node_modules/@gdh/adapters/dist/authoring-hook-state-path.js.map +0 -1
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
import fs from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { randomUUID } from "node:crypto";
|
|
4
|
+
import { resolveGitRoot } from "../../git-root.js";
|
|
5
|
+
import { setCodexRetrustReminder } from "../../state/codex-retrust-reminder.js";
|
|
6
|
+
import { appendMigrationTraceEvent } from "../../state/migration-trace.js";
|
|
7
|
+
/**
|
|
8
|
+
* s3c21 → s3c22 — canonical hook paths + defensive command literals (RFC 0010).
|
|
9
|
+
*
|
|
10
|
+
* Single class-1 migration step shipped in v3.0.0 per RFC 0010 R3.1. Cleans
|
|
11
|
+
* up the pre-RFC layout so the orchestrator's downstream re-bake can write
|
|
12
|
+
* the canonical `<gitroot>/.gdh/hooks/` surface without colliding with the
|
|
13
|
+
* legacy `.claude/hooks/gdh-*.js` and `.codex/hooks/gdh-authoring-guard.js`
|
|
14
|
+
* scripts, and without leaving the legacy command literals in
|
|
15
|
+
* `.claude/settings.json` or `.codex/config.toml`.
|
|
16
|
+
*
|
|
17
|
+
* Why a registry entry: the surfaces themselves are deterministic (re-bake
|
|
18
|
+
* writes the new files, re-bake patches the new command literals into
|
|
19
|
+
* `.claude/settings.json` and `.codex/config.toml` idempotently). But re-bake
|
|
20
|
+
* does NOT delete legacy files at the OLD paths and does NOT strip the OLD
|
|
21
|
+
* command literals — those are the irreducible cleanup ops this entry owns.
|
|
22
|
+
* This is the one exception the registry README's "no class-1 identity
|
|
23
|
+
* entries" rule makes room for: a class-1 file MOVE has cleanup work that
|
|
24
|
+
* deterministic re-bake cannot perform.
|
|
25
|
+
*
|
|
26
|
+
* Transform contract:
|
|
27
|
+
* 1. Resolve git root via the canonical `resolveGitRoot()` helper. The
|
|
28
|
+
* legacy + new layouts are both git-root-anchored under D2; if the
|
|
29
|
+
* target is not in a git repo, fail fast with the typed
|
|
30
|
+
* `GitRequiredError` (D1).
|
|
31
|
+
* 2. Delete the five legacy hook script files at their pre-RFC paths
|
|
32
|
+
* (`.claude/hooks/gdh-{authoring-guard,check-update,check-update-worker,statusline}.js`,
|
|
33
|
+
* `.codex/hooks/gdh-authoring-guard.js`). Missing files are a no-op.
|
|
34
|
+
* 3. After per-file deletion, attempt to remove `.claude/hooks/` and
|
|
35
|
+
* `.codex/hooks/` directories ONLY when empty. Foreign hooks under
|
|
36
|
+
* these dirs (other tools' hooks) are preserved — `rmdir` rejects
|
|
37
|
+
* non-empty directories.
|
|
38
|
+
* 4. Rewrite `.claude/settings.json`: parse the JSON, scrub every hook
|
|
39
|
+
* group whose `command` literal matches the legacy SessionStart
|
|
40
|
+
* command (`LEGACY_GDH_SESSION_START_HOOK_COMMAND`) or the legacy
|
|
41
|
+
* Claude authoring `node -e "<walk-up>" .claude/hooks/gdh-authoring-guard.js`
|
|
42
|
+
* megastring. Drop `statusLine.command` if equal to the legacy
|
|
43
|
+
* `GDH_STATUSLINE_COMMAND` literal. Write idempotently via 2-space
|
|
44
|
+
* indent + trailing newline.
|
|
45
|
+
* 5. Rewrite `.codex/config.toml`: strip the entire managed
|
|
46
|
+
* `# BEGIN GDH managed authoring hooks ... # END GDH managed
|
|
47
|
+
* authoring hooks` envelope. Re-bake writes the new envelope
|
|
48
|
+
* idempotently downstream.
|
|
49
|
+
*
|
|
50
|
+
* Verify probe (D-05 — anti-tautology):
|
|
51
|
+
* - Pre-state has all five legacy hook files + the legacy command
|
|
52
|
+
* literals → verify rejects with the matching reason.
|
|
53
|
+
* - Post-state has none of them → verify passes.
|
|
54
|
+
*
|
|
55
|
+
* Idempotency: re-running on an already-migrated target is a no-op
|
|
56
|
+
* (every step is in-place delete-when-present / scrub-when-present).
|
|
57
|
+
*
|
|
58
|
+
* Companion fixture pair: `tests/fixtures/migration-goldens/s3c21_to_s3c22_canonical_hook_paths/{before,after}/`.
|
|
59
|
+
*/
|
|
60
|
+
const ENTRY_ID = "s3c21_to_s3c22_canonical_hook_paths";
|
|
61
|
+
const LEGACY_HOOK_RELATIVE_PATHS = [
|
|
62
|
+
".claude/hooks/gdh-authoring-guard.js",
|
|
63
|
+
".claude/hooks/gdh-check-update.js",
|
|
64
|
+
".claude/hooks/gdh-check-update-worker.js",
|
|
65
|
+
".claude/hooks/gdh-statusline.js",
|
|
66
|
+
".codex/hooks/gdh-authoring-guard.js",
|
|
67
|
+
];
|
|
68
|
+
const LEGACY_HOOK_PARENT_DIRS = [".claude/hooks", ".codex/hooks"];
|
|
69
|
+
const CLAUDE_SETTINGS_RELATIVE_PATH = ".claude/settings.json";
|
|
70
|
+
const CODEX_CONFIG_RELATIVE_PATH = ".codex/config.toml";
|
|
71
|
+
/**
|
|
72
|
+
* Legacy SessionStart command literal (pre-RFC 0010). Mirrors
|
|
73
|
+
* `LEGACY_GDH_SESSION_START_HOOK_COMMAND` exported from
|
|
74
|
+
* `packages/adapters/src/claude-settings-patch.ts`. Inlined here to avoid
|
|
75
|
+
* an `@gdh/adapters` → `@gdh/core` reverse import edge.
|
|
76
|
+
*/
|
|
77
|
+
const LEGACY_SESSION_START_COMMAND = "node .claude/hooks/gdh-check-update.js";
|
|
78
|
+
/**
|
|
79
|
+
* Legacy statusline command literal (pre-RFC 0010). Mirrors
|
|
80
|
+
* `GDH_STATUSLINE_COMMAND` exported from `claude-statusline-render.ts`.
|
|
81
|
+
*/
|
|
82
|
+
const LEGACY_STATUSLINE_COMMAND = "node .claude/hooks/gdh-statusline.js";
|
|
83
|
+
/**
|
|
84
|
+
* Substring matcher for the pre-RFC Claude authoring `node -e "<walk-up>"`
|
|
85
|
+
* megastring. The walk-up shape contains the literal
|
|
86
|
+
* `.claude/hooks/gdh-authoring-guard.js` somewhere in its body; matching on
|
|
87
|
+
* that substring inside a `node -e ` prefix is sufficient — the new
|
|
88
|
+
* defensive literal at `${CLAUDE_PROJECT_DIR:-...}/.gdh/hooks/authoring-guard.js`
|
|
89
|
+
* does NOT contain `.claude/hooks/gdh-authoring-guard.js`.
|
|
90
|
+
*/
|
|
91
|
+
function isLegacyClaudeAuthoringWalkUpCommand(command) {
|
|
92
|
+
return (command.startsWith("node -e ") &&
|
|
93
|
+
command.includes(".claude/hooks/gdh-authoring-guard.js"));
|
|
94
|
+
}
|
|
95
|
+
function isLegacyHookCommand(hook) {
|
|
96
|
+
if (hook?.type !== "command")
|
|
97
|
+
return false;
|
|
98
|
+
const command = typeof hook?.command === "string" ? hook.command : "";
|
|
99
|
+
return (command === LEGACY_SESSION_START_COMMAND ||
|
|
100
|
+
isLegacyClaudeAuthoringWalkUpCommand(command));
|
|
101
|
+
}
|
|
102
|
+
function isLegacyManagedStatusline(value) {
|
|
103
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) {
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
const record = value;
|
|
107
|
+
return record["type"] === "command" && record["command"] === LEGACY_STATUSLINE_COMMAND;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Strip the managed Codex authoring-hook envelope. Mirrors
|
|
111
|
+
* `removeManagedCodexAuthoringHookBlock` in
|
|
112
|
+
* `packages/adapters/src/codex-authoring-hook-block.ts` — inlined to keep
|
|
113
|
+
* @gdh/core layer-pure.
|
|
114
|
+
*/
|
|
115
|
+
function stripManagedCodexAuthoringHookEnvelope(content) {
|
|
116
|
+
return content
|
|
117
|
+
.replace(/(?:^|\n)# BEGIN GDH managed authoring hooks\n[\s\S]*?# END GDH managed authoring hooks\n?/, "\n")
|
|
118
|
+
.replace(/\n{3,}/g, "\n\n")
|
|
119
|
+
.trimEnd();
|
|
120
|
+
}
|
|
121
|
+
async function fileExists(absolutePath) {
|
|
122
|
+
return fs
|
|
123
|
+
.access(absolutePath)
|
|
124
|
+
.then(() => true)
|
|
125
|
+
.catch(() => false);
|
|
126
|
+
}
|
|
127
|
+
async function writeFileAtomic(filePath, content) {
|
|
128
|
+
await fs.mkdir(path.dirname(filePath), { recursive: true });
|
|
129
|
+
const tempPath = path.join(path.dirname(filePath), `.${path.basename(filePath)}.${randomUUID()}.tmp`);
|
|
130
|
+
await fs.writeFile(tempPath, content, "utf8");
|
|
131
|
+
await fs.rename(tempPath, filePath);
|
|
132
|
+
}
|
|
133
|
+
function scrubLegacyHookGroups(groups) {
|
|
134
|
+
const scrubbed = [];
|
|
135
|
+
for (const group of groups) {
|
|
136
|
+
if (!group || typeof group !== "object" || !Array.isArray(group.hooks)) {
|
|
137
|
+
scrubbed.push(group);
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
const filteredHooks = group.hooks.filter((hook) => !isLegacyHookCommand(hook));
|
|
141
|
+
if (filteredHooks.length === 0) {
|
|
142
|
+
// Whole group consisted of legacy entries — drop the group.
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
scrubbed.push({ ...group, hooks: filteredHooks });
|
|
146
|
+
}
|
|
147
|
+
return scrubbed;
|
|
148
|
+
}
|
|
149
|
+
function scrubLegacyClaudeSettings(content) {
|
|
150
|
+
let parsed;
|
|
151
|
+
try {
|
|
152
|
+
const trimmed = content.trim();
|
|
153
|
+
if (trimmed.length === 0)
|
|
154
|
+
return content;
|
|
155
|
+
parsed = JSON.parse(trimmed);
|
|
156
|
+
}
|
|
157
|
+
catch {
|
|
158
|
+
return content;
|
|
159
|
+
}
|
|
160
|
+
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
161
|
+
return content;
|
|
162
|
+
}
|
|
163
|
+
const settings = parsed;
|
|
164
|
+
let mutated = false;
|
|
165
|
+
if (settings.hooks !== null && typeof settings.hooks === "object") {
|
|
166
|
+
const hooks = settings.hooks;
|
|
167
|
+
for (const key of Object.keys(hooks)) {
|
|
168
|
+
const groups = hooks[key];
|
|
169
|
+
if (!Array.isArray(groups))
|
|
170
|
+
continue;
|
|
171
|
+
const scrubbed = scrubLegacyHookGroups(groups);
|
|
172
|
+
if (scrubbed.length === 0) {
|
|
173
|
+
delete hooks[key];
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
hooks[key] = scrubbed;
|
|
177
|
+
}
|
|
178
|
+
mutated = true;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
if (isLegacyManagedStatusline(settings.statusLine)) {
|
|
182
|
+
delete settings.statusLine;
|
|
183
|
+
mutated = true;
|
|
184
|
+
}
|
|
185
|
+
if (!mutated)
|
|
186
|
+
return content;
|
|
187
|
+
return `${JSON.stringify(settings, null, 2)}\n`;
|
|
188
|
+
}
|
|
189
|
+
export const entry_s3c21_to_s3c22 = {
|
|
190
|
+
id: ENTRY_ID,
|
|
191
|
+
from: { schema: 3, agentContract: 21 },
|
|
192
|
+
to: { schema: 3, agentContract: 22 },
|
|
193
|
+
classesTouched: ["deterministic"],
|
|
194
|
+
async transform(targetPath) {
|
|
195
|
+
// RFC 0010 D1 + D2 — anchor on git root. The legacy + new layouts both
|
|
196
|
+
// sit at git toplevel, so the migration target is the git root for the
|
|
197
|
+
// working tree containing `targetPath`. The chain orchestrator hands us
|
|
198
|
+
// the integration root (already git-root-anchored under D2 once 91-C is
|
|
199
|
+
// live), but be defensive: re-resolve the git root so monorepo nested
|
|
200
|
+
// calls land at the right place even if the orchestrator passes a
|
|
201
|
+
// sub-path.
|
|
202
|
+
const gitRoot = await resolveGitRoot(targetPath);
|
|
203
|
+
// Step 2 — delete legacy hook script files. Missing files are a no-op.
|
|
204
|
+
// Each successful deletion is recorded as a `file_deleted` trace event
|
|
205
|
+
// so `gdh self-update` can surface it to the operator post-apply
|
|
206
|
+
// (CPATH-15).
|
|
207
|
+
for (const relativePath of LEGACY_HOOK_RELATIVE_PATHS) {
|
|
208
|
+
const absolutePath = path.join(gitRoot, relativePath);
|
|
209
|
+
const existed = await fs
|
|
210
|
+
.access(absolutePath)
|
|
211
|
+
.then(() => true)
|
|
212
|
+
.catch(() => false);
|
|
213
|
+
if (!existed)
|
|
214
|
+
continue;
|
|
215
|
+
await fs.rm(absolutePath, { force: true });
|
|
216
|
+
await appendMigrationTraceEvent(gitRoot, ENTRY_ID, {
|
|
217
|
+
kind: "file_deleted",
|
|
218
|
+
relativePath,
|
|
219
|
+
summary: `Deleted legacy hook script ${relativePath} (relocated under .gdh/hooks/ in v3.0.0).`,
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
// Step 3 — best-effort empty-directory cleanup. `rmdir` on a non-empty
|
|
223
|
+
// dir rejects with ENOTEMPTY, which is exactly the foreign-hooks-preserved
|
|
224
|
+
// semantics we want. Swallow any error so a non-empty dir does not abort
|
|
225
|
+
// the transform.
|
|
226
|
+
for (const relativeDir of LEGACY_HOOK_PARENT_DIRS) {
|
|
227
|
+
const absoluteDir = path.join(gitRoot, relativeDir);
|
|
228
|
+
const removed = await fs
|
|
229
|
+
.rmdir(absoluteDir)
|
|
230
|
+
.then(() => true)
|
|
231
|
+
.catch(() => false);
|
|
232
|
+
if (removed) {
|
|
233
|
+
await appendMigrationTraceEvent(gitRoot, ENTRY_ID, {
|
|
234
|
+
kind: "directory_removed",
|
|
235
|
+
relativePath: relativeDir,
|
|
236
|
+
summary: `Removed empty legacy hook directory ${relativeDir} (foreign hooks would have prevented this).`,
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
// Step 4 — scrub legacy literals from `.claude/settings.json`.
|
|
241
|
+
const claudeSettingsPath = path.join(gitRoot, CLAUDE_SETTINGS_RELATIVE_PATH);
|
|
242
|
+
const claudeSettings = await fs
|
|
243
|
+
.readFile(claudeSettingsPath, "utf8")
|
|
244
|
+
.catch(() => null);
|
|
245
|
+
if (claudeSettings !== null) {
|
|
246
|
+
const next = scrubLegacyClaudeSettings(claudeSettings);
|
|
247
|
+
if (next !== claudeSettings) {
|
|
248
|
+
await writeFileAtomic(claudeSettingsPath, next);
|
|
249
|
+
await appendMigrationTraceEvent(gitRoot, ENTRY_ID, {
|
|
250
|
+
kind: "claude_settings_rewritten",
|
|
251
|
+
relativePath: CLAUDE_SETTINGS_RELATIVE_PATH,
|
|
252
|
+
summary: "Stripped legacy SessionStart / authoring walk-up / statusline command literals from .claude/settings.json.",
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
// Step 5 — strip the legacy Codex authoring-hook envelope from
|
|
257
|
+
// `.codex/config.toml`. Re-bake re-emits the new envelope downstream.
|
|
258
|
+
// PR-1 / CPATH-16: any rewrite here means the operator's Codex CLI will
|
|
259
|
+
// see the managed authoring-hook entry as `Modified` until manually
|
|
260
|
+
// re-trusted via `/hooks` → `t`. Set the reminder marker so
|
|
261
|
+
// `gdh self-update` and `gdh status` can surface the action item.
|
|
262
|
+
const codexConfigPath = path.join(gitRoot, CODEX_CONFIG_RELATIVE_PATH);
|
|
263
|
+
const codexConfig = await fs
|
|
264
|
+
.readFile(codexConfigPath, "utf8")
|
|
265
|
+
.catch(() => null);
|
|
266
|
+
if (codexConfig !== null) {
|
|
267
|
+
const stripped = stripManagedCodexAuthoringHookEnvelope(codexConfig);
|
|
268
|
+
// `stripManagedCodexAuthoringHookEnvelope` trims the trailing newline;
|
|
269
|
+
// restore it so the file ends with a single newline (Phase 91-B
|
|
270
|
+
// contract). When the envelope is absent and content already trimmed
|
|
271
|
+
// matches, no write is needed.
|
|
272
|
+
const normalized = stripped === "" ? "" : `${stripped}\n`;
|
|
273
|
+
if (normalized !== codexConfig) {
|
|
274
|
+
await writeFileAtomic(codexConfigPath, normalized);
|
|
275
|
+
await appendMigrationTraceEvent(gitRoot, ENTRY_ID, {
|
|
276
|
+
kind: "codex_config_rewritten",
|
|
277
|
+
relativePath: CODEX_CONFIG_RELATIVE_PATH,
|
|
278
|
+
summary: "Stripped legacy `# BEGIN GDH managed authoring hooks` envelope from .codex/config.toml; re-bake re-emits the canonical envelope.",
|
|
279
|
+
});
|
|
280
|
+
await setCodexRetrustReminder(gitRoot, ENTRY_ID);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
},
|
|
284
|
+
async verify(targetPath) {
|
|
285
|
+
const gitRoot = await resolveGitRoot(targetPath);
|
|
286
|
+
// 1. Legacy hook script files must be absent.
|
|
287
|
+
for (const relativePath of LEGACY_HOOK_RELATIVE_PATHS) {
|
|
288
|
+
const absolutePath = path.join(gitRoot, relativePath);
|
|
289
|
+
if (await fileExists(absolutePath)) {
|
|
290
|
+
return {
|
|
291
|
+
ok: false,
|
|
292
|
+
reason: `Expected legacy hook file ${relativePath} to be removed by the s3c21→s3c22 transform; file still present (legacy_hook_files_remain).`,
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
// 2. `.claude/settings.json` must not contain any legacy command literal.
|
|
297
|
+
const claudeSettingsPath = path.join(gitRoot, CLAUDE_SETTINGS_RELATIVE_PATH);
|
|
298
|
+
const claudeSettings = await fs
|
|
299
|
+
.readFile(claudeSettingsPath, "utf8")
|
|
300
|
+
.catch(() => null);
|
|
301
|
+
if (claudeSettings !== null) {
|
|
302
|
+
if (claudeSettings.includes(LEGACY_SESSION_START_COMMAND)) {
|
|
303
|
+
return {
|
|
304
|
+
ok: false,
|
|
305
|
+
reason: `Expected legacy SessionStart command literal to be stripped from ${CLAUDE_SETTINGS_RELATIVE_PATH}; literal still present (legacy_session_start_remains).`,
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
if (claudeSettings.includes("node -e ") &&
|
|
309
|
+
claudeSettings.includes(".claude/hooks/gdh-authoring-guard.js")) {
|
|
310
|
+
return {
|
|
311
|
+
ok: false,
|
|
312
|
+
reason: `Expected legacy Claude authoring walk-up command to be stripped from ${CLAUDE_SETTINGS_RELATIVE_PATH}; legacy literal still present (legacy_claude_authoring_walk_up_remains).`,
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
if (claudeSettings.includes(LEGACY_STATUSLINE_COMMAND)) {
|
|
316
|
+
return {
|
|
317
|
+
ok: false,
|
|
318
|
+
reason: `Expected legacy statusline command literal to be stripped from ${CLAUDE_SETTINGS_RELATIVE_PATH}; literal still present (legacy_statusline_remains).`,
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
// 3. `.codex/config.toml` must not contain the legacy authoring walk-up.
|
|
323
|
+
const codexConfigPath = path.join(gitRoot, CODEX_CONFIG_RELATIVE_PATH);
|
|
324
|
+
const codexConfig = await fs.readFile(codexConfigPath, "utf8").catch(() => null);
|
|
325
|
+
if (codexConfig !== null) {
|
|
326
|
+
if (codexConfig.includes(".codex/hooks/gdh-authoring-guard.js")) {
|
|
327
|
+
return {
|
|
328
|
+
ok: false,
|
|
329
|
+
reason: `Expected legacy Codex authoring walk-up command to be stripped from ${CODEX_CONFIG_RELATIVE_PATH}; legacy literal still present (legacy_codex_authoring_walk_up_remains).`,
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
return { ok: true };
|
|
334
|
+
},
|
|
335
|
+
};
|
|
336
|
+
//# sourceMappingURL=s3c21_to_s3c22_canonical_hook_paths.js.map
|
package/node_modules/@gdh/core/dist/migrations/entries/s3c21_to_s3c22_canonical_hook_paths.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"s3c21_to_s3c22_canonical_hook_paths.js","sourceRoot":"","sources":["../../../src/migrations/entries/s3c21_to_s3c22_canonical_hook_paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAM3E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AAEH,MAAM,QAAQ,GAAG,qCAAqC,CAAC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L,EAAE,EAAE,KAAK;oBACT,MAAM,EAAE,kEAAkE,6BAA6B,sDAAsD;iBAC9J,CAAC;YACJ,CAAC;QACH,CAAC;QAED,yEAAyE;QACzE,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,0BAA0B,CAAC,CAAC;QACvE,MAAM,WAAW,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;QACjF,IAAI,WAAW,KAAK,IAAI,EAAE,CAAC;YACzB,IAAI,WAAW,CAAC,QAAQ,CAAC,qCAAqC,CAAC,EAAE,CAAC;gBAChE,OAAO;oBACL,EAAE,EAAE,KAAK;oBACT,MAAM,EAAE,uEAAuE,0BAA0B,0EAA0E;iBACpL,CAAC;YACJ,CAAC;QACH,CAAC;QAED,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;IACtB,CAAC;CACF,CAAC"}
|
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Single source of truth for assigning every GDH-managed render call site to
|
|
5
5
|
* one of three drift classes: `"deterministic"`, `"user-data"`, or
|
|
6
|
-
* `"project-native"`. Required by GOV-03 (
|
|
7
|
-
* locked by Phase 70 decisions D-05, D-06, D-08, D-13..D-24
|
|
8
|
-
*
|
|
6
|
+
* `"project-native"`. Required by GOV-03 (`.notes/REQUIREMENTS.md`) and
|
|
7
|
+
* locked by Phase 70 decisions D-05, D-06, D-08, D-13..D-24 (see the v1.16
|
|
8
|
+
* milestone entry in `.notes/MILESTONES.md`; the original phase artifacts
|
|
9
|
+
* lived under `.planning/phases/70-...` and were retired with the planning
|
|
10
|
+
* directory).
|
|
9
11
|
*
|
|
10
12
|
* Consumers:
|
|
11
13
|
* - Migration registry (Phase 72)
|
|
@@ -209,24 +211,24 @@ export declare const GDH_MANAGED_SURFACE_CLASSES: readonly [{
|
|
|
209
211
|
readonly 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.";
|
|
210
212
|
}, {
|
|
211
213
|
readonly surfaceId: "authoring_hook";
|
|
212
|
-
readonly relativePath:
|
|
214
|
+
readonly relativePath: ".gdh/hooks/authoring-guard.js";
|
|
213
215
|
readonly class: "deterministic";
|
|
214
|
-
readonly notes: "
|
|
216
|
+
readonly notes: "Single shared authoring validation hook rendered by renderGdhAuthoringHook() in packages/adapters/src/authoring-hook-render.ts. Path constant GDH_AUTHORING_HOOK_RELATIVE_PATH (RFC 0010 D3 / v3.0.0). Both Claude and Codex invoke the same script; agent identity is read from process.argv[2] at fire time, not baked at render time.";
|
|
215
217
|
}, {
|
|
216
218
|
readonly surfaceId: "claude_update_hook";
|
|
217
|
-
readonly relativePath: ".
|
|
219
|
+
readonly relativePath: ".gdh/hooks/check-update.js";
|
|
218
220
|
readonly class: "deterministic";
|
|
219
|
-
readonly 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.";
|
|
221
|
+
readonly 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. RFC 0010 D4 — relocated from .claude/hooks/gdh-check-update.js to the canonical <gitroot>/.gdh/hooks/ surface in v3.0.0.";
|
|
220
222
|
}, {
|
|
221
223
|
readonly surfaceId: "claude_update_worker";
|
|
222
|
-
readonly relativePath: ".
|
|
224
|
+
readonly relativePath: ".gdh/hooks/check-update-worker.js";
|
|
223
225
|
readonly class: "deterministic";
|
|
224
|
-
readonly 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.";
|
|
226
|
+
readonly 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. RFC 0010 D4 — relocated from .claude/hooks/gdh-check-update-worker.js to the canonical <gitroot>/.gdh/hooks/ surface in v3.0.0.";
|
|
225
227
|
}, {
|
|
226
228
|
readonly surfaceId: "claude_statusline";
|
|
227
|
-
readonly relativePath: ".
|
|
229
|
+
readonly relativePath: ".gdh/hooks/statusline.js";
|
|
228
230
|
readonly class: "deterministic";
|
|
229
|
-
readonly 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.";
|
|
231
|
+
readonly 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. RFC 0010 D4 — relocated from .claude/hooks/gdh-statusline.js to the canonical <gitroot>/.gdh/hooks/ surface in v3.0.0.";
|
|
230
232
|
}, {
|
|
231
233
|
readonly surfaceId: "agents_md_managed_block";
|
|
232
234
|
readonly relativePath: "AGENTS.md";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"managed-surface-classes.d.ts","sourceRoot":"","sources":["../../src/migrations/managed-surface-classes.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"managed-surface-classes.d.ts","sourceRoot":"","sources":["../../src/migrations/managed-surface-classes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,MAAM,MAAM,sBAAsB,GAC9B,eAAe,GACf,WAAW,GACX,gBAAgB,CAAC;AAErB,MAAM,WAAW,gCAAgC;IAC/C,sEAAsE;IACtE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,+DAA+D;IAC/D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,2BAA2B;IAC1C;;;;OAIG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,6CAA6C;IAC7C,QAAQ,CAAC,KAAK,EAAE,sBAAsB,CAAC;IACvC,qDAAqD;IACrD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;;;;;OAKG;IACH,QAAQ,CAAC,sBAAsB,CAAC,EAAE,SAAS,gCAAgC,EAAE,CAAC;CAC/E;AAED;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+UmB,CAAC;AAE5D;;;;;;GAMG;AACH,MAAM,MAAM,mBAAmB,GAC7B,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,CAAC;AAE5D;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,mBAAmB,EAC9B,aAAa,EAAE,sBAAsB,GACpC,IAAI,CAcN"}
|
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Single source of truth for assigning every GDH-managed render call site to
|
|
5
5
|
* one of three drift classes: `"deterministic"`, `"user-data"`, or
|
|
6
|
-
* `"project-native"`. Required by GOV-03 (
|
|
7
|
-
* locked by Phase 70 decisions D-05, D-06, D-08, D-13..D-24
|
|
8
|
-
*
|
|
6
|
+
* `"project-native"`. Required by GOV-03 (`.notes/REQUIREMENTS.md`) and
|
|
7
|
+
* locked by Phase 70 decisions D-05, D-06, D-08, D-13..D-24 (see the v1.16
|
|
8
|
+
* milestone entry in `.notes/MILESTONES.md`; the original phase artifacts
|
|
9
|
+
* lived under `.planning/phases/70-...` and were retired with the planning
|
|
10
|
+
* directory).
|
|
9
11
|
*
|
|
10
12
|
* Consumers:
|
|
11
13
|
* - Migration registry (Phase 72)
|
|
@@ -225,27 +227,27 @@ export const GDH_MANAGED_SURFACE_CLASSES = [
|
|
|
225
227
|
// ---------------------------------------------------------------
|
|
226
228
|
{
|
|
227
229
|
surfaceId: "authoring_hook",
|
|
228
|
-
relativePath:
|
|
230
|
+
relativePath: ".gdh/hooks/authoring-guard.js",
|
|
229
231
|
class: "deterministic",
|
|
230
|
-
notes: "
|
|
232
|
+
notes: "Single shared authoring validation hook rendered by renderGdhAuthoringHook() in packages/adapters/src/authoring-hook-render.ts. Path constant GDH_AUTHORING_HOOK_RELATIVE_PATH (RFC 0010 D3 / v3.0.0). Both Claude and Codex invoke the same script; agent identity is read from process.argv[2] at fire time, not baked at render time.",
|
|
231
233
|
},
|
|
232
234
|
{
|
|
233
235
|
surfaceId: "claude_update_hook",
|
|
234
|
-
relativePath: ".
|
|
236
|
+
relativePath: ".gdh/hooks/check-update.js",
|
|
235
237
|
class: "deterministic",
|
|
236
|
-
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.",
|
|
238
|
+
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. RFC 0010 D4 — relocated from .claude/hooks/gdh-check-update.js to the canonical <gitroot>/.gdh/hooks/ surface in v3.0.0.",
|
|
237
239
|
},
|
|
238
240
|
{
|
|
239
241
|
surfaceId: "claude_update_worker",
|
|
240
|
-
relativePath: ".
|
|
242
|
+
relativePath: ".gdh/hooks/check-update-worker.js",
|
|
241
243
|
class: "deterministic",
|
|
242
|
-
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.",
|
|
244
|
+
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. RFC 0010 D4 — relocated from .claude/hooks/gdh-check-update-worker.js to the canonical <gitroot>/.gdh/hooks/ surface in v3.0.0.",
|
|
243
245
|
},
|
|
244
246
|
{
|
|
245
247
|
surfaceId: "claude_statusline",
|
|
246
|
-
relativePath: ".
|
|
248
|
+
relativePath: ".gdh/hooks/statusline.js",
|
|
247
249
|
class: "deterministic",
|
|
248
|
-
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.",
|
|
250
|
+
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. RFC 0010 D4 — relocated from .claude/hooks/gdh-statusline.js to the canonical <gitroot>/.gdh/hooks/ surface in v3.0.0.",
|
|
249
251
|
},
|
|
250
252
|
// ---------------------------------------------------------------
|
|
251
253
|
// Renderers in packages/docs/src/ (3 entries).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"managed-surface-classes.js","sourceRoot":"","sources":["../../src/migrations/managed-surface-classes.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"managed-surface-classes.js","sourceRoot":"","sources":["../../src/migrations/managed-surface-classes.ts"],"names":[],"mappings":"AAAA;;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,WAAW;QAClB,KAAK,EACH,kMAAkM;KACrM;IAED,kEAAkE;IAClE,+CAA+C;IAC/C,kEAAkE;IAClE;QACE,SAAS,EAAE,eAAe;QAC1B,YAAY,EAAE,eAAe;QAC7B,KAAK,EAAE,gBAAgB;QACvB,KAAK,EACH,8KAA8K;QAChL,sBAAsB,EAAE;YACtB;gBACE,EAAE,EAAE,2BAA2B;gBAC/B,OAAO,EAAE,wDAAwD;aAClE;YACD;gBACE,EAAE,EAAE,mBAAmB;gBACvB,OAAO,EAAE,2CAA2C;aACrD;SACF;KACF;CACwD,CAAC;AAY5D;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,qBAAqB,CACnC,SAA8B,EAC9B,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"}
|
|
@@ -93,7 +93,7 @@ export declare function isWorkspaceRelativePath(candidate: string): boolean;
|
|
|
93
93
|
* (s2c3→s2c6, s2c6→s2c7, s3c7→s3c8) are class-1-only per the audit and
|
|
94
94
|
* are intentionally absent.
|
|
95
95
|
*/
|
|
96
|
-
export declare const MIGRATION_REGISTRY_ENTRIES: readonly [GdhMigrationEntry, GdhMigrationEntry];
|
|
96
|
+
export declare const MIGRATION_REGISTRY_ENTRIES: readonly [GdhMigrationEntry, GdhMigrationEntry, GdhMigrationEntry];
|
|
97
97
|
/**
|
|
98
98
|
* Result of applyMigrationChain (D-06).
|
|
99
99
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/migrations/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/migrations/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAI3E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAKjE;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC;AAED;;;GAGG;AACH,MAAM,MAAM,6BAA6B,GACrC;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAA;CAAE,GACrB;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpD;;;;;;;;;GASG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,uBAAuB,CAAC;IACvC,QAAQ,CAAC,EAAE,EAAE,uBAAuB,CAAC;IACrC,QAAQ,CAAC,cAAc,EAAE,SAAS,sBAAsB,EAAE,CAAC;IAC3D,QAAQ,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1D,QAAQ,CAAC,MAAM,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,6BAA6B,CAAC,CAAC;IAChF,qFAAqF;IACrF,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B;;;;;;;;;;;;;;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AE,uBAAuB,CAAC;IAC3C,QAAQ,CAAC,MAAM,EAAE,uBAAuB,CAAC;IACzC,kEAAkE;IAClE,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC,CAAC;AAgCN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAsB,mBAAmB,CACvC,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,uBAAuB,EACjC,MAAM,EAAE,uBAAuB,EAC/B,OAAO,GAAE,SAAS,iBAAiB,EAA+B;AAClE;;;;;;;GAOG;AACH,kBAAkB,CAAC,EAAE;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACxE,OAAO,CAAC,4BAA4B,CAAC,CAkGvC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { entry_s2c2_to_s2c3 } from "./entries/s2c2_to_s2c3_rules_schema_v2_to_v3.js";
|
|
2
2
|
import { entry_s3c8_to_s3c9 } from "./entries/s3c8_to_s3c9_register_runtime_bridge_autoload.js";
|
|
3
|
+
import { entry_s3c21_to_s3c22 } from "./entries/s3c21_to_s3c22_canonical_hook_paths.js";
|
|
3
4
|
import { resolveEnvelopeBySlug } from "./envelopes/index.js";
|
|
4
5
|
import { readMigrationState } from "../state/migration-state.js";
|
|
5
6
|
/**
|
|
@@ -53,6 +54,7 @@ export function isWorkspaceRelativePath(candidate) {
|
|
|
53
54
|
export const MIGRATION_REGISTRY_ENTRIES = [
|
|
54
55
|
entry_s2c2_to_s2c3,
|
|
55
56
|
entry_s3c8_to_s3c9,
|
|
57
|
+
entry_s3c21_to_s3c22,
|
|
56
58
|
];
|
|
57
59
|
/**
|
|
58
60
|
* Pair comparator: returns negative if a < b, zero if equal, positive if a > b.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/migrations/registry.ts"],"names":[],"mappings":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C;QACpC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,KAAK,EAAE,iBAAiB;gBACxB,aAAa,EAAE,KAAK,CAAC,EAAE;gBACvB,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;gBAC7D,OAAO;gBACP,uEAAuE;gBACvE,oBAAoB,EAAE,IAAI;aAC3B,CAAC;QACJ,CAAC;QACD,MAAM,YAAY,GAAG,MAAM,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QACpD,IAAI,CAAC,YAAY,CAAC,EAAE,EAAE,CAAC;YACrB,OAAO;gBACL,KAAK,EAAE,eAAe;gBACtB,aAAa,EAAE,KAAK,CAAC,EAAE;gBACvB,MAAM,EAAE,YAAY,CAAC,MAAM;gBAC3B,OAAO;gBACP,wEAAwE;gBACxE,oBAAoB,EAAE,IAAI;aAC3B,CAAC;QACJ,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACzB,CAAC;IACD,OAAO,OAAO,CAAC,MAAM,KAAK,CAAC;QACzB,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE;QAChC,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Codex re-trust reminder marker (RFC 0010 / CPATH-16 / PR-1).
|
|
3
|
+
*
|
|
4
|
+
* Codex CLI 0.124.0+ silently disables hooks whose `command` literal differs
|
|
5
|
+
* from the trusted hash. The v3.0.0 canonical-path migration rewrites the
|
|
6
|
+
* managed authoring-hook command literal in `.codex/config.toml` (legacy
|
|
7
|
+
* `node -e ... walk-up ...` → `sh -c 'node "$(git rev-parse ...)/...".js codex'`),
|
|
8
|
+
* so every existing Codex-managed target ends up with a `Modified` hook
|
|
9
|
+
* entry until the operator manually re-trusts via `/hooks` → `t` in the
|
|
10
|
+
* Codex TUI. GDH cannot detect re-trust state from outside Codex (the hash
|
|
11
|
+
* is internal), so the best we can do is print the reminder unconditionally
|
|
12
|
+
* the first time post-migration the operator runs `gdh status` against a
|
|
13
|
+
* Codex-managed target — and clear the marker after surfacing it once.
|
|
14
|
+
*
|
|
15
|
+
* Storage: `<targetPath>/.gdh-state/codex-retrust-reminder.json`
|
|
16
|
+
*
|
|
17
|
+
* Lifecycle:
|
|
18
|
+
* 1. Migration entry sets the marker after rewriting the
|
|
19
|
+
* `.codex/config.toml` envelope.
|
|
20
|
+
* 2. `gdh self-update` post-success surfaces the reminder on stderr
|
|
21
|
+
* immediately (CPATH-16 first part).
|
|
22
|
+
* 3. `gdh status` reads + emits the reminder on its first invocation
|
|
23
|
+
* against a Codex-managed target post-migration (CPATH-16 second part)
|
|
24
|
+
* and clears the marker.
|
|
25
|
+
*
|
|
26
|
+
* The marker is a single line; the structured JSON shape is for future
|
|
27
|
+
* extensibility (set_at timestamp + entry_id provenance).
|
|
28
|
+
*/
|
|
29
|
+
export declare const CODEX_RETRUST_REMINDER_RELATIVE_PATH = ".gdh-state/codex-retrust-reminder.json";
|
|
30
|
+
export interface GdhCodexRetrustReminder {
|
|
31
|
+
/** Migration entry id that triggered the reminder. */
|
|
32
|
+
readonly setBy: string;
|
|
33
|
+
/** Wall-clock timestamp the marker was written (ISO 8601). */
|
|
34
|
+
readonly setAt: string;
|
|
35
|
+
}
|
|
36
|
+
export declare const CODEX_RETRUST_REMINDER_TEXT: string;
|
|
37
|
+
export declare function setCodexRetrustReminder(targetPath: string, setBy: string): Promise<void>;
|
|
38
|
+
export declare function readCodexRetrustReminder(targetPath: string): Promise<GdhCodexRetrustReminder | null>;
|
|
39
|
+
export declare function clearCodexRetrustReminder(targetPath: string): Promise<void>;
|
|
40
|
+
//# sourceMappingURL=codex-retrust-reminder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex-retrust-reminder.d.ts","sourceRoot":"","sources":["../../src/state/codex-retrust-reminder.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,eAAO,MAAM,oCAAoC,2CACP,CAAC;AAE3C,MAAM,WAAW,uBAAuB;IACtC,sDAAsD;IACtD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,8DAA8D;IAC9D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,2BAA2B,QAIT,CAAC;AAEhC,wBAAsB,uBAAuB,CAC3C,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,IAAI,CAAC,CAQf;AAED,wBAAsB,wBAAwB,CAC5C,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,uBAAuB,GAAG,IAAI,CAAC,CAYzC;AAED,wBAAsB,yBAAyB,CAC7C,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,IAAI,CAAC,CAGf"}
|