Skip to content

About

No description, website, or topics provided.

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Seismic Agent V0.3.3

V0.5.1 UI refinement

V0.5.1 reserves the sidebar for the persistent Seismic Agent conversation and approval decisions. Project context and dataset controls are no longer duplicated in the sidebar. Main navigation uses Streamlit tabs: Workspace, Processing, QC, and History. The Load new dataset control lives on the Workspace page.

The attached user-provided .gitignore replaces the package's previous .gitignore unchanged.

V0.3.3 builds on V0.3 and adds a dual-provider agent runtime. The default deployment uses a local OpenClaw Gateway; direct OpenAI Responses API access remains available as an explicit deployment option. The deterministic Seismic Unix execution path and human approval gate are unchanged.

V0.4: automatic QC reflection

After an agent-proposed filter is approved and successfully executed, V0.4 automatically:

sufilter
  -> deterministic before/after QC
  -> agent reflection
  -> ACCEPT or ADJUST
  -> human approval required for any adjustment

The reflection step does not use forced OpenClaw client-function calling. The seismic application computes QC evidence itself, then asks the configured provider (OpenClaw by default, OpenAI optional) to interpret that evidence. If the provider recommends adjusted filter corners, the application validates them and creates a normal pending approval; it never automatically runs the second filter.

If the LLM reflection fails, the successfully produced SU output is retained and the QC tab still works. Reflection failure never rolls back processing.

What V0.3.3 adds

The new Chat Agent can use four structured tools:

inspect_dataset        automatic / read-only
inspect_frequency      automatic / read-only
compare_datasets       automatic / read-only
apply_bandpass_filter  approval-gated

The important safety boundary is:

LLM calls apply_bandpass_filter
        ↓
creates pending proposal only
        ↓
user clicks Approve & Run sufilter
        ↓
Workflow Engine
        ↓
Validator
        ↓
SU Executor
        ↓
sufilter

The model never gets arbitrary shell access and never directly executes Seismic Unix processing commands.

Architecture

Browser
   │
   ▼
Streamlit
   │
   ├──────────── Manual Process / QC tabs
   │
   ▼
SeismicAgent
   │
   ├── inspect_dataset
   ├── inspect_frequency
   ├── compare_datasets
   └── apply_bandpass_filter → pending approval only
                                  │
                                  ▼
                            Human approval
                                  │
                                  ▼
                           Workflow Engine
                                  │
                           Tool Registry
                                  │
                              Validator
                                  │
                             SU Executor
                                  │
                              sufilter
                                  │
                                  ▼
                            Project History

Directory structure

agentic-seismic-unix/
├── app.py
├── Dockerfile
├── docker-compose.yml
├── requirements.txt
├── .env.example
│
├── config/
│   └── agent.yaml
│
├── agent/
│   ├── __init__.py
│   ├── seismic_agent.py
│   ├── provider_factory.py
│   ├── openai_agent.py  # compatibility shim
│   ├── prompts.py
│   ├── toolkit.py
│   ├── providers/
│   │   ├── base.py
│   │   ├── openclaw_provider.py
│   │   └── openai_provider.py
│   └── README.md
│
├── su/
│   ├── registry.py
│   ├── validator.py
│   ├── executor.py
│   └── importer.py
│
├── tools/
│   ├── sufilter.yaml
│   ├── inspect_dataset.yaml
│   ├── inspect_frequency.yaml
│   └── compare_datasets.yaml
│
├── seismic/
│   ├── io.py
│   ├── spectrum.py
│   ├── qc.py
│   └── plotting.py
│
├── workflow/
│   ├── engine.py
│   └── history.py
│
├── project/
│   ├── project.py
│   └── state.py
│
├── knowledge/
│   └── filtering.md
│
├── recipes/
│   └── bandpass_qc.yaml
│
├── source/
└── data/

Agent provider configuration

Provider selection is deployment configuration, not a UI control.

The default file is:

config/agent.yaml

Default:

provider: openclaw
fallback_provider: null

openclaw:
  base_url: http://127.0.0.1:18789/v1
  model: openclaw/default
  credential_env: OPENCLAW_GATEWAY_TOKEN
  agent_id: null

openai:
  model: gpt-5.6
  api_key_env: OPENAI_API_KEY

Default: local OpenClaw

OpenClaw must expose its OpenResponses-compatible endpoint. In the OpenClaw Gateway configuration enable:

{
  gateway: {
    http: {
      endpoints: {
        responses: { enabled: true }
      }
    }
  }
}

Copy the environment template:

cp .env.example .env

Set the Gateway credential used by your OpenClaw auth mode:

OPENCLAW_GATEWAY_TOKEN=your_gateway_token_or_password

The supplied Docker Compose uses network_mode: host, which is appropriate for the target Linux/OCI deployment and allows the container to reach an OpenClaw Gateway that remains bound to host loopback at 127.0.0.1:18789.

If your OpenClaw deployment uses a dedicated agent, set either:

openclaw:
  model: openclaw/my-seismic-agent

or set agent_id and keep model: openclaw.

Optional: direct OpenAI API

Change:

provider: openai

and set:

OPENAI_API_KEY=your_api_key

The default direct model is:

gpt-5.6

No automatic OpenClaw → OpenAI fallback is enabled. fallback_provider is deliberately null so a deployment does not silently change model/provider, credentials, cost surface, or audit behavior.

You may override the selected provider for a deployment with:

AGENT_PROVIDER=openai

but the preferred persistent setting is config/agent.yaml.

Provider architecture

Streamlit
   ↓
SeismicAgent
   ↓
AgentProvider
  ├── OpenClawProvider  ← default
  └── OpenAIProvider    ← optional
   ↓
Same four client-side seismic tools
   ↓
Approval gate
   ↓
Workflow Engine → Validator → SU Executor

OpenClaw is used as the reasoning/model-routing runtime only. Seismic Unix tools are not exposed as OpenClaw shell/exec tools. They remain client-side functions owned by this application.

Build and run

Put the official Seismic Unix source tarball under source/ using the existing V0.2 convention, then:

docker compose build
docker compose up -d

Open:

http://YOUR_VM_IP:8501

or route your existing Cloudflare Tunnel to http://localhost:8501.

First agent test

After uploading a SEG-Y file, try:

Inspect this dataset and tell me what you see.

Then:

Inspect the frequency content and recommend a reasonable bandpass filter.

The agent should inspect the data and create a Pending Approval card. No filter is executed yet.

Click:

Approve & Run sufilter

Then ask:

Review the filter result. Did it improve the data?

The agent should call compare_datasets and discuss the machine-readable QC metrics.

Human-in-the-loop behavior

Auto

The agent may automatically execute:

  • dataset inspection
  • frequency inspection
  • latest before/after QC comparison

Approval required

The agent cannot automatically execute:

  • sufilter

Its apply_bandpass_filter tool creates only a pending proposal. The Streamlit approval button is the authority that starts the existing deterministic processing workflow.

Frequency inspection

inspect_frequency now reports a compact model-readable summary including:

  • peak frequency
  • 5/10/50/90/95% cumulative preview-spectrum power frequencies
  • number of traces analyzed
  • Nyquist frequency

These values are descriptive QC statistics. They are deliberately not labeled automatically as signal/noise boundaries; the agent must interpret them conservatively.

Existing V0.2 fixes retained

This version is based on the user-edited V0.2 archive, including its improved SU endian detection and direct SU trace reading logic.

Current limitations

  • One active project/session in the Streamlit UI at a time.
  • One agent, not a multi-agent architecture.
  • One processing operation: sufilter.
  • The QC metrics are intentionally simple.
  • Chat history is kept in Streamlit session state, not yet persisted to project storage.
  • The agent provider is selected per deployment: local OpenClaw by default, direct OpenAI API optionally.
  • The app does not yet estimate processing cost or runtime.

Recommended V0.4

After V0.3 is stable on real seismic data, the next useful step is the QC reflection loop:

Agent proposes filter
   ↓
User approves
   ↓
sufilter
   ↓
QC metrics
   ↓
Agent reviews automatically
   ↓
Accept / propose adjusted filter

At that point the application starts to become genuinely iterative rather than only conversational.

OpenClaw input-schema fix in V0.3.3

V0.3.1 replayed ChatGPT/OpenAI-style easy message objects to the OpenClaw /v1/responses endpoint. Some OpenClaw versions reject that shape with:

400 input: Invalid input

V0.3.3 uses the documented OpenResponses string input for each new OpenClaw turn and supplies a stable per-project user key so the Gateway can preserve session context. Tool continuations still use function_call_output with previous_response_id. OpenAI direct mode continues to use explicit message history.

A minimal Gateway smoke test is:

curl -sS http://127.0.0.1:18789/v1/responses \
  -H "Authorization: Bearer $OPENCLAW_GATEWAY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"model":"openclaw/default","input":"hello"}'

V0.3.3 OpenClaw tool-selection fix

OpenClaw supports caller-supplied client function tools, but tool_choice: auto allows the underlying model to answer without calling one. For explicit seismic data requests, V0.3.3 pins the first read-only tool deterministically:

  • dataset/general inspection -> inspect_dataset
  • spectrum/frequency/filter recommendation -> inspect_frequency
  • review of a completed filter -> compare_datasets

After the first tool result, the agent returns to tool_choice: auto, allowing it to explain the evidence or propose the approval-gated bandpass tool. The runtime prompt also explicitly tells the model that a project dataset is loaded and that the supplied client-side tools are available.

This avoids the failure mode where the model replies that it cannot access a dataset even though the application has already loaded one.

v0.4 OpenClaw compatibility change

OpenClaw's /v1/responses endpoint enforces pinned/required client tool calls: if the selected backend agent does not emit a matching structured function_call, the Gateway returns HTTP 502. Some OpenClaw backend/model combinations may therefore fail even though the Gateway accepted the tool schema.

V0.4 defaults OpenClaw to:

openclaw:
  tool_strategy: application_routed

In this mode, obvious read-only seismic intents are routed by the application:

inspect dataset       -> inspect_dataset
frequency / spectrum  -> inspect_frequency
review filter result  -> compare_datasets

The application executes the read-only inspection tool first and sends its structured result to OpenClaw as authoritative application evidence. OpenClaw then performs interpretation/reasoning. Client-side tools remain available with tool_choice=auto, but correctness no longer depends on a forced OpenClaw function call.

OpenAI direct mode continues to use native Responses API function calling.

If a future OpenClaw backend reliably emits client-side function calls, you can test:

openclaw:
  tool_strategy: native

For production deployments, application_routed is the recommended default.

V0.4 hotfix

Re-export AgentConfigurationError from agent.seismic_agent for compatibility with app.py.

QC metric correction in V0.4

Before/after signal-retention and high-frequency-reduction ratios are now computed from unnormalized mean amplitude spectra. Plotting remains independently normalized for visual comparison. This prevents display normalization from distorting quantitative reflection metrics.

v0.5.1 OpenClaw proposal bridge fix

In openclaw.tool_strategy: application_routed mode, read-only evidence and bandpass proposal creation are both application-routed. OpenClaw no longer needs to emit a native client function call for apply_bandpass_filter. When the user explicitly asks for a filter recommendation, the model returns a marked JSON proposal envelope; the application parses it, validates f1 < f2 < f3 < f4 < Nyquist, and creates the normal human-approval-gated pending action.

If the proposed frequency values look geophysically unexpected, first check the displayed sample interval and Nyquist. All proposal frequencies are interpreted in Hz and are rejected automatically if they violate the dataset Nyquist limit.

v0.5.1 proposal bridge hardening

OpenClaw application-routed mode no longer requires the model to emit the <SEISMIC_PROPOSAL> envelope perfectly. For explicit bandpass recommendation turns, the application can also parse common prose forms such as 8-15-50-60 Hz, 8 / 15 / 50 / 60 Hz, or labeled f1=... values. Parsed values still pass through the normal dataset-aware validator and only create a pending action; they never execute processing automatically.

V0.5.1 — Workstation UI

V0.5.1 is primarily a UI/layout release. The processing and agent safety model from V0.4.2 is retained.

Sidebar responsibilities

  • project context and current dataset
  • page navigation
  • persistent Seismic Agent chat
  • pending processing approval / rejection
  • latest tool trace and QC reflection

Main workspace pages

  • Workspace — full-width current seismic section, spectrum, project summary
  • Processing — manual bandpass controls plus input preview
  • QC — before/after seismic, spectrum, metrics, agent review
  • History — processing timeline, detailed provenance, project state, tool specs

The design rule is:

Sidebar = decisions + conversation + navigation
Main area = seismic data + plots + QC

UI source layout

ui/
├── sidebar.py
├── workspace_page.py
├── processing_page.py
├── qc_page.py
├── history_page.py
└── components/
    ├── project_summary.py
    └── proposal_card.py

No new Seismic Unix processing commands are introduced in V0.5.1. The existing OpenClaw/OpenAI provider selection, application-routed OpenClaw compatibility, proposal validation, human approval gate, provenance, and automatic QC reflection are preserved.

About

No description, website, or topics provided.

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages