Skip to content

Latest commit

 

History

History
executable file
·
117 lines (89 loc) · 4.48 KB

File metadata and controls

executable file
·
117 lines (89 loc) · 4.48 KB

CLAUDE.md

vsp — Go-native MCP server and CLI for SAP ABAP Development Tools (ADT).

Doc intent: CLAUDE.md = dev context. README.md = user onboarding. reports/ = research/history. contexts/ = session handoff.


Current Priorities

1. Graph Engine (pkg/graph/) — In Progress

Sequence: unify existing dep logic → SQL/ADT adapters → impact/path queries.

  • Done: core types, parser dep extraction, boundary analyzer (11 tests)
  • Pending: SQL adapters (CROSS/WBCROSSGT/D010INC), ADT adapters, unify cli_deps.go + cli_extra.go + ctxcomp/analyzer.go
  • Design: 002, 003

2. GUI Debugger (Issue #2) — Strategic

Plan: MCP debug sessions → DAP → Web UI. ADT REST API mapped from CL_TPDA_ADT_RES_APP. Design: 001

3. Open Issues

  • #88 Lock handle bug (EditSource/WriteSource) — real user report
  • #55 RunReport in APC — architectural limit
  • #46, #45 Sync script — low effort

Build & Test

go build -o vsp ./cmd/vsp              # Build
go test ./...                           # Unit tests
go test -tags=integration -v ./pkg/adt/ # Integration (needs SAP)
make build-all                          # 9 platforms

Key flags: --mode focused|expert|hyperfocused, --read-only, --allowed-packages "Z*", --disabled-groups 5THD


Codebase

cmd/vsp/              CLI entry + 28 commands
internal/mcp/
  handlers_*.go       Domain handlers (read, edit, debug, graph, ...)
  tools_register.go   Registration + mode logic
  tools_focused.go    Focused mode whitelist
  handlers_universal.go  Hyperfocused single-tool (SAP)
pkg/
  adt/                ADT client (HTTP, CSRF, sessions, all SAP ops)
  graph/              Dependency graph engine (in progress)
  ctxcomp/            Context compression (dep resolution for read)
  abaplint/           ABAP lexer + parser (91 statements, 8 lint rules)
  dsl/                Fluent API, YAML workflows, batch ops
  cache/              In-memory + SQLite
  scripting/          Lua engine
  llvm2abap/          LLVM→ABAP (research)
  wasmcomp/           WASM→ABAP (research)
Task Files
Add MCP tool tools_register.go + handlers_*.go + tools_focused.go
Add ADT operation pkg/adt/client.go, crud.go, devtools.go, codeintel.go
Add graph feature pkg/graph/
Add lint rule pkg/abaplint/rules.go
Add integration test pkg/adt/integration_test.go
Fix MCP/docs/config README.md, docs/cli-agents/*, handlers_universal.go

Adding a New MCP Tool

  1. Handler in handlers_*.go:
func (s *Server) handleX(ctx context.Context, req mcp.CallToolRequest) (*mcp.CallToolResult, error) {
    name, _ := req.GetArguments()["name"].(string)
    result, err := s.adtClient.Method(ctx, name)
    if err != nil { return newToolResultError(err.Error()), nil }
    return mcp.NewToolResultText(format(result)), nil
}
  1. Register in tools_register.go with shouldRegister("X")
  2. Route in handlers_analysis.go (or appropriate router)
  3. Add to tools_focused.go if needed in focused mode

Common Issues

  1. CSRF errors — auto-refreshed in http.go
  2. Lock conflicts — edit handler does auto lock/unlock
  3. Session issues — some CRUD/debugger flows are session-sensitive; verify stateful/stateless before changing transport or auth logic
  4. Auth — use basic OR cookies, not both
  5. ZADT_VSP — WebSocket debug/RFC/RunReport require it installed on SAP

Security

Never commit .env, cookies.txt, .mcp.json, or local agent/MCP config files (all in .gitignore).

Conventions

Reports: reports/YYYY-MM-DD-NNN-title.md. SAP objects: ZADT_<nn>_<name>, ZCL_ADT_<name>, packages $ZADT*.


Areas Requiring Care

Area Risk Notes
pkg/graph/ New, incomplete Only parser adapter; SQL/ADT adapters pending
handlers_debugger.go WebSocket-only REST breakpoints 403 on newer SAP; use ZADT_VSP
handlers_amdp.go Experimental Session works, breakpoints unreliable
pkg/adt/ui5.go Read-only Write needs /UI5/CL_REPOSITORY_LOAD
pkg/llvm2abap/, pkg/wasmcomp/ Research Not production; don't treat as stable
pkg/adt/debugger.go (REST) Deprecated Prefer websocket_debug.go
docs/cli-agents/* Config drift Codex TOML format may differ from Claude/Gemini JSON docs