Skip to content

Commit 1250319

Browse files
authored
LLM / Claude cleanup (#12812)
1 parent 9efc018 commit 1250319

9 files changed

Lines changed: 62 additions & 541 deletions

.claude/CLAUDE.md

Lines changed: 58 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ with a sophisticated plugin system.
1414
- Testing: Catch2 (unit tests) + AuTest Python framework (end-to-end tests)
1515
- Protocols: TLS, HTTP/1.1, HTTP/2, HTTP/3 (via Quiche)
1616

17+
## Personal Preferences
18+
19+
If `.claude/PERSONAL.md` sub-agent exists, load it for user-specific code style
20+
preferences and working conventions. This file is gitignored and optional.
21+
1722
## Build Commands
1823

1924
### Basic Build
@@ -53,6 +58,13 @@ cmake --build build -t traffic_server
5358
cmake --build build -t format # Format code before committing
5459
```
5560

61+
### Key CMake Options
62+
- `BUILD_EXPERIMENTAL_PLUGINS=ON` - Enable experimental plugins
63+
- `ENABLE_QUICHE=ON` - QUIC/HTTP3 support
64+
- `ENABLE_CRIPTS=ON` - Cripts scripting API
65+
- `BUILD_REGRESSION_TESTING=ON` - Enable test suite
66+
- `ENABLE_ASAN=ON` - Configure ASan instrumentation
67+
5668
## Testing
5769

5870
### Unit Tests (Catch2)
@@ -94,13 +106,9 @@ For example, to run `cache-auth.test.py`:
94106
./autest.sh --sandbox /tmp/sbcursor --clean=none -f cache-auth
95107
```
96108

97-
The CI system publishes the following docker image in which the CI runs autests:
98-
99-
```
100-
ci.trafficserver.apache.org/ats/fedora:43
101-
```
102-
103-
The fedora version is updated regularly to the latest fedora release.
109+
Most end-to-end test coverage is in `tests/gold_tests/`. The CI system uses the
110+
Docker image `ci.trafficserver.apache.org/ats/fedora:43` (Fedora version updated
111+
regularly).
104112

105113
### Writing Autests
106114

@@ -110,7 +118,7 @@ using the Proxy Verifier format. This is simpler, more maintainable, and
110118
parseable by tools.
111119

112120
**For complete details on writing autests, see:**
113-
- `doc/developer-guide/testing/autests.en.rst` - Comprehensive guide to ATSReplayTest
121+
- `doc/developer-guide/testing/autests.en.rst` - Comprehensive guide to autest
114122
- Proxy Verifier format: https://github.com/yahoo/proxy-verifier
115123
- AuTest framework: https://autestsuite.bitbucket.io/
116124

@@ -159,8 +167,10 @@ fixes an issue, add a 'Fixes: #<issue_number>' line.
159167

160168
**Base Libraries (`src/`):**
161169
- `tscore/` - Core utilities and data structures
170+
- `tsutil/` - Core utilities (metrics, debugging, regex, etc.)
162171
- `api/` - Plugin API implementation
163172
- `tscpp/api/` - C++ API wrapper for plugins
173+
- `cripts/` - Cripts scripting framework for plugins
164174

165175
### Event-Driven Architecture
166176

@@ -242,6 +252,12 @@ Plugins register callbacks at various points in request processing:
242252
3. Use `traffic_top` for live statistics
243253
4. Use `traffic_ctl` for runtime inspection
244254

255+
**Debug Controls in Code:**
256+
```cpp
257+
static DbgCtl dbg_ctl{"my_component"};
258+
SMDebug(dbg_ctl, "Processing request for URL: %s", url);
259+
```
260+
245261
## Important Conventions
246262

247263
### License Headers
@@ -250,10 +266,43 @@ Plugins register callbacks at various points in request processing:
250266
- Follow the existing license header format used in the codebase
251267

252268
### Code Style
253-
- C++20 standard
269+
- C++20 standard (nothing from C++23 or later)
254270
- Use RAII principles
255271
- Prefer smart pointers for ownership
272+
- Don't use templates unless needed and appropriate
256273
- Run `cmake --build build -t format` before committing
274+
- Line length: 132 characters maximum
275+
- Don't add comments where the code documents itself
276+
277+
**C++ Formatting (Mozilla-based style):**
278+
- Indentation: 2 spaces for C/C++
279+
- Braces: Linux style (opening brace on same line)
280+
- Pointer alignment: Right (`Type *ptr`, not `Type* ptr`)
281+
- Variable declarations: Add empty line after declarations before subsequent code
282+
- Avoid naked conditions (always use braces with if statements)
283+
284+
**Naming Conventions:**
285+
- CamelCase for classes: `HttpSM`, `NetVConnection`
286+
- snake_case for variables and functions: `server_entry`, `handle_api_return()`
287+
- UPPER_CASE for macros and constants: `HTTP_SM_SET_DEFAULT_HANDLER`
288+
289+
**Modern C++ Patterns (Preferred):**
290+
```cpp
291+
// GOOD - Modern C++20
292+
auto buffer = std::make_unique<MIOBuffer>(alloc_index);
293+
for (const auto &entry : container) {
294+
if (auto *vc = entry.get_vc(); vc != nullptr) {
295+
// Process vc
296+
}
297+
}
298+
299+
// AVOID - Legacy C-style
300+
MIOBuffer *buffer = (MIOBuffer*)malloc(sizeof(MIOBuffer));
301+
```
302+
303+
### Python Code Style (for tests and tools)
304+
- Python 3.11+ with proper type annotations
305+
- 4-space indentation, never TABs
257306

258307
### Memory Management
259308
- Custom allocators supported (jemalloc, mimalloc)

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,4 +210,7 @@ tests/gold_tests/tls/ssl-post
210210
src/iocore/cache/test_*
211211
src/iocore/cache/unit_tests/var/trafficserver/cache.db
212212

213-
.claude/settings.local.json
213+
# LLM / AI
214+
.cursor/
215+
.claude/*
216+
!.claude/CLAUDE.md

memory-bank/01-project-overview.md

Lines changed: 0 additions & 93 deletions
This file was deleted.

memory-bank/02-build-system.md

Lines changed: 0 additions & 95 deletions
This file was deleted.

memory-bank/03-plugin-system.md

Lines changed: 0 additions & 58 deletions
This file was deleted.

0 commit comments

Comments
 (0)