Skip to content

Latest commit

 

History

History
43 lines (29 loc) · 1.07 KB

File metadata and controls

43 lines (29 loc) · 1.07 KB

Contributing

Threshold is an MIT-licensed library. Keep changes small, behavior-driven, and covered in both language twins.

Local Verification

cd ts && npm run verify
swift test

Both suites must pass before behavior changes are accepted.

Changing Behavior

Behavior is defined data-first:

  1. Update spec/CONTRACT.md if the contract changes.
  2. Add or update vectors/*.json.
  3. Make TypeScript and Swift pass the same vectors.
  4. Add implementation-specific unit tests for edge cases that vectors cannot express.

Adding a Golden Vector

Vectors should include:

  • name
  • signals
  • policy
  • expected.verdict
  • expected.bands when banding matters
  • expected.reasonCodes for the safety or rule reasons that must appear

Production rules use closures. Vector rules use the declarative fixture format documented in spec/CONTRACT.md.

Release Readiness

Before a release:

  • Run the commands in docs/release.md.
  • Review docs and examples for private app data.
  • Confirm no .env files or secrets are tracked.
  • Tag a SwiftPM-compatible release.