mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-12-05 11:15:01 +03:00
2.5 KiB
2.5 KiB
Working on AFFiNE Native Playground (for agents)
These rules apply at repository root on the darksky/native-playground branch and topic branches under darksky/np/**. Subdirectory AGENTS.md files (notably blocksuite/native-playground/AGENTS.md) state narrower rules beside the code they govern.
Branch & CI workflow
- Never merge to
canary. Integration lands ondarksky/native-playgroundonly. - PR-less CI on push: Push topic branches matching
darksky/np/**(ordarksky/native-playground) to trigger.github/workflows/native-playground.ymldirectly..github/workflows/build-test.ymlignoresdarksky/native-playgroundpull requests so unrelated legacy jobs stay silent. - Review council gate: Every topic branch requires at least 3 of 4 review council approvals before squash-landing onto
darksky/native-playground. - Performance regression gate: Any CI benchmark metric regressing by more than 10% against the rolling
N-3baseline is routed to the dedicated performance guardian before landing. - Cargo rustflags isolation: Root
.cargo/config.tomlinjects NAPI linker flags (-all_load,-undefined dynamic_lookup,-z nodelete) that Cargo concatenates into nested workspaces. Always build and testblocksuite/native-playgroundwithCARGO_ENCODED_RUSTFLAGS=""in the environment.
Engineering & testing principles
- Global optimum over band-aid patches: Favor clean structural refactoring and bold deletion over minimal-diff workarounds, defensive clutter, or over-abstraction. Delete obsolete helpers, structs, and files outright, and fold single-caller one-way fragments back into their caller when they add indirection without clarity.
- Test names match actual scope: Every test file and test function name must accurately reflect everything it asserts — never append unrelated assertions to a narrowly named test without renaming it to match.
- Table-driven tests: Group related scenarios (geometry/hit-testing, parsers, key sequences, IME cases) into concise table-driven loops rather than proliferating near-identical
#[test]functions.
Keeping rules true
- When a change makes any statement, path, command, or invariant in an
AGENTS.mdfile inaccurate, update thatAGENTS.mdin the same commit. - A new directory with rules of its own gets an
AGENTS.mdand a one-lineCLAUDE.mdcontaining@AGENTS.md. - Keep code, comments, workflows,
AGENTS.md, and commit messages free of internal process-journal jargon.