Refactor fingerprinting: AI-only, embedded decisions, cac CLI#32
Merged
nahiyankhan merged 3 commits intomainfrom Apr 17, 2026
Merged
Refactor fingerprinting: AI-only, embedded decisions, cac CLI#32nahiyankhan merged 3 commits intomainfrom
nahiyankhan merged 3 commits intomainfrom
Conversation
Unify the fingerprinting pipeline as AI-only with a single multi-target extract path, add embedding-based decision comparison, and replace citty with cac for proper variadic CLI support. **Pipeline unification (Director.profile)** Collapse `extract` / `extractMulti` and `Director.profile` / `profileMulti` into single `Target[]`-taking implementations. `setToolContext` now fires unconditionally, fixing a latent bug where `compare`, `drift`, `comply`, and `fleet` silently completed without fingerprints whenever the LLM requested tools. **Clean path hygiene** Stop mutating `file.path` with `[label]` prefixes in multi-source extraction; `sourceLabel` alone carries provenance. `run_extractor` takes an optional `source` arg to disambiguate and errors on collision. **AI-only, no fallbacks** Remove `provider.interpret` and both fallback paths inside `FingerprintAgent` (no-chat-support, 20-iteration safety). `profile()` throws without LLM config and routes cwd through the agent pipeline. `profileRegistry` stays as a distinct deterministic shadcn path. Delete legacy symbols: `FINGERPRINT_SCHEMA`, `buildFingerprintPrompt`, `buildDesignLanguagePrompt`, `analyzeStructure`, `DesignLanguageProfile`, `EnrichedFingerprint.languageProfile`, `profileWithAnalysis`, `fingerprintFromExtraction`. **Decision comparison via embeddings** Add `DesignDecision.embedding?: number[]` and a batched `embedTexts` primitive. Both agent paths embed decisions at profile time when an embedding provider is configured. `compareFingerprints` replaces word- overlap matching with cosine similarity above a 0.75 threshold, blending unmatched coverage with matched-pair distance. Missing embeddings → decisions reported qualitatively, excluded from the weighted scalar so they don't pollute the number. New test covers paraphrase matching, divergence, and the missing-embedding fallback. **citty → cac** All 17 commands migrated. Three `process.argv` scanning hacks (`profile`, `fleet`, `viz`) deleted — cac's `[...targets]` handles variadic natively. `ghost profile ./a -v ./b` now captures both targets instead of dropping the second one. Verified: typecheck, biome check, file-size check, build, 101/101 tests. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replace the "64-dim vector" framing with the observation/decisions/values model. Swap the stale "Architecture 15%" weight card for "Decisions 15%" (matches WEIGHTS_WITH_DECISIONS in fingerprint/compare.ts) and rename the radar axis to match. Add a paragraph describing paraphrase-robust decision matching via cosine similarity above 0.75. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
extract/extractMultiandDirector.profile/profileMultiinto singleTarget[]-taking implementations, removes deterministic/fallback paths, and fixes a latent bug wheresetToolContextdidn't fire when the LLM requested tools (causingcompare/drift/comply/fleetto silently finish without fingerprints).DesignDecision.embedding?: number[]is populated at profile time;compareFingerprintsnow matches decisions by cosine similarity above a 0.75 threshold, blending unmatched coverage with matched-pair distance. Missing embeddings are reported qualitatively and excluded from the scalar so they don't pollute the number.process.argvscanning hacks (profile,fleet,viz) deleted — cac's[...targets]handles variadic natively, soghost profile ./a -v ./bnow captures both targets.Deleted legacy symbols
FINGERPRINT_SCHEMA,buildFingerprintPrompt,buildDesignLanguagePrompt,analyzeStructure,DesignLanguageProfile,EnrichedFingerprint.languageProfile,profileWithAnalysis,fingerprintFromExtraction,provider.interpret.Test plan
pnpm check— biome + typecheck + file-sizepnpm test— 101/101 passing (newcompare-decisions.test.tscovers paraphrase matching, divergence, and the missing-embedding fallback)pnpm buildghost profile ./a -v ./bcaptures both targets (was dropping the second with citty)ghost compare/drift/comply/fleetcomplete end-to-end when the LLM uses tools (previously silently empty)/docs/concepts🤖 Generated with Claude Code