Skip to content

feat(support): add support use case target#66

Merged
nkarpov merged 9 commits intomainfrom
feat/support-use-case
Mar 20, 2026
Merged

feat(support): add support use case target#66
nkarpov merged 9 commits intomainfrom
feat/support-use-case

Conversation

@nkarpov
Copy link
Copy Markdown
Collaborator

@nkarpov nkarpov commented Mar 19, 2026

Summary

  • Add support target to databricks.yml with full DAG
  • Support request generator: deterministic synthetic data from delivered events
  • Support triage agent: DSPy ReAct with UC function tools and policy-based guardrails
  • Scoring stream with fake-it-till-up pattern and inference capping
  • Lakebase + App stages to follow in subsequent commits

Based on work from PR #63.

Co-authored-by: Andre Landgraf andre@landgraf.dev

Test plan

  • Deploy with databricks bundle deploy -t support
  • Run the initializer job and verify Canonical_Data + Lakeflow complete
  • Verify support request generator produces data in support.raw_support_requests
  • Verify support agent deploys and endpoint reaches READY
  • Verify agent stream produces data in support.support_agent_reports
  • Verify fake-it-till-up: first run uses deterministic responses, subsequent runs use real inference

This pull request was AI-assisted by Isaac.

nkarpov and others added 9 commits March 19, 2026 16:20
… scoring stream

Add new `support` target to databricks.yml with full DAG:
- Support request generator (deterministic synthetic data from delivered events)
- Support triage agent (DSPy ReAct with UC function tools, policy-based guardrails)
- Scoring stream with fake-it-till-up pattern and inference capping

Based on work from PR #63. Lakebase + App stages to follow.

Co-authored-by: Andre Landgraf <andre@landgraf.dev>
Co-authored-by: Isaac
…unction

- Agent stream now depends on SDP directly (not generator), matching
  the refund pattern where all stages fan out from SDP
- Fix get_order_overview to JOIN simulator.locations for location name
  (all_events has location_id, not location)

Co-authored-by: Andre Landgraf <andre@landgraf.dev>
Co-authored-by: Isaac
Generator is the split point - both Support_Request_Agent (leaf) and
Support_Request_Agent_Stream fan out from Support_Request_Generator_Stream.

Co-authored-by: Andre Landgraf <andre@landgraf.dev>
Co-authored-by: Isaac
- Add support_lakebase stage: Lakebase instance, synced table for
  support_agent_reports, OLTP tables (operator_actions, support_replies,
  request_status, response_ratings), warehouse, app deployment
- Port supportconsolek React/TS app from PR #63
- Dynamic app.yaml generation with computed warehouse/endpoint values
- Add sync exclusions for supportconsolek build artifacts
- Wire Support_Lakebase_And_App into DAG (depends on agent stream)

Co-authored-by: Andre Landgraf <andre@landgraf.dev>
Co-authored-by: Isaac
…tations

- Use databricks_postgres as logical database (not caspers_support)
  so synced table and OLTP tables are in the same Postgres database
- Rename synced table to support_agent_reports_sync to match what
  the support console app queries (support.support_agent_reports_sync)
- Fix App resource database_name to databricks_postgres

Co-authored-by: Andre Landgraf <andre@landgraf.dev>
Co-authored-by: Isaac
…grants

The previous approach blindly picked list_roles()[1] for DATABRICKS_SUPERUSER
membership, which didn't grant schema-level permissions to the app principal.

Now resolves the app's service principal IDs and explicitly grants:
- USAGE, CREATE on support schema (OLTP + synced tables)
- USAGE, CREATE on public schema (AppKit persistent cache)
- SELECT, INSERT, UPDATE, DELETE on all tables in both schemas
- Default privileges for future tables/sequences
- Creates Postgres role via databricks_auth extension

Co-authored-by: Andre Landgraf <andre@landgraf.dev>
Co-authored-by: Isaac
UC function creation validates that referenced tables exist. Create
empty stub tables with matching schemas before defining
get_user_support_history and get_user_request_history functions.
Downstream jobs use CREATE TABLE IF NOT EXISTS with identical schemas,
so this is a no-op if tables already exist.

Co-authored-by: Andre Landgraf <andre@landgraf.dev>
Co-authored-by: Isaac
…ault

The default databricks_postgres database doesn't register properly with
the control plane for App resource role provisioning. Switch to an
explicitly created caspers_support database (matching main's pattern
of using a custom database name) so the platform can auto-provision
roles during app creation.

All components now consistently use caspers_support:
- DatabaseCatalog, synced table, OLTP tables, app resource, app.yaml

Co-authored-by: Andre Landgraf <andre@landgraf.dev>
Co-authored-by: Isaac
The control plane fails to auto-provision roles for the database
resource. Instead, create app with warehouse resource only and
handle Postgres permissions via explicit psycopg2 grants. App
connects to Lakebase via env vars (LAKEBASE_ENDPOINT, PGDATABASE).

Co-authored-by: Andre Landgraf <andre@landgraf.dev>
Co-authored-by: Isaac
@nkarpov nkarpov merged commit 016516a into main Mar 20, 2026
@nkarpov nkarpov deleted the feat/support-use-case branch March 20, 2026 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant