Spaces:
Sleeping
Sleeping
Commit History
-
feat(mcp): KEY_VAR ENV: indirection + scheme-less/port-tolerant host matching
Folds in what the Space-side hotfix (0b84b8a) had that the TS_ENV table didn't: techpartners support and robust URL parsing. KEY_VAR may now be ENV:<NAME> to dereference a secret that already exists under its own name (the techpartners key lives only as a Space secret), and ts_url may omit the scheme or carry a port. Unknown clusters still fail loud with the known-environment list. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>e27ea87
-
refactor(mcp): resolve trusted-auth keys from the shared TS_ENV_<n> table
The MCP server had its own two-key mapping ('sebe' in url -> SEBE_SE_TA_KEY, else SE_PRIMARY_TA_KEY) — any third instance (e.g. the new pmm env) silently got the secloud key and failed auth. _resolve_ts_target now looks the build's ts_url host up in the same numbered TS_ENV_<n>_LABEL/URL/KEY_VAR table the app dropdown reads: one environment scheme for both entry points; unknown instances fail loud listing the known environments. TS_ENV_URL_DEFAULT keeps its no-URL fallback role. 4 unit tests. DEPLOY NOTE: before this reaches the MCP Space, add the TS_ENV_<n>_* secrets there (it currently has only the legacy key pair); legacy SEBE_SE_TA_KEY / SE_PRIMARY_TA_KEY become unused after that. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>5ce76f0
-
fix(mcp+pipeline): share demos with operator + harden data-quality consumers
- mcp_server: every MCP build shares the created model + liveboard with the operator (MCP_SHARE_WITH, default mike.boone@thoughtspot.com) so demos are visible no matter who ran them. Owner unchanged — the build still authenticates AS owner_email, so the caller passed in owns the objects. - blueprint.from_dict: drop non-numeric seasonal `monthly` params too (line 261) — the merged author can emit a dict there like it did for params. - engine + validator: _safe_date() tolerates a non-ISO insight window bound (e.g. the LLM token 'relative_minus_8_months') instead of crashing on date.fromisoformat — the second merge bug that failed Cloudscape. Root theme: the merged blueprint author emits richer output than the parser/engine expected; harden the consumers to tolerate it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>3d735c7
-
fix(mcp): log/persist payload once per ACCEPTED build, not on busy-retries
log_mcp_payload + the full-brief stdout dump ran in build_demo_from_brief BEFORE the slot/busy check, so a client re-polling a queued build wrote a duplicate durable row every retry (a --limit 4 run logged Vantage ~12x while it waited for a slot; a batch of 6 would spray 100+). Move both into _run_build, which only runs for builds that actually acquired a slot — so exactly one durable row per accepted build, tagged with its run_id. The lightweight CALL line still records every attempt in the ephemeral log. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>c9b5cac -
feat(mcp): durably persist full intake payload to Supabase (real logging)
Ephemeral stdout logging (~1 day) is not a system of record — it's why Jack's CopperPoint/Surescripts briefs were lost. Add durable capture: log_mcp_payload() in supabase_client inserts the full brief + metadata into an `mcp_payloads` table, called from build_demo_from_brief on receipt (before validation, so even rejected payloads are kept). Best-effort and non-raising — a persist failure never blocks or breaks a build (verified: with the table absent it returns False gracefully, PGRST205). Uses the existing anon-key client pattern. Requires a one-time table (anon key can't run DDL): create table if not exists public.mcp_payloads ( id bigint generated always as identity primary key, created_at timestamptz not null default now(), run_id text, company_name text, use_case text, company_url text, ts_url text, owner_email text, brief text, brief_len integer ); SQL-created tables have RLS off by default, so the anon key can write. Co-Authored-By: Claude Opus 4.8 <norepl…4b20a09 -
feat(mcp): log the FULL brief (research payload) on receipt, not a 200-char preview
We only logged brief_preview=brief[:200], so real payloads couldn't be recovered or replayed — the full CopperPoint (~3.9k) and Surescripts (~4k) briefs Jack/others sent are effectively lost. Now build_demo_from_brief dumps the COMPLETE brief to the log stream on receipt, delimited PAYLOAD_BRIEF_BEGIN/END (so a multi-line brief reassembles despite newline-splitting) and BEFORE validation (so even rejected payloads are captured). Same retained log stream we already read via the HF logs API. Caveat: HF logs retain ~1 day; durable Supabase capture is the follow-up (needs a table — pending boone's OK on the schema). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1655c3f
-
feat(mcp): per-run recent_builds store in status() for multi-build result collection
status() kept only a single _last_build slot; with bounded concurrency (cap 3) a client that fires several builds can't reliably collect each result — later completions overwrite the slot before it's read. Add a compact, capped (_RECENT_BUILDS_CAP=50) OrderedDict of finished builds keyed by run_id, recorded in _run_build's result() and exposed as status().recent_builds (newest last, no ddl to keep the payload small). _last_build kept for back-compat. In-memory; resets on restart (durable Supabase logging still a follow-up). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>dcc1160
-
fix(mcp): status tracks real deploy progress — drop UI heartbeat banner
The app yields a 2s spinner banner ("...Creating connection & tables...") while deploy_all runs in its worker thread. It reached _set_progress and (a) pinned phase to "creating connection" (banner contains "connection"), (b) clobbered the real per-line detail from on_progress every 2s, and (c) its 200-char truncation dropped the banner's own "Recent:" tail — so status froze on "creating connection" for the whole build. Route every yield/line through _apply_progress(), which drops the banner so the on_progress stream (Creating connection, [async] import, Model created, synonyms, liveboard) drives phase/detail instead. Also two phase-mapping fixes exposed by the replay: - check [async] before the retry bucket: async import lines say "polling" as normal operation, so a healthy import was mislabeled "waiting on ThoughtSpot (retrying)". - check "creating tables" before "loading data" so TS table-create isn't shown as a Snowflake data load. Verified with a replay test against the re…620405d
-
feat(mcp): concurrent builds (bounded) — remove single-flight lock
The build pipeline is already concurrency-safe (app/QA have run concurrent builds for months); the MCP's single-flight _build_lock was an unnecessary v1 guard. - Replace _build_lock with a BoundedSemaphore (MCP_MAX_CONCURRENT_BUILDS, default 3): builds run in parallel; only a call past the cap gets "busy". - Track multiple builds: _current_build -> _active_builds{run_id: info}; _set_progress targets a run_id; status returns active_builds[] + active_count + capacity (plus a back-compat current_build when exactly one runs). - Remove the vestigial os.environ["DEMOPREP_DEV_USER_EMAIL"]=owner write — owner is per-instance, so concurrent builds don't race on it (audited). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>296fba8 -
feat(mcp): real-time status via deploy progress bridge + return DDL early
- Progress bridge: _run_thoughtspot_deployment gains an optional on_progress hook chained onto its internal progress_callback; the MCP passes one that updates _set_progress, so status.current_build.detail/phase track LIVE (importing tables -> creating model -> creating liveboard) instead of freezing between the generator's sparse yields. [async] lines map to an "importing tables" phase. App/test callers pass no on_progress (default None) — unaffected. - DDL returned early: _run_build stashes ddl_text in _current_build the moment run_ddl_creation returns (~5 min in) and includes it in last_build, so a caller polling status() gets the schema well before the ~15-min TS deploy finishes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>cbd0efa
-
feat(mcp): granular build status (detail + finer phases); use_case optional
- status: capture the progress the Snowflake-load and TS-deploy generators already yield (previously discarded) → set a finer phase via keyword mapping (creating tables / loading data / 504-retry / creating model / model created / creating liveboard / liveboard TML phase) and expose the latest raw line as current_build.detail (_set_progress / _progress_text / _phase_from_text). - use_case is now optional: only brief + company_name are required. When omitted, the demo is authored purely from the brief and labeled "Custom Analytics". Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>daaa123 -
fix(mcp): pin mcp==1.28.1 (fastmcp import); per-build owner via TS_USER_DEFAULT
- requirements: pin mcp==1.28.1. Under mcp>=1.26.0 the HF image ended up with a partial/stale mcp missing mcp.server.fastmcp, so boot crashed at the FastMCP import. Pinning + the requirements change force a clean pip reinstall. - owner identity now resolves per build (mirrors ts_url): build_demo_from_brief takes an optional owner_email, falling back to TS_USER_DEFAULT (_resolve_owner, fail-loud). Removes the hardcoded owner default; boot no longer requires it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>713e95e -
feat(mcp): per-build TS target + key-by-URL; drop env registry, owner default
- build_demo_from_brief takes an optional ts_url; the TS target is resolved per build (falls back to TS_ENV_URL_DEFAULT), and the trusted-auth key is chosen by instance: 'sebe' -> SEBE_SE_TA_KEY, else -> SE_PRIMARY_TA_KEY (_resolve_ts_target, fail-loud on missing url/key). - Remove the MCP_TS_ENV_LABEL + TS_ENV_<n> registry lookup (the MCP uses one env; the registry was dead weight) and the boot-time url/key resolution. - Owner email is now a hardcoded interim default (MCP_OWNER_EMAIL no longer required at boot) until per-call owner lands — diverges from fail-loud by design, flagged with TODO. - ping/status/startup log report default_ts_url instead of a fixed label. Space needs only: MCP_ACCESS_TOKEN, TS_ENV_URL_DEFAULT, SEBE_SE_TA_KEY, SE_PRIMARY_TA_KEY, SUPABASE_URL/_ANON_KEY, ANTHROPIC_API_KEY. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>6ff6e4c
-
fix: make MCP builds succeed + ready hf-mcp-deploy for Hugging Face
- build_demo: max_tokens 8192->16384, LLM timeout 180->300s. Rich blueprints were exceeding the output cap and truncating mid-JSON -> unparseable -> empty blueprint -> "provide at least N dimensions/facts" abort. - blueprint: add DemoBlueprint.autorepair() — deterministically coerce the FIXABLE structural violations (bad distribution, invalid share_of, insight dim/value remaps, magnitude clamp, pad insights/questions) so a valid demo ships instead of aborting. Content that can't be safely fabricated still fails loud; user directives are never auto-repaired. NOTE: this softens the "fail loud, never degrade" principle by design — approved for the AgentSpot path so a build produces a demo rather than an abort. - blueprint_author: wire autorepair after the LLM repair rounds, then recompute problems (structural + directive). - mcp_server: async build (returns run_id instantly, build runs in a daemon thread), status tool for fire-and-poll, hit logging, owner/env resolut…1fa623b
-
feat: MCP server + HF Docker Space config for AgentSpot
mcp_server.py exposes the demo-build pipeline as MCP tools (ping, build_demo_from_brief). Thin adapter over the existing controller; streamable-HTTP with a pure-ASGI bearer gate + unauthenticated health route. Dockerfile/README target an HF Docker Space (deploy branch only). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>5844a76