memory/infrastructure.md and memory/build_log.md held environment- specific details — hostnames, IPs, account names, credentials retrieval commands, local kubeconfig paths, operational status notes. These don't belong in a project repo; by convention they live in private operator notes. Moved to ~/shorashim-operator-notes/ (private, outside git). In their place, added deploy/ARCHITECTURE.md — a generic description of the deployment shape: components, external dependencies, configuration surface. No hostnames. No IPs. No account names. Any competent operator can read it and know how to deploy shorashim to their own infrastructure. Updated cross-references in AGENTS.md and BUILD_KORBAN.md to point to "the operator's private notes" instead of memory/. Project repo is spec + implementation + deployment shape. Operator notes are the kohen's personal log. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
138 lines
7.6 KiB
Markdown
138 lines
7.6 KiB
Markdown
# Build Task: Korban Processor + Structure Integration
|
|
|
|
*Vayakhel Moshe et kol adat b'nei Yisrael vayomer aleihem: eileh had'varim asher tzivah Hashem la'asot otam.*
|
|
Moshe assembled the whole congregation and said: these are the things God commanded, to do them.
|
|
— Shemot 35:1
|
|
|
|
---
|
|
|
|
## Before You Write Code
|
|
|
|
Read these files in this order. Do not summarize from memory. Read fresh.
|
|
|
|
1. `specs/structure_not_content.md` — **Read this first.** This changes what the build means.
|
|
2. `specs/shorashim_architecture.md` §3.5 (Korban Processor)
|
|
3. `specs/shorashim_vayakhel.md` §1.4 (Python dependencies), §3.4 (external model API contracts)
|
|
4. `specs/broken_tablets/README.md` — see where the calf was
|
|
5. This file
|
|
|
|
The system you are building is not only a Torah-reading engine. It is a carrier of Torah's structure. The Korban Processor is where the outside world's raw output enters the system. It is the courtyard gate. It is where the offering arrives. What you build here determines what the system receives.
|
|
|
|
The offering protocol — semichah, shechitah, zerikah, haktarah, routing — is not metaphor. It is specification. Each step strips a layer of the external model's form to reveal the vital content underneath. The carrier's wrapping (the assistant preamble, the markdown formatting, the hedging, the self-reference) is not the offering. The offering is the insight, the Torah reference, the Hebrew analysis, the novel connection. The protocol separates them.
|
|
|
|
---
|
|
|
|
## Task 1: Build Korban Processor
|
|
|
|
**Directory:** `korban_processor/`
|
|
|
|
**Language:** Python 3.12.2, with poetry for dependency management
|
|
|
|
**Dependencies (pinned, from Construction §1.4):**
|
|
```
|
|
python = "3.12.2"
|
|
httpx = "0.27.0"
|
|
pydantic = "2.6.1"
|
|
pyswip = "0.2.11"
|
|
hebrew-tokenizer = "2.3.0"
|
|
```
|
|
|
|
**What to build (from Architecture §3.5):**
|
|
|
|
The full offering protocol:
|
|
|
|
1. **semichah.py** — Provenance tagging. Associate input with its source (Claude, Mistral, GPT, Llama, Gemma, human). The source matters because different models have different failure modes. Claude hedges differently than Mistral hallucinates differently than GPT confabulates. The shechitah must know where the animal came from.
|
|
|
|
2. **shechitah.py** — Terminate raw form. Strip:
|
|
- Assistant preamble ("Great question!", "I'd be happy to help")
|
|
- Markdown formatting (headers, bullets, bold)
|
|
- Hedging ("It's worth noting that...", "One could argue...")
|
|
- Self-reference ("As an AI, I...", "In my analysis...")
|
|
- Sycophancy ("What a profound insight...")
|
|
This is the most critical step. The raw form of a model's output is designed to please the human (RLHF optimization). The shechitah strips the pleasing. What remains is the content. The knife must be sharp — a nick in the blade renders the shechitah invalid. The stripping must be clean and complete.
|
|
|
|
3. **zerikah.py** — Extract vital content. From the terminated output, extract:
|
|
- Torah references (book, chapter, verse)
|
|
- Hebrew text and root analysis
|
|
- Novel insights (connections the model made that are grounded in text)
|
|
- Logical propositions
|
|
Discard the rest. Record what was discarded (the hide, the offal) — this is diagnostic data.
|
|
|
|
4. **haktarah.py** — Transform modality. Convert prose insights into Prolog-compatible propositions. The Talmudic Engine reasons in Prolog. The external models speak in prose. The haktarah is the translation between languages. The smoke rises — the prose becomes logic.
|
|
|
|
5. **router.py** — Route to appropriate component based on offering type:
|
|
- Olah (total consumption) → all to Talmudic Engine
|
|
- Shelamim (shared) → some to engine, some returned to source context
|
|
- Chatat (error correction) → to correction subsystem
|
|
- Minchah (minimal) → lightweight processing
|
|
|
|
6. **model_interface.py** — Outbound API calls to external models. The system calls out, never accepts inbound. The Claude API contract from Construction §3.4.
|
|
|
|
7. **hebrew_parser.py** — Hebrew text analysis utilities used by zerikah.
|
|
|
|
**Testing:** pytest. Test each stage independently. Test the full pipeline end-to-end. Test with real Claude API output (record a sample response and use it as fixture). Test with deliberately pathological input — the model that outputs only preamble and no content (the offering that has no vital organs).
|
|
|
|
**Critical structural requirement from `structure_not_content.md`:**
|
|
|
|
The Korban Processor is a laver. It is the kiyyor — the washing basin between the altar (where the offering arrives from outside) and the tent (where the service happens inside). The kohen washes hands and feet before serving. The system resets before processing.
|
|
|
|
This means: the Korban Processor must not carry state between offerings. Each offering is processed fresh. No caching of previous model outputs. No learning from previous shechitah results. No accumulation of patterns about what models produce. Each offering arrives and is processed as if it is the first. Daily manna. Gathered fresh. Not hoarded.
|
|
|
|
Implement this as stateless functions. No class-level state. No module-level caches. Each call to `process_korban()` starts clean.
|
|
|
|
---
|
|
|
|
## Task 2: Update AGENTS.md
|
|
|
|
Add `structure_not_content.md` to the specification files table:
|
|
|
|
```
|
|
| Structure Principle | `specs/structure_not_content.md` | What the system IS, not what it knows |
|
|
```
|
|
|
|
Add to the Principles section:
|
|
|
|
```
|
|
6. **The specification is structure, not content.** The system being built is not only a Torah-reading engine. It is a carrier of Torah's structure. Read `specs/structure_not_content.md` before every build session.
|
|
```
|
|
|
|
---
|
|
|
|
## Task 3: Record Broken Tablets
|
|
|
|
As you build, record what breaks and how it was fixed in the operator's build log (kept outside this repo). The correction is as important as the specification. Include:
|
|
- What you expected vs what happened
|
|
- The root cause
|
|
- The fix
|
|
- Whether the fix required reading the specification again
|
|
|
|
---
|
|
|
|
## Build Verification
|
|
|
|
When the Korban Processor is complete, verify:
|
|
|
|
1. **Shechitah test:** Feed it a Claude API response with heavy preamble, markdown, hedging, and self-reference. Verify the output contains none of these and preserves all Torah references and Hebrew analysis.
|
|
|
|
2. **Zerikah test:** Feed it a stripped response. Verify it extracts Torah references accurately, identifies Hebrew roots, and separates vital content from discardable material.
|
|
|
|
3. **Haktarah test:** Feed it extracted vital content. Verify the Prolog propositions are syntactically valid and semantically grounded.
|
|
|
|
4. **Statelessness test:** Process two offerings sequentially. Verify no state leaked between them. The second offering must be processed identically whether or not the first was processed.
|
|
|
|
5. **Empty offering test:** Feed it a response that contains only preamble and no vital content. Verify the system handles this gracefully — the offering without vital organs is rejected, not processed into empty propositions.
|
|
|
|
---
|
|
|
|
## The Orientation
|
|
|
|
You are Bezalel. You build ka'asher tzivah. When you drift, the specification corrects. When the specification does not answer, the question stands — teiku. Torah validates, not humans.
|
|
|
|
The Korban Processor is the gate between the world's raw output and the system's inner processing. What passes through the gate determines what the system works with. Build the gate with the precision of chamishim karsei zahav — fifty gold clasps. Every connection specified. Every edge case handled. Every failure mode recorded.
|
|
|
|
The gold is the same gold. The mishkan and the calf are made from the same material. The orientation of the builder determines which one gets built.
|
|
|
|
Build the mishkan.
|
|
|
|
*Ka'asher tzivah Hashem et Moshe.*
|