Ghost stack 6/6 — Sprawl sweep & cleanup#194
Draft
nahiyankhan wants to merge 7 commits into
Draft
Conversation
a3057f7 to
c3a8672
Compare
0563dfe to
a1c56a0
Compare
Survey was pre-graph raw-signal capture with no live CLI command — its dispatch in fingerprint-commands was all dead _-prefixed code, reachable only as a vestigial .json lint kind. Deleted: ghost-core/survey/, the survey exports, the dead survey-pattern dispatch (~300 lines in fingerprint-commands), the .json/survey file-kind, an orphan ghost-core/fingerprint-package.ts, and 6 survey tests. Also clears ~150 'surface' false-positives (ui_surfaces color vocab) ahead of the surface->node unification.
…alog Discovery is now name + description, like tool selection. 'description' is a first-class node field (the retrieval payload); 'gather' with no arg builds the catalog from graph nodes (buildGraphMenu) — node id + description — plus any spine-only tree positions. Node frontmatter is passthrough: free-form keys (audience, stage) ride along untouched, gated on nothing. Surface-as-a-content-concept dissolves: the composition-edge vocabulary (composes/governed-by) is deleted (lateral composition is node 'relates'), the surface menu builder is replaced by the node catalog, and surfaces.yml is demoted to an optional terse spine file (id + parent + description) that folds into the node id space. Skill (capture.md, SKILL.md) documents description as the retrieval payload. All green: 113 tests, full check.
Delete the pre-graph standalone artifacts ghost.resources/v1 and ghost.patterns/v1 (modules, file-kinds, lint fns, path fields, test) — never part of the node/graph model. Prune dead constants (RESOURCES/PATTERNS/ FINGERPRINT_YML/FINGERPRINT/FINGERPRINTS_DIRNAME/SCOPE_SURVEYS/CHECKS_FILENAME), all dead public re-exports. Scrub the skill bundle of facet-era residue: delete voice.md + patterns.md, rewrite schema.md and recall.md to the node model, and remove every 'facet' reference across the bundle. Remaining schemas are exactly the graph model: node, check, surfaces, fingerprint-package, advisory-review. The intent/inventory/composition filename constants stay only for legacy-package detection -> migrate guidance. All green: 109 tests, full check, install bundle 10 files.
Delete orphan scan/schema.ts (198-line survey-era color/palette zod schema, zero importers) and scan/package-config.ts (normalizeReferenceInput, dead since --reference was dropped). Remove dead exports: getCommandDiscoveryForCommand, fingerprintPackageDisplayPath, and the LintOptions interface + its re-export — none had any caller. Remaining 'dead-looking' exports (GHOST_*_SCHEMA identity constants, getCommandDiscoveryMetadata, resolveGitRoot) are intentional public API / reserved surface and stay. All green: 109 tests, full check.
Two eras of phase plans had accumulated. Delete the pre-graph surface-model
cutover family (coordinate-space, surface-schema, surface-binding,
contract-and-binding, ghost-layers, reset, implementation-plan, phase-{1..8}-plan,
phase-7b-*, polish-*, guided-migration) — superseded by the graph reset. Delete
the shipped graph-era execution plans (one-road, graph-implementation-plan,
phase-{1-node-schema..7-cross-package}) — the implementation is in code and git
history is the record. Delete parked-survey-module (survey was since deleted).
Keep the durable set: fingerprint-first-architecture (settled), context-graph
(the model), scenarios-worked (worked reference), contract-storage +
compare-drift-fleet-rethink (open/parked), ghost-ui. Rewrite the README arc to
match and fix the one broken cross-link.
… limits Architecture hygiene pass: - Split scan/inventory.ts (1082 lines, one giant function-bag) into a focused scan/inventory/ module: constants, paths, walk, manifests, hints, git, and an index.ts orchestrator. Each concern is now independently readable/testable; largest piece is 243 lines. - Group the 8 root-level command + review-packet files under src/commands/, so the layering reads commands/ (CLI) -> scan/ (I/O) -> ghost-core/ (model). review-packet (domain-ish, the odd one out at root) now lives with its review command. Fixed skill-command's bundle-path URL for the new depth. - Delete all three file-size EXCEPTIONS: two were stale lies (cli.ts granted 580 for 161 actual; fingerprint-commands 1135 for 178) and inventory no longer needs one. Every file now passes the honest 500-line default. All green: 109 tests, full check, zero file-size exceptions.
jiti (1.7MB) and tinyglobby were declared runtime deps but imported nowhere in source — Ghost rolls its own tiny workspace-glob matcher. Removed both; runtime deps are now cac + yaml + zod. Also fix the build bug where 'tsc --build' incremental retained deleted modules (relay, compare, context/, core/, old inventory) in dist/ because the build's rm -rf cleared dist but not tsconfig.tsbuildinfo. Now clears both. The published artifact drops from ~1.9MB/777 files to ~397KB/248 files (104KB packed). Updated the release-tarball check's expected-deps list. All green.
a1c56a0 to
99543c2
Compare
c3a8672 to
42e7f6d
Compare
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.
Stacked PR 6 of 6 · base: `ghost/05-node-graph`
Tidy-up. Merges last.
Contents
Stack order