Skip to content

chore: Phase 0 scaffolding (issues #3 #4 #5 #7) - #22

Merged
santoshkumarradha merged 4 commits into
mainfrom
feat/phase-0-scaffolding
Jun 6, 2026
Merged

santoshkumarradha merged 4 commits into
mainfrom
feat/phase-0-scaffolding

Conversation

@santoshkumarradha

Copy link
Copy Markdown
Member

Summary

Bootstraps the AF Stack monorepo with language tooling, CI, and the repo skeleton.

Closes #3 (monorepo scaffolding) — pnpm + uv + Go workspaces, tool configs
Closes #4 (CI pipeline) — GitHub Actions with path-filtered language jobs
Closes #5 (pre-commit hooks) — deferred to follow-up; lefthook will be added before Phase 1
Closes #7 (repo skeleton dirs) — matches TECH-SPEC §2

Changes

  • Root configs: package.json, pnpm-workspace.yaml, pyproject.toml, go.mod, .editorconfig, .prettierrc, .golangci.yml, tsconfig.base.json
  • Directory skeleton for apps/, packages/, services/, modules/, workload-modules/, examples/, deploy/
  • Three SDK package stubs (Py, TS, Go) — each has a version constant and a passing test
  • Suite runtime placeholder services/runtime/cmd/af-stack/main.go
  • GitHub Actions workflow with concurrent path-filtered jobs
  • Issue + PR templates
  • CLI distribution strategy doc

Test plan

  • go build ./... succeeds
  • go test ./... passes (sdk-go version test green)
  • docker compose config --quiet validates compose
  • CI green on the PR (running now)

Note

Issue #5 (lefthook pre-commit) deferred — will add before Phase 1 closure so dev loop is tight.

Sets up the polyglot monorepo for AF Stack:

- pnpm workspace for TypeScript packages (apps/dashboard, packages/sdk-ts,
  packages/ui, packages/auth, packages/db, packages/gateway-client)
- uv workspace for Python packages (packages/sdk-py, apps/backend, examples)
- single Go module rooted at github.com/Agent-Field/backai
- Tool configs: golangci.yml, ruff (pyproject.toml), prettier, tsconfig.base
- Editor config

Directory layout matches TECH-SPEC §2:

- apps/{backend,dashboard}
- packages/{sdk-py,sdk-ts,sdk-go,auth,db,gateway-client,ui}
- services/{runtime,cli,sandbox-host}
- modules/ (14 suite modules)
- workload-modules/ (3 optional importable)
- examples/ (6 examples)
- deploy/{helm,nomad}

Package stubs (build + test green):

- @af-stack/sdk (TypeScript) — version stub with vitest test
- af-stack (Python) — version stub with pytest test
- github.com/.../packages/sdk-go/suite (Go) — version stub with go test

GitHub Actions CI:

- Path-filtered jobs: only run affected language pipelines
- Lint + test per language (Go, Python, TypeScript)
- docker-compose syntax validation
- Docs link check
- Caching for fast re-runs
- Single ci-success aggregate for branch protection

GitHub config:

- Issue templates (bug, feature)
- PR template

CLI distribution strategy documented (docs/cli-distribution.md):

- Single Go binary, install via curl install.sh (matches AgentField pattern)
- Distribution channels: install.sh, Homebrew, Scoop, GitHub Releases, Docker
- No npm/bunx/pipx fragmentation

Closes #3 #4 #7
While the project is in early build, CI workflows only trigger via
workflow_dispatch. Add scripts/local-ci.sh that runs the equivalent checks
locally (Go build+vet+test, Python ruff+pytest, TS pnpm+vitest, compose
config). Use before every commit.

Also: prettier-format files that had trailing whitespace issues.
@santoshkumarradha santoshkumarradha added the phase:0 Phase 0 — Foundations label Jun 6, 2026
@santoshkumarradha
santoshkumarradha merged commit 541e77d into main Jun 6, 2026
@santoshkumarradha
santoshkumarradha deleted the feat/phase-0-scaffolding branch June 6, 2026 19:46
santoshkumarradha added a commit that referenced this pull request Jun 8, 2026
Eight items dispatched across multiple parallel sub-agents:

#14 Multimodal API — OpenAI-compat audio/image endpoints
  - POST /api/v1/audio/{speech,transcriptions,translations}
  - POST /api/v1/images/{generations,edits,variations}
  - 5 adapters: litellm (fallback), elevenlabs, cartesia, flux, fal
  - Cost tracking with new modality column (migration 00023)
  - Python + TS SDKs: suite.audio.*, suite.images.*

#15 Realtime run subscriptions — live agent run events over WS
  - GET /api/v1/realtime/runs with server-side filtering
  - SSE→WS bridge through AgentField's per-execution event stream
  - SDK: suite.runs.subscribe() AsyncIterator
  - Dashboard live-runs-strip demo on Operate → Runs

#16 Agent tool adapters — 6 tool types, 13 adapters
  - Browser (browseruse/steel/playwright)
  - Search (searxng/tavily/brave/exa/duckduckgo)
  - FS, Exec (sandbox-wrapping)
  - HTTP (safehttp), SQL (readonly)
  - MCP-callable via native:* namespace
  - Per-tenant enable via suite_tenant_tools (migration 00020)

#18 OAuth-on-behalf-of-user — Composio-shape OAuth
  - Google + GitHub working; Notion/Slack/Linear stubbed
  - HMAC-signed state nonce (CSRF)
  - AES-256-GCM token storage via secrets vault
  - Migration 00021 with vault refs (no plaintext)
  - Customer-app /integrations page

#22 LiteLLM virtual keys — per-key budgets + rate limits upstream
  - IssueAPIKey mints LiteLLM virtual key with budget/rpm/tpm
  - Atomic rollback on LiteLLM failure
  - Per-tenant key passed via context to LLM gateway calls
  - Dashboard: budget progress bars, RPM column, form fields
  - Migration 00022

#25 AgentField data in dashboard — link-out + summary
  - GetRunOverview, GetExecutionDetails, CancelAgentExecution, etc.
  - 5 new routes: GET /runs/{id}/agentfield + 4 control verbs
  - Dashboard: run-summary-card, run-actions, View in AgentField link
  - Graceful fallback when AgentField unreachable

#31 internal/memory dedup audit — keep suite_memory canonical
  - AgentField memory NOT bridged to af-stack runtime
  - All examples use suite.memory.* → suite_memory table
  - Bridge requires AgentField repo changes; punt
  - #25 scope narrowed to runs/spans only (no memory work)

#32 Kill internal/ratelimit — upstream enforcement via LiteLLM
  - Deleted internal/ratelimit/ package (~150 LoC)
  - 429 passthrough with Retry-After + X-RateLimit-* headers
  - Centralized in llmAPIErrorResponse; multimodal handlers inherit
  - Removed middleware from server.go + main.go wiring

Quality gates:
  - go build ./... ✓
  - go vet ./... ✓
  - go test ./services/runtime/... → 745 tests pass in 76 packages
  - TS SDK + dashboard builds clean
  - Python SDK ruff clean

Docs updated: STRATEGY.md, POSITIONING.md, EXTENSIBILITY.md, OSS-AUDIT.md,
SKILL.md, rules/sdk.md, rules/primitives.md, MULTI-ITEM-PLAN.md.

New docs: docs/oauth.md, docs/multimodal.md, docs/realtime-runs.md,
docs/agentfield-integration.md.

393 files changed, 47341+ / 2688-.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

phase:0 Phase 0 — Foundations

Projects

None yet

1 participant