# Letter TALLY PIPELINE

This workspace includes:

- A per-verse Arabic letter tally engine for normalized sources.
- A reproducible workspace audit utility (registry + hashes + TXT validation report).

## Letter Matrix Engine

- Script: `letter_tally_engine.py`
- Input discovery:
    - Scans workspace root for `*_normalized.xlsx`.
    - Ignores Excel lock files starting with `~$`.
- Outputs per source slug:
    - `out/csv/<slug>_LETTER_MATRIX.csv`
    - `out/json/<slug>_LETTER_MATRIX.json`
    - `out/excel/<slug>_LETTER_MATRIX.xlsx`

Run:

```powershell
c:/Users/wolfk/Desktop/Letter TALLY PIPELINE/.venv/Scripts/python.exe letter_tally_engine.py
```

## Reproducible Audit Utility

- Script: `workspace_registry_hash_audit.py`
- Default outputs:
    - `out/audit/workspace_registry.csv`
    - `out/audit/workspace_hash_manifest.sha256`
    - `out/audit/workspace_validation_report.txt`

Run:

```powershell
c:/Users/wolfk/Desktop/Letter TALLY PIPELINE/.venv/Scripts/python.exe workspace_registry_hash_audit.py
```

Optional arguments:

```text
--root <path>           Workspace root to audit (default: script directory)
--output-dir <path>     Output directory (default: out/audit)
--exclude-dir <name>    Additional directory name to exclude (repeatable)
```

## Notes

- `README.md` is auto-generated by `letter_tally_engine.py` each time it runs.
- If you manually edit `README.md`, rerunning the engine will overwrite it.
