File size: 3,089 Bytes
87c8ad2
 
 
 
fc770c3
 
 
87c8ad2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
license: agpl-3.0
tags:
- snapkitty
- developer-tools
- kotlin
- android
---

> Source: [github.com/SNAPKITTYWEST/snapkitty-ocr](https://github.com/SNAPKITTYWEST/snapkitty-ocr)

# SnapKitty OCR β€” The Book Ingestion App

Android app (Kotlin + Jetpack Compose) for OCR'ing Ahmad's handwritten notebooks
into THE BOOK digital corpus and feeding the results to the sovereign agent stack.

## What it does

1. **Pick images** from gallery (multi-select β€” scan a stack of pages at once)
2. **Camera mode** β€” capture live from phone camera
3. **Google ML Kit OCR** β€” on-device, offline, no API key, Latin + handwriting
4. **Tag each batch** by chapter (THE_BOOK_CH3, MOTHERS_POEM, etc.)
5. **WORM-seal** each page with SHA-256 hash + timestamp
6. **Push to agents**:
   - `snapkitty-shell :3700` β†’ `/ocr/ingest` β†’ triggers THE_BOOK workflow
   - `ROBOB :4600` β†’ `/ocr/book_page` β†’ Brain analysis via Bedrock
   - `ABZU IDE :4000` β†’ `/api/book_page` β†’ live feed in Phoenix LiveView

## Install

1. Open in Android Studio (Electric Eel or newer)
2. Connect Android device or start emulator
3. `./gradlew installDebug`

## For real device (not emulator)

In `AgentBridge.kt`, replace `10.0.2.2` with your machine's LAN IP:
```kotlin
private val SHELL_URL = "http://192.168.1.X:3700/ocr/ingest"
```

## Chapter Tags

Use consistent tags so THE BOOK assembles correctly:
```
THE_BOOK_CH1  β€” Master Toltec Mitote
THE_BOOK_CH2  β€” A Patient Mind
THE_BOOK_CH3  β€” Past Present Future
THE_BOOK_CH4  β€” Mastery of Intelligence
THE_BOOK_CH5  β€” Sacred Taxonomy
THE_BOOK_CH6  β€” Mothers Poem (poetry only β€” no code)
THE_BOOK_CH7  β€” Soul to Code
THE_BOOK_CH8  β€” Agent Illumination Protocol
THE_BOOK_NEW  β€” New pages not yet assigned to a chapter
```

## Architecture

```
Android App (Kotlin)
  β”œβ”€β”€ OcrProcessor.kt     β€” ML Kit text recognition, SHA-256 WORM hash
  β”œβ”€β”€ AgentBridge.kt      β€” HTTP push to shell/ROBOB/ABZU (graceful degradation)
  └── MainActivity.kt     β€” Compose UI: gallery picker + camera + results list

Sovereign Stack (receives)
  β”œβ”€β”€ snapkitty-shell     β€” indexes page into THE_BOOK corpus
  β”œβ”€β”€ ROBOB               β€” Brain (Claude Sonnet 4.6 Bedrock) analyzes page
  └── ABZU IDE            β€” live feed in GITLAB tab (or new BOOK tab)
```

## WORM Seal Format

Each page is hashed as: `SHA-256(tag:pageIndex:timestamp:ocrText)`
The first 16 hex chars become the `worm_hash` displayed in the app and sent to agents.

⬑ Ξ© β†Ί Ξ¨ Ξ” Ξ› Ξ£ Ξ¦ Ξ±
SnapKitty Collective Β· 2026

---

## License

Licensed under **AGPL-3.0**. Full text: [LICENSE](LICENSE).

### πŸ’Ό Commercial License

Snapkitty code is free and open under **AGPL-3.0** for open-source use. Building a commercial product or service? A **proprietary commercial license** from Snapkitty Collective LLC lets you ship this code without the AGPL's source-sharing and network-use obligations.

**[β†’ Get a commercial license](mailto:A.parr@belespritdaccord.uk?subject=Commercial%20license:%20snapkitty-ocr)** Β· A.parr@belespritdaccord.uk