Thanks for your interest. Chainblocks is a small, doctrinaire library:
contributions that fit the doctrine in STORY.md are welcomed; contributions
that try to make solution-intelligence something else (a distributed system, a query
engine, a SaaS) are not.
git clone https://github.com/wfredricks/solution-intelligence.git
cd solution-intelligence
npm install
npm testThe full local quality gate:
npm run typecheck
npm test
npm run test:coverage
npm run jsdoc-coverage
npm run build- File an issue first for any non-trivial change. Discuss the design
before writing code. This is especially important because the
bookend documents (
STORY.md,REQUIREMENTS.md,MODEL.md,docs/USE-CASES.md,docs/FEATURES.md) are the contract; code conforms to them, not the other way around. - Branch naming:
feature/<short-description>orfix/<short-description>. - Commit conventions: Conventional Commits —
feat:,fix:,docs:,test:,refactor:,chore:,perf:,build:. - PR target:
main. Major version development uses anextbranch when a major release is in flight.
- Node.js 20.x or 22.x (matches
enginesinpackage.json) - npm (no pnpm, no yarn)
- No system dependencies — solution-intelligence is pure JS/TS with one runtime
dependency (
canonicalize)
npm test # all tests (unit + integration + requirements + scenario)
npm run test:unit # pure-logic tests only
npm run test:integration # tests that touch the filesystem
npm run test:requirements # REQ-CB-* traceability
npm run test:scenario # UC-* end-to-end scenarios
npm run test:coverage # with coverage report; gates at 80%
npm run test:bench # performance benchmarks (run on-demand)Coverage must stay ≥80% (lines, branches, functions, statements) on every PR. JSDoc coverage must stay ≥90% on exported symbols.
Every PR that adds a public API must:
- Add JSDoc to the exported symbol, including:
- One-sentence summary
@param,@returns,@throwsas applicable@requirement REQ-CB-NNNtag pointing at the requirement(s) the symbol satisfies@examplefor non-trivial APIs
- Update
docs/API.mdso every exported symbol has a section. - Add an entry to
CHANGELOG.mdunder[Unreleased]. - Add or update an
examples/entry if the API is non-trivial.
PRs that change the bookend documents (STORY.md, REQUIREMENTS.md,
MODEL.md, docs/USE-CASES.md, docs/FEATURES.md) require explicit
maintainer review. These are the contract.
- TypeScript strict mode is on; do not relax it
- No
anywithout a justification comment (// Why: ...) - No
console.login shipped code — solution-intelligence emits no logs - No magic strings or numbers — use a named
const X = ... as const; - Tests describe real behaviors; do not write tests purely to pad coverage
- Pure-logic ↔ I/O separation:
src/core/is the pure-logic side,src/stores/is where I/O lives. Don't drag I/O into core.
- Ensure CI is green:
typecheck,test,test:coverage,jsdoc-coverage,examples(all jobs in.github/workflows/ci.yml). - Add JSDoc and CHANGELOG entry per above.
- Request review. New features that don't trace to an existing
docs/USE-CASES.mduse case need a discussion of whether the use case should be added. - Squash on merge.
- Distributed-consensus features (multi-writer, gossip, etc.)
- Query / indexing / search of payloads (project to a database)
- Encryption of payloads in core
- Public-blockchain anchoring as a core feature (plugin only)
- A SaaS / hosted-service shim
- New runtime dependencies (the dep list is
canonicalize, period — adding one requires a SECURITY.md update and maintainer sign-off) - Format changes to the on-disk JSONL without a major version bump
The full doctrine is in STORY.md §"What we will not build". If your
contribution is in that list, it does not mean it's a bad idea — it means
it should ship as a separate package.
By contributing, you agree your contributions are licensed under the Apache License 2.0.