Initial commit: agentic chat app for IBM Storage Scale REST API v3

Adds a Python package that wraps the Storage Scale /scalemgmt/v3 management
API behind a Claude-driven tool-use loop. Ships a Rich-styled terminal REPL
and a Streamlit web UI sharing the same Agent/Dispatcher/GPFSClient stack.

Guardrails are env-driven (.env): read-only by default; writes and DELETE
gated by GPFS_ALLOW_WRITES / GPFS_ALLOW_DESTRUCTIVE; optional path
allow/deny regex; mutating calls require operator confirmation. Free-text
GPFS_INSTRUCTIONS (or GPFS_INSTRUCTIONS_FILE) appended to the system prompt.

The system prompt also includes a curated v3 endpoint reference compiled
from IBM Storage Scale 5.2.3 / 6.0.0 documentation so the agent doesn't
have to guess endpoint shapes for common operations.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Laurence Horrocks-Barlow 2026-05-20 01:36:59 +01:00
commit 8840ba74f7
13 changed files with 959 additions and 0 deletions

49
.env.example Normal file
View file

@ -0,0 +1,49 @@
# ──────────────────────────────────────────────────────────────────────────────
# GPFS Agent configuration
# Copy this file to `.env` and fill in your values.
# ──────────────────────────────────────────────────────────────────────────────
# ── Anthropic / model ────────────────────────────────────────────────────────
ANTHROPIC_API_KEY=sk-ant-xxx
# Model is overridable. Defaults to claude-sonnet-4-6.
# Other valid IDs: claude-opus-4-7, claude-haiku-4-5-20251001
ANTHROPIC_MODEL=claude-sonnet-4-6
ANTHROPIC_MAX_TOKENS=4096
# ── GPFS REST API (IBM Storage Scale, formerly Spectrum Scale) ───────────────
# Base URL of the GUI node hosting the REST API, including the version prefix.
# v3 is the current native REST API on Storage Scale 5.2.x / 6.0.x.
# Default GUI port is 443 (CNSA / container deploys) or 46443 (native install).
# The interactive Swagger UI lives at https://<gui>/openapi/ — useful for
# discovering endpoints your specific release ships.
GPFS_API_BASE=https://gpfs-gui.example.com:443/scalemgmt/v3
GPFS_USERNAME=admin
GPFS_PASSWORD=changeme
# Set to "false" to skip TLS verification (self-signed certs in lab gear).
GPFS_VERIFY_TLS=true
# Optional path to a CA bundle to trust.
# GPFS_CA_BUNDLE=C:\path\to\ca.pem
# Per-request timeout in seconds.
GPFS_TIMEOUT=30
# ── Guardrails ───────────────────────────────────────────────────────────────
# The agent is read-only by default. Flip these to expand its powers.
GPFS_ALLOW_WRITES=false # enables POST and PUT
GPFS_ALLOW_DESTRUCTIVE=false # enables DELETE (requires ALLOW_WRITES=true)
# Optional regex allow/deny applied to the request path *after* the API base.
# e.g. ^/filesystems(/|$) to restrict to filesystem endpoints.
# GPFS_PATH_ALLOW=^/.*
# GPFS_PATH_DENY=^/(perfmon|auth)/
# Additional natural-language instructions appended to the system prompt.
# Use this for site-specific guardrails (e.g. "never touch fs_prod_archive").
# You can also point GPFS_INSTRUCTIONS_FILE at a text file for longer prompts.
GPFS_INSTRUCTIONS=
# GPFS_INSTRUCTIONS_FILE=./instructions.md
# If "true", the agent will ask for human confirmation before any mutating call
# even when writes are allowed. Recommended in production.
GPFS_CONFIRM_MUTATIONS=true