- reminderService: dueThisWeek/dueThisMonth use exclusive day ranges (1-7,
8-30) matching getHorizon() buckets; schattenmarktReadyCount counts by
type=SCHATTENMARKT_RELEASE (same criteria as the feed filter)
- ReminderKpiBar: clicking a horizon card resets filterType to ALL;
clicking Pre-Market card resets filterHorizon to ALL — ensures the number
shown on the card always equals the number of rows displayed below
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace 3-row filter panel with a grouped feed (Überfällig / Diese Woche /
Dieser Monat / Später). KPI cards are now clickable shortcuts that filter to
their time horizon or type (Pre-Market). Filter bar condenses to one row:
search + type dropdown + archive toggle. Rows get a left priority-color
border (red/orange/yellow). Default status filter is ACTIVE+SNOOZED.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Score formula simplified to: finalScore = round(hard×60% + soft×40%)
Removes dataQualityModifier, confidenceModifier, mustHaveEval.scoreImpact —
the breakdown panel now always matches the displayed score.
Also removes 'industrie groove' from Zürich-only location signals — the phrase
describes an aesthetic preference, not a district reference.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add AITrace type, AITraceStore (circular buffer, localStorage in DEV,
window.__aiTraces for DevTools), provenanceToStatus() helper
- Instrument OpenRouterAIService withFallback with latency tracking and
trace recording across all three paths (no-key, success, error)
- Wrap all MockAIService methods with traceMock for consistent in-memory
tracing including method name, latency, and validation status
- Improve all 6 prompt templates with ROLLE/AUFGABE/VERBOTE/BEISPIEL
structure; marketSignalPrompt carries hard prohibition against claiming
confirmed availability from unconfirmed signals
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add AIProvenance + AIResponse<T> to IAIService — all 11 methods now
return structured provenance (provider, model, source, fallbackUsed,
validationPassed) instead of bare ItemResponse<T>
- Add schemas.ts with Zod schemas for all 8 AI response types;
validateAIResponse() utility returns null on failure, never throws
- Rewrite OpenRouterAIService: every method validates AI JSON against
its Zod schema; failed validation triggers MockAIService fallback
with fallbackUsed:true — no invalid data can reach the UI
- Fix MockAIService.generateFollowUpQuestions: replace broken
mockParseNeed(JSON.stringify(criteria)) with direct ParsedNeedCriteria
field inspection; returns max 3 prioritised FollowUpQuestion objects
- Add provenance: mockProvenance() to all MockAIService responses
- Improve decisionBriefPrompt: structured JSON schema example,
confidence vocabulary, availability disclaimer
- Improve matchExplanationPrompt: score-tier vocabulary, isFutureSignal
flag forbids confirmed-availability language for future signals
- Add 102 new tests: mustHaveScorer (16), softFactorEnrichment (38),
aiSchemas (52) — 154 total, all passing; 0 TypeScript errors
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Teil A — GenericBadge:
- Neue src/components/shared/GenericBadge.tsx mit zwei Varianten:
transparent (${color}18 Hintergrund, farbiger Text, opt. Border)
solid (gefüllte Farbe, weisser Text)
- Props: label, color, variant, showBorder, bold, icon, size, tooltip, ariaLabel
- 7 Badges auf GenericBadge refactored (Config-Objekt + 1-Zeiler):
ReviewStatusBadge, ReviewPriorityBadge, ReviewEntityTypeBadge,
AIOutputStatusBadge, AIErrorBadge, MatchStatusBadge, ShortlistStatusBadge
- Barrel-Export in src/components/shared/index.ts
Teil B — Provider-Isolation:
- src/mock-data/propertyStore.ts als neutrales Daten-Modul erstellt
- MockupPropertyProvider: importiert aus mock-data statt selbst zu definieren
- MockupUnitProvider: importiert aus mock-data statt aus MockupPropertyProvider
- matchSyncService: importiert aus mock-data statt aus MockupPropertyProvider
- Kein Provider importiert mehr einen anderen Provider
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
IAIService:
+ generateMatchExplanation, summarizeTradeOffs, generateDataQualitySummary,
classifyMarketSignal (4 new methods covering all documented AI output types)
OpenRouterAIService:
- All 11 methods now make real API calls via withFallback() pattern
- Every fallback is explicit (console.warn/error) — no silent mock bleed-through
- Proper JSON extraction with type-safe parsers, no any casts
- parseNeed: AI JSON → ParseNeedResult mapping (no TODO stubs)
- generateFollowUpQuestions, generateMatchExplanation, summarizeTradeOffs,
generateDataQualitySummary, classifyMarketSignal, generateOfferEmail,
extractCriteria, generateFollowUp: fully implemented
Prompts: +followUpQuestionsPrompt, +tradeOffPrompt, +dataQualityPrompt, +marketSignalPrompt
Factory (index.ts):
- VITE_AI_PROVIDER=mock|openrouter (new, takes priority)
- VITE_USE_REAL_AI=true still supported (legacy compat)
- Missing API key → explicit console.warn + MockAIService fallback
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
PipelineItems are domain data and must not live in Zustand. Moves the
full stack to the correct layer: MockupPipelineProvider (localStorage
persistence + seed fallback) → pipelineService → usePipeline hooks
(useQuery for reads, useMutation for writes with cache invalidation).
pipelineStore is now UI-only: dialogOpen, pendingItem, openSavedDialog,
closeSavedDialog. All consumers updated to use the new hooks.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- scoreCalculator: apply dataQuality/confidence modifiers to finalScore (were computed but hardcoded to 0)
- authService: call queryClient.clear() on logout to prevent cross-session data leakage
- queryClient: extract to src/lib/queryClient.ts singleton so services can access it without circular imports
- matchSyncService: new service layer owns match-generation logic; MockupNeedProvider no longer imports other providers directly
- hooks (11 files): add onError + German toast feedback to every useMutation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Score: remove hidden dataQuality/confidence modifiers from finalScore;
formula now correctly shows hard×60% + soft×40% = displayed total
- "Ihr Objekt" badge: only shown for PROPERTY_MANAGER/ORGANIZATION_ADMIN
in both IntelligenceMatchCard and MatchCardHeader (DEMAND_USER sees
Verified Portfolio as a normal listing without ownership indicator)
- Compare: fix factor lookup to use allFactors (includes mid-range 45–70
scores) so Prestige, Erreichbarkeit etc. no longer show "Nicht verfügbar"
- Compare: richer AI summary with overallAssessment, perPropertyAssessment
(strengths/weaknesses/bestFor/keyRisk per property), and recommendation
- Compare/Results: pb:10 so CompareTray never overlaps last row of content
- AppShell: dynamic route names for /demand/results/:id → "Match Detail"
and /demand/property/:id → "Objekt Detail" (no more UUID in header)
- MatchDetail: remove "Match EF9" debug chip from sticky nav
- LocationIntelligencePanel: comparable listings are now clickable links
navigating to /demand/property/:id
- Comparable links: blue text + hover highlight
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add 50 mock properties (prop-050–099) tuned for UC-A (Fahrradhändler RETAIL),
UC-B (Umzugsfirma OFFICE Zürich-West) and UC-C (Vermögensverwalter PREMIUM)
- District-aware scoreLocation: district match→100, city-only→70 when need
specifies districts, canton→60, no match→35; fixes UC-C prop-001 over-scoring
- mustHaveScorer: add klimatisierung keyword; parking minimum count logic
- Soft factor scale fix: integer 0–100 values no longer multiplied ×100
- footfall: map passerbyFrequency string (HIGH→85, MEDIUM_HIGH→68…) before
enrichment fallback so RETAIL properties score correctly
- Parser: Kreis list extraction ("Kreis 3, 4, 5, und 8" → 4 district entries),
neighbourhood→district map (Seefeld, Bahnhofstrasse), prestige signals
- Results: remove VERIFIED_PORTFOLIO role gate — all users see portfolio cards,
enabling gold (85+) and silver (70–84) cards for every demo use case
- Fix flash of wrong cards on NeedBuilder nav (effectiveNeedId not activeNeed?.id)
- needs.ts: UC-A preferredLocations now includes Kreis 3/4/5/8 entries
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Results page: chip strip shows all saved searches — click to switch without
creating a new search. Defaults to first need instead of most-recently-created
so pre-existing mock needs load immediately on navigation.
- AI parser: asset-type-aware monthly budget threshold (RETAIL: 500, others: 150)
so "150 CHF/m²" for retail is correctly converted to 1800 CHF/m²/year instead
of being stored as an impossibly low annual value that excludes all properties.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Single scoring system: MockupNeedProvider rewrites matches via calculateScore
exclusively — allFactors always populated, no more dual-system (computeScore
removed), weights from weightingProfile reflected in every breakdown
- ScoreInlineBreakdown: new component shows hard/soft criteria with importance
labels (Entscheidend/Sehr wichtig/…) and formula on compact + expanded cards
- MatchCardAdapter: passes scoreBreakdown + allFactors to ViewModel
- MatchDetail: 'Zukunftssignal' label replaced with 'Future Availability'
- aiService budget parser: values < 100 treated as monthly and multiplied by 12
to produce correct annual CHF/m²/year value — fixes 0-result searches
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add Reminder Manager page (/supply/reminder-manager) with KPI bar,
filter bar, list/card feed, and detail drawer (7 sections incl.
activity log, snooze, complete, dismiss actions)
- Add Schattenmarkt-Freigabe toggle on PropertyDetailView: Verwaltung
can opt-in properties for early market exposure before contract expiry
- Auto-generate FutureSignal cards via useSchattenmarktSignals hook
when leaseEndDate - leadTimeMonths <= MOCK_TODAY
- Fix useUnifiedResults: use property.resultType as fallback (was
defaulting everything to VERIFIED_PORTFOLIO)
- Fix demand Results: hide VERIFIED_PORTFOLIO from non-manager users
even when showOwnProperties toggle was previously enabled
- Fix AppShell: redirect to allowed workspace on user role switch
- Fix 3 wrong match scores (match-002: 93→62, match-009: 86→55,
match-017: 87→52)
- Add 7 new match records (match-050–056) for need-001, need-002,
need-011
- Add need-011 (Retail Bern Innenstadt)
- Add prop-031–036 (EXTERNAL_MARKET / MAISON_WORK / FUTURE_AVAILABILITY)
- Fix duplicate image URLs across all properties
- Add signal-011 (Bern Altstadt, Mode Boutique) + propertyId to
signal-001
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- PropertyUnit: add isFlexible, minLettableSqm, offeredSqm fields
- New UnitBundle + UnitNeedMatch domain types
- unitMatchService: match individual units or bundles against LatentNeeds
(exact, partial/Teilfläche, bundle match types with area scoring)
- Mock units updated: prop-001/007/012/013 free units flagged as flexible
with minimum lettable areas
- UnitStructurePanel replaces old Stockwerkstruktur table:
- Checkboxes on free units (when ≥2 exist) for bundle selection
- Inline match pills per free unit (top need + score)
- Expand row to see all matching needs with area details
- 'Teilfläche möglich' chip for flexible units with min sqm
- Bundle panel appears when 2+ units selected: shows combined sqm,
bundle matches, and note about remaining area after contract
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds a new "Aktivitätslog" tab (9th tab) to the supply-side property
drawer. Shows match approvals/rejections, need registrations, data
quality flags, and governance actions linked to this specific property.
Only visible to Verwaltung users in their own property view.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Replace ActivityTimeline stub with full vertical timeline page:
grouped by day, filterable by workflow category (Suche/Matching/
Intelligence/Review/Governance), KPI strip, AI vs human distinction
- Expand governanceService mock data from 3 → 24 events covering the
full demo storyline (source crawl → signal detection → need creation →
AI parse → match generation → review → shortlist → decision brief)
- Add 11 new ActivityEventTypes: AI_PARSE_COMPLETED, MATCH_GENERATED,
FUTURE_SIGNAL_DETECTED/CONVERTED, SHORTLIST_CREATED/FINALIZED,
DECISION_BRIEF_CREATED, SOURCE_CRAWLED, DATA_QUALITY_FLAGGED,
REVIEW_COMPLETED, AI_OUTPUT_REVIEWED
- Update Governance.tsx switch statements to handle all new types
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Wires the existing "AI Assistent" button in the TopBar and adds a 420px
slide-in drawer with context-aware suggestions, message thread, loading
animation, and action cards requiring manual confirmation. Template-based
mock service returns German-language answers keyed by route + question
keywords — no real LLM calls, no invented facts.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Full 2-panel workspace at /ops/ai-monitoring: metrics strip (total, failed,
pending, approval rate, top prompt version, active model), filterable output
table by type/status/error, and detail panel with output preview, prompt
versioning, error details, and role-aware review actions.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaces the old ad-hoc ReviewQueue page with a full governance-compliant
workflow: filterable task list, detail panel with confidence/risk context,
role-aware approve/reject/escalate/more-data actions, and persistent notes.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Role-based workspace access: Property Manager gets Supply+Demand,
Operations restricted to Super Admin + Reviewer only
- Root redirect routes each persona to their first workspace
- Match Center: replaced 3-panel with auto-sorted flat list + drawer
- AI Search: unified form with dual-action (Jetzt suchen / Als Suchprofil speichern)
- CompareTray hidden on non-Demand routes; Vergleichen removed from Supply
- LocationIntelligencePanel: city KPIs, rent trends, soft factors, comparables
- NegotiationInsightsPanel: price positioning, active demand, selling arguments
- scoreCalculator: cap hardMatchScore and softFactorScore to max 100
- Layout: add display:flex to overflow:hidden wrappers so inner scroll works
(MatchCenter drawer, MarketIntelligence, SourceMonitoring, SignalPipeline)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2-panel workspace at /supply/future-availability: filterable signal list with FutureSignalCard (type/sensitivity/review badges + mandatory disclaimer) and collapsible detail panel with full evidence, review workflow (IN_REVIEW→APPROVED/REJECTED), shortlist action, and review task creation.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3-panel Shortlists page with left list, center detail, right decision brief panel. AddToShortlistDialog wired into result feed cards and match detail. Full DRAFT→REVIEW_READY→FINALIZED workflow, AI-generated decision brief draft, duplicate prevention, and compare-view integration.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>