Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .changeset/add-bucket-schema-and-merge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
"ghost-expression": minor
---

Land the three-stage scan pipeline: topology (`map.md`) → objective (`bucket.json`) → subjective (`expression.md`). All three stages are now owned by `ghost-expression`; the previously separate `ghost-map` package is folded in.

**New artifact: `ghost.bucket/v1`** — catalogues every concrete design value with structured specs, occurrence counts, and deterministic content-hashed IDs.

**New verbs:**
- `ghost-expression inventory [path]` — emit deterministic raw repo signals as JSON (manifests, language histogram, registry, top-level tree, git remote). Feeds the topology recipe. (Migrated from `ghost-map inventory`.)
- `ghost-expression bucket <op>` — `merge` (concat with id-based dedup, idempotent — useful for modular rollups and fleet cohort views), `fix-ids` (recompute every row's `id` from content, so surveyor agents can author rows with empty `id` fields and finalize in one pass).
- `ghost-expression scan-status [dir]` — report which scan stages have produced artifacts (`map.md`, `bucket.json`, `expression.md`) and which stage to run next. The build-system glue orchestrators call between stages.

**Updated verbs:**
- `ghost-expression lint` now auto-detects file kind by extension/content and dispatches to the right validator (`expression.md`, `map.md`, or `bucket.json`).

**New skill recipes:**
- `map.md` — author `map.md` from a target (the topology stage). Migrated from the standalone `ghost-map` package.
- `survey.md` — author `bucket.json` from a target (the objective stage). Walks the agent through LLM-driven extraction with dialect-specific grep strategies, exhaustiveness discipline, and saturation predicate.
- `scan.md` — meta-recipe that orchestrates topology → survey → profile end-to-end via `scan-status` checkpoints. Use when the user wants a full scan rather than a specific stage.

**Refactored skill recipe:**
- `profile.md` — now strictly the subjective interpretation stage. Reads `bucket.json` as ground truth; cannot fabricate values not in the bucket; cites bucket rows as evidence. Pre-requires `map.md` + `bucket.json`. Hard split from the previous one-pass extract+interpret recipe.

**Removed:** the `ghost-map` package is deleted. `ghost.map/v1` schema and types now live in `@ghost/core`; `inventory` and `lint` (for `map.md`) move to `ghost-expression`. Consumers that imported from `ghost-map` should switch to `@ghost/core` (schemas/types) or `ghost-expression` (CLI verbs / library functions).

Bucket schema, deterministic-id generation, lint, merge, and fix-ids primitives live in `@ghost/core`.
5 changes: 5 additions & 0 deletions .changeset/canonical-decision-vocabulary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ghost-expression": minor
---

Add a controlled vocabulary of 12 canonical decision dimensions (`color-strategy`, `surface-hierarchy`, `shape-language`, `typography-voice`, `spatial-system`, `density`, `motion`, `elevation`, `theming-architecture`, `interactive-patterns`, `token-architecture`, `font-sourcing`) so fleet-aggregation primitives can group decisions across members. Profile recipe nudges authors toward canonical slugs; novel project-flavored slugs may pair with an optional `dimension_kind` that maps to a canonical bucket. New soft `non-canonical-dimension` lint warning suggests the closest canonical match. The schema accepts the optional `dimension_kind` field on `decisions[]`; existing expressions remain valid.
8 changes: 1 addition & 7 deletions .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,5 @@
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": [
"ghost-ui",
"ghost-docs",
"@ghost/core",
"ghost-fleet",
"ghost-map"
]
"ignore": ["ghost-ui", "ghost-docs", "@ghost/core", "ghost-fleet"]
}
6 changes: 6 additions & 0 deletions .changeset/drop-roles.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"ghost-expression": major
"ghost-drift": patch
---

Drop `roles[]` from the `expression.md` schema. Slot → token bindings either fall out of decisions[] (pattern consequences) or live in bucket.json components[] (exhaustive catalog). The hybrid `roles[]` slot was filling neither role cleanly and didn't scale to systems with many components. Existing files that carry `roles:` will fail strict lint — drop the section to migrate. Drift skill recipes that referenced `roles[]` as part of the expression frontmatter have been updated.
9 changes: 9 additions & 0 deletions .changeset/drop-signature-section.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"ghost-expression": major
---

Drop the `# Signature` body section and `observation.distinctiveTraits` field from the `expression.md` schema. Every claim Signature carried — distinctive traits, load-bearing absences — was already covered better elsewhere: `rules[]` with `presence_floor` codifies absences as enforceable patterns, decisions cite evidence directly, and `observation.personality` carries the lightweight summarizing role. Signature had collapsed into restating frontmatter as bullets.

The parser silently ignores legacy `# Signature` blocks in older `expression.md` files, so existing artifacts continue to load without erroring. The writer no longer emits the section, and lint no longer expects it. `INVARIANTS.md` §3 has been amended to remove "Signature" from the body partition list.

Removed: `DesignObservation.distinctiveTraits` (TypeScript), `# Signature` body section, `observation.distinctiveTraits` field. Context-bundle emit now uses `observation.personality` for the trait-phrase hooks in README and skill description.
14 changes: 14 additions & 0 deletions .changeset/fix-oklch-backfill-and-tighten-survey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
"ghost-expression": patch
"ghost-drift": patch
---

Fix self-distance bug + tighten the survey recipe's exhaustiveness rule.

**Bug fix.** `loadExpression` now backfills `oklch` on palette colors that arrive hex-only (frontmatter without an explicit `oklch` tuple). Without this, `comparePalette` treated hex-only colors as fully unmatched and contributed distance `1.0` per color — even when comparing an expression to itself. Self-distance was reported as 17.5% on a freshly authored expression. Backfill is deterministic (same hex → same oklch), so re-parsing the same file always yields the same in-memory shape.

**Defensive fallback.** `comparePalette` also now resolves oklch on-the-fly when missing, and falls back to hex-string equality when even on-the-fly compute can't parse the color (CSS variables, opaque external refs). This covers third-party producers that don't backfill on write.

**Recipe tightening.** `survey.md` now states the exhaustiveness rule up front and applies it per section. The rule is repo-agnostic — the recipe doesn't name specific signal sources (no "use registry.json"); the agent identifies the canonical signal in *this* repo, enumerates exhaustively, and cross-checks counts. New `Never sample` rule and explicit guidance against placeholder/glob names. Triggered by a dogfood scan that produced ~10% recall on `components[]` (6 rows for a 97-component package).

**Schema cut: `bucket.libraries[]` removed.** External libraries (icon sets, primitive collections, motion libs, charting) no longer have a top-level bucket section. Whether a system uses Radix or hand-rolls primitives doesn't change what its design language *is*. When a library is load-bearing for the design language (icon family, font sourcing), it surfaces as prose evidence in the interpreter stage under the relevant decision dimension. Bucket sections are now `values`, `tokens`, `components`. `LibraryRow` / `LibraryRowSchema` / `libraryRowId` removed from `@ghost/core` exports. Existing `bucket.json` files with a `libraries` field will fail lint (use a no-op migration: drop the field).
5 changes: 5 additions & 0 deletions .changeset/v0-rules-and-perceptual-prior.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ghost-expression": minor
---

Add `rules[]` as the v0 authoring surface for drift review and a perceptual-weight prior that calibrates emitted severity. An `expression.md` can now declare grep-friendly rules in frontmatter (id, canonical, kind, pattern, optional severity / match / tolerance / presence_floor / support); the emitter renders them as a Rams-shaped slash command grouped by Critical / Serious / Nit, with rationale + match shape + support cited per rule and a calibration footer that explains why severities landed where they did. Severity is computed from a fixed perceptual tier (color and font-family are loud, shape and elevation structural, spacing and motion-detail rhythmic) plus presence-floor escalation against the bucket — adding to a silent dimension is louder than tweaking a populated one. Existing `decisions[]`-driven expressions continue to emit the previous structured-section layout; the new rules-driven path activates only when `rules[]` is present. Ships a one-liner curl installer at `install/install.sh` so the skill bundle can be installed without npm or a build step; recipes carry prose fallbacks for the most-called CLI verbs (`scan-status`, `inventory`, `lint`) so the no-CLI path is real, not degraded.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ packages/ghost-ui/.ghost/

# Emitted skill bundle — re-generate with `ghost emit skill`
.claude/skills/

# Scratch dir for dogfood scans and ad-hoc experiments
.scratch/
Loading
Loading