fix: honor GHOST_PACKAGE_DIR in drift, ack, history, and review-command paths#187
Merged
Merged
Conversation
…nd paths Several local-fingerprint lookups hardcoded ".ghost" instead of the configured package directory, so relocating the package via GHOST_PACKAGE_DIR broke drift, ack, diverge, compare --temporal history, and the review-command emit footer. Resolve those through resolveGhostDirDefault() while keeping the .ghost default and leaving published node_modules/<pkg>/.ghost paths unchanged. Co-authored-by: Goose <opensource@block.xyz> Ai-assisted: true
nahiyankhan
approved these changes
Jun 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Ghost supports relocating the fingerprint package via
GHOST_PACKAGE_DIR(documented inSKILL.mdfor host wrappers and nested packages). But several commands still hardcoded the literal.ghost, so they ignored the configured directory. A repo whose package lives at, say,.agents/ghost/works forinit/scan/lint/verify/check/review, but silently breaks fordrift,ack,diverge,compare --temporal, and theemit review-commandfooter.This makes
GHOST_PACKAGE_DIRresolution consistent across all local-package paths.What
Replace hardcoded local-package
.ghostliterals withresolveGhostDirDefault()(which honorsGHOST_PACKAGE_DIRand falls back to.ghost):evolution-commands.ts—loadLocalFingerprint()resolves the configured dir (fixesack/diverge).drift-command.ts— local source fallback and the legacyfingerprint.mdfallback resolve the configured dir.core/evolution/history.ts—appendHistory/readHistorywrite and readhistory.jsonlunder the configured dir (fixescompare --temporal).context/package-review-command.ts— the emit footer's display fallback uses the configured dir.Intentionally left as
.ghost:FINGERPRINT_PACKAGE_DIRconstants — that is the upstream defaultresolveGhostDirDefault()returns when unset.node_modules/<pkg>/.ghostlookups — published npm packages ship their fingerprint at.ghost; a consumer'sGHOST_PACKAGE_DIRdoes not apply to dependencies.Tests
test/evolution/history-package-dir.test.ts: history writes to.ghostby default and to.agents/ghostwhenGHOST_PACKAGE_DIRis set (and not to.ghost).pnpm checkgreen (biome, typecheck, file-size, docs, bundle, CLI manifest).GHOST_PACKAGE_DIR=.agents/ghost ghost initthenghost ackresolves the package from.agents/ghost(previously failed looking in.ghost); plainghost initstill defaults to.ghost.Generated with Goose