@skillcap/gdh 0.23.0 → 0.25.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.
- package/INSTALL-BUNDLE.json +1 -1
- package/RELEASE-SPAN-UPDATE-CONTRACTS.json +122 -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 +9 -131
- package/node_modules/@gdh/adapters/dist/authoring-hook-render.js.map +1 -1
- package/node_modules/@gdh/adapters/dist/claude-statusline-render.d.ts.map +1 -1
- package/node_modules/@gdh/adapters/dist/claude-statusline-render.js +6 -28
- 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.map +1 -1
- package/node_modules/@gdh/adapters/dist/claude-update-hook-render.js +7 -40
- 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.map +1 -1
- package/node_modules/@gdh/adapters/dist/claude-update-worker-render.js +7 -68
- package/node_modules/@gdh/adapters/dist/claude-update-worker-render.js.map +1 -1
- package/node_modules/@gdh/adapters/dist/deferred-actions-advisory.d.ts +71 -0
- package/node_modules/@gdh/adapters/dist/deferred-actions-advisory.d.ts.map +1 -0
- package/node_modules/@gdh/adapters/dist/deferred-actions-advisory.js +89 -0
- package/node_modules/@gdh/adapters/dist/deferred-actions-advisory.js.map +1 -0
- package/node_modules/@gdh/adapters/dist/durable-backup.d.ts +209 -0
- package/node_modules/@gdh/adapters/dist/durable-backup.d.ts.map +1 -0
- package/node_modules/@gdh/adapters/dist/durable-backup.js +346 -0
- package/node_modules/@gdh/adapters/dist/durable-backup.js.map +1 -0
- package/node_modules/@gdh/adapters/dist/index.d.ts +11 -3
- package/node_modules/@gdh/adapters/dist/index.d.ts.map +1 -1
- package/node_modules/@gdh/adapters/dist/index.js +79 -43
- package/node_modules/@gdh/adapters/dist/index.js.map +1 -1
- package/node_modules/@gdh/adapters/dist/inventory-sweep.d.ts +53 -0
- package/node_modules/@gdh/adapters/dist/inventory-sweep.d.ts.map +1 -0
- package/node_modules/@gdh/adapters/dist/inventory-sweep.js +98 -0
- package/node_modules/@gdh/adapters/dist/inventory-sweep.js.map +1 -0
- package/node_modules/@gdh/adapters/dist/process-orchestration.d.ts +223 -0
- package/node_modules/@gdh/adapters/dist/process-orchestration.d.ts.map +1 -0
- package/node_modules/@gdh/adapters/dist/process-orchestration.js +368 -0
- package/node_modules/@gdh/adapters/dist/process-orchestration.js.map +1 -0
- package/node_modules/@gdh/adapters/dist/self-update-mechanics.d.ts +157 -14
- package/node_modules/@gdh/adapters/dist/self-update-mechanics.d.ts.map +1 -1
- package/node_modules/@gdh/adapters/dist/self-update-mechanics.js +570 -89
- package/node_modules/@gdh/adapters/dist/self-update-mechanics.js.map +1 -1
- package/node_modules/@gdh/adapters/dist/skill-rendering.d.ts +2 -5
- package/node_modules/@gdh/adapters/dist/skill-rendering.d.ts.map +1 -1
- package/node_modules/@gdh/adapters/dist/skill-rendering.js +39 -56
- package/node_modules/@gdh/adapters/dist/skill-rendering.js.map +1 -1
- package/node_modules/@gdh/adapters/dist/template-assets.d.ts +2 -0
- package/node_modules/@gdh/adapters/dist/template-assets.d.ts.map +1 -0
- package/node_modules/@gdh/adapters/dist/template-assets.js +26 -0
- package/node_modules/@gdh/adapters/dist/template-assets.js.map +1 -0
- package/node_modules/@gdh/adapters/dist/templates/authoring-hook.js.tpl +128 -0
- package/node_modules/@gdh/adapters/dist/templates/claude-check-update-hook.js.tpl +37 -0
- package/node_modules/@gdh/adapters/dist/templates/claude-check-update-worker.js.tpl +65 -0
- package/node_modules/@gdh/adapters/dist/templates/claude-statusline.js.tpl +25 -0
- package/node_modules/@gdh/adapters/package.json +8 -8
- package/node_modules/@gdh/authoring/package.json +2 -2
- package/node_modules/@gdh/cli/dist/index.d.ts +9 -0
- package/node_modules/@gdh/cli/dist/index.d.ts.map +1 -1
- package/node_modules/@gdh/cli/dist/index.js +249 -6
- package/node_modules/@gdh/cli/dist/index.js.map +1 -1
- package/node_modules/@gdh/cli/dist/migrate.d.ts +152 -1
- package/node_modules/@gdh/cli/dist/migrate.d.ts.map +1 -1
- package/node_modules/@gdh/cli/dist/migrate.js +355 -8
- package/node_modules/@gdh/cli/dist/migrate.js.map +1 -1
- package/node_modules/@gdh/cli/dist/self-update.d.ts +14 -0
- package/node_modules/@gdh/cli/dist/self-update.d.ts.map +1 -1
- package/node_modules/@gdh/cli/dist/self-update.js +197 -15
- package/node_modules/@gdh/cli/dist/self-update.js.map +1 -1
- package/node_modules/@gdh/cli/dist/setup.d.ts +4 -0
- package/node_modules/@gdh/cli/dist/setup.d.ts.map +1 -1
- package/node_modules/@gdh/cli/dist/setup.js +8 -67
- 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/index.d.ts +99 -5
- package/node_modules/@gdh/core/dist/index.d.ts.map +1 -1
- package/node_modules/@gdh/core/dist/index.js +24 -5
- package/node_modules/@gdh/core/dist/index.js.map +1 -1
- package/node_modules/@gdh/core/dist/migrations/entries/s2c2_to_s2c3_rules_schema_v2_to_v3.d.ts +3 -0
- package/node_modules/@gdh/core/dist/migrations/entries/s2c2_to_s2c3_rules_schema_v2_to_v3.d.ts.map +1 -0
- package/node_modules/@gdh/core/dist/migrations/entries/s2c2_to_s2c3_rules_schema_v2_to_v3.js +247 -0
- package/node_modules/@gdh/core/dist/migrations/entries/s2c2_to_s2c3_rules_schema_v2_to_v3.js.map +1 -0
- package/node_modules/@gdh/core/dist/migrations/entries/s3c8_to_s3c9_register_runtime_bridge_autoload.d.ts +3 -0
- package/node_modules/@gdh/core/dist/migrations/entries/s3c8_to_s3c9_register_runtime_bridge_autoload.d.ts.map +1 -0
- package/node_modules/@gdh/core/dist/migrations/entries/s3c8_to_s3c9_register_runtime_bridge_autoload.js +152 -0
- package/node_modules/@gdh/core/dist/migrations/entries/s3c8_to_s3c9_register_runtime_bridge_autoload.js.map +1 -0
- package/node_modules/@gdh/core/dist/migrations/envelopes/envelope-output-validator.d.ts +3 -0
- package/node_modules/@gdh/core/dist/migrations/envelopes/envelope-output-validator.d.ts.map +1 -0
- package/node_modules/@gdh/core/dist/migrations/envelopes/envelope-output-validator.js +67 -0
- package/node_modules/@gdh/core/dist/migrations/envelopes/envelope-output-validator.js.map +1 -0
- package/node_modules/@gdh/core/dist/migrations/envelopes/index.d.ts +37 -0
- package/node_modules/@gdh/core/dist/migrations/envelopes/index.d.ts.map +1 -0
- package/node_modules/@gdh/core/dist/migrations/envelopes/index.js +60 -0
- package/node_modules/@gdh/core/dist/migrations/envelopes/index.js.map +1 -0
- package/node_modules/@gdh/core/dist/migrations/envelopes/types.d.ts +121 -0
- package/node_modules/@gdh/core/dist/migrations/envelopes/types.d.ts.map +1 -0
- package/node_modules/@gdh/core/dist/migrations/envelopes/types.js +2 -0
- package/node_modules/@gdh/core/dist/migrations/envelopes/types.js.map +1 -0
- package/node_modules/@gdh/core/dist/migrations/golden-harness.d.ts +40 -0
- package/node_modules/@gdh/core/dist/migrations/golden-harness.d.ts.map +1 -0
- package/node_modules/@gdh/core/dist/migrations/golden-harness.js +71 -0
- package/node_modules/@gdh/core/dist/migrations/golden-harness.js.map +1 -0
- package/node_modules/@gdh/core/dist/migrations/managed-surface-classes.d.ts +322 -0
- package/node_modules/@gdh/core/dist/migrations/managed-surface-classes.d.ts.map +1 -0
- package/node_modules/@gdh/core/dist/migrations/managed-surface-classes.js +384 -0
- package/node_modules/@gdh/core/dist/migrations/managed-surface-classes.js.map +1 -0
- package/node_modules/@gdh/core/dist/migrations/managed-target-surface-inventory.d.ts +294 -0
- package/node_modules/@gdh/core/dist/migrations/managed-target-surface-inventory.d.ts.map +1 -0
- package/node_modules/@gdh/core/dist/migrations/managed-target-surface-inventory.js +365 -0
- package/node_modules/@gdh/core/dist/migrations/managed-target-surface-inventory.js.map +1 -0
- package/node_modules/@gdh/core/dist/migrations/probes.d.ts +58 -0
- package/node_modules/@gdh/core/dist/migrations/probes.d.ts.map +1 -0
- package/node_modules/@gdh/core/dist/migrations/probes.js +112 -0
- package/node_modules/@gdh/core/dist/migrations/probes.js.map +1 -0
- package/node_modules/@gdh/core/dist/migrations/registry.d.ts +205 -0
- package/node_modules/@gdh/core/dist/migrations/registry.d.ts.map +1 -0
- package/node_modules/@gdh/core/dist/migrations/registry.js +214 -0
- package/node_modules/@gdh/core/dist/migrations/registry.js.map +1 -0
- package/node_modules/@gdh/core/dist/state/atomic-write.d.ts +19 -0
- package/node_modules/@gdh/core/dist/state/atomic-write.d.ts.map +1 -0
- package/node_modules/@gdh/core/dist/state/atomic-write.js +34 -0
- package/node_modules/@gdh/core/dist/state/atomic-write.js.map +1 -0
- package/node_modules/@gdh/core/dist/state/migration-state.d.ts +135 -0
- package/node_modules/@gdh/core/dist/state/migration-state.d.ts.map +1 -0
- package/node_modules/@gdh/core/dist/state/migration-state.js +186 -0
- package/node_modules/@gdh/core/dist/state/migration-state.js.map +1 -0
- package/node_modules/@gdh/core/dist/state/processes-snapshot.d.ts +72 -0
- package/node_modules/@gdh/core/dist/state/processes-snapshot.d.ts.map +1 -0
- package/node_modules/@gdh/core/dist/state/processes-snapshot.js +113 -0
- package/node_modules/@gdh/core/dist/state/processes-snapshot.js.map +1 -0
- package/node_modules/@gdh/core/dist/state/render-inventory.d.ts +54 -0
- package/node_modules/@gdh/core/dist/state/render-inventory.d.ts.map +1 -0
- package/node_modules/@gdh/core/dist/state/render-inventory.js +77 -0
- package/node_modules/@gdh/core/dist/state/render-inventory.js.map +1 -0
- package/node_modules/@gdh/core/package.json +1 -1
- package/node_modules/@gdh/docs/dist/agent-contract.d.ts +2 -1
- package/node_modules/@gdh/docs/dist/agent-contract.d.ts.map +1 -1
- package/node_modules/@gdh/docs/dist/agent-contract.js +5 -3
- package/node_modules/@gdh/docs/dist/agent-contract.js.map +1 -1
- package/node_modules/@gdh/docs/dist/guidance.d.ts +2 -0
- package/node_modules/@gdh/docs/dist/guidance.d.ts.map +1 -1
- package/node_modules/@gdh/docs/dist/guidance.js +29 -255
- package/node_modules/@gdh/docs/dist/guidance.js.map +1 -1
- package/node_modules/@gdh/docs/dist/index.d.ts +1 -1
- package/node_modules/@gdh/docs/dist/index.d.ts.map +1 -1
- package/node_modules/@gdh/docs/dist/index.js +1 -1
- package/node_modules/@gdh/docs/dist/index.js.map +1 -1
- package/node_modules/@gdh/docs/dist/query.d.ts.map +1 -1
- package/node_modules/@gdh/docs/dist/query.js +4 -5
- package/node_modules/@gdh/docs/dist/query.js.map +1 -1
- package/node_modules/@gdh/docs/dist/recovery-hints.js +1 -1
- package/node_modules/@gdh/docs/dist/recovery-hints.js.map +1 -1
- package/node_modules/@gdh/docs/dist/template-assets.d.ts +2 -0
- package/node_modules/@gdh/docs/dist/template-assets.d.ts.map +1 -0
- package/node_modules/@gdh/docs/dist/template-assets.js +26 -0
- package/node_modules/@gdh/docs/dist/template-assets.js.map +1 -0
- package/node_modules/@gdh/docs/dist/templates/guidance/authoring-and-validation.md.tpl +111 -0
- package/node_modules/@gdh/docs/dist/templates/guidance/gdh-glossary.md.tpl +34 -0
- package/node_modules/@gdh/docs/dist/templates/guidance/persistence-semantics.md.tpl +24 -0
- package/node_modules/@gdh/docs/dist/templates/guidance/project-migration.md.tpl +19 -0
- package/node_modules/@gdh/docs/dist/templates/guidance/project-surfaces.md.tpl +14 -0
- 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/dist/bridge-surface.js +63 -2
- package/node_modules/@gdh/runtime/dist/bridge-surface.js.map +1 -1
- 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
|
@@ -2492,6 +2492,128 @@
|
|
|
2492
2492
|
}
|
|
2493
2493
|
]
|
|
2494
2494
|
}
|
|
2495
|
+
},
|
|
2496
|
+
{
|
|
2497
|
+
"version": "0.24.0",
|
|
2498
|
+
"releaseTag": "v0.24.0",
|
|
2499
|
+
"migrationStatus": "required",
|
|
2500
|
+
"summary": "v0.24.0 ships v1.18 Migration Chain Integrity. Five managed-surface version constants bump (GDH_AGENT_CONTRACT_VERSION 8 -> 9, GDH_GUIDANCE_INDEX_VERSION 4 -> 5, GDH_GUIDANCE_UNIT_VERSION 17 -> 18, GDH_UPDATE_HOOK_VERSION 5 -> 6, GDH_RUNTIME_BRIDGE_SURFACE_VERSION 11 -> 12). The migration registry adds entry s3c8_to_s3c9_register_runtime_bridge_autoload — a class-3 project-native register_autoload op that writes the GDHBridge autoload entry into project.godot deterministically, replacing the pre-v0.24 manual editor plugin-enable detour the chain matrix flagged as compatibility_degraded.",
|
|
2501
|
+
"releaseHighlights": {
|
|
2502
|
+
"summary": "v0.24.0 ships the v1.18 Migration Chain Integrity milestone. GDH now guarantees that every supported version listed in `docs/product/SUPPORTED-VERSIONS.md` reaches HEAD through `gdh self-update` without manual editor intervention. The release adds a falsifiable five-condition `release:apply` gate (registry completeness, chain matrix, corpus parity, goldens, migration-verify outcome `pass`), a typed managed-surface drift manifest with module-load `assertClassRegistered` guards, deterministic GDHBridge autoload registration during install/repair/self-update, a single-direction migration registry with paired golden fixtures, durable backup with crash-resilient restore, render-inventory orphan sweeping, and a `bumpAndRebakePin` 12-step orchestrator that composes all of the above.",
|
|
2503
|
+
"operatorChanges": [
|
|
2504
|
+
"**Deterministic GDHBridge autoload registration.** `gdh setup`, `gdh self-update`, and `gdh migrate --apply` now write the GDHBridge autoload entry into `project.godot` directly. Pre-v0.24, agents driving self-update had to instruct the operator to open the Godot editor and enable the GDH Runtime Bridge plugin so it could register the autoload itself. The chain matrix flagged that detour as `compatibility_degraded`; v0.24 closes it as a class-3 project-native `register_autoload` op on the v1.18 manifest allowlist.",
|
|
2505
|
+
"**Migration chain matrix.** `npm run test:migration-chain` exercises every supported version (v0.18.0 through v0.23.0) end-to-end against HEAD via the installed tarball. `release:apply` invokes the matrix in-process and refuses to tag on non-zero exit.",
|
|
2506
|
+
"**Five-condition release-apply gate.** `corepack yarn release:apply` enforces five machine-verifiable conditions before tagging: registry completeness (every `surfaceVersionChange` has a bracketing `MIGRATION_REGISTRY_ENTRIES` entry), chain matrix exit 0, corpus parity (`SUPPORTED-VERSIONS.md` rows match `tests/fixtures/migration-corpus/v<version>/` directories), goldens exit 0, and migration-verify outcome `pass`. There is no env-flag bypass, no `--force`, no skip-attestation file.",
|
|
2507
|
+
"**Managed surface drift classification.** `GDH_MANAGED_SURFACE_CLASSES` from `@gdh/core` is the typed source of truth for the three drift classes (deterministic / user-data / project-native). Every managed-surface renderer carries a module-load `assertClassRegistered` guard that aborts the install pipeline if the manifest and a renderer drift.",
|
|
2508
|
+
"**Local pre-commit and pre-push hooks.** `corepack yarn hooks:install` installs simple-git-hooks. Pre-commit catches schema-affecting diffs without paired migration entries and goldens; pre-push runs the adjacent star-case chain test plus all goldens. Hooks are bypass-able by `git commit --no-verify` and `git push --no-verify` — these are git-level escapes that no hook framework can prevent.",
|
|
2509
|
+
"**Maintainer release skills.** `/gdh-dev:release`, `/gdh-dev:migration-verify`, and `/gdh-dev:publish` (Claude) and the Codex/Cursor equivalents now own the end-to-end release flow. `/gdh-dev:migration-verify` is a thin wrapper around `node scripts/release-lib/migration-verify.mjs` and consumes its locked JSON outcome contract.",
|
|
2510
|
+
"**Durable backup.** `bumpAndRebakePin` step 5 writes a directory-level durable backup at `.gdh-state/backup/` via the staged-rename strategy (`.gdh-state/backup.new/` → atomic `fs.rename`). Restore is byte-equal round-trip; user-edit drift is detected by absence of any KNOWN_GDH_MARKERS and persisted in the manifest's `preservation_notes`.",
|
|
2511
|
+
"**Render-inventory orphan sweeping.** `bumpAndRebakePin` writes `.gdh-state/render-inventory.json` after each successful re-bake; the next run computes set-diff against the previous inventory and deletes orphaned managed files. Symlink-safe (`fs.lstat` existence probe + `fs.rm` unlink semantics) and path-traversal-gated.",
|
|
2512
|
+
"**Migration-verifier JSON outcome contract.** `scripts/release-lib/migration-verify.mjs` returns one of `pass | blocked | incomplete` over six conditions (artifacts, registry completeness, release-note/manifest/verification consistency, corpus parity, chain matrix, goldens). Both `/gdh-dev:migration-verify` and `release:apply` consume the same JSON; `release:apply` passes pre-computed chain + goldens evidence so the helper does not double-spawn."
|
|
2513
|
+
]
|
|
2514
|
+
},
|
|
2515
|
+
"updateContract": {
|
|
2516
|
+
"summary": "Managed targets need release-specific migration for v0.24.0 because five managed-surface version constants bumped and the migration registry now writes the GDHBridge autoload entry into project.godot deterministically. After self-update, run gdh migrate --apply, then validate adapter status, drift, and the deterministic autoload registration.",
|
|
2517
|
+
"steps": [
|
|
2518
|
+
{
|
|
2519
|
+
"id": "self_update_runtime_workflow_package",
|
|
2520
|
+
"kind": "mechanical",
|
|
2521
|
+
"summary": "Install the v0.24.0 GDH package.",
|
|
2522
|
+
"detail": "Run gdh self-update so the new managed surface contract versions and the s3c8_to_s3c9_register_runtime_bridge_autoload registry entry are available to the host.",
|
|
2523
|
+
"commands": [
|
|
2524
|
+
"gdh self-update --apply"
|
|
2525
|
+
],
|
|
2526
|
+
"validationCommands": [
|
|
2527
|
+
"gdh status"
|
|
2528
|
+
]
|
|
2529
|
+
},
|
|
2530
|
+
{
|
|
2531
|
+
"id": "rebake_v118_managed_surfaces",
|
|
2532
|
+
"kind": "mechanical",
|
|
2533
|
+
"summary": "Re-bake managed AGENTS.md, guidance, and hook surfaces; register the GDHBridge autoload in project.godot.",
|
|
2534
|
+
"detail": "Run gdh migrate --apply so agent contract version 9 writes the new AGENTS.md contract block, guidance index version 5 and unit version 18 write the refreshed guidance, hook version 6 writes managed hook scripts, and the v1.18 register_autoload op writes the GDHBridge autoload entry into project.godot if it is missing.",
|
|
2535
|
+
"commands": [
|
|
2536
|
+
"gdh migrate --apply"
|
|
2537
|
+
],
|
|
2538
|
+
"validationCommands": [
|
|
2539
|
+
"gdh adapters status",
|
|
2540
|
+
"gdh verify drift",
|
|
2541
|
+
"gdh status"
|
|
2542
|
+
]
|
|
2543
|
+
},
|
|
2544
|
+
{
|
|
2545
|
+
"id": "verify_runtime_bridge_autoload_registered",
|
|
2546
|
+
"kind": "agent_reasoning",
|
|
2547
|
+
"summary": "Confirm the GDHBridge autoload is registered deterministically in project.godot.",
|
|
2548
|
+
"detail": "Open project.godot and confirm an `[autoload]` section contains `GDHBridge=\"*res://addons/gdh_bridge/runtime/gdh_runtime_bridge.gd\"`. Pre-v0.24 targets that relied on the manual editor plugin-enable detour pick up the entry automatically during gdh migrate --apply. No editor session is required.",
|
|
2549
|
+
"commands": [
|
|
2550
|
+
"gdh status"
|
|
2551
|
+
],
|
|
2552
|
+
"validationCommands": [
|
|
2553
|
+
"gdh status",
|
|
2554
|
+
"gdh authoring check --mode final"
|
|
2555
|
+
]
|
|
2556
|
+
}
|
|
2557
|
+
]
|
|
2558
|
+
}
|
|
2559
|
+
},
|
|
2560
|
+
{
|
|
2561
|
+
"version": "0.25.0",
|
|
2562
|
+
"releaseTag": "v0.25.0",
|
|
2563
|
+
"migrationStatus": "required",
|
|
2564
|
+
"summary": "v0.25.0 ships v1.19 Target Surface Containment. Four managed-surface version constants bump (GDH_AGENT_CONTRACT_VERSION 9 -> 10, GDH_GUIDANCE_INDEX_VERSION 5 -> 6, GDH_GUIDANCE_UNIT_VERSION 18 -> 19, GDH_UPDATE_HOOK_VERSION 6 -> 7). Existing managed targets need deterministic re-bake so generated guidance moves under .gdh/guidance, onboarding lives in generated skills, validation check skills are retired, and managed hooks/statusline outputs refresh from template assets. No new class-2 or class-3 migration registry entry is introduced.",
|
|
2565
|
+
"releaseHighlights": {
|
|
2566
|
+
"summary": "v0.25.0 ships the v1.19 Target Surface Containment milestone. GDH no longer generates target-project guidance under `docs/agent/`; managed guidance now lives under `.gdh/guidance/`, workflow instructions live inside generated `gdh-*` skills, validation check skills are retired in favor of hooks/MCP/CLI evidence, and generated renderer bodies now come from tracked template assets instead of large inline strings. The release also contains maintainer safety fixes: setup/tests no longer write developer-global MCP or npm state, test runs block host Godot discovery by default, and the default pre-push hook runs only the cheap migration-golden guard.",
|
|
2567
|
+
"operatorChanges": [
|
|
2568
|
+
"**Generated guidance is contained under `.gdh/guidance/`.** Managed target projects receive `.gdh/guidance/README.md` and the deeper guidance units there. `docs/agent/` is no longer a generated target-project surface, so target project docs do not absorb GDH-owned operating manuals as project truth.",
|
|
2569
|
+
"**Onboarding is a skill.** The generated onboarding workflow now lives in `gdh-onboard` for Claude, Codex, and Cursor instead of a loose `00-gdh-onboarding.md` guidance document.",
|
|
2570
|
+
"**Validation check skills are retired.** GDH no longer ships generated `gdh-check` skills as instruction surfaces. Authoring evidence remains available through managed hooks, MCP/CLI status, and explicit `gdh authoring check` commands.",
|
|
2571
|
+
"**Managed renderers use template assets.** Guidance and hook/statusline renderer bodies are read from tracked `.tpl` assets during build/package assembly, which makes generated output easier to review and keeps source files out of giant string-literal drift.",
|
|
2572
|
+
"**Maintainer setup and tests are contained.** GDH development tests now use repo/test-local config homes for MCP and npm package flows, and the default integration environment disables host Godot discovery/spawning unless a test opts in.",
|
|
2573
|
+
"**Release pre-push is cheaper.** The repo pre-push hook runs migration goldens only. The full migration chain remains enforced by `release:apply`, where it has the correct release-version context."
|
|
2574
|
+
]
|
|
2575
|
+
},
|
|
2576
|
+
"updateContract": {
|
|
2577
|
+
"summary": "Managed targets need deterministic re-bake for v0.25.0 because agent contract, guidance index, guidance unit, and update-hook surface versions changed. After self-update, run gdh migrate --apply, then validate adapter status, drift, and lifecycle health.",
|
|
2578
|
+
"steps": [
|
|
2579
|
+
{
|
|
2580
|
+
"id": "self_update_target_surface_containment_package",
|
|
2581
|
+
"kind": "mechanical",
|
|
2582
|
+
"summary": "Install the v0.25.0 GDH package.",
|
|
2583
|
+
"detail": "Run gdh self-update so the v0.25.0 renderers, template assets, managed-surface versions, and cleanup behavior are available to the host.",
|
|
2584
|
+
"commands": [
|
|
2585
|
+
"gdh self-update --apply"
|
|
2586
|
+
],
|
|
2587
|
+
"validationCommands": [
|
|
2588
|
+
"gdh status"
|
|
2589
|
+
]
|
|
2590
|
+
},
|
|
2591
|
+
{
|
|
2592
|
+
"id": "rebake_v119_managed_surfaces",
|
|
2593
|
+
"kind": "mechanical",
|
|
2594
|
+
"summary": "Re-bake managed AGENTS.md, skills, guidance, and hooks.",
|
|
2595
|
+
"detail": "Run gdh migrate --apply so agent contract version 10 refreshes the managed AGENTS.md block and generated skills, guidance index version 6 and unit version 19 write `.gdh/guidance/`, hook version 7 refreshes hook/statusline outputs, and render-inventory cleanup removes stale GDH-owned generated guidance outside `.gdh`.",
|
|
2596
|
+
"commands": [
|
|
2597
|
+
"gdh migrate --apply"
|
|
2598
|
+
],
|
|
2599
|
+
"validationCommands": [
|
|
2600
|
+
"gdh adapters status",
|
|
2601
|
+
"gdh verify drift",
|
|
2602
|
+
"gdh status"
|
|
2603
|
+
]
|
|
2604
|
+
},
|
|
2605
|
+
{
|
|
2606
|
+
"id": "review_project_docs_for_gdh_leakage",
|
|
2607
|
+
"kind": "manual_review",
|
|
2608
|
+
"summary": "Review any remaining project-owned docs for stale copied GDH prose.",
|
|
2609
|
+
"detail": "GDH removes managed outputs it owns. If a target project manually copied old `docs/agent/*` prose into project-owned docs, treat that as project content and review it manually instead of deleting it automatically.",
|
|
2610
|
+
"commands": [],
|
|
2611
|
+
"validationCommands": [
|
|
2612
|
+
"gdh status"
|
|
2613
|
+
]
|
|
2614
|
+
}
|
|
2615
|
+
]
|
|
2616
|
+
}
|
|
2495
2617
|
}
|
|
2496
2618
|
]
|
|
2497
2619
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authoring-hook-render.d.ts","sourceRoot":"","sources":["../src/authoring-hook-render.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"authoring-hook-render.d.ts","sourceRoot":"","sources":["../src/authoring-hook-render.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,mCAAmC,yCAAyC,CAAC;AAC1F,eAAO,MAAM,kCAAkC,wCAAwC,CAAC;AACxF,eAAO,MAAM,6BAA6B,uRAC4O,CAAC;AACvR,eAAO,MAAM,4BAA4B,qRAC2O,CAAC;AAErR,wBAAgB,sBAAsB,CAAC,KAAK,EAAE;IAC5C,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,CAAC;CACpC,GAAG,MAAM,CAOT"}
|
|
@@ -1,138 +1,16 @@
|
|
|
1
|
-
import { GDH_UPDATE_HOOK_VERSION } from "@gdh/core";
|
|
1
|
+
import { GDH_UPDATE_HOOK_VERSION, assertClassRegistered } from "@gdh/core";
|
|
2
|
+
import { renderAdapterTemplate } from "./template-assets.js";
|
|
3
|
+
assertClassRegistered("authoring_hook", "deterministic");
|
|
2
4
|
export const CLAUDE_AUTHORING_HOOK_RELATIVE_PATH = ".claude/hooks/gdh-authoring-guard.js";
|
|
3
5
|
export const CODEX_AUTHORING_HOOK_RELATIVE_PATH = ".codex/hooks/gdh-authoring-guard.js";
|
|
4
6
|
export const CLAUDE_AUTHORING_HOOK_COMMAND = "node -e \"const fs=require('fs'),path=require('path');let d=process.cwd();for(;;){const f=path.join(d,'.claude/hooks/gdh-authoring-guard.js');if(fs.existsSync(f)){require(f);break}const p=path.dirname(d);if(p===d)throw new Error('GDH Claude authoring hook not found');d=p}\"";
|
|
5
7
|
export const CODEX_AUTHORING_HOOK_COMMAND = "node -e \"const fs=require('fs'),path=require('path');let d=process.cwd();for(;;){const f=path.join(d,'.codex/hooks/gdh-authoring-guard.js');if(fs.existsSync(f)){require(f);break}const p=path.dirname(d);if(p===d)throw new Error('GDH Codex authoring hook not found');d=p}\"";
|
|
6
8
|
export function renderGdhAuthoringHook(input) {
|
|
7
|
-
return
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
`const AGENT = ${JSON.stringify(input.agent)};`,
|
|
14
|
-
"",
|
|
15
|
-
"const fs = require('fs');",
|
|
16
|
-
"const path = require('path');",
|
|
17
|
-
"const { spawnSync } = require('child_process');",
|
|
18
|
-
"",
|
|
19
|
-
"const AUTHORING_EXTENSIONS = new Set(['.gd', '.tscn', '.tres']);",
|
|
20
|
-
"let CURRENT_EVENT = '';",
|
|
21
|
-
"",
|
|
22
|
-
"main();",
|
|
23
|
-
"",
|
|
24
|
-
"function main() {",
|
|
25
|
-
" const input = readHookInput();",
|
|
26
|
-
" const targetRoot = resolveTargetRoot(input);",
|
|
27
|
-
" const hookEvent = String(input.hook_event_name || '');",
|
|
28
|
-
" CURRENT_EVENT = hookEvent;",
|
|
29
|
-
" if (!targetRoot) return allow();",
|
|
30
|
-
" if (hookEvent === 'PostToolUse' || hookEvent === 'FileChanged') return handlePostEdit(input, targetRoot);",
|
|
31
|
-
" return allow();",
|
|
32
|
-
"}",
|
|
33
|
-
"",
|
|
34
|
-
"function handlePostEdit(input, targetRoot) {",
|
|
35
|
-
" const changed = collectChangedFiles(input, targetRoot);",
|
|
36
|
-
" const authoring = changed.filter(isAuthoringValidationPath);",
|
|
37
|
-
" if (authoring.length === 0) return allow();",
|
|
38
|
-
" const changedArgs = authoring.flatMap((file) => ['--changed', file]);",
|
|
39
|
-
" // Attempt to refresh the diagnostics broker for changed files.",
|
|
40
|
-
" // Broker refresh failure is non-fatal: the authoring check falls back to direct LSP.",
|
|
41
|
-
" runGdh(targetRoot, ['authoring', 'diagnostics', 'refresh', '--target', targetRoot, ...changedArgs]);",
|
|
42
|
-
" // Run compact authoring check. When broker was refreshed, this uses the fresh snapshot.",
|
|
43
|
-
" // When broker is unavailable, this falls back to direct LSP post-edit collection.",
|
|
44
|
-
" const result = runGdh(targetRoot, ['authoring', 'check', '--target', targetRoot, '--mode', 'post-edit', '--format', 'compact', ...changedArgs]);",
|
|
45
|
-
" if (!result.ok || !/Completion allowed\\./.test(result.output)) {",
|
|
46
|
-
" return block(`GDH post-edit authoring check needs attention.\\n${result.output || result.error || 'No check output.'}`);",
|
|
47
|
-
" }",
|
|
48
|
-
" return allow();",
|
|
49
|
-
"}",
|
|
50
|
-
"",
|
|
51
|
-
"function runGdh(targetRoot, args) {",
|
|
52
|
-
" const result = spawnSync('npx', ['-y', `@skillcap/gdh@${PINNED_VERSION}`, ...args], {",
|
|
53
|
-
" cwd: targetRoot,",
|
|
54
|
-
" encoding: 'utf8',",
|
|
55
|
-
" windowsHide: true,",
|
|
56
|
-
" timeout: 120000,",
|
|
57
|
-
" });",
|
|
58
|
-
" const output = `${result.stdout || ''}${result.stderr || ''}`.trim();",
|
|
59
|
-
" return { ok: result.status === 0, output, error: result.error ? String(result.error.message || result.error) : '' };",
|
|
60
|
-
"}",
|
|
61
|
-
"",
|
|
62
|
-
"function collectChangedFiles(input, targetRoot) {",
|
|
63
|
-
" const baseCwd = input && typeof input.cwd === 'string' ? input.cwd : process.cwd();",
|
|
64
|
-
" const files = [];",
|
|
65
|
-
" addFile(files, input.file_path, targetRoot, baseCwd);",
|
|
66
|
-
" addFromToolPayload(files, input.tool_input, targetRoot, baseCwd);",
|
|
67
|
-
" addFromToolPayload(files, input.tool_response, targetRoot, baseCwd);",
|
|
68
|
-
" const command = input && input.tool_input && typeof input.tool_input.command === 'string' ? input.tool_input.command : '';",
|
|
69
|
-
" for (const file of parsePatchFileNames(command)) addFile(files, file, targetRoot, baseCwd);",
|
|
70
|
-
" return unique(files);",
|
|
71
|
-
"}",
|
|
72
|
-
"",
|
|
73
|
-
"function addFromToolPayload(files, payload, targetRoot, baseCwd) {",
|
|
74
|
-
" if (!payload || typeof payload !== 'object') return;",
|
|
75
|
-
" addFile(files, payload.file_path, targetRoot, baseCwd);",
|
|
76
|
-
" addFile(files, payload.filePath, targetRoot, baseCwd);",
|
|
77
|
-
" addFile(files, payload.path, targetRoot, baseCwd);",
|
|
78
|
-
" if (Array.isArray(payload.file_paths)) for (const file of payload.file_paths) addFile(files, file, targetRoot, baseCwd);",
|
|
79
|
-
" if (Array.isArray(payload.files)) for (const file of payload.files) addFile(files, file, targetRoot, baseCwd);",
|
|
80
|
-
"}",
|
|
81
|
-
"",
|
|
82
|
-
"function parsePatchFileNames(command) {",
|
|
83
|
-
" const files = [];",
|
|
84
|
-
" const pattern = /^\\*\\*\\* (?:Add|Update|Delete) File: (.+)$/gm;",
|
|
85
|
-
" let match;",
|
|
86
|
-
" while ((match = pattern.exec(command)) !== null) files.push(match[1].trim());",
|
|
87
|
-
" return files;",
|
|
88
|
-
"}",
|
|
89
|
-
"",
|
|
90
|
-
"function addFile(files, value, targetRoot, baseCwd) {",
|
|
91
|
-
" if (typeof value !== 'string' || value.trim() === '') return;",
|
|
92
|
-
" const normalized = normalizeToTargetRelative(value.trim(), targetRoot, baseCwd);",
|
|
93
|
-
" if (normalized) files.push(normalized);",
|
|
94
|
-
"}",
|
|
95
|
-
"",
|
|
96
|
-
"function normalizeToTargetRelative(value, targetRoot, baseCwd) {",
|
|
97
|
-
" if (value.startsWith('res://')) return value.slice('res://'.length);",
|
|
98
|
-
" const canonicalTargetRoot = canonicalPath(targetRoot);",
|
|
99
|
-
" const canonicalBaseCwd = canonicalPath(baseCwd || targetRoot);",
|
|
100
|
-
" const absolute = path.isAbsolute(value) ? canonicalPath(value) : path.resolve(canonicalBaseCwd, value);",
|
|
101
|
-
" const relative = path.relative(canonicalTargetRoot, absolute);",
|
|
102
|
-
" if ((relative.startsWith('..') || path.isAbsolute(relative)) && !path.isAbsolute(value) && isInside(canonicalTargetRoot, canonicalBaseCwd)) {",
|
|
103
|
-
" const fallbackRelative = path.relative(canonicalTargetRoot, path.resolve(canonicalTargetRoot, value));",
|
|
104
|
-
" if (!fallbackRelative.startsWith('..') && !path.isAbsolute(fallbackRelative)) return fallbackRelative.split(path.sep).join('/');",
|
|
105
|
-
" }",
|
|
106
|
-
" if (relative.startsWith('..') || path.isAbsolute(relative)) return null;",
|
|
107
|
-
" return relative.split(path.sep).join('/');",
|
|
108
|
-
"}",
|
|
109
|
-
"function isInside(root, candidate) { const rel = path.relative(root, path.resolve(candidate)); return rel === '' || (!rel.startsWith('..') && !path.isAbsolute(rel)); }",
|
|
110
|
-
"function canonicalPath(value) { try { return fs.realpathSync.native ? fs.realpathSync.native(value) : fs.realpathSync(value); } catch { return path.resolve(value); } }",
|
|
111
|
-
"",
|
|
112
|
-
"function isAuthoringValidationPath(file) {",
|
|
113
|
-
" if (file === 'project.godot' || file.endsWith('/project.godot')) return true;",
|
|
114
|
-
" return AUTHORING_EXTENSIONS.has(path.extname(file).toLowerCase());",
|
|
115
|
-
"}",
|
|
116
|
-
"",
|
|
117
|
-
"function resolveTargetRoot(input) {",
|
|
118
|
-
" const base = path.resolve(__dirname, '..', '..');",
|
|
119
|
-
" const fromScript = path.resolve(base, TARGET_RELATIVE_PATH || '.');",
|
|
120
|
-
" if (fs.existsSync(fromScript)) return fromScript;",
|
|
121
|
-
" if (input && typeof input.cwd === 'string') return input.cwd;",
|
|
122
|
-
" return process.cwd();",
|
|
123
|
-
"}",
|
|
124
|
-
"",
|
|
125
|
-
"function unique(values) { return [...new Set(values.filter(Boolean))].sort(); }",
|
|
126
|
-
"function readHookInput() { try { return JSON.parse(fs.readFileSync(0, 'utf8') || '{}'); } catch { return {}; } }",
|
|
127
|
-
"",
|
|
128
|
-
"function allow() { process.exit(0); }",
|
|
129
|
-
"function block(reason) {",
|
|
130
|
-
" const payload = { decision: 'block', reason };",
|
|
131
|
-
" if (AGENT === 'codex') payload.hookSpecificOutput = { hookEventName: CURRENT_EVENT, additionalContext: reason };",
|
|
132
|
-
" process.stdout.write(`${JSON.stringify(payload)}\\n`);",
|
|
133
|
-
" process.exit(0);",
|
|
134
|
-
"}",
|
|
135
|
-
"",
|
|
136
|
-
].join("\n");
|
|
9
|
+
return renderAdapterTemplate("authoring-hook.js.tpl", {
|
|
10
|
+
hookVersion: String(GDH_UPDATE_HOOK_VERSION),
|
|
11
|
+
pinnedVersionJson: JSON.stringify(input.pinnedVersion),
|
|
12
|
+
targetRelativePathJson: JSON.stringify(input.targetRelativePath),
|
|
13
|
+
agentJson: JSON.stringify(input.agent),
|
|
14
|
+
});
|
|
137
15
|
}
|
|
138
16
|
//# sourceMappingURL=authoring-hook-render.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authoring-hook-render.js","sourceRoot":"","sources":["../src/authoring-hook-render.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"authoring-hook-render.js","sourceRoot":"","sources":["../src/authoring-hook-render.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAE3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,qBAAqB,CAAC,gBAAgB,EAAE,eAAe,CAAC,CAAC;AAEzD,MAAM,CAAC,MAAM,mCAAmC,GAAG,sCAAsC,CAAC;AAC1F,MAAM,CAAC,MAAM,kCAAkC,GAAG,qCAAqC,CAAC;AACxF,MAAM,CAAC,MAAM,6BAA6B,GACxC,oRAAoR,CAAC;AACvR,MAAM,CAAC,MAAM,4BAA4B,GACvC,kRAAkR,CAAC;AAErR,MAAM,UAAU,sBAAsB,CAAC,KAItC;IACC,OAAO,qBAAqB,CAAC,uBAAuB,EAAE;QACpD,WAAW,EAAE,MAAM,CAAC,uBAAuB,CAAC;QAC5C,iBAAiB,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,aAAa,CAAC;QACtD,sBAAsB,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,kBAAkB,CAAC;QAChE,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC;KACvC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-statusline-render.d.ts","sourceRoot":"","sources":["../src/claude-statusline-render.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"claude-statusline-render.d.ts","sourceRoot":"","sources":["../src/claude-statusline-render.ts"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,eAAO,MAAM,+BAA+B,oCACT,CAAC;AAEpC;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB,yCAAyC,CAAC;AAE7E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,4BAA4B,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAI5E"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { GDH_UPDATE_HOOK_VERSION } from "@gdh/core";
|
|
1
|
+
import { GDH_UPDATE_HOOK_VERSION, assertClassRegistered } from "@gdh/core";
|
|
2
|
+
import { renderAdapterTemplate } from "./template-assets.js";
|
|
3
|
+
assertClassRegistered("claude_statusline", "deterministic");
|
|
2
4
|
/**
|
|
3
5
|
* Relative path of the optional managed Claude statusline renderer script.
|
|
4
6
|
* GDH bakes this file so projects can opt into it manually, but adapter
|
|
@@ -48,32 +50,8 @@ export const GDH_STATUSLINE_COMMAND = "node .claude/hooks/gdh-statusline.js";
|
|
|
48
50
|
* output is literal JavaScript.
|
|
49
51
|
*/
|
|
50
52
|
export function renderClaudeUpdateStatusline(_pinnedVersion) {
|
|
51
|
-
return
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
"// Claude statusline: emits an upgrade hint when ~/.cache/gdh/update-check.json reports stale.",
|
|
55
|
-
"// Cache written by .claude/hooks/gdh-check-update-worker.js on SessionStart (UPD-01).",
|
|
56
|
-
"// Silent offline degrade per D-06 — missing/corrupt cache writes the empty string.",
|
|
57
|
-
"",
|
|
58
|
-
"const fs = require('fs');",
|
|
59
|
-
"const path = require('path');",
|
|
60
|
-
"const os = require('os');",
|
|
61
|
-
"",
|
|
62
|
-
"const homeDir = os.homedir();",
|
|
63
|
-
"const cacheFile = path.join(homeDir, '.cache', 'gdh', 'update-check.json');",
|
|
64
|
-
"",
|
|
65
|
-
"let gdhUpdate = '';",
|
|
66
|
-
"if (fs.existsSync(cacheFile)) {",
|
|
67
|
-
" try {",
|
|
68
|
-
" const cache = JSON.parse(fs.readFileSync(cacheFile, 'utf8'));",
|
|
69
|
-
" if (cache && cache.updateAvailable) {",
|
|
70
|
-
" gdhUpdate = '\\x1b[33m⬆ /gdh-update\\x1b[0m │ ';",
|
|
71
|
-
" }",
|
|
72
|
-
" } catch (e) {}",
|
|
73
|
-
"}",
|
|
74
|
-
"",
|
|
75
|
-
"process.stdout.write(gdhUpdate);",
|
|
76
|
-
"",
|
|
77
|
-
].join("\n");
|
|
53
|
+
return renderAdapterTemplate("claude-statusline.js.tpl", {
|
|
54
|
+
hookVersion: String(GDH_UPDATE_HOOK_VERSION),
|
|
55
|
+
});
|
|
78
56
|
}
|
|
79
57
|
//# sourceMappingURL=claude-statusline-render.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-statusline-render.js","sourceRoot":"","sources":["../src/claude-statusline-render.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"claude-statusline-render.js","sourceRoot":"","sources":["../src/claude-statusline-render.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAE3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,qBAAqB,CAAC,mBAAmB,EAAE,eAAe,CAAC,CAAC;AAE5D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAC1C,iCAAiC,CAAC;AAEpC;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,sCAAsC,CAAC;AAE7E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,UAAU,4BAA4B,CAAC,cAAuB;IAClE,OAAO,qBAAqB,CAAC,0BAA0B,EAAE;QACvD,WAAW,EAAE,MAAM,CAAC,uBAAuB,CAAC;KAC7C,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-update-hook-render.d.ts","sourceRoot":"","sources":["../src/claude-update-hook-render.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"claude-update-hook-render.d.ts","sourceRoot":"","sources":["../src/claude-update-hook-render.ts"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,eAAO,MAAM,sCAAsC,sCACd,CAAC;AAEtC;;;GAGG;AACH,eAAO,MAAM,wCAAwC,6CACT,CAAC;AAE7C;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,2BAA2B,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAKzE"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { GDH_UPDATE_HOOK_VERSION } from "@gdh/core";
|
|
1
|
+
import { GDH_UPDATE_HOOK_VERSION, assertClassRegistered } from "@gdh/core";
|
|
2
|
+
import { renderAdapterTemplate } from "./template-assets.js";
|
|
3
|
+
assertClassRegistered("claude_update_hook", "deterministic");
|
|
2
4
|
/**
|
|
3
5
|
* Relative path of the managed Claude SessionStart parent hook script.
|
|
4
6
|
* This is the .js file Claude Code invokes when a session opens on a
|
|
@@ -33,44 +35,9 @@ export const CLAUDE_CHECK_UPDATE_WORKER_RELATIVE_PATH = ".claude/hooks/gdh-check
|
|
|
33
35
|
* output is literal JavaScript.
|
|
34
36
|
*/
|
|
35
37
|
export function renderClaudeCheckUpdateHook(pinnedVersion) {
|
|
36
|
-
return
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
"// Called by Claude Code SessionStart hook — runs once per session.",
|
|
41
|
-
"// Baked by @gdh/adapters at the pinned gdh_version — regenerated by gdh self-update.",
|
|
42
|
-
"",
|
|
43
|
-
"const fs = require('fs');",
|
|
44
|
-
"const path = require('path');",
|
|
45
|
-
"const os = require('os');",
|
|
46
|
-
"const { spawn } = require('child_process');",
|
|
47
|
-
"",
|
|
48
|
-
"(function () {",
|
|
49
|
-
" // Dev-mode short-circuit: contributors running from source must never see an update signal.",
|
|
50
|
-
" // (Baked script cannot read .gdh-state/local-paths.json without @gdh/core; env var covers the contributor case.)",
|
|
51
|
-
" if (process.env.GDH_DEV_REPO && process.env.GDH_DEV_REPO.trim()) return;",
|
|
52
|
-
"",
|
|
53
|
-
" const homeDir = os.homedir();",
|
|
54
|
-
" const cacheDir = path.join(homeDir, '.cache', 'gdh');",
|
|
55
|
-
" const cacheFile = path.join(cacheDir, 'update-check.json');",
|
|
56
|
-
"",
|
|
57
|
-
" try { fs.mkdirSync(cacheDir, { recursive: true }); } catch (e) {}",
|
|
58
|
-
"",
|
|
59
|
-
" const workerPath = path.join(__dirname, 'gdh-check-update-worker.js');",
|
|
60
|
-
" const child = spawn(process.execPath, [workerPath], {",
|
|
61
|
-
" stdio: 'ignore',",
|
|
62
|
-
" windowsHide: true,",
|
|
63
|
-
" detached: true,",
|
|
64
|
-
" env: {",
|
|
65
|
-
" ...process.env,",
|
|
66
|
-
" GDH_CACHE_FILE: cacheFile,",
|
|
67
|
-
` GDH_PINNED_VERSION: ${JSON.stringify(pinnedVersion)},`,
|
|
68
|
-
" },",
|
|
69
|
-
" });",
|
|
70
|
-
"",
|
|
71
|
-
" child.unref();",
|
|
72
|
-
"})();",
|
|
73
|
-
"",
|
|
74
|
-
].join("\n");
|
|
38
|
+
return renderAdapterTemplate("claude-check-update-hook.js.tpl", {
|
|
39
|
+
hookVersion: String(GDH_UPDATE_HOOK_VERSION),
|
|
40
|
+
pinnedVersionJson: JSON.stringify(pinnedVersion),
|
|
41
|
+
});
|
|
75
42
|
}
|
|
76
43
|
//# sourceMappingURL=claude-update-hook-render.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-update-hook-render.js","sourceRoot":"","sources":["../src/claude-update-hook-render.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"claude-update-hook-render.js","sourceRoot":"","sources":["../src/claude-update-hook-render.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAE3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,qBAAqB,CAAC,oBAAoB,EAAE,eAAe,CAAC,CAAC;AAE7D;;;;GAIG;AACH,MAAM,CAAC,MAAM,sCAAsC,GACjD,mCAAmC,CAAC;AAEtC;;;GAGG;AACH,MAAM,CAAC,MAAM,wCAAwC,GACnD,0CAA0C,CAAC;AAE7C;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,2BAA2B,CAAC,aAAqB;IAC/D,OAAO,qBAAqB,CAAC,iCAAiC,EAAE;QAC9D,WAAW,EAAE,MAAM,CAAC,uBAAuB,CAAC;QAC5C,iBAAiB,EAAE,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC;KACjD,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-update-worker-render.d.ts","sourceRoot":"","sources":["../src/claude-update-worker-render.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"claude-update-worker-render.d.ts","sourceRoot":"","sources":["../src/claude-update-worker-render.ts"],"names":[],"mappings":"AAUA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,6BAA6B,CAC3C,cAAc,CAAC,EAAE,MAAM,GACtB,MAAM,CAOR"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { GDH_UPDATE_HOOK_VERSION, GDH_UPDATE_REGISTRY_URL, } from "@gdh/core";
|
|
1
|
+
import { GDH_UPDATE_HOOK_VERSION, GDH_UPDATE_REGISTRY_URL, assertClassRegistered, } from "@gdh/core";
|
|
2
|
+
import { renderAdapterTemplate } from "./template-assets.js";
|
|
3
|
+
assertClassRegistered("claude_update_worker", "deterministic");
|
|
2
4
|
/**
|
|
3
5
|
* Render the background worker source that is spawned (detached + unref) by
|
|
4
6
|
* the SessionStart parent hook. The worker performs the HTTPS probe against
|
|
@@ -28,72 +30,9 @@ import { GDH_UPDATE_HOOK_VERSION, GDH_UPDATE_REGISTRY_URL, } from "@gdh/core";
|
|
|
28
30
|
export function renderClaudeCheckUpdateWorker(_pinnedVersion) {
|
|
29
31
|
// _pinnedVersion is accepted for API uniformity with the hook renderer;
|
|
30
32
|
// the worker body itself reads process.env.GDH_PINNED_VERSION at runtime.
|
|
31
|
-
return
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"// Probes https://registry.npmjs.org/@skillcap/gdh/latest and writes the",
|
|
36
|
-
"// result to the per-user cache at ~/.cache/gdh/update-check.json.",
|
|
37
|
-
"// Exits silently on any failure — D-06 silent-failure contract.",
|
|
38
|
-
"",
|
|
39
|
-
"'use strict';",
|
|
40
|
-
"",
|
|
41
|
-
"const fs = require('fs');",
|
|
42
|
-
"",
|
|
43
|
-
"// Compare semver: true if a is strictly newer than b.",
|
|
44
|
-
"// Strips pre-release suffixes (e.g. '3-beta.1' → '3') to avoid NaN from Number().",
|
|
45
|
-
"function isNewer(a, b) {",
|
|
46
|
-
" const pa = (a || '').split('.').map(s => Number(s.replace(/-.*/, '')) || 0);",
|
|
47
|
-
" const pb = (b || '').split('.').map(s => Number(s.replace(/-.*/, '')) || 0);",
|
|
48
|
-
" for (let i = 0; i < 3; i++) {",
|
|
49
|
-
" if (pa[i] > pb[i]) return true;",
|
|
50
|
-
" if (pa[i] < pb[i]) return false;",
|
|
51
|
-
" }",
|
|
52
|
-
" return false;",
|
|
53
|
-
"}",
|
|
54
|
-
"",
|
|
55
|
-
"(async () => {",
|
|
56
|
-
" // Dev-mode short-circuit: contributors running from source must never see an update signal.",
|
|
57
|
-
" // (Baked worker checks ONLY the env var — cannot read local-paths.json without @gdh/core.)",
|
|
58
|
-
" if (process.env.GDH_DEV_REPO && process.env.GDH_DEV_REPO.trim()) return;",
|
|
59
|
-
"",
|
|
60
|
-
" const pinned = process.env.GDH_PINNED_VERSION;",
|
|
61
|
-
" if (!pinned) return;",
|
|
62
|
-
"",
|
|
63
|
-
" const cacheFile = process.env.GDH_CACHE_FILE;",
|
|
64
|
-
" if (!cacheFile) return;",
|
|
65
|
-
"",
|
|
66
|
-
" let res = null;",
|
|
67
|
-
" try {",
|
|
68
|
-
` res = await fetch(${JSON.stringify(GDH_UPDATE_REGISTRY_URL)}, {`,
|
|
69
|
-
" signal: AbortSignal.timeout(10000),",
|
|
70
|
-
" });",
|
|
71
|
-
" } catch (e) {}",
|
|
72
|
-
"",
|
|
73
|
-
" let latest = null;",
|
|
74
|
-
" if (res && res.ok) {",
|
|
75
|
-
" try {",
|
|
76
|
-
" const body = await res.json();",
|
|
77
|
-
" if (typeof body.version === 'string') {",
|
|
78
|
-
" latest = body.version;",
|
|
79
|
-
" }",
|
|
80
|
-
" } catch (e) {}",
|
|
81
|
-
" }",
|
|
82
|
-
"",
|
|
83
|
-
" // Offline / registry 5xx / parse error — write nothing per D-06.",
|
|
84
|
-
" if (latest === null) return;",
|
|
85
|
-
"",
|
|
86
|
-
" const result = {",
|
|
87
|
-
" pinned,",
|
|
88
|
-
" latest,",
|
|
89
|
-
" checkedAt: new Date().toISOString(),",
|
|
90
|
-
" source: 'npm-registry-latest',",
|
|
91
|
-
" updateAvailable: isNewer(latest, pinned),",
|
|
92
|
-
" };",
|
|
93
|
-
"",
|
|
94
|
-
" try { fs.writeFileSync(cacheFile, JSON.stringify(result, null, 2)); } catch (e) {}",
|
|
95
|
-
"})();",
|
|
96
|
-
"",
|
|
97
|
-
].join("\n");
|
|
33
|
+
return renderAdapterTemplate("claude-check-update-worker.js.tpl", {
|
|
34
|
+
hookVersion: String(GDH_UPDATE_HOOK_VERSION),
|
|
35
|
+
registryUrlJson: JSON.stringify(GDH_UPDATE_REGISTRY_URL),
|
|
36
|
+
});
|
|
98
37
|
}
|
|
99
38
|
//# sourceMappingURL=claude-update-worker-render.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-update-worker-render.js","sourceRoot":"","sources":["../src/claude-update-worker-render.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,uBAAuB,
|
|
1
|
+
{"version":3,"file":"claude-update-worker-render.js","sourceRoot":"","sources":["../src/claude-update-worker-render.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,qBAAqB,CAAC,sBAAsB,EAAE,eAAe,CAAC,CAAC;AAE/D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,UAAU,6BAA6B,CAC3C,cAAuB;IAEvB,wEAAwE;IACxE,0EAA0E;IAC1E,OAAO,qBAAqB,CAAC,mCAAmC,EAAE;QAChE,WAAW,EAAE,MAAM,CAAC,uBAAuB,CAAC;QAC5C,eAAe,EAAE,IAAI,CAAC,SAAS,CAAC,uBAAuB,CAAC;KACzD,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { type GdhDeferredActionStatus, type GdhEnvelopePendingAdvisory, type GdhHostHarnessIntrospect, type GdhProcessRestartProbe } from "@gdh/core";
|
|
2
|
+
/**
|
|
3
|
+
* Adapters consumed by {@link computeDeferredActionsAdvisory} (and threaded
|
|
4
|
+
* through `buildGdhStatusResult`). Both fields default to `null` so unit tests
|
|
5
|
+
* (which cannot introspect a real host harness) see probe results degrade to
|
|
6
|
+
* `pending` and the advisory remains correctly gated.
|
|
7
|
+
*/
|
|
8
|
+
export interface GdhStatusBuildAdapters {
|
|
9
|
+
readonly hostHarnessIntrospect: GdhHostHarnessIntrospect;
|
|
10
|
+
readonly processProbe: GdhProcessRestartProbe;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Probed deferred-action entry surfaced through `gdh status`.
|
|
14
|
+
*
|
|
15
|
+
* Mirrors the `GdhDeferredAction` shape minus the on-disk-only fields; carries
|
|
16
|
+
* the live probe result so consumers can rebuild rendering without re-running
|
|
17
|
+
* the probes.
|
|
18
|
+
*/
|
|
19
|
+
export interface GdhDeferredActionStatusEntry {
|
|
20
|
+
readonly id: string;
|
|
21
|
+
readonly description: string;
|
|
22
|
+
readonly status: GdhDeferredActionStatus;
|
|
23
|
+
readonly reason?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Backup-cleanup advisory shape (D-17). Emitted ONLY when:
|
|
27
|
+
* 1. every probed deferred action returns `clean` (or there are zero), AND
|
|
28
|
+
* 2. `.gdh-state/backup/` exists (a manifest was readable), AND
|
|
29
|
+
* 3. `.gdh-state/backup.new/` does NOT exist (no in-progress migration).
|
|
30
|
+
*
|
|
31
|
+
* The `command` literal is the verbatim CLI invocation users run.
|
|
32
|
+
*/
|
|
33
|
+
export interface GdhBackupAdvisory {
|
|
34
|
+
readonly command: "gdh migration clear-backups";
|
|
35
|
+
readonly reason: "all_deferred_actions_clean";
|
|
36
|
+
readonly from_pin: string;
|
|
37
|
+
readonly to_pin: string;
|
|
38
|
+
}
|
|
39
|
+
export interface GdhDeferredActionsAdvisoryResult {
|
|
40
|
+
readonly deferredActions: readonly GdhDeferredActionStatusEntry[];
|
|
41
|
+
readonly backupAdvisory: GdhBackupAdvisory | null;
|
|
42
|
+
/**
|
|
43
|
+
* Phase 73 D-12: envelope-pending advisory. `null` unless
|
|
44
|
+
* `migration.json.pending_envelope_resume` is non-null. Mutually exclusive
|
|
45
|
+
* with {@link GdhBackupAdvisory} — when this is non-null, `backupAdvisory`
|
|
46
|
+
* is `null` because clearing the durable backup while a chain is paused
|
|
47
|
+
* destroys the rollback substrate.
|
|
48
|
+
*/
|
|
49
|
+
readonly envelopeAdvisory: GdhEnvelopePendingAdvisory | null;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Read `migration.json`, run the probe per deferred action, and decide whether
|
|
53
|
+
* to emit the backup-cleanup advisory.
|
|
54
|
+
*
|
|
55
|
+
* Threat mitigations:
|
|
56
|
+
* - T-72-05-03 (TOCTOU): re-reads migration.json AND backup state freshly
|
|
57
|
+
* inside this function; no cached probe results are consumed across calls.
|
|
58
|
+
* - T-72-05-04 (malformed migration.json): `readMigrationState` returns null
|
|
59
|
+
* on parse/shape failure → `deferredActions` is `[]` and the advisory is
|
|
60
|
+
* gated through the standard truth table.
|
|
61
|
+
* - T-72-05-06 (stale probe → clean): the gate requires `status === "clean"`
|
|
62
|
+
* for every probe; `stale` and `pending` both block the advisory.
|
|
63
|
+
* - T-72-05-07 (interrupted migration): staging-dir check forces the advisory
|
|
64
|
+
* to null whenever `.gdh-state/backup.new/` exists.
|
|
65
|
+
*
|
|
66
|
+
* Defaults: `adapters.hostHarnessIntrospect = null` and `adapters.processProbe
|
|
67
|
+
* = null` (every probe degrades to `pending`, so the advisory does not spuriously
|
|
68
|
+
* fire when a host cannot evaluate the deferred conditions).
|
|
69
|
+
*/
|
|
70
|
+
export declare function computeDeferredActionsAdvisory(targetPath: string, adapters?: GdhStatusBuildAdapters): Promise<GdhDeferredActionsAdvisoryResult>;
|
|
71
|
+
//# sourceMappingURL=deferred-actions-advisory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deferred-actions-advisory.d.ts","sourceRoot":"","sources":["../src/deferred-actions-advisory.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,uBAAuB,EAC5B,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC5B,MAAM,WAAW,CAAC;AAOnB;;;;;GAKG;AACH,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,qBAAqB,EAAE,wBAAwB,CAAC;IACzD,QAAQ,CAAC,YAAY,EAAE,sBAAsB,CAAC;CAC/C;AAED;;;;;;GAMG;AACH,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,uBAAuB,CAAC;IACzC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,OAAO,EAAE,6BAA6B,CAAC;IAChD,QAAQ,CAAC,MAAM,EAAE,4BAA4B,CAAC;IAC9C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,gCAAgC;IAC/C,QAAQ,CAAC,eAAe,EAAE,SAAS,4BAA4B,EAAE,CAAC;IAClE,QAAQ,CAAC,cAAc,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAClD;;;;;;OAMG;IACH,QAAQ,CAAC,gBAAgB,EAAE,0BAA0B,GAAG,IAAI,CAAC;CAC9D;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,8BAA8B,CAClD,UAAU,EAAE,MAAM,EAClB,QAAQ,CAAC,EAAE,sBAAsB,GAChC,OAAO,CAAC,gCAAgC,CAAC,CA0E3C"}
|