File size: 8,671 Bytes
9425aed
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
# SovereignShell - BOB Command Infrastructure

**Version:** 1.0  
**Trust Deed:** BOB_SOVEREIGN_ENGINEERING_CHARTER_V1  
**Status:** ACTIVE

---

## Overview

SovereignShell is the command-line interface for BOB (Bel Esprit Orchestrator Bot), providing enterprise-grade tools for building, testing, auditing, and deploying verified systems according to the BOB Trust Deed v1.0.

## Core Commands

### bob-build
Compile verified components with optional formal verification.

```bash

bob-build [component] [--verify] [--profile=<profile>]

```

**Options:**
- `--verify`: Run formal verification before build
- `--profile`: Select build profile (dev, prod, audit)

**Examples:**
```bash

bob-build compiler --verify

bob-build runtime --profile=prod

bob-build simulator --verify --profile=audit

```

### bob-test
Execute deterministic test suites with reproducible results.

```bash

bob-test [suite] [--deterministic] [--coverage]

```

**Options:**
- `--deterministic`: Ensure reproducible results (sets seeds, disables parallelism)
- `--coverage`: Generate coverage report

**Examples:**
```bash

bob-test compiler --deterministic

bob-test runtime --coverage

bob-test --deterministic --coverage

```

### bob-audit
Generate cryptographically sealed audit records.

```bash

bob-audit [component] [--format=<json|text>]

```

**Options:**
- `--format`: Output format (json or text)

**Examples:**
```bash

bob-audit compiler

bob-audit runtime --format=text

```

### bob-policy
Query Prolog/Datalog policy rules with optional reasoning traces.

```bash

bob-policy query <rule> [--explain]

```

**Options:**
- `--explain`: Provide reasoning trace

**Examples:**
```bash

bob-policy query "agent_class(oracle, X)"

bob-policy query "route_task(compile, Agent, Priority)" --explain

bob-policy query "verify_deed(deploy_production, Verdict)"

```

### bob-deploy
Deploy only validated and sealed artifacts.

```bash

bob-deploy [target] [--validate] [--seal]

```

**Options:**
- `--validate`: Validate artifacts before deployment (default: true)
- `--no-validate`: Skip validation (NOT RECOMMENDED)
- `--seal`: Generate deployment seal (default: true)
- `--no-seal`: Skip seal generation (NOT RECOMMENDED)

**Examples:**
```bash

bob-deploy production

bob-deploy staging --validate --seal

bob-deploy development

```

### bob-proof
Run formal verification pipeline using multiple proof backends.

```bash

bob-proof [theorem] [--backend=<lean4|ada|coq>]

```

**Options:**
- `--backend`: Proof backend (lean4, ada, or coq)

**Examples:**
```bash

bob-proof optimization_preserves_semantics

bob-proof state_transition_valid --backend=ada

bob-proof compiler_correctness --backend=coq

```

---

## Installation

### Prerequisites

**Required:**
- Bash 4.0+
- sha256sum (coreutils)
- find, grep (standard Unix tools)

**Optional (for specific commands):**
- Rust toolchain (for bob-build, bob-test)
- SWI-Prolog (for bob-policy)
- Lean 4 (for bob-proof --backend=lean4)
- GNAT/SPARK (for bob-proof --backend=ada)
- Coq (for bob-proof --backend=coq)

### Setup

1. **Add to PATH:**
```bash

export PATH="$PATH:/path/to/bobs-control-repo/bob-shell"

```

2. **Make scripts executable:**
```bash

chmod +x bob-shell/*.sh

```

3. **Create aliases (optional):**
```bash

alias bob-build='bash /path/to/bob-shell/bob-build.sh'

alias bob-test='bash /path/to/bob-shell/bob-test.sh'

alias bob-audit='bash /path/to/bob-shell/bob-audit.sh'

alias bob-policy='bash /path/to/bob-shell/bob-policy.sh'

alias bob-deploy='bash /path/to/bob-shell/bob-deploy.sh'

alias bob-proof='bash /path/to/bob-shell/bob-proof.sh'

```

---

## Trust Deed Compliance

All SovereignShell commands enforce BOB Trust Deed v1.0 principles:

### NO_STUBS

- Rejects TODO markers

- Rejects placeholder functions

- Rejects fake implementations

- Rejects empty methods

- Rejects simulated success responses



### SOURCE_INTEGRITY
Every component must document:
- Purpose
- Inputs
- Outputs
- Dependencies
- Verification method

### NO_PYTHON_RUNTIME
- Python prohibited in production execution paths
- Allowed only for build-time tooling
- Enforced by bob-audit and bob-deploy

### DEFENSIVE_ENGINEERING

- Rejects ambiguous requirements

- Asks for missing invariants

- Prefers explicit failure modes

- Documents all assumptions



---



## Workflow Examples



### Complete Build Pipeline



```bash

# 1. Build with verification

bob-build compiler --verify --profile=prod



# 2. Run deterministic tests

bob-test compiler --deterministic --coverage



# 3. Generate audit record

bob-audit compiler --format=json



# 4. Verify policy compliance

bob-policy query "verify_deed(deploy_production, Verdict)"



# 5. Deploy to production

bob-deploy production --validate --seal

```



### Formal Verification Workflow



```bash

# 1. Prove theorem with Lean 4

bob-proof optimization_preserves_semantics --backend=lean4



# 2. Verify contracts with Ada/SPARK

bob-proof state_transition_valid --backend=ada



# 3. Build with verification enabled

bob-build compiler --verify



# 4. Deploy verified artifacts

bob-deploy production

```



### Audit Trail Generation



```bash

# 1. Audit all components

for component in compiler runtime simulator; do

    bob-audit $component --format=json

done



# 2. Generate deployment seal

bob-deploy staging --seal



# 3. Verify policy compliance

bob-policy query "verify_deed(audit_complete, Verdict)" --explain

```



---



## Output Locations



### Build Artifacts

- **Location:** `${REPO_ROOT}/build/`
- **Reports:** `${REPO_ROOT}/build/*-build-report-*.txt`

### Test Results
- **Reports:** `${REPO_ROOT}/test-report-*.txt`
- **Coverage:** `${REPO_ROOT}/coverage/`

### Audit Records
- **Location:** `${REPO_ROOT}/.audit/`
- **Format:** JSON or text
- **Seals:** SHA-256 cryptographic seals

### Deployment Packages
- **Location:** `${REPO_ROOT}/.deploy/`
- **Manifests:** `DEPLOYMENT_MANIFEST.json`
- **Seals:** `DEPLOYMENT_SEAL.txt`

### Proof Certificates
- **Location:** `${REPO_ROOT}/.proofs/`
- **Format:** Text certificates with SHA-256 hashes

---

## Integration with Existing Architecture

### Continuity Integration
SovereignShell respects Continuity protocol:
- Searches `.continuity/decisions.json` before changes
- Logs architectural decisions immediately
- Maintains session state in `.continuity/SESSION_NOTES.md`

### QATAAUM Integration
Compatible with QATAAUM quantum assembly runtime:
- Respects clean-room boundaries
- Uses approved languages only
- Maintains formal verification chain

### Sovereign Stack Integration
Integrates with:
- j-matrix-twin (SUBLEQ attention)
- bob-orchestrator (Lean 4 + Ada + Mamba + Prolog)
- sov-kernel-monster (Fortran quantum simulator)
- sovereign-array (Lean 4 APL algebra)
- Trust Deed governance system
- WORM chain immutability

---

## Troubleshooting

### Command Not Found
```bash

# Ensure scripts are executable

chmod +x bob-shell/*.sh



# Add to PATH

export PATH="$PATH:$(pwd)/bob-shell"

```

### Verification Tools Missing
```bash

# Install Lean 4

curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh



# Install SWI-Prolog

sudo apt-get install swi-prolog



# Install GNAT Community

# Download from https://www.adacore.com/community

```

### Permission Denied
```bash

# Make all scripts executable

find bob-shell -name "*.sh" -exec chmod +x {} \;

```

---

## Security Considerations

### Cryptographic Seals
- All audit records sealed with SHA-256
- Deployment packages include tamper-evident seals
- Proof certificates are machine-checkable

### Trust Deed Enforcement
- Automated checks for Python in production
- Stub detection across codebase
- Documentation validation
- Policy compliance verification

### Audit Trail
- Immutable audit records
- Cryptographic chain of custody
- Explainable policy decisions

---

## Version History

### v1.0 (2026-07-25)
- Initial SovereignShell release
- Six core commands implemented
- Trust Deed v1.0 compliance
- Integration with existing architecture

---

## License

Apache License 2.0 - See repository LICENSE file for details.

---

## Contact

- **Issues:** Repository issue tracker
- **Trust Deed:** See `BOB_TRUST_DEED_V1.md`
- **Architecture:** See `ARCHITECTURE_PAPER_45_PAGES.md`

---

**Built with precision. Verified with proofs. Delivered with pride.**

*SovereignShell - Enterprise Command Infrastructure for BOB*