docs: add AGENTS.md with custom-image dependency install rule #27
Reference in New Issue
Block a user
Delete Branch "feat/custom-image-deps-rule"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
AGENTS.mdat repo root with the rule: dependency installation must always use the project's custom Docker image (built from repo-rootDockerfile, same as CI'sgitea.tap-tap.win/taptap/fastsync-ci:v7) — never ad-hoc host package installs. Includes the exactdocker build/docker runcommands plus build/test commands..opencode/agents/architect.mdand.opencode/agents/cmake-expert.md.Notes
AGENTS.md.Review: Approve ✅ (with follow-ups)
Docs-only PR — so accuracy is the whole game. I audited every factual claim against
origin/main, theDockerfile, and the CI workflow: the facts hold up.✅ Verified accurate
lint,build-and-test,sanitizers) usefastsync-ci:v7../build/testsexists (add_executable(tests …));python3 -m pytest tests/is literally what main's CI runs (tests/integration collected via tests/conftest.py). Correctly avoids mentioning ctest (not on main yet).sh -c '… -j$(nproc)'so nproc evaluates inside the container; flags all sound.🟡 Warnings
coverage/valgrindjobs runapt-get install -y lcov/valgrindat workflow runtime; neither package is in the Dockerfile. If both PRs merge: CI will do exactly whatAGENTS.md:20forbids, and this PR's "Dockerfile is complete, no changes needed" audit conclusion stops being true. Nuance: the rule as written targets host/agent environments while #25 installs inside the CI container — a spirit-of-the-rule conflict, not letter-of-the-rule. Resolve by addinglcov+valgrindto the Dockerfile and bumping the image tag (whichever PR lands second), or explicitly scoping the rule.CMakeLists.txt:12-23has a live-DSANITIZER=address|thread|noneoption used by CI.🔵 Suggestions
docker run … sh -c './build/tests && python3 -m pytest tests/') — under this PR's own rule the host may have no toolchain/pytest.-DSTRICT_WARNINGS=ON,-DSANITIZER=address) and that first configure needs network (FetchContent clones xxHash from GitHub).docker runexample leaves root-ownedbuild/artifacts on the host — consider--user "$(id -u):$(id -g)"or a cleanup note. Also offerdocker pull …/fastsync-ci:v7as a faster alternative guaranteeing CI parity.ctestandFASTSYNC_UNDER_VALGRIND=1.README.md:157-167still tells humans tosudo apt installon the host — a one-line "this rule governs automation; see README for manual setup" cross-reference would prevent confusion.Verdict: No critical factual errors; every auditable claim verified. Approve — but please resolve the #25 contradiction (lcov/valgrind in the image) in whichever PR lands second, and consider sweeping up the stale cmake-expert.md lines since you're already touching that file.
Thanks for the thorough review! All points have been addressed in commit
0f9e689:⚠️ Warnings resolved:
-DSANITIZER=address|threadoption (both in Conventions and item #6)💡 Suggestions incorporated:
./build/tests && python3 -m pytest tests/inside the containerdocker pullalternative for faster CI-parity setup--user "$(id -u):$(id -g)"variant to avoid root-owned build artifactsRemaining (out of scope for this PR, tracked for follow-up):
sudo apt installcross-referenceRe-review: Approve ✅ (with follow-ups)
Reviewed the updated PR at commit
0f9e689. All previously identified issues are addressed:✅ What's Fixed
docker build, no pull alternativedocker pull--uservariantdocker runcovering all three🟡 Remaining warnings (docs gaps, not blockers)
All targets link Threads::Threads and ${ZSTD_LIBRARY}; omitsOpenSSL::SSL,OpenSSL::Crypto, andxxhash(present in the snippet and inorigin/main:CMakeLists.txt).elseif(NOT SANITIZER STREQUAL "none")); the snippet silently accepts garbage.-DCMAKE_C_FLAGS="-fsanitize=address ..."manual approach — inconsistent with the-DSANITIZER=option documented everywhere else in the file.AGENTS.mdsaysdocker pull …/fastsync-ci:v7— the registry:v7was built before this PR's Dockerfile update and lacks lcov/valgrind. Image must be rebuilt post-merge. Also, CI'sci.yamlreferences:v7— will need a tag bump or rebuild sync.🔵 Suggestions
addressandthreadfor parity — CI only runsaddress; note that.nix-shell.Verdict: Approve — No critical factual errors. The warnings are documentation consistency gaps (cmake-expert conventions/sanitizer sections), not blockers. The
:v7registry image must be rebuilt post-merge to pick up lcov/valgrind.Re-review items addressed in commit
02ceb68:🟡 Warnings resolved:
Threads::Threads,${ZSTD_LIBRARY},OpenSSL::SSL,OpenSSL::Crypto,xxhash).elseif(NOT SANITIZER STREQUAL "none")error check matching real CMakeLists.txt.-DCMAKE_C_FLAGS=sections with-DSANITIZER=address|thread(kept UBSan manual only since no option exists yet).:v7image — AGENTS.md now notes the prebuilt image reflects the previous Dockerfile state; rebuild from source for newly added packages.💡 Suggestions:
address".The
:v7CI image must be rebuilt post-merge — that's a follow-up CI ops task.