Spaces:
Sleeping
Sleeping
Commit History
-
Sync from GitHub main — ERP priority, WMCA/Shropshire watchlist, network preserve-owners fix (a7395ea)
Verified signaturea87217c
-
Add unauth web feedback form — primary capture path
Piers Lyon +1: Claude Opus 4.7 (1M context)Email replies are messy: the tenant Application Access Policy blocked Mail.Read on the digest mailbox, and recipients reading from a personal inbox would never have their replies routed back to us anyway. A web form sidesteps all of it. What ships: - New feedback_form.py renders a single-purpose Streamlit page (name dropdown pre-filled from ?from= query param, free-text body, one submit button, tight thank-you). No login required. - app.py recognises ?form=feedback BEFORE the auth gate and routes to the public form, st.stop()'s before anything else loads. No other page is affected. - Form submissions flow through the SAME parser + storage path as mailbox replies (feedback_ingest.parse_reply_to_signals → _store_message). A new recipient_override kwarg lets web-form submissions tag the colleague directly, since the synthetic web-form sender address wouldn't match team_emails. - Digest footer now leads with a prominent "Open feedback form →" button (URL pre-filled with …b28e767
-
Sidebar: remove Service Line filter (not needed)
Piers Lyon +1: Claude Opus 4.7 (1M context)User requested. The radio (All / TD / CC / CODE 3i) only affected the Dashboard's filtering logic, and the default with the session value missing is 'All' — i.e. no filtering. Removing the control locks the Dashboard into the universal 'All' view, which is what most users want anyway. Per-page filtering can be added back inside individual pages later if it ever becomes useful. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>6c3620b -
Sidebar: drop 'Detailed Stats' expander, label the 3 KPIs properly
Piers Lyon +1: Claude Opus 4.7 (1M context)User asked 'is this of any value?' about the per-source counts in the sidebar. Honest answer: every number in the Detailed Stats expander duplicates the Data Coverage Summary on the Source Health page. The 3 KPI tiles above were also poorly labelled — bare emoji + a number, with the meaning hidden in a hover tooltip. - Drop the Detailed Stats expander (Jobs / News / Reports / Tenders / Sentiment / M&A / LI Intel / TD/CC Pipeline counts) — Source Health is the canonical place for these. - Label the 3 sidebar KPIs: 🏢 Companies / 🔥 Hot / 🔗 Network so their meaning is visible at a glance. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>4620e71 -
Fold COUNCIL SCAN into HUNT NOW as a 9th source
Piers Lyon +1: Claude Opus 4.7 (1M context)User requested: 'I want that included in the hunt not a separate action.' - hunter.AutonomousHunter: add 'councils' to source_status; new _hunt_councils method that wraps the existing council_scanner. run_council_scan() so all the targeted-council logic (~70 councils, per-council Network/Tenders/Jobs/News/People with per-council network warm-intro mapping) is reused unchanged. Council scan runs as the 9th step in the hunt sequence after the 8 broad sources. Updates set_last_council_scan_at for backward compatibility with existing watchers of that timestamp. - collator.SOURCE_API_KEYS / SOURCE_SETUP_INSTRUCTIONS: register 'councils' as a tracked source so the Source Health card shows it. - ui_components.SOURCE_LABELS: add 'councils' label + emoji. - app.py sidebar: drop the separate COUNCIL SCAN button, the cooldown helper, and the 'which scan should I run?' expander. Update the HUNT NOW tooltip to reflect 9 sources and the longer 10–20 min runtime. Drop the no…055f393 -
Move state_sync pull into app.py — Dockerfile CMD bypasses entrypoint.sh
Piers Lyon +1: Claude Opus 4.7 (1M context)Diagnostic from the running Space showed 'Last pull (entrypoint marker): — none —' even though HF_TOKEN and HF_STATE_REPO are correctly set and the dataset exists. Root cause: the Dockerfile's CMD launches streamlit directly, so entrypoint.sh (which had the pull step) is never executed on HF Spaces. All the pull-on-start logic was dead code in that path. Fix: move state_sync.pull_state() into app.py at module load, BEFORE the init_*_db calls. Now the pull runs regardless of how the container is launched (Dockerfile CMD, entrypoint.sh, manual streamlit run). Added an idempotency guard (skip if already pulled this process) so Streamlit reruns don't re-fetch on every render. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>39e7824 -
Stop state sync from overwriting good remote data with empty local DB
Piers Lyon +1: Claude Opus 4.7 (1M context)User reports: pulled good remote DB → restart → leads.db comes up empty (pull failed silently or didn't restore) → init creates empty tables → 5-min periodic sync pushes the 172 kB empty DB → overwrites the good 30 MB remote DB. User now sees "0 connections" with no way back. The push hooks were also wrapped in `except: pass` so we never saw the silent failures. Fixes: - state_sync.push_state(): refuse to auto-push if the DB has fewer than 10 rows of meaningful content (companies + network + jobs + news + briefings combined). The 'Sync now' button still works with force=True so the user can override after deliberately re-populating an empty DB. - state_sync.diagnose(): full diagnostic — token / repo / SDK version / local-DB content / pull marker / remote dataset state / in-memory pull/push timestamps / last error. Surfaces from the UI. - app.py sidebar: 'Sync now' result is now persisted via session_state and rendered as st.success / st.error after the rerun (was silentl…60fe1d8 -
State sync caption: surface pull timestamp, distinguish from push
Piers Lyon +1: Claude Opus 4.7 (1M context)Container restart shows '💾 State: … no sync yet' even though the state pull HAS happened — the pull runs in a separate Python process (entrypoint.sh's `python -m state_sync pull`) whose in-memory last_pulled_at doesn't propagate to Streamlit. Fix: pull writes a marker file at /tmp/curium_state_pulled_at, and status() reads it as a fallback when in-memory state is empty. Caption now reads e.g. '💾 mipwr-admin/curium-intel-state · pulled 14:05 · no push yet (auto every 5 min)' so it's clear the data was restored even before the first push fires. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>f15390f -
Render Last-hunt bold via <strong>, not markdown asterisks
Piers Lyon +1: Claude Opus 4.7 (1M context)The Last-hunt caption sits inside a div rendered with unsafe_allow_html=True, which doesn't parse markdown. The literal asterisks were showing up in the UI as "Last hunt: **18 minutes ago**". Switch to a real <strong> tag so the timestamp renders bold. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>219b56e -
Free persistent storage via HF Dataset repo (no Pro tier needed)
Piers Lyon +1: Claude Opus 4.7 (1M context)HF Spaces' free tier wipes the container filesystem on every restart — including every code push. That meant leads.db (network connections, hunt history, briefings, source health) was getting reset many times a day. The fix without paying for Pro is to use a private HF Dataset repo as a remote store for the SQLite file. state_sync.py - pull_state(): downloads leads.db from the dataset on container start - push_state(): uploads a consistent snapshot (sqlite3 backup API, safe vs. concurrent writes) — no-op if file unchanged since last push - start_periodic_sync(): background daemon thread, pushes every N min (default 5, configurable via STATE_SYNC_INTERVAL_MIN) - CLI: `python -m state_sync pull|push` for entrypoint use - Auto-creates the dataset repo (private) on first push if needed entrypoint.sh - Pulls state from HF Dataset before launching streamlit. No-op (with a logged hint) if HF_TOKEN / HF_STATE_REPO aren't set. app.py - Starts the periodic sync at st…20e93be -
Hunt timestamp + per-source progress; Market Research radars (in progress)
Piers Lyon +1: Claude Opus 4.7 (1M context)User reports the Source Health dashboard shows "Last hunt: never" and several sources stuck at NEVER RUN even after running HUNT NOW. Two real bugs in the hunt flow: 1. set_last_hunt_at() ran AFTER the hunt completed (app.py). On HF Spaces the websocket can drop a long-running script before completion — when that happens, the timestamp never gets written and the cooldown never engages, leaving "Last hunt: never". Move set_last_hunt_at() / set_last_council_scan_at() to run BEFORE the hunt — the moment the user clicks the button — so an interrupted hunt still records the attempt. 2. The hunt only flips a source from 'never_run' → 'success'/'error' AFTER the source's hunt method finishes. If the script is killed mid-run, every source past that point silently stays at 'never_run'. Now writes 'in_progress' to source_health at the start of each source so the UI shows exactly where the hunt is — and where it died if it gets cut off. 3. pages/7_Source_Health…dc327ce -
Add prep_connections.py CLI to dodge HF Spaces upload-size limit
Piers Lyon +1: Claude Opus 4.7 (1M context)User reports the in-app upload still does nothing for the 25 MB master XLSX even with maxUploadSize / maxMessageSize raised — HF Spaces' edge proxy silently drops the websocket frame before it reaches Python. Workaround that doesn't require migrating off HF or paying for a bigger tier: convert the XLSX to a slim CSV locally first. The Curium master workbook is mostly inert sheets (pivot tables, message templates, dropdowns); the actual New Data sheet alone is ~5 MB as CSV. - scripts/prep_connections.py: tiny CLI that wraps the existing convert_xlsx_to_csv (with the same sheet auto-detection that prefers movement-tracking sheets) and writes a CSV next to the source. Tested on the real workbook: 25.1 MB XLSX -> 5.1 MB CSV. - app.py: file_uploader help text mentions the script, plus a collapsible "Large XLSX won't upload?" expander with the exact command for admins who hit the silent-drop symptom. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1527bac -
Raise WebSocket message cap so file_uploader actually delivers bytes
Piers Lyon +1: Claude Opus 4.7 (1M context)User reports "Nothing after upload" — the file_uploader returns to its empty state with no toast and "0 connections loaded" still showing. With the always-rerun handler in place, this means the file bytes never reached Python at all. st.file_uploader streams the file over the Streamlit websocket. The relevant cap is server.maxMessageSize (default 200 MB but often silently capped by upstream proxies). We previously raised maxUploadSize but not maxMessageSize, so a 25 MB XLSX would be accepted by the HTTP layer then dropped at the websocket frame boundary. - .streamlit/config.toml: pin maxMessageSize=100 - entrypoint.sh: same flag on the streamlit run command for the HF Spaces container - app.py: log file_uploader state on every render so a repeat of this symptom can be diagnosed from HF runtime logs (we'll see whether the upload is reaching Python or dropping at the proxy) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>ba883a4 -
Fix Network upload: sheet auto-detection + always-visible toast
Piers Lyon +1: Claude Opus 4.7 (1M context)The Curium master connections workbook contains 16 sheets (Old Data, New Data, dropdowns, message templates, pivot tables…). The previous XLSX converter used `wb.active` which returns whichever sheet was active when the file was last saved — often a pivot or template sheet with no connection data. The import then succeeded with 0 rows and the user got "0 connections loaded" with no feedback. network_loader.py - convert_xlsx_to_csv: scan every sheet, pick the one with the connection-data header signature (Company + Position + name/owner columns), prefer ones with an Owner column, then largest row count. Falls back to wb.active if nothing matches. Also handles preamble rows before the actual header row. - COLUMN_MAPPINGS: drop 'First Name' from the full_name aliases — it short-circuited the proper First+Last combine when only the separate columns existed. Add 'Company Change?' / 'Position Change?' as aliases for the team's master sheet conventions. - load_master_csv: stash…35db415 -
Show upload feedback + next-step CTA on Network sidebar widget
Piers Lyon +1: Claude Opus 4.7 (1M context)The connections-upload widget previously called st.success(...) immediately followed by st.rerun(), which wiped the success toast before the user could see it. Combined with the file_uploader re-firing the import on every rerun, admins saw no feedback after uploading — only "0 connections loaded" still showing. Fixes: - Stash the load_master_csv result in session_state and render it AFTER the rerun, then clear, so success/warning/error all stay visible. - Detect a fresh upload by name+size and only import once per upload (avoids re-clearing + re-importing on every page rerun). - Wrap the import in a spinner. - When success and imported > 0, show a clear next-step CTA pointing at HUNT NOW so admins know how to convert the network into warm routes. - When success but imported == 0, show a diagnostic warning naming the required columns (Owner / Full Name / Company / Position) instead of silently leaving "0 connections loaded". - Sidebar caption now also shows the team-member co…da4d359
-
Expand sidebar scan tooltips + add 'which scan?' helper expander
Piers Lyon +1: Claude Opus 4.6 (1M context)- HUNT NOW tooltip now explains broad 8-source market sweep purpose - COUNCIL SCAN tooltip explains targeted public-sector scope - Inline expander visible to all users with comparison table answering 'which scan should I run?' without needing to hover Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>f4add44
-
Add hunt cooldown + last-run timestamp display
Piers Lyon +1: Claude Opus 4.6 (1M context)- All users see 'Last hunt: X ago' caption beneath HUNT NOW button - Same for COUNCIL SCAN - Admin button disables for 60 min after a successful hunt (configurable via HUNT_COOLDOWN_MINUTES / COUNCIL_SCAN_COOLDOWN_MINUTES env vars) - Tooltip shows unlock time when blocked - Scheduled hunt also stamps the timestamp so manual hunts respect it - Failed hunts don't trigger cooldown (allows retry) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>0c6de48 -
Add Market Research module: industry reports + weekly briefing generator
Piers Lyon +1: Claude Opus 4.6 (1M context)New page (Market Research) with three tabs: - Weekly Briefing: AI-generated Curium-style market digest pulling from jobs, tenders, news, and uploaded reports - Industry Reports: PDF upload + Claude-extracted key statistics, themes, and Curium-relevance analysis - Briefing History: searchable archive of past digests Briefing format matches Curium's house style: - Senior transformation hires (filtered to Head of/Director of with transformation/change/digital keywords) - Contract / framework awards with strategic context - Corporate transformation news - Research report stat pull-outs Admin-only for generation/upload (Claude spend); viewers can browse history and library. All actions audit-logged. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>4f480f2
-
Add auth, audit logging, backup/restore, and HF Spaces deployment
Piers Lyon +1: Claude Opus 4.6 (1M context)- Two-tier auth: admin (full access) + viewer (read-only, concurrent sessions) - All Claude-spending buttons gated to admin role (HUNT, drafts, queries) - Append-only JSONL audit log for all significant actions - Scheduled hunt toggle (admin UI) + entrypoint for future automation - Database backup/restore buttons for ephemeral HF Spaces storage - Dockerfile for HF Spaces (Docker SDK, port 7860, non-root user) - Password hash generator script (bcrypt) - Deployment guides for both Azure Container Apps and Hugging Face Spaces Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>560b4ce
-
Refactor into multipage Streamlit app with new intelligence features
Piers Lyon +1: Claude Opus 4.6Split monolithic app.py into multipage architecture with dedicated pages for Dashboard, Approach Brief, Tenders, Councils, LinkedIn Hub, Intelligence Query, and Source Health. Extract shared UI components into ui_components.py. Add AI query engine (query_engine.py) for natural-language lookups and LinkedIn activity generator (linkedin_activity.py) for daily engagement playbooks. Remove deprecated cqc_radar.py. Expand config.yaml with new source definitions and enhance collator, email engine, network loader, hunter, and LinkedIn modules. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>b8f40ca
-
Add council scanner for targeted UK council opportunity search
Piers Lyon +1: Claude Opus 4.6New council_scanner.py module scans ~70 councils across 6 categories (county, metropolitan, London borough, Scottish, Welsh, combined authority) through 5 phases: network cross-reference, tenders, jobs, news, and LinkedIn key people. Updated app.py with COUNCIL SCAN sidebar button and Council Opportunities tab showing warm intros and cold outreach targets. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>e87cb11 -
Add colleague email buttons and enhance LinkedIn intelligence UI
Piers Lyon +1: Claude Opus 4.6Adds template-based email drafting for LinkedIn route-in actions: per-card "Email {colleague}" buttons and a batch "Email All Routes" button with copyable drafts and mailto links. Also enhances the LinkedIn Intelligence tab with action-scored cards, urgency tiers, route-in messages, and a transformation alerts column. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>e94e59d
-
Fix LinkedIn login setup crashing when browser closed early
Piers Lyon +1: Claude Opus 4.6Wrap all post-login page navigations in try/except so closing the browser window at any point no longer throws. Also fall back to checking the persistent profile directory when the browser is closed before login detection completes. Updated UI message to tell the user not to close the browser manually. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>cc32a65
-
Add LinkedIn deep intelligence scan (stage 9)
Piers Lyon +1: Claude Opus 4.6Authenticated LinkedIn scraping via persistent Playwright browser profile to gather relationship strength data from live profiles, activity feeds, and company pages. Includes anti-ban strategy (daily limits, human-like delays, rate-limit detection), relationship scoring engine (0-100 with 5 tiers), and full UI integration (login setup, status indicator, LI Intel dossier tab). New files: linkedin_intel.py, linkedin_relationship.py Modified: collator.py, hunter.py, config.yaml, app.py Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>e86b850 -
Show contact names in Team Members section and fix CQC API auth
Piers Lyon +1: Claude Opus 4.6- Add contact name next to each company in "Team Members to Contact" so team members immediately know who to speak to - Update CQC radar to use subscription key auth via the newer api.service.cqc.org.uk endpoint (old endpoint now returns 403) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>2c139b3 -
Add annual report text mining and CQC inspection triggers
Piers Lyon +1: Claude Opus 4.6Add two new high-value data sources to the sales intelligence tool: 1. Annual Report Text Mining - downloads annual reports from Companies House, extracts text (XHTML/PDF), and uses Claude to identify transformation signals (restructuring, leadership changes, strategy shifts, culture programmes) 2. CQC Inspection Triggers - monitors Care Quality Commission ratings for healthcare organisations rated "Requires Improvement" or "Inadequate", which typically trigger transformation programmes Both sources integrate into the existing scoring engine with combo bonuses (report+job, CQC+job) and display in new dashboard tabs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>aa0f1ab