Backend
- /sessions POST opens a long-lived ClaudeSDKClient kept in an
in-process dict; /sessions/{id}/query streams turns against it.
Per-session asyncio.Lock serializes concurrent calls. Idle TTL
10 min, 32-session cap with LRU eviction. Reaper task.
- /query (single-shot) is kept for the demo card path and as a
fallback for non-chat consumers.
Frontend
- store.ts: messages[] + sessionId; sendMessage() appends a user
bubble + streaming agent bubble and pipes SSE into it. Tool calls
continue to drive the canvas via predictFieldsInline. Per-turn
agentFields reset on sendMessage so one turn doesn't ghost-show
another turn's fields.
- ChatThread.tsx: Claude-chat style bubbles — user (serif, accent
soft) vs agent (bordered card with tool chips + final answer).
Auto-scrolls on new messages. "new chat" closes the session.
- QueryInput.tsx: single composer used for first-turn and
follow-ups. Enter sends, Shift+Enter newlines. Label flips…
feat(dashboard): plot the agent's tool calls on the canvas
Ubuntu+1: Claude Opus 4.7
ccb56e6
Previously the FieldPanel only rendered the scenario-card preview; the
agent's predict_solver / predict_surrogate tool calls during /query
were invisible on the canvas. Now each tool call fires an inline
/predict against the same scenario dict and merges the result into a
new agentFields bucket that the FieldPanel prefers over the scenario
preview while it's present.
- client.ts: predictFieldsInline(scenario, engine) for ad-hoc fields
- store.ts: agentFields + agentFieldsBusy; pushEvent triggers the
inline predict on mcp__geoforce__predict_solver/_surrogate
- FieldPanel.tsx: prefer agentFields, show a 'from agent' chip, cope
with solver-only or surrogate-only rendering during streaming
No backend changes; /predict already accepts inline scenarios. No
extra Anthropic spend — predict is local Python.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
fix(agent): use claude-opus-4-7 to match hackathon + repo-wide config
Ubuntu+1: Claude Opus 4.7
72309a5
The runtime DEFAULT_MODEL was still pinned to opus-4-6 while every
subagent frontmatter, .claude/settings.json, and JOURNAL/AGENTS docs
use opus-4-7. The API-backed /query path was silently on the weaker
model. Align with the hackathon thesis ("Built with Opus 4.7").
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
fix(dashboard): drop /api prefix in prod build
Ubuntu+1: Claude Opus 4.7
b9c6688
The dev setup uses Vite's /api → :8765 proxy with a rewrite that
strips the prefix. In prod the dashboard and FastAPI share an origin
with no rewrite, so /api/scenarios was 404-ing and the UI got stuck
on 'Loading scenarios…'. Set VITE_API_BASE="" so the built bundle
calls /scenarios, /predict, /query, /health directly.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
fix(docker): fallback-fetch LFS weights if pointer stub arrives
Ubuntu+1: Claude Opus 4.7
f4d645e
HF Spaces Docker SDK does not materialise LFS content in the build
context. The .pt weights file was arriving as a text pointer stub,
causing /predict?engine=surrogate to 500. Detect the stub and curl the
real binary from the Space's own resolve URL during the build.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Pin numpy<2 and scipy<1.14 in Dockerfile
Ubuntu+1: Claude Opus 4.7
c6582ad
HF Space runtime crashed because torch 2.2.2 wheels were built against
NumPy 1.x and the image was pulling NumPy 2.4.4. Pin both numpy and
scipy to the 1.x-compatible line so uvicorn can import the solver.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Shorten HF Spaces short_description to fit 60-char limit
Ubuntu+1: Claude Opus 4.7
7d9718e
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- demo/scenarios.yaml: q1 and q3 now have matching producer wells so
mass is balanced; solver T/P outputs are physically sensible
(T stays within [T_inj, T_initial], P in ±1 MPa of base)
- demo/validation.ipynb: reproducible Theis (0.38%) + 1D conduction
(0.18%) + solver-vs-surrogate agreement table for all 3 scenarios
- README.md: HF Spaces frontmatter (docker sdk, app_port 8765)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Day-2 afternoon: field heatmaps, Dockerfile, README
Ubuntu+1: Claude Opus 4.7
3e3d78c
- POST /predict returns solver+surrogate T/P arrays for a scenario
- FieldPanel renders both engines side-by-side via canvas magma cmap
(shared tMin/tMax so disagreement is visible; Δ Tmax chip)
- Dashboard bundle stays at 160 kB JS / 3.5 kB CSS (no plotly)
- Multi-stage Dockerfile: node build → python runtime (CPU-only torch),
FastAPI auto-mounts dashboard/dist when present
- Root README with thesis, architecture diagram, install paths,
honest scope/limitations
- Dry-run of all 3 scenarios recorded in JOURNAL (flagged q1/q3
solver pressure/temperature anomalies for reviewer pre-demo)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add Claude-styled React dashboard
Ubuntu+1: Claude Opus 4.7
644a6a3
Vite + TS + zustand UI for the agent SSE backend. Implements the
claude-design-system skill (Clay accent, warm paper bg, serif headings,
1px borders) with zero runtime deps beyond React + zustand — no
Material/Chakra/shadcn/Tailwind.
Wires scenario picker, query box, live agent trace (tool events + text),
and final answer panel against agent/api.py on port 8765.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- demo/scenarios.yaml: Q1 (drill T), Q2 (sustainable MW / 20 yr, with UQ
distributions), Q3 (well placement, with OAT sensitivity knob).
- tools/monte_carlo.py: ensemble wrapper with uniform/normal/lognormal/
triangular sampling; returns P10/P50/P90 temperature + pressure fields
plus per-draw scalar summaries. Default engine = surrogate (30 samples
in ~0.1 s).
- tools/sensitivity.py: OAT parameter sweep with probe_temperature_C and
reservoir-mean metrics; returns per-parameter curves + |delta| ranking.
- agent/runtime.py: two new MCP tools (monte_carlo, sensitivity_oat)
registered with the SDK MCP server; system prompt updated to describe
all four tools.
- agent/api.py: FastAPI app with /health, /scenarios, and SSE /query
streaming AssistantMessage text + ToolUseBlock events to the UI.
- app/app.py: Streamlit fallback (<200 lines) with sidebar scenario
picker, solver/surrogate side-by-side heatmaps, and an agent-trace
panel backed by ClaudeSDKClient.
All 13 tests s…
Day-1 evening milestone: both engines live, agent answers Q1
Ubuntu+1: Claude Opus 4.6
97f04e4
- tools/predict_solver.py: unified (scenario) -> {T, P, grid, engine} wrapper
around solver.coupled.run_coupled_transient
- tools/predict_surrogate.py: matching schema wrapper around v1.1 CNN surrogate
(handles well-index rescaling from arbitrary grid -> 32x32)
- agent/runtime.py: claude-agent-sdk runtime, in-process SDK MCP server
exposing both tools to claude-opus-4-6. CLI entry point answers
natural-language geothermal questions end-to-end.
Q1 verified: "drill at x=200m, y=100m after 1 yr of 0.5 kg/s reinjection" ->
agent correctly maps coords, calls predict_solver, reports T ~ 123 C, P ~ 15.0 MPa.
Spot-check against direct solver call matches.
Day-1-evening GO/NO-GO: solver GO (Theis 0.38% err, conduction 0.18% err).
13/13 tests green.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Coupled solver: implicit P->T with upwind advection + wells
Ubuntu+1: Claude Opus 4.6
464a35c
wells.py: WellSpec + apply_wells builds per-cell volumetric, injection-heat,
and production-mass arrays for a list of point wells.
coupled.py: sequential implicit step — Darcy pressure, then energy with
conduction + upwind advection + well sources. Returns pressure, temperature,
and face mass fluxes. run_coupled_transient wraps n_steps.
Smoke tests (3 passing):
* zero-wells coupled run matches pure-conduction energy solver to 1e-6
* injector/producer pair elevates P at injector, depresses at producer,
cools the injector cell, and breaks radial symmetry in the +x direction
* single-step sanity check: shapes and finiteness with wells
Full suite: 13/13 green.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Energy solver passes 1D conduction benchmark (0.18% err)
Ubuntu+1: Claude Opus 4.6
259ebe4
Implicit backward-Euler conduction with Dirichlet BCs via identity-row.
mean_rel_err=0.18%, max_rel_err=0.37% vs erfc semi-infinite slab.
Second of two Day-1 GO/NO-GO gates — solver track is GO.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds solver/{grid,properties,darcy}.py and solver/benchmarks/theis.py.
Single-phase linearized Boussinesq pressure equation, fully-implicit
backward-Euler, 5-point FV stencil on a structured 2D grid. IAPWS-IF97
reference-state water properties via the iapws PyPI package.
Theis benchmark (tests/test_solver_theis.py):
- 64x64 grid, 1 km square (15.625 m cells)
- k=1e-13, phi=0.15, c_t=1.5e-9, mass_rate=0.01 kg/s injection
- 200 steps of dt=25 s, sampled r in {3,5,7}*dx at 3 times
- mean relative error: 0.38% (threshold 5%)
- max relative error: 0.90% (threshold 10%)
- monotonic pressure rise at the well cell: PASS
Day 1 Afternoon, pressure-solver milestone: GREEN.
Next: energy solver + 1D conduction benchmark.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Port GeoForce v1.1 CNN surrogate; smoke test green
Ubuntu+1: Claude Opus 4.7
5ec1901
Adds surrogate/ with the ReservoirCNN architecture, frozen v1.1
normalization (6-channel input, 10-channel output), and a cached
predict() wrapper. Weights (248 KB, 57,802 params) copied from
ForceX-AI model registry and verified via tests/test_surrogate_smoke.py
(5/5 pass, <2s total).
Corrects surrogate-operator.md: output P range is [1e5, 5e7] Pa
(not [5e6, 25e6]); channel 0 is the full initial-T field, not a
scalar base_T. pyproject.toml pins Python 3.11+, CPU torch, iapws,
scipy, and dev/agent/app optional-deps groups.
Day 1 Morning milestone: done.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add .gitignore
Ubuntu+1: Claude Opus 4.7
2236dc1
Blocks secrets (.env, *.key, *-sa-key.json), Python/Node build
artifacts, editor metadata, and weights backups. First line
pattern is .env — ensures the new repo-root .env holding
ANTHROPIC_API_KEY never gets committed.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add JOURNAL.md — complete build narrative
Ubuntu+1: Claude Opus 4.7
801004f
Explains the why behind every decision: thesis evolution, scope
boundaries, architecture choices, TOUGH relationship, UI strategy,
risk register. Separate from PROGRESS.md (task state) and
HACKATHON-PLAN.md (the contract).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add tough-reference skill for deep TOUGH family knowledge
Ubuntu+1: Claude Opus 4.7
2d8f274
Captures LBNL TOUGH architecture (IFD, backward-Euler, Newton-
Raphson), EOS modules, V&V benchmarks, and licensing rationale.
Makes GeoForce-Solver's single-phase simplifications defensible
to expert judges. Wired into solver-engineer subagent and the
CLAUDE.md/AGENTS.md skills tables.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add ui-engineer subagent + claude-design-system skill for React dashboard
Ubuntu+1: Claude Opus 4.7
2a88270
Demo now ships as a dual surface: React+Vite+TS dashboard (primary,
styled with Anthropic's visual design language) plus a minimal
Streamlit fallback (safety net). Deployed to HuggingFace Spaces via
a Dockerfile space.
New Claude attributes:
- .claude/agents/ui-engineer.md — owns dashboard/ and app/; FastAPI
backend with SSE agent-trace stream; Dockerfile for HF Spaces;
explicit non-invocation in per-query pipeline (build-phase agent)
- .claude/skills/claude-design-system/SKILL.md — Anthropic palette
(warm paper bg, Clay accent), serif+sans typography, spacing and
radius scales, matplotlib rcParams to match the dashboard palette,
do/don't list
Updates:
- CLAUDE.md: 8 subagents, 5 skills, dashboard stack constraints
- AGENTS.md: add ui-engineer to the team + UI Agent Flow section
- HACKATHON-PLAN.md §3 IN: dual-surface UI; §4 layout: dashboard/
directory tree and Dockerfile; §5 Day 2: backend morning,
dashboard afternoon, ship evening; §7 Risks: dashboard build and
SSE…
Rename solver to GeoForce-Solver; lock single-phase scope with two-phase stub option
Ubuntu+1: Claude Opus 4.7
3f782b5
- Rename TinyTOUGH → GeoForce-Solver across all 9 Claude Code files
- HACKATHON-PLAN.md §3 OUT: harden "two-phase is cut" language; carve
out a narrow Day 2 evening stub (saturation variable plumbing only,
no flash logic) — permitted only if solver is green AND submission
is already filed
- HACKATHON-PLAN.md §5 Day 2 evening: add two-phase stub as a
stretch goal with explicit preconditions
- HACKATHON-PLAN.md §9 demo framing: Ulubelu-inspired synthetic
(liquid-dominated, on-brand, no over-claiming)
- PROGRESS.md decisions log: record rename, phase scope, framing
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Scaffold Claude Code multi-agent project for hackathon
Ubuntu+1: Claude Opus 4.7
2e96a4f
Pivot to dual-tool thesis: Opus 4.7 agents build TinyTOUGH solver
alongside the deployed v1.1 CNN surrogate in 48 hours. Scaffolding:
- HACKATHON-PLAN.md v2: dual-engine scope, Day 1 GO/NO-GO checkpoint,
explicit fallback to surrogate-only if analytical benchmarks fail
- CLAUDE.md: project-wide instructions, priority rules, agent pattern
- AGENTS.md: visible 7-subagent architecture with parallel/sequential
execution diagrams for Q1/Q2/Q3
- PROGRESS.md: live task state and decisions log
- .claude/settings.json: model pinned to claude-opus-4-7, permissions,
post-write pytest hook
- .claude/agents/*.md: planner, geologist, solver-engineer,
surrogate-operator, uq-specialist, visualizer, reviewer
- .claude/skills/*/SKILL.md: iapws97-water, monte-carlo-uq,
field-visualization, analytical-benchmarks
- .claude/commands/*.md: /query, /validate-solver, /parallel-mc, /demo
- .claude/hooks/post_write_pytest.sh: auto-run tests on solver edits
Targets 1st prize ($50K) with "Best use of C…
Add HACKATHON-PLAN.md: 2-day scope for Opus 4.7 hackathon
Ubuntu+1: Claude Opus 4.7
309688c
Scope: ship a Claude Opus 4.7 agent driving the deployed v1.1 CNN
surrogate (57,802 params, R² 0.994/0.997) with Monte Carlo UQ to
answer 3 exploration-phase engineering questions. Streamlit demo,
90s video, v0.1-hackathon tag. Explicitly cuts v2 physics,
retraining, and 3D work as out-of-scope for 2 days.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Initial: seed from ForceX-AI v2-real-transform planning docs
Ubuntu+1: Claude Opus 4.7
6f6fd44
Copy PLAN.md, PROGRESS.md, and REAL-ENGINEERING-QUESTIONS.md from
products/geoforce/v2-real-transform as the starting point for the
GeoForce Claude Code Opus 4.7 Hackathon build.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>