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
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:
@@ -27,16 +27,19 @@ FetchContent_Declare(xxhash GIT_REPOSITORY https://github.com/Cyan4973/xxHash GI
|
|||||||
FetchContent_MakeAvailable(xxhash)
|
FetchContent_MakeAvailable(xxhash)
|
||||||
|
|
||||||
# Sanitizer option
|
# Sanitizer option
|
||||||
set(SANITIZER "none" CACHE STRING "Sanitizer to enable (address, thread, none)")
|
set(SANITIZER "none" CACHE STRING "Sanitizer to enable (address, thread, undefined, none)")
|
||||||
set_property(CACHE SANITIZER PROPERTY STRINGS address thread none)
|
set_property(CACHE SANITIZER PROPERTY STRINGS address thread undefined none)
|
||||||
if(SANITIZER STREQUAL "address")
|
if(SANITIZER STREQUAL "address")
|
||||||
add_compile_options(-fsanitize=address -fno-omit-frame-pointer -g)
|
add_compile_options(-fsanitize=address -fno-omit-frame-pointer -g)
|
||||||
add_link_options(-fsanitize=address)
|
add_link_options(-fsanitize=address)
|
||||||
elseif(SANITIZER STREQUAL "thread")
|
elseif(SANITIZER STREQUAL "thread")
|
||||||
add_compile_options(-fsanitize=thread -fno-omit-frame-pointer -g)
|
add_compile_options(-fsanitize=thread -fno-omit-frame-pointer -g)
|
||||||
add_link_options(-fsanitize=thread)
|
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")
|
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()
|
endif()
|
||||||
|
|
||||||
option(STRICT_WARNINGS "Enable strict warnings" OFF)
|
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).
|
- Use `file(GLOB ...)` for source collection (existing pattern).
|
||||||
- All targets link `Threads::Threads`, `${ZSTD_LIBRARY}`, `OpenSSL::SSL`, `OpenSSL::Crypto`, and `xxhash`.
|
- 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).
|
- 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)`.
|
- 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`.
|
- 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`.
|
3. Add new dependencies with `find_package` or `find_library`.
|
||||||
4. When adding a new executable target, follow the pattern of existing targets.
|
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.
|
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.
|
7. Always verify the build compiles after changes.
|
||||||
|
|
||||||
## Sanitizer Configurations
|
## Sanitizer Configurations
|
||||||
@@ -119,11 +122,9 @@ cmake -B build -S . -DSANITIZER=thread # ThreadSanitizer (race conditions)
|
|||||||
cmake --build build -j$(nproc)
|
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
|
```bash
|
||||||
cmake -B build -S . \
|
cmake -B build -S . -DSANITIZER=undefined
|
||||||
-DCMAKE_C_FLAGS="-fsanitize=undefined -fno-omit-frame-pointer -g" \
|
|
||||||
-DCMAKE_EXE_LINKER_FLAGS="-fsanitize=undefined"
|
|
||||||
cmake --build build -j$(nproc)
|
cmake --build build -j$(nproc)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ Design integration tests that verify the full transfer pipeline works end-to-end
|
|||||||
- Multiple configurations (TCP, SSH, TLS, compression, multithreading)
|
- Multiple configurations (TCP, SSH, TLS, compression, multithreading)
|
||||||
- Network shaping (LAN, WAN profiles)
|
- Network shaping (LAN, WAN profiles)
|
||||||
- Feature tests (dry run, archive, exclude, delete, incremental, bandwidth limit)
|
- 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
|
### 3. New: Focused Integration Tests
|
||||||
When adding new features or fixing bugs, write targeted 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
|
### Pattern 4: Incremental Sync
|
||||||
```bash
|
```bash
|
||||||
# First sync
|
# 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
|
# Modify source
|
||||||
echo "updated" >> /tmp/src/file.txt
|
echo "updated" >> /tmp/src/file.txt
|
||||||
@@ -90,14 +90,14 @@ echo "updated" >> /tmp/src/file.txt
|
|||||||
### Pattern 5: Delete Verification
|
### Pattern 5: Delete Verification
|
||||||
```bash
|
```bash
|
||||||
# Initial sync
|
# 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
|
# Add extra file to dest
|
||||||
echo "extra" > /tmp/dst/.../extra.txt
|
echo "extra" > /tmp/dst/.../extra.txt
|
||||||
|
|
||||||
# Sync with --delete
|
# Sync with --delete
|
||||||
./build/client --source-dir /tmp/src --dest-dir /tmp/dst \
|
./build/client --source-dir /tmp/src --dest-dir /tmp/dst \
|
||||||
--save-to-disk --delete -M
|
--save-to-disk --delete
|
||||||
|
|
||||||
# Verify extra.txt is gone
|
# Verify extra.txt is gone
|
||||||
test ! -f /tmp/dst/.../extra.txt
|
test ! -f /tmp/dst/.../extra.txt
|
||||||
@@ -116,7 +116,7 @@ The project uses Gitea Actions. Key jobs:
|
|||||||
jobs:
|
jobs:
|
||||||
new-job:
|
new-job:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: gitea.tap-tap.win/taptap/fastsync-ci:v7
|
container: gitea.tap-tap.win/taptap/fastsync-ci:v10
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Configure
|
- name: Configure
|
||||||
@@ -128,7 +128,7 @@ jobs:
|
|||||||
- name: Unit Tests
|
- name: Unit Tests
|
||||||
run: ./build-${{ matrix.sanitizer }}/tests
|
run: ./build-${{ matrix.sanitizer }}/tests
|
||||||
- name: Integration 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.
|
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:
|
After any code change:
|
||||||
- [ ] Unit tests pass: `./build/tests`
|
- [ ] 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`
|
- [ ] Build clean: no warnings with `-Wall`
|
||||||
- [ ] No memory errors: ASan clean
|
- [ ] No memory errors: ASan clean
|
||||||
- [ ] No thread errors: TSan clean (if threading involved)
|
- [ ] No thread errors: TSan clean (if threading involved)
|
||||||
|
|||||||
@@ -138,11 +138,9 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
|||||||
|
|
||||||
Build for fuzzing:
|
Build for fuzzing:
|
||||||
```bash
|
```bash
|
||||||
cmake -B build-fuzz -S . \
|
CC=clang CXX=clang++ cmake -B build-fuzz -S . -DENABLE_FUZZ=ON
|
||||||
-DCMAKE_C_FLAGS="-fsanitize=fuzzer,address,undefined -g" \
|
|
||||||
-DCMAKE_EXE_LINKER_FLAGS="-fsanitize=fuzzer,address,undefined"
|
|
||||||
cmake --build build-fuzz -j$(nproc)
|
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
|
### AFL++ Harness
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ STYLE: <count>
|
|||||||
|
|
||||||
If the user wants to post the review as a PR comment:
|
If the user wants to post the review as a PR comment:
|
||||||
```bash
|
```bash
|
||||||
tea pr comment <number> --comment "<review report>"
|
tea comment --repo TapTap/FastSync <number> "<review report>"
|
||||||
```
|
```
|
||||||
|
|
||||||
## Rules
|
## Rules
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ docker run --rm -v "$PWD:/workspace" -w /workspace gitea.tap-tap.win/taptap/fast
|
|||||||
### If integration tests fail
|
### If integration tests fail
|
||||||
Run locally before pushing:
|
Run locally before pushing:
|
||||||
```bash
|
```bash
|
||||||
python3 -m pytest tests/ -v --tb=short
|
python3 -m pytest tests/integration/ -n 4 --dist=load -m "not setpriv"
|
||||||
```
|
```
|
||||||
|
|
||||||
## Branch Strategy
|
## Branch Strategy
|
||||||
|
|||||||
@@ -314,7 +314,7 @@ ssh user@host 'mkdir -p destination'
|
|||||||
Start the FastSync server:
|
Start the FastSync server:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
./build/server --destination-root /path/to -p 8080
|
./build/server --destination-root /path/to -p 8080 --allow-unauthenticated
|
||||||
```
|
```
|
||||||
|
|
||||||
Then run the client:
|
Then run the client:
|
||||||
@@ -366,7 +366,7 @@ FastSync-native are optional performance or transport extensions.
|
|||||||
./build/client --incremental --checksum /source/ user@host:destination/
|
./build/client --incremental --checksum /source/ user@host:destination/
|
||||||
|
|
||||||
#Preserve supported mode and timestamp metadata
|
#Preserve supported mode and timestamp metadata
|
||||||
./build/client -M /source/ user@host:destination/
|
./build/client --preserve /source/ user@host:destination/
|
||||||
|
|
||||||
#Keep backups of overwritten destination files
|
#Keep backups of overwritten destination files
|
||||||
./build/client --backup --backup-dir backups \
|
./build/client --backup --backup-dir backups \
|
||||||
@@ -643,7 +643,7 @@ Run the unit test binary:
|
|||||||
Run the Python integration suite:
|
Run the Python integration suite:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
python3 -m pytest tests/
|
python3 -m pytest tests/integration/ -n 4 --dist=load -m "not setpriv"
|
||||||
```
|
```
|
||||||
|
|
||||||
For stricter local validation:
|
For stricter local validation:
|
||||||
|
|||||||
Reference in New Issue
Block a user