- Introduced profile selection modal for creating notes from interview profiles. - Added settings for interview configuration path, auto-starting interviews, and intercepting unresolved link clicks. - Updated package files to include YAML dependency for configuration handling. - Enhanced CSS for profile selection and interview wizard UI elements.
9.0 KiB
Chain Inspector v0.4.2 - Template Matching Profiles Implementierungsbericht
Status: ✅ Vollständig implementiert und getestet
Datum: 2025-01-XX
Version: v0.4.2.0
Basiert auf: Chain Inspector v0.4.1.0
Übersicht
Chain Inspector v0.4.2 erweitert v0.4.1 um Template Matching Profiles - eine konfigurierbare Steuerung für Template Matching-Verhalten über chain_templates.yaml defaults.profiles. Profile ermöglichen unterschiedliche Thresholds und Verhalten für "discovery" (weniger strikt) vs. "decisioning" (strikter) Szenarien.
Neue Features
1. Template Matching Profiles
Profile-Konzept:
- discovery: Weniger strikt, mehr Findings (für Exploration)
- decisioning: Strikter, weniger Findings (für Entscheidungen)
Profile-Konfiguration (chain_templates.yaml):
defaults:
profiles:
discovery:
required_links: false
min_slots_filled_for_gap_findings: 1
min_score_for_gap_findings: 0
decisioning:
required_links: true
min_slots_filled_for_gap_findings: 3
min_score_for_gap_findings: 20
Profile-Parameter:
required_links(boolean): Steuert, ob fehlende Template-Links bestraft werdenmin_slots_filled_for_gap_findings(number): Mindestanzahl gefüllter Slots für Findingsmin_score_for_gap_findings(number): Mindest-Score für Findings
2. Settings Integration
Neue Setting:
templateMatchingProfile:"discovery" | "decisioning"(default:"discovery")- Erscheint in Settings UI als Dropdown
- Wird persistiert und an
inspectChainsübergeben
3. Profile-basierte Findings-Logik
required_links Verhalten:
-
required_links=false(discovery):- Fehlende Links werden NICHT bestraft (kein -5 Score)
- Links zählen nur positiv, wenn erfüllt (+10)
- Findings werden nur basierend auf Slots emittiert, nicht auf fehlenden Links
-
required_links=true(decisioning):- Fehlende Links werden bestraft (-5 Score)
- Findings können auch für fehlende Links emittiert werden
missing_slot Findings:
- Werden nur emittiert, wenn:
slotsFilled >= profile.min_slots_filled_for_gap_findingsUNDbestScore >= profile.min_score_for_gap_findingsUNDmissingSlots.length > 0
- Discovery: Niedrige Thresholds → mehr Findings
- Decisioning: Hohe Thresholds → weniger Findings
4. Report-Erweiterung
Neues Report-Feld: templateMatchingProfileUsed
{
name: string; // "discovery" | "decisioning"
resolvedFrom: "settings" | "default";
profileConfig?: {
required_links?: boolean;
min_slots_filled_for_gap_findings?: number;
min_score_for_gap_findings?: number;
};
}
Technische Implementierung
Geänderte Dateien
src/dictionary/types.ts
- Neue Interface:
TemplateMatchingProfilerequired_links?: booleanmin_slots_filled_for_gap_findings?: numbermin_score_for_gap_findings?: number
- Erweiterte Interface:
ChainTemplatesConfigdefaults.profiles?: { discovery?: TemplateMatchingProfile; decisioning?: TemplateMatchingProfile }
src/settings.ts
- Neue Setting:
templateMatchingProfile: "discovery" | "decisioning"(default:"discovery")
src/ui/MindnetSettingTab.ts
- Neue UI-Komponente: Dropdown für Template Matching Profile
- Positioniert nach Chain Templates Path Setting
src/dictionary/parseChainTemplates.ts
- Erweitert: Parsing für
defaults.profiles.discoveryunddefaults.profiles.decisioning - Permissive: Unbekannte Felder werden ignoriert
src/analysis/templateMatching.ts
- Erweiterte Funktion:
matchTemplates()- Neuer Parameter:
profile?: TemplateMatchingProfile - Übergibt Profile an
findBestAssignment()undscoreAssignment()
- Neuer Parameter:
- Erweiterte Funktion:
scoreAssignment()- Verwendet
profile.required_linksstattdefaultsRequiredLinks - Priorität:
profile > template.matching > defaults.matching
- Verwendet
- Erweiterte Funktion:
findBestAssignment()- Übergibt Profile an
scoreAssignment()
- Übergibt Profile an
src/analysis/chainInspector.ts
- Erweiterte Funktion:
inspectChains()- Neuer Parameter:
templateMatchingProfileName?: string - Lädt Profile aus
chainTemplates.defaults.profiles[profileName] - Übergibt Profile an
matchTemplates() - Findings-Logik verwendet Profile-Thresholds:
min_slots_filled_for_gap_findings(default: 2)min_score_for_gap_findings(default: 0)
- Neuer Parameter:
- Erweiterte Interface:
ChainInspectorReporttemplateMatchingProfileUsed?: { name, resolvedFrom, profileConfig }
src/commands/inspectChainsCommand.ts
- Erweiterte Funktion:
executeInspectChains()- Übergibt
settings.templateMatchingProfileaninspectChains()
- Übergibt
- Erweiterte Funktion:
formatReport()- Zeigt "Template Matching Profile" Sektion mit:
- Profile-Name
- Resolved from (settings/default)
- Profile-Config (wenn vorhanden)
- Zeigt "Template Matching Profile" Sektion mit:
src/tests/analysis/templateMatching.profiles.test.ts (NEU)
- 4 Tests:
should emit missing_slot findings with discovery profile (low thresholds)should NOT emit missing_slot findings with decisioning profile (high thresholds)should apply required_links=false from profile (no penalty for missing links)should apply required_links=true from profile (penalty for missing links)
Profile-Auflösung
Priorität:
- Settings:
settings.templateMatchingProfile(wenn gesetzt) - Default:
"discovery"(wenn nicht gesetzt) - YAML:
chainTemplates.defaults.profiles[profileName](wenn vorhanden) - Fallback: Kein Profile → vorheriges Verhalten (safe default)
Resolved From:
"settings": Profile wurde aus Settings geladen"default": Profile wurde als Default verwendet (kein Setting gesetzt)
Verwendung
In Obsidian
- Öffnen Sie Settings → Mindnet Settings
- Wählen Sie Template matching profile: "Discovery" oder "Decisioning"
- Öffnen Sie eine Markdown-Datei mit Edges
- Positionieren Sie den Cursor in einer Section
- Öffnen Sie die Command Palette (Strg+P / Cmd+P)
- Wählen Sie: "Mindnet: Inspect Chains (Current Section)"
- Prüfen Sie die Console (Strg+Shift+I / Cmd+Option+I) für den Report
Erwartete Ausgabe:
templateMatchingProfileUsedzeigt verwendetes Profilemissing_slotFindings erscheinen nur, wenn Profile-Thresholds erfüllt sind- Discovery: Mehr Findings (niedrige Thresholds)
- Decisioning: Weniger Findings (hohe Thresholds)
Profile-Konfiguration
Erforderliche Datei: chain_templates.yaml (Standard: "_system/dictionary/chain_templates.yaml")
Beispiel-Konfiguration:
defaults:
profiles:
discovery:
required_links: false
min_slots_filled_for_gap_findings: 1
min_score_for_gap_findings: 0
decisioning:
required_links: true
min_slots_filled_for_gap_findings: 3
min_score_for_gap_findings: 20
matching:
required_links: false # Fallback, wenn Profile nicht definiert
Test-Ergebnisse
Erfolgreiche Tests (4/4 Profile-Tests)
✅ Discovery Profile (Low Thresholds):
- Test: Partial match mit fehlendem Slot
- Ergebnis:
missing_slotFinding wird emittiert (Thresholds erfüllt)
✅ Decisioning Profile (High Thresholds):
- Test: Partial match mit fehlendem Slot
- Ergebnis:
missing_slotFinding wird NICHT emittiert (Thresholds nicht erfüllt)
✅ required_links=false:
- Test: Missing link ohne Penalty
- Ergebnis: Score >= 0 (keine -5 Penalty)
✅ required_links=true:
- Test: Missing link mit Penalty
- Ergebnis: Score < 0 (-5 Penalty angewendet)
Bestehende Tests
✅ Alle v0.4.x Tests bestehen weiterhin (3/3 templateMatching, 3/3 integration)
Build-Status
✅ TypeScript kompiliert ohne Fehler
✅ Keine Linter-Fehler
✅ Alle neuen Tests bestehen
Vergleich v0.4.1 vs v0.4.2
| Feature | v0.4.1 | v0.4.2 |
|---|---|---|
| Template Matching | ✅ | ✅ |
| 1-Hop Outgoing Neighbors | ✅ | ✅ |
| Profile-basierte Konfiguration | ❌ | ✅ |
| Profile-Thresholds für Findings | ❌ | ✅ |
| required_links aus Profile | ❌ | ✅ |
| Profile Provenance im Report | ❌ | ✅ |
| Settings UI für Profile | ❌ | ✅ |
Zusammenfassung
Chain Inspector v0.4.2 erweitert v0.4.1 erfolgreich um:
✅ Template Matching Profiles - Konfigurierbare Profile (discovery/decisioning)
✅ Profile-basierte Findings - Thresholds steuern Findings-Emission
✅ required_links aus Profile - Soft vs. Required Links-Verhalten
✅ Settings Integration - UI-Dropdown für Profile-Auswahl
✅ Profile Provenance - Verifizierbare Profile-Herkunft im Report
✅ Permissive Config - Ignoriert unbekannte Felder sicher
✅ Deterministic Output - Stabile Sortierung für Golden Tests
Alle neuen Tests bestehen (4/4 Profile-Tests)
TypeScript kompiliert ohne Fehler
Keine Linter-Fehler
Production Ready ✅
Die Implementierung ermöglicht flexible Template Matching-Konfiguration für verschiedene Use Cases (Exploration vs. Entscheidungsfindung).
Erstellt: 2025-01-XX
Autor: Cursor AI Agent
Status: ✅ Production Ready