fix(opencode): correct remaining agent/skill doc drift
CI / lint (pull_request) Successful in 1m31s
CI / sanitizers (address) (pull_request) Skipped
CI / sanitizers (undefined) (pull_request) Skipped
CI / fuzz-build (pull_request) Skipped
CI / coverage (pull_request) Skipped
CI / valgrind (pull_request) Skipped
CI / build-and-test (pull_request) Successful in 1m44s

- pr-review: replace invalid 'tea pr comment' with 'tea comment' (the
  former is not a tea subcommand)
- integrator: drop stray '-M' from client examples (-M is now
  --remote-option and requires an argument), use the canonical pytest
  integration command, and bump the CI image tag to v10
- test-writer: build fuzz targets via -DENABLE_FUZZ=ON instead of
  hand-rolled -fsanitize flags; fix the fuzz binary path
- cmake-expert: document -DSANITIZER=undefined, which is now live in
  CMakeLists.txt
- README: add --allow-unauthenticated to the plain-TCP server example,
  use --preserve for metadata (not -M), and use the canonical
  integration command
- AGENTS.md: use the canonical integration command
This commit is contained in:
2026-09-13 10:41:23 +02:00
parent 5c8970c64f
commit 0f95f48899
6 changed files with 24 additions and 25 deletions
+10 -9
View File
@@ -27,16 +27,19 @@ FetchContent_Declare(xxhash GIT_REPOSITORY https://github.com/Cyan4973/xxHash GI
FetchContent_MakeAvailable(xxhash)
# Sanitizer option
set(SANITIZER "none" CACHE STRING "Sanitizer to enable (address, thread, none)")
set_property(CACHE SANITIZER PROPERTY STRINGS address thread none)
set(SANITIZER "none" CACHE STRING "Sanitizer to enable (address, thread, undefined, none)")
set_property(CACHE SANITIZER PROPERTY STRINGS address thread undefined none)
if(SANITIZER STREQUAL "address")
add_compile_options(-fsanitize=address -fno-omit-frame-pointer -g)
add_link_options(-fsanitize=address)
elseif(SANITIZER STREQUAL "thread")
add_compile_options(-fsanitize=thread -fno-omit-frame-pointer -g)
add_link_options(-fsanitize=thread)
elseif(SANITIZER STREQUAL "undefined")
add_compile_options(-fsanitize=undefined -fno-omit-frame-pointer -g)
add_link_options(-fsanitize=undefined)
elseif(NOT SANITIZER STREQUAL "none")
message(FATAL_ERROR "Unknown sanitizer: ${SANITIZER}. Supported values: address, thread, none")
message(FATAL_ERROR "Unknown sanitizer: ${SANITIZER}. Supported values: address, thread, undefined, none")
endif()
option(STRICT_WARNINGS "Enable strict warnings" OFF)
@@ -94,7 +97,7 @@ tests/integration/ — Python pytest integration tests
- Use `file(GLOB ...)` for source collection (existing pattern).
- All targets link `Threads::Threads`, `${ZSTD_LIBRARY}`, `OpenSSL::SSL`, `OpenSSL::Crypto`, and `xxhash`.
- Include directories: `src/shared`, `src/server`, `src/client`, `tests` (for test target).
- Sanitizer support: pass `-DSANITIZER=address` or `-DSANITIZER=thread` to cmake (live option in CMakeLists.txt).
- Sanitizer support: pass `-DSANITIZER=address`, `-DSANITIZER=thread`, or `-DSANITIZER=undefined` to cmake (live option in CMakeLists.txt).
- Build with `cmake -B build -S . && cmake --build build -j$(nproc)`.
- For CI, dependencies are provided by the project's custom Docker image (repo-root `Dockerfile`, same image CI uses). For local development, use `nix-shell`. Never add `apt-get install` / `pip install` to CI workflows. See `AGENTS.md`.
@@ -105,7 +108,7 @@ tests/integration/ — Python pytest integration tests
3. Add new dependencies with `find_package` or `find_library`.
4. When adding a new executable target, follow the pattern of existing targets.
5. When adding a new library (static/shared), use `add_library` and follow the project's naming.
6. For sanitizer builds, pass `-DSANITIZER=address` or `-DSANITIZER=thread` to cmake (matching CI's matrix strategy).
6. For sanitizer builds, pass `-DSANITIZER=address`, `-DSANITIZER=thread`, or `-DSANITIZER=undefined` to cmake (matching CI's matrix strategy).
7. Always verify the build compiles after changes.
## Sanitizer Configurations
@@ -119,11 +122,9 @@ cmake -B build -S . -DSANITIZER=thread # ThreadSanitizer (race conditions)
cmake --build build -j$(nproc)
```
For UndefinedBehaviorSanitizer (no `-DSANITIZER=undefined` option in CMakeLists.txt yet), use the manual flag approach:
UndefinedBehaviorSanitizer uses the same built-in option:
```bash
cmake -B build -S . \
-DCMAKE_C_FLAGS="-fsanitize=undefined -fno-omit-frame-pointer -g" \
-DCMAKE_EXE_LINKER_FLAGS="-fsanitize=undefined"
cmake -B build -S . -DSANITIZER=undefined
cmake --build build -j$(nproc)
```
+7 -7
View File
@@ -21,7 +21,7 @@ Design integration tests that verify the full transfer pipeline works end-to-end
- Multiple configurations (TCP, SSH, TLS, compression, multithreading)
- Network shaping (LAN, WAN profiles)
- Feature tests (dry run, archive, exclude, delete, incremental, bandwidth limit)
- Run: `python3 -m pytest tests/ -v --tb=short`
- Run: `python3 -m pytest tests/integration/ -n 4 --dist=load -m "not setpriv"`
### 3. New: Focused Integration Tests
When adding new features or fixing bugs, write targeted integration tests.
@@ -77,7 +77,7 @@ openssl req -x509 -newkey rsa:2048 -keyout /tmp/key.pem -out /tmp/cert.pem \
### Pattern 4: Incremental Sync
```bash
# First sync
./build/client --source-dir /tmp/src --dest-dir /tmp/dst --save-to-disk -M
./build/client --source-dir /tmp/src --dest-dir /tmp/dst --save-to-disk
# Modify source
echo "updated" >> /tmp/src/file.txt
@@ -90,14 +90,14 @@ echo "updated" >> /tmp/src/file.txt
### Pattern 5: Delete Verification
```bash
# Initial sync
./build/client --source-dir /tmp/src --dest-dir /tmp/dst --save-to-disk -M
./build/client --source-dir /tmp/src --dest-dir /tmp/dst --save-to-disk
# Add extra file to dest
echo "extra" > /tmp/dst/.../extra.txt
# Sync with --delete
./build/client --source-dir /tmp/src --dest-dir /tmp/dst \
--save-to-disk --delete -M
--save-to-disk --delete
# Verify extra.txt is gone
test ! -f /tmp/dst/.../extra.txt
@@ -116,7 +116,7 @@ The project uses Gitea Actions. Key jobs:
jobs:
new-job:
runs-on: ubuntu-latest
container: gitea.tap-tap.win/taptap/fastsync-ci:v7
container: gitea.tap-tap.win/taptap/fastsync-ci:v10
steps:
- uses: actions/checkout@v4
- name: Configure
@@ -128,7 +128,7 @@ jobs:
- name: Unit Tests
run: ./build-${{ matrix.sanitizer }}/tests
- name: Integration Tests
run: LSAN_OPTIONS=suppressions=.lsan-suppressions.txt python3 -m pytest tests/ -v --tb=short
run: LSAN_OPTIONS=suppressions=.lsan-suppressions.txt python3 -m pytest tests/integration/ -n 4 --dist=load -m "not setpriv"
```
The symlink step is required because `tests/conftest.py` expects `./build` to exist.
@@ -136,7 +136,7 @@ The symlink step is required because `tests/conftest.py` expects `./build` to ex
After any code change:
- [ ] Unit tests pass: `./build/tests`
- [ ] Integration tests pass: `python3 -m pytest tests/ -v --tb=short`
- [ ] Integration tests pass: `python3 -m pytest tests/integration/ -n 4 --dist=load -m "not setpriv"`
- [ ] Build clean: no warnings with `-Wall`
- [ ] No memory errors: ASan clean
- [ ] No thread errors: TSan clean (if threading involved)
+2 -4
View File
@@ -138,11 +138,9 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
Build for fuzzing:
```bash
cmake -B build-fuzz -S . \
-DCMAKE_C_FLAGS="-fsanitize=fuzzer,address,undefined -g" \
-DCMAKE_EXE_LINKER_FLAGS="-fsanitize=fuzzer,address,undefined"
CC=clang CXX=clang++ cmake -B build-fuzz -S . -DENABLE_FUZZ=ON
cmake --build build-fuzz -j$(nproc)
./build-fuzz/tests/fuzz_chunk_deserialize corpus/ -max_len=1048576
./build-fuzz/fuzz_chunk_deserialize corpus/ -max_len=1048576
```
### AFL++ Harness
+1 -1
View File
@@ -125,7 +125,7 @@ STYLE: <count>
If the user wants to post the review as a PR comment:
```bash
tea pr comment <number> --comment "<review report>"
tea comment --repo TapTap/FastSync <number> "<review report>"
```
## Rules