Cloud-native serverless runtime for AI agent sessions. Wraps the Pi AI framework with Knative Serving, Redis-backed session persistence, K8s sandbox execution, and budget-aware compaction checkpoints.
serverless-harness/
├── harness/ # Core harness runtime (@sh/harness)
├── packages/
│ ├── k8s-sandbox/ # K8s pod exec client (@sh/k8s-sandbox)
│ ├── knative-server/ # Knative HTTP entrypoint (@sh/knative-server)
│ ├── session-backend/ # Redis session storage (@sh/session-backend)
│ └── work-queue/ # Redis Streams work queue (@sh/work-queue)
├── experiments/ # Performance experiments (@sh/experiments)
├── deploy/knative/ # Deployment scripts and smoke tests
├── pi-fork/ # Git submodule: Pi AI framework (must be built)
└── Dockerfile # Container image (node:22-alpine)
| Task | Command |
|---|---|
| Install deps | pnpm install |
| Build pi-fork types | cd pi-fork && npm ci && npm run build |
| Lint | make lint |
| Format | make fmt |
| Test (all) | make test |
| Typecheck | make typecheck |
| Pre-commit install | pre-commit install |
# Clone with submodules
git clone --recurse-submodules https://github.com/kagenti/serverless-harness.git
cd serverless-harness
# Build pi-fork (required for type declarations)
cd pi-fork && npm ci && npm run build && cd ..
# Install workspace deps
pnpm install
# Install pre-commit hooks
pre-commit install- TypeScript (strict mode), Node.js 22+
- pnpm 9+ workspace monorepo
- Prettier for formatting (see .prettierrc)
- Shellcheck for shell scripts in deploy/
- Pre-commit hooks enforce lint on commit
- DCO sign-off required:
git commit -s
- vitest 2.x for all test suites
- Redis required for work-queue and session-backend tests
- Live smoke tests gated by env vars (M3_LIVE_SMOKE, etc.)
Redirect long command output to files — never pollute conversation context:
export LOG_DIR=/tmp/kagenti/tdd/serverless-harness
mkdir -p $LOG_DIR
command > $LOG_DIR/name.log 2>&1; echo "EXIT:$?"All commits require sign-off:
git commit -s -m "feat: description"Use Assisted-By (not Co-Authored-By) for AI attribution:
Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>