Harden entry safety, unify runtime config, bound document unpacking
checks / pytest (push) Has been cancelled
checks / moderation (push) Has been cancelled
checks / node (push) Has been cancelled

Shared-IP safety: entry autoban and entry notifications default off, and a
shared IP is treated as review evidence only. ban_user/ban_cluster refuse
reason=entry_ip_collision (also with the legacy flag set to 1), so token status
and quota are never touched; explicit admin moderation still works.

Reproducible startup: new bot/runtime_config.py and scripts/run.py load the
repository .env (or --env-file) without shell interpolation, normalize
config/DB/upstream aliases, and make the bot, Mini App, gateway, econ cap,
account admin, mk_daemon, entry admin and key notifications resolve the same
paths. "run.py <target> --check" is an offline preflight that starts nothing
and reports placeholders, missing upstream DB and invalid data directories.

Resource limits: aggregate Office decompression, a 400 read-entry cap and a
per-row XLSX cell budget stop early; truncated or corrupt archives are
reported instead of raising.

Deploy and docs: only source-backed systemd units remain, and
deploy/runtime.env.example documents the environment contract including the
0600 session-secret file rules. Removed the destructive
"cp bot/iishko_bot.py bot/grok_bot.py" instruction, the unused generated site/
snapshot and the unsupported iishko-ts staging unit; corrected .env.example,
README, ARCHITECTURE, SECURITY, docs/native-gateway.md and iishko-ts/README.md.

Tests: entry safety, runtime bootstrap, economy paths, file intake, deploy
contract, abilities_guard CLI, and a startup smoke that launches all three
components through scripts/run.py with non-loopback network blocked. Every
config reader, selfcheck included, accepts a UTF-8 BOM.

Verified on this tree: pytest 716 passed + 322 subtests, node --test 73/73,
go test and go vet clean, selfcheck --source-only ok, gitleaks worktree and
history 0 findings. No production or live-split changes are included.
This commit is contained in:
Vlad Gothbreach
2026-10-31 00:39:35 +03:00
parent 52018ca568
commit af292ff15d
52 changed files with 2858 additions and 551 deletions
+8 -6
View File
@@ -2,8 +2,8 @@
Status: **shipped runtime is Python**. `gateway/grok-web-skin.py` plus the
`gateway_*` modules below are the runtime that this tree ships and tests. A Go
native gateway is **not included and is not the default** — nothing here requires
a Go toolchain, and no Go build is part of CI.
native gateway is **not included and is not the default**. The separate Go service
in `moderation/` is built and checked in CI; it is not the gateway.
This page documents operational behaviour, not internals. Authoritative behaviour
is the code in `gateway/` and the root `tests/` suite.
@@ -18,9 +18,9 @@ is the code in `gateway/` and the root `tests/` suite.
| `gateway/gateway_usage.py` | usage accounting shared by HTTP and key paths |
| `gateway/gateway_providers.py` | provider registry (pinning, ownership, rpm bounds) |
| `gateway/gateway_provider_relay.py` | relay of a request to a pinned provider |
| `gateway/gateway_commerce.py` | money routes (wallet/paid offers), disabled by default |
| `gateway/commerce_access.py` | access rules for money/board routes |
| `gateway/community_board.py` | community board: authenticated `/api/activities` (no kill-switch flag) |
| `bot/gateway_commerce.py` | money routes (wallet/paid offers), disabled by default |
| `bot/commerce_access.py` | access rules for money/board routes |
| `bot/community_board.py` | community board: authenticated `/api/activities` (no kill-switch flag) |
| `bot/account_balances.py` | exact read-only balance aggregation shared by HTTP and the key daemon |
## Adaptive RPM
@@ -42,7 +42,9 @@ output are unaffected.
Pinning is opt-in and registry-driven:
```bash
export IISHKO_PROVIDERS_FILE=gateway/providers.example.json
cp gateway/providers.example.json providers.json
# Edit the private copy for your own instance before enabling pinning.
export IISHKO_PROVIDERS_FILE="$PWD/providers.json"
```
* The registry file is operator-owned configuration; `gateway/providers.example.json`