Skip to content

Commit 094959d

Browse files
committed
Document Black Belt CLI relocation into module
1 parent 1e005b5 commit 094959d

1 file changed

Lines changed: 56 additions & 27 deletions

File tree

‎bin/BLACKBELT_CLI.md‎

Lines changed: 56 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ This directory adds a Linux terminal interface for the Black Belt Ethical Audito
88
- `blackbelt.cpp` — C++17 client.
99
- `BlackBeltCLI.java` — Java 21 client.
1010
- `blackbelt-engine.sh` — shared Ollama-compatible engine transport.
11+
- `blackbelt-output.sh` — exact-response output/transport helper.
12+
- `blackbelt-2.c` — alternate C client with local response saving disabled.
1113
- `Makefile` — build/install targets.
1214

1315
The existing BBEA input schema requires `style`, `belt_level`, `jurisdiction`, `conduct_observations`, and `ethical_responses`; optional fields include `legitimacy_hint`, `legal_context`, and `auditor_notes`. The CLI therefore accepts the same structured JSON rather than inventing a second input format.
@@ -22,7 +24,7 @@ From this directory:
2224
make
2325
```
2426

25-
This produces the C/C++ executables and the Java 21 class.
27+
This produces the C/C++ executables and the Java 21 class. The standard build also normalizes the shell scripts in this directory to executable permissions.
2628

2729
## Use
2830

@@ -34,6 +36,14 @@ cat audit.json | ./blackbelt-cpp
3436
cat audit.json | java BlackBeltCLI
3537
```
3638

39+
Interactive C/C++ mode accepts either a natural-language question or a JSON audit object:
40+
41+
```text
42+
Black Belt Ethical Auditor
43+
Ask a question or enter a JSON audit object. Type 'help' or 'quit'.
44+
black-belt>
45+
```
46+
3747
File mode:
3848

3949
```bash
@@ -50,24 +60,24 @@ The default transport targets an Ollama-compatible service at:
5060
http://127.0.0.1:11434/api/generate
5161
```
5262

53-
The default model is `llama3.1:8b`. Override either without recompiling:
63+
The default model is `llama3.2:latest`. Override either without recompiling:
5464

5565
```bash
5666
export BBEA_ENGINE_URL=http://127.0.0.1:11434/api/generate
57-
export BBEA_MODEL=llama3.1:8b
67+
export BBEA_MODEL=llama3.2:latest
5868
```
5969

60-
The Java client connects directly to the engine. The C and C++ clients use the shared `blackbelt-engine.sh` adapter, which packages the canonical JSON request and sends it to the same engine endpoint. This gives all three front ends one engine contract and permits the transport to evolve later into a local Unix socket, TCP service, or direct native library without changing the audit input format.
70+
The C and C++ clients use the shared `blackbelt-engine.sh` adapter, which packages the request and sends it to the same engine endpoint. Natural-language questions are sent without Ollama's JSON-output constraint; structured audit objects retain the established JSON output contract.
6171

6272
## Prompt selection
6373

64-
By default the engine adapter loads:
74+
The repository prompt remains at:
6575

6676
```text
67-
black.belt/sharp/system.prompt
77+
../../../black.belt/sharp/system.prompt
6878
```
6979

70-
A system-wide installation also places the prompt at `/usr/share/blackbelt/sharp/system.prompt`.
80+
when running from this directory. A system-wide installation also places the prompt at `/usr/share/blackbelt/sharp/system.prompt`.
7181

7282
Override it with:
7383

@@ -77,10 +87,16 @@ export BBEA_SYSTEM_PROMPT=/path/to/system.prompt
7787

7888
## Installation
7989

80-
For the requested `/bin` installation:
90+
The CLI source now lives under:
91+
92+
```text
93+
modules/black-belt/bin/
94+
```
95+
96+
From this directory:
8197

8298
```bash
83-
cd bin
99+
make
84100
sudo make install PREFIX=/bin
85101
```
86102

@@ -90,27 +106,40 @@ For a conventional local executable directory instead:
90106
sudo make install PREFIX=/usr/local/bin
91107
```
92108

93-
The repository implementation remains under `/bin`; the installation prefix is configurable for Linux distributions and packaging systems.
109+
The installation prefix is configurable for Linux distributions and packaging systems.
110+
111+
## Output and transport
112+
113+
C and C++ save the exact engine stdout response bytes by default under:
114+
115+
```text
116+
~/.local/state/blackbelt/responses/
117+
```
118+
119+
Use `--save FILE` for an explicit output path or `--no-save` to disable the default local save. `blackbelt-2` is the alternate no-save binary.
120+
121+
Optional network transport is controlled with `BBEA_TRANSPORT`. HTTPS and SSH are supported directly; plaintext HTTP, Telnet, and raw TCP require explicit `BBEA_ALLOW_INSECURE=1`. Encrypted authenticated channels are recommended for network output.
94122

95123
## Architecture
96124

97125
```text
98-
+----------------------+
99-
| Black Belt Web/JSP |
100-
+----------+-----------+
101-
|
102-
v
103-
+------------+ +----------------------+ +-------------------+
104-
| C CLI |--->| |--->| Ollama / Llama |
105-
+------------+ | BBEA Engine Contract | | BBEA model |
106-
| | +-------------------+
107-
+------------+ | JSON in / JSON out |
108-
| C++17 CLI |--->| |
109-
+------------+ +----------------------+
110-
111-
+------------+
112-
| Java 21 CLI|---------------------------> same engine endpoint
113-
+------------+
126+
+----------------------+
127+
| Black Belt Web/JSP |
128+
+----------+-----------+
129+
|
130+
v
131+
+----------------+ +----------------------+ +-------------------+
132+
| C CLI |------>| |------>| Ollama / Llama |
133+
+----------------+ | BBEA Engine Contract | | BBEA model |
134+
| C++17 CLI |------>| | +-------------------+
135+
+----------------+ | JSON audit / |
136+
| blackbelt-2 |------>| natural language |
137+
+----------------+ | question modes |
138+
| Java 21 CLI |------>| |
139+
+----------------+ +----------------------+
140+
141+
Repository location:
142+
modules/black-belt/bin/
114143
```
115144

116-
The existing web module and `sharp` model artifacts remain in place. The CLI intentionally does not duplicate the model prompt or create a second scoring system. It feeds the existing BBEA contract so the terminal and web interfaces can converge on the same AI evaluation path.
145+
The existing web module and `sharp` model artifacts remain authoritative. The CLI does not duplicate the model prompt or create a second scoring system. It feeds the existing BBEA contract so the terminal and web interfaces can converge on the same AI evaluation path.

0 commit comments

Comments
 (0)