|
| 1 | +# CLAUDE.md |
| 2 | + |
| 3 | +Guidance for working in `lab-context-engineering`, a Kagenti platform component. |
| 4 | + |
| 5 | +## What this repo is |
| 6 | + |
| 7 | +A single **Go** core that reduces the token cost of LLM agent traffic. It ships as a |
| 8 | +standalone proxy binary (`cmd/proxy`), an importable library (`engine`, `surfaces`), and |
| 9 | +eval-containers wiring. Its lineage is the Python `winnow` prototype (`../winnow`), which |
| 10 | +is the behavioral reference — port its *logic*, re-implement its transport in Go. |
| 11 | + |
| 12 | +## Hard boundaries |
| 13 | + |
| 14 | +- **No AuthBridge / kagenti-extensions code lives here.** That plugin is built in |
| 15 | + `kagenti-extensions` and depends on this repo. Keep the public API (`engine`, |
| 16 | + `surfaces`, `config`) clean and importable; never reach into another repo. |
| 17 | +- **Fail open, always.** Any error in any stage forwards the original request untouched. |
| 18 | + Reductions must be reversible (markers + rewind store). Never drop content that is only |
| 19 | + *predicted* unused — `provable_only` is on by default. |
| 20 | + |
| 21 | +## Conventions |
| 22 | + |
| 23 | +- Go 1.25, module `github.com/kagenti/lab-context-engineering`. `make fmt lint test build`. |
| 24 | +- Match the surrounding code's style; keep packages small and single-purpose. |
| 25 | +- **Commits: DCO sign-off is mandatory** — `git commit -s`. Author as the repo owner. |
| 26 | + AI attribution uses `Assisted-By:` — never `Co-Authored-By`, never a "Generated with" |
| 27 | + line. Conventional-commit titles. |
| 28 | +- Observability follows OpenTelemetry **GenAI semantic conventions** (`gen_ai.*`). |
| 29 | + |
| 30 | +## Layout |
| 31 | + |
| 32 | +`cmd/proxy` (binary) · `engine` (Transform/Expand + stages) · `surfaces` (wire⇄canonical) |
| 33 | +· `internal/*` (types, extract, relevance, signals, taxonomy, actions, cache, markers, |
| 34 | +rewind, zones, session, compaction, tokens) · `config` · `observability` · `deploy` · |
| 35 | +`docs`. |
0 commit comments