Read this file at task start and again after context compaction. It applies only inside this package. The parent repository rules still apply.
Preserve BrainVault V1 forever. Optimization, portability, UX, and packaging may change. The same semantic inputs must always produce the same root.
Ask the owner before making a new protocol choice. Never reinterpret a frozen constant, encoding, normalization rule, salt, domain, factor, or wallet path.
bun run check.CLI / workers / native schedulers
|
v
public wallet API
|
v
ordered canonical root fold
|
v
V1 encoding / salt / KDF
src/core/primitives/spec.ts owns frozen bytes, constants, normalization, and salts.src/core/primitives/kdf.ts owns one canonical Argon2id shard.src/core/canonical.ts owns ordered root combination and has no I/O or wallet code.src/core/index.ts owns wallet projections and the public library API.src/cli/index.ts owns interaction and disclosure policy. It may not reimplement V1.Keep lower-level mechanics behind their existing module. A new export or wider visibility is an API change and requires a concrete caller, test, and rationale.
primitives/spec.ts; do not scatter magic values.continue over nested branches. Always use braces.Do not perform style-only rewrites while fixing behavior. Existing public APIs and boolean parameters remain unchanged unless the task explicitly owns them.
NO_COLOR.bun run verify:source proves byte-reproducible builds and
bundled-binary hash equality without running during package installation.workers=1/2/8/32 by multiplier=1/2/10 matrix.Never approve from comments or benchmark output alone. Report the exact command, pass/fail counts, root where relevant, and remaining unverified boundary.
Work only on main and only inside brainvault/. Before a commit run
git diff --check; before push run bun run check.
Use a concise imperative commit subject. Explain why in the body when the reason is not obvious from the diff.
Never publish, tag, replace an archive, or update a frozen historical hash unless the owner explicitly authorizes that release operation.