Files
encyclopedia-knowledge-graph/docs/FEDORA41-INGGLISH-ISOPSEPHIC-EXEGESIS-PACKAGE-TECHNICAL-QA-AND-OPENROUTER-AUDIT.md
T

104 lines
10 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Technical Audit & Reasoning Report: Fedora 41 `ingglish-isopsephic-exegesis` RPM Package, OpenRouter Endpoint URLs & `google/gemini-4-argon` Mandatory Reasoning Behavior (`v2.17.0`)
**Document ID:** `FEDORA41-INGGLISH-ISOPSEPHIC-EXEGESIS-PACKAGE-TECHNICAL-QA-AND-OPENROUTER-AUDIT`
**Package Under Audit:** `ingglish-isopsephic-exegesis-2.17.0-1.fc41.noarch.rpm` (`/workspace/ingglish-hyperdope-gematria/packaging/`)
**Target Scripts & Configs Inspected:**
- `/workspace/ingglish-hyperdope-gematria/ingglish-aq-archive/scripts/synthesize_news_dossier_openrouter.py` (`/usr/libexec/ingglish-exegesis/scripts/synthesize_news_dossier_openrouter.py`)
- `/workspace/ingglish-hyperdope-gematria/packaging/bundle/scripts/run_exegesis_and_push_fedora41.sh` (`/usr/bin/ingglish-exegesis-push`)
- `/workspace/ingglish-hyperdope-gematria/packaging/rpm/ingglish-exegesis.sysconfig` (`/etc/sysconfig/ingglish-exegesis`)
- `/workspace/ingglish-hyperdope-gematria/packaging/rpm/ingglish-isopsephic-exegesis.spec` & `packaging/build-fedora41-rpm.sh`
---
## 1. Executive Summary of Conclusions
| Audit Question / Topic | Verified Conclusion | Codebase Evidence & Line References |
| :--- | :--- | :--- |
| **1. OpenRouter Gemini 4 Migration Guide: `"google/gemini-4-argon cannot have reasoning turned off"`** | **CONFIRMED COMPATIBLE (Does NOT turn reasoning off; requires `max_tokens` headroom awareness if `google/gemini-4-argon` is selected).**<br/>`ingglish-isopsephic-exegesis` (`synthesize_news_dossier_openrouter.py`) **never** sends any parameter attempting to disable reasoning (`reasoning: {"enabled": false}`, `reasoning: {"effort": "none"}`, `reasoning_effort: "none"`, or `thinking_budget: 0`). However, because OpenRouter counts mandatory reasoning tokens against `"max_tokens": 2800`, using `google/gemini-4-argon` without raising `max_tokens` (e.g. to `8192`) or setting `reasoning: {"effort": "low"}` can exhaust the `2,800`-token cap during internal reasoning. | • `synthesize_news_dossier_openrouter.py` (`lines 36, 507–542`)<br/>• `/etc/sysconfig/ingglish-exegesis` (`line 8`: default model is `google/gemini-2.5-pro`) |
| **2. Supported OpenRouter API Endpoint URLs** | **Default:** `https://openrouter.ai/api/v1/chat/completions`.<br/>**Overrides:** Supports any full Chat Completions `POST` URL set via `OPENROUTER_API_URL` in `/etc/sysconfig/ingglish-exegesis` or `--api-url` on the CLI. Does **not** auto-append `/chat/completions` to a bare base URL (`https://openrouter.ai/api/v1`), so the full endpoint path must be supplied. | • `synthesize_news_dossier_openrouter.py` (`lines 35, 476, 519–533, 653`)<br/>• `run_exegesis_and_push_fedora41.sh` (`lines 96, 190`)<br/>• `ingglish-exegesis.sysconfig` (`line 7`) |
| **3. Fedora 41 `rpmbuild` (`RPM 4.20`) `%install` & `%changelog` Behavior** | **RESOLVED & VERIFIED (`v2.16.0–v2.17.0`).**<br/>Fedora 41's `RPM 4.20` runs `%install` inside `BUILD/%{name}-%{version}-build` rather than `BUILD/`. Staging payload directories in `%{_sourcedir}` (`${STAGE_TOP}/SOURCES`) and adding a dated `%changelog` section resolves both `cp: cannot stat 'skills/*'` and the `%source_date_epoch_from_changelog` warning. | • `packaging/rpm/ingglish-isopsephic-exegesis.spec` (`lines 31–54, 92–94`)<br/>• `packaging/build-fedora41-rpm.sh` (`lines 40–77`) |
| **4. Local Hermes Cronjob Coexistence During Target-System Evaluation** | **PAUSED (`d28b479ec217`).**<br/>Local Hermes cronjob `current-events-isopsephic-exegesis-daily-0000-gmt` (`0 19 * * *` EST / `00:00 UTC`) is paused (`enabled: false, state: paused`) to prevent duplicate commits while evaluating the Fedora 41 package on the target machine. | • Hermes `cronjob_manage` (`job_id: d28b479ec217`, `paused_at: 2026-12-01T08:19:17-05:00`) |
---
## 2. Detailed Reasoning & Code Analysis: `"google/gemini-4-argon cannot have reasoning turned off"`
### 2.1 Question
> *"Per the OpenRouter Gemini 4 Migration Guide, `google/gemini-4-argon` cannot have reasoning turned off." Confirm whether this is or is not the case for `ingglish-isopsephic-exegesis`.*
### 2.2 Exact Request Payload Sent by `ingglish-isopsephic-exegesis`
In `/workspace/ingglish-hyperdope-gematria/ingglish-aq-archive/scripts/synthesize_news_dossier_openrouter.py` (which is packaged into `/usr/libexec/ingglish-exegesis/scripts/synthesize_news_dossier_openrouter.py` inside the Fedora 41 RPM), `call_openrouter_exegesis()` (`lines 507–535`) constructs the HTTP `POST` body as follows:
```python
req_body = json.dumps(
{
"model": model,
"temperature": 0.3,
"max_tokens": 2800,
"messages": [
{"role": "system", "content": system_prompt},
{"role": "user", "content": json.dumps(summary_input, ensure_ascii=False)},
],
}
).encode("utf-8")
```
### 2.3 Step-by-Step Reasoning & Conclusions
1. **`ingglish-isopsephic-exegesis` Does NOT Attempt to Disable Reasoning:**
- The OpenRouter request payload omits `reasoning`, `reasoning_effort`, `include_reasoning`, and `provider.ThinkingConfig`.
- Because it never passes `reasoning: {"enabled": false}`, `reasoning: {"effort": "none"}`, or `thinking_budget: 0`, OpenRouter's restriction that `google/gemini-4-argon` cannot have reasoning turned off is **not violated** by `ingglish-isopsephic-exegesis`.
2. **Default Configured Model Is `google/gemini-2.5-pro`:**
- By default, `/etc/sysconfig/ingglish-exegesis` (`line 8`) and `synthesize_news_dossier_openrouter.py` (`line 36`) set:
`OPENROUTER_MODEL="google/gemini-2.5-pro"`
3. **Important Token-Budget Interaction If You Override `OPENROUTER_MODEL="google/gemini-4-argon"`:**
- While `ingglish-isopsephic-exegesis` does not disable reasoning, `google/gemini-4-argon` always performs internal reasoning before emitting visible `choices[0].message.content`.
- On OpenRouter's `/api/v1/chat/completions` endpoint, `"max_tokens": 2800` (`line 511`) caps the **sum of internal reasoning tokens plus visible completion tokens**.
- If `google/gemini-4-argon` expends e.g. `2,200–2,800` tokens on mandatory internal reasoning for the news-harvest JSON, the visible Markdown output in `choices[0].message.content` (`# Dossier: ...`, `## 1. Semiotic, Archetypal & Hyperstitional Analysis`, and `## 2. Atomic Lexicon & Remarkable Isopsephic Identities`) can be truncated or empty (`finish_reason: "length"`).
- When `content` is empty or missing `"## 1."`, line `538` of `synthesize_news_dossier_openrouter.py` (`if not content or "## 1." not in content:`) falls back to `_build_deterministic_sections_1_and_2(harvest, target_date)`.
- **Recommendation for `google/gemini-4-argon`:** If you configure `OPENROUTER_MODEL="google/gemini-4-argon"` in `/etc/sysconfig/ingglish-exegesis`, either keep `google/gemini-2.5-pro` or raise `max_tokens` (e.g., `8192`–`12000`) / pass `"reasoning": {"effort": "low"}` (which keeps mandatory reasoning enabled at minimal token cost).
---
## 3. Detailed Reasoning & Code Analysis: Supported OpenRouter API Endpoint URLs
### 3.1 Endpoint Resolution Chain in `ingglish-isopsephic-exegesis`
Across the three layers of the Fedora 41 package, the OpenRouter endpoint URL is resolved in the following order:
1. **Environment File (`/etc/sysconfig/ingglish-exegesis`, line `7`):**
```sh
OPENROUTER_API_URL="https://openrouter.ai/api/v1/chat/completions"
```
2. **Systemd Worker Script (`/usr/bin/ingglish-exegesis-push` / `run_exegesis_and_push_fedora41.sh`, lines `96` & `190`):**
```bash
export OPENROUTER_API_URL="${OPENROUTER_API_URL:-https://openrouter.ai/api/v1/chat/completions}"
SYNTH_ARGS=(--harvest "${HARVEST_JSON}" --archive-dir "${ARCHIVE_DIR}" --model "${OPENROUTER_MODEL}" --api-url "${OPENROUTER_API_URL}")
```
3. **Python Synthesizer (`synthesize_news_dossier_openrouter.py`, lines `35` & `653`):**
```python
OPENROUTER_DEFAULT_URL = "https://openrouter.ai/api/v1/chat/completions"
eff_url = (api_url or os.environ.get("OPENROUTER_API_URL") or OPENROUTER_DEFAULT_URL).strip()
```
### 3.2 Supported Endpoint URLs & Format Requirements
- **Primary Canonical URL:** `https://openrouter.ai/api/v1/chat/completions`
- **Custom Gateway / Proxy URLs:** Any `https://` URL that implements the OpenRouter / OpenAI Chat Completions `POST` contract (`Authorization: Bearer <OPENROUTER_API_KEY>`, `Content-Type: application/json`, `HTTP-Referer: https://hyperstitionstud.io`, `X-Title: HyperstitionStudio-Ingglish-Exegesis`) and returns JSON with `choices[0].message.content`.
- **Full Path Requirement:** Because `urllib.request.Request(api_url, data=req_body, ..., method="POST")` (`line 519`) posts directly to `api_url` verbatim without appending `/chat/completions`, `OPENROUTER_API_URL` must always include the full `/api/v1/chat/completions` (or `/v1/chat/completions`) path rather than a base URL like `https://openrouter.ai/api/v1`.
---
## 4. Fedora 41 `RPM 4.20` Build Root-Cause & Resolution Summary (`v2.16.0–v2.17.0`)
1. **Observed Symptom on Fedora 41:**
```text
+ cp -a 'skills/*' /tmp/ingglish-rpmbuild-870344/BUILD/ingglish-isopsephic-exegesis-2.13.0-build/BUILDROOT/usr/share/hermes/skills/
cp: cannot stat 'skills/*': No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.3mWfdI (%install)
RPM build warnings:
%source_date_epoch_from_changelog is set, but %changelog has no entries to take a date from
```
2. **Root Cause:**
- Fedora 41 upgraded `rpm-build` to `RPM 4.20`, which isolates each build inside `%{_topdir}/BUILD/%{name}-%{version}-build` instead of `%{_topdir}/BUILD`.
- Staging files into `${STAGE_TOP}/BUILD/` left `BUILD/ingglish-isopsephic-exegesis-<version>-build/` empty when `%install` ran.
3. **Applied Fix (`v2.16.0–v2.17.0`):**
- `packaging/build-fedora41-rpm.sh` stages `skills/`, `scripts/`, `vendor/`, `sysconfig/`, `systemd/`, and `sysusers.d/` inside `${STAGE_TOP}/SOURCES` and passes `--define "_sourcedir ${STAGE_TOP}/SOURCES"` to `rpmbuild -bb`.
- `packaging/rpm/ingglish-isopsephic-exegesis.spec` references `%{_sourcedir}/skills/*`, `%{_sourcedir}/scripts/*`, `%{_sourcedir}/vendor/*`, `%{_sourcedir}/sysconfig/*`, `%{_sourcedir}/systemd/*`, and `%{_sourcedir}/sysusers.d/*` in `%install`, and includes a dated `%changelog` section synchronized by `version_sync.py`.