Threshold is an MIT-licensed library. Keep changes small, behavior-driven, and covered in both language twins.
cd ts && npm run verify
swift testBoth suites must pass before behavior changes are accepted.
Behavior is defined data-first:
- Update
spec/CONTRACT.mdif the contract changes. - Add or update
vectors/*.json. - Make TypeScript and Swift pass the same vectors.
- Add implementation-specific unit tests for edge cases that vectors cannot express.
Vectors should include:
namesignalspolicyexpected.verdictexpected.bandswhen banding mattersexpected.reasonCodesfor the safety or rule reasons that must appear
Production rules use closures. Vector rules use the declarative fixture format documented in spec/CONTRACT.md.
Before a release:
- Run the commands in
docs/release.md. - Review docs and examples for private app data.
- Confirm no
.envfiles or secrets are tracked. - Tag a SwiftPM-compatible release.