Skip to content

A framework for honest collaboration between humans and AI systems

License

Notifications You must be signed in to change notification settings

SonicField/nbs-framework

NBS Framework

A framework for honest collaboration between humans and AI systems.

Documentation

Examples

  • CLAUDE.md - Example project configuration for NBS programming

Foundation

  • Goals - The why. Everything else exists in service of this.

Pillars

Built on the foundation:

Tools

Core Command

  • /nbs - Review and dispatch

Run this after any session. It detects context and dispatches:

  • In investigation/* branch → reviews investigation rigour
  • After /nbs-discovery → verifies the discovery report is complete
  • After /nbs-recovery → reviews the recovery work
  • Otherwise → general NBS review

NBS Teams Tools

Supervisor/worker patterns for multi-agent AI work. See NBS Teams for the full overview.

Commands for setting up and using NBS teams:

For AI-as-supervisor or AI-as-worker roles:

Workflow Commands

Document Tools

Tools for working with documents - analysing, planning, and describing:

See Document Tools for the full overview.

Side Quest Commands

Run this when you want to test a hypothesis before committing to a direction. Creates an isolated investigation branch, designs falsifiable experiments, and produces a verdict (falsified / failed to falsify / inconclusive).

Verification Commands

Operational Tools

  • /nbs-audit - Audit codebase against engineering standards with parallel sub-agents
  • /nbs-poll - Periodic check of chats and workers (heartbeat)
  • /nbs-chat-digest - Summarise chat channel history
  • /nbs-pte - Precise Technical English mode for unambiguous specifications
  • /nbs-natural - Exit Precise Technical English mode

Sub-Projects

Terminal Weathering

Progressive replacement of CPython call protocol paths with C type slot implementations, using NBS principles. Evidence from initial Rust/PyO3 work showed that function body replacement leaves CPython's dispatch overhead intact — the performance-critical layer is the call protocol, which requires direct C access to type slots. The methodology (evidence gates, falsifiability, progressive replacement) is unchanged; the unit of work shifted from function bodies to type slots, and the implementation language from Rust to C against CPython's type API, with ASan, leak analysis, and refcount verification as mandatory correctness gates.

Testing

The framework includes automated tests using a novel AI-evaluates-AI approach, plus unit and integration tests for all C binaries.

make test-unit     # 70+ unit tests across bus, chat, sidecar
make test          # Integration tests (lifecycle, interrupt, auto-archive, + component tests)
make test-all      # Everything

See tests/README.md for details.

Planning

Project plans and progress logs live in planning/:

  • <date>-<project>-plan.md - Terminal goal, completed/outstanding items, decisions
  • <date>-<project>-progress.md - Session-by-session record of what was done

Installation

Prerequisites

  • GCC (C11 support) or Clang
  • GNU Make
  • tmux (runtime dependency for session management)

Quick Start

git clone https://github.com/SonicField/nbs-framework.git
cd nbs-framework
make && make install
./bin/install.sh

That's it. Three commands: clone, build, install.

What Gets Built

make builds all five C components from src/:

Component Binary Purpose
nbs-bus bin/nbs-bus File-based event queue for agent coordination
nbs-chat bin/nbs-chat, bin/nbs-chat-terminal, bin/nbs-chat-remote, bin/nbs-chat-web Chat file protocol (create, send, read, poll, search)
nbs-sidecar bin/nbs-sidecar Background monitor for Claude Code sessions (20 behaviours)
nbs-pty-session bin/pty-session Terminal session manager (create, send, read, wait, kill)
nbs-worker bin/nbs-worker Worker lifecycle management (spawn, status, search, dismiss)

All binaries are compiled with -Wall -Wextra -Wshadow -Werror -std=c11. Assertions are always-on (not gated by NDEBUG).

make install copies binaries to bin/.

./bin/install.sh creates ~/.nbs/ with processed commands and symlinks in ~/.claude/commands/.

For custom install location: ./bin/install.sh --prefix=/path/to/location

Running Tests

make test          # Integration tests for all components
make test-unit     # Unit tests only (bus + chat + sidecar)
make test-all      # Unit tests + integration tests

Build Modes

make debug         # Debug build (-O0 -g, for gdb)
make               # Release build (-O2, assertions ON)

ASan builds are available per-component: make -C src/nbs-sidecar asan

Remaining Bash Scripts

The bin/ directory also contains bash scripts for user-facing tools that are not performance-critical:

  • nbs-claude — Thin wrapper (~300 lines) that launches Claude Code + nbs-sidecar
  • nbs-remote-* — SSH proxy tools for remote operations
  • pty-session-lock — Advisory locking for pty sessions
  • nbs-chat-init — Project initialisation

These are orchestration scripts, not hot-path code. The sidecar, chat, bus, pty-session, and worker — all called per-tick or per-agent-action — are C binaries.

Author

Dr Alex Turner

Licence

MIT

About

A framework for honest collaboration between humans and AI systems

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published