Step Eleven — Error‑aware cadence, compatibility diffs, per‑route token caps, signed audits, and a one‑liner install

We harden the living system. Your phone‑native gateway now adapts per error class, classifies schema changes, enforces route‑level token caps, and writes an append‑only, signed audit chain. And yes: you get a systemd unit + one‑line installer for Debian/Ubuntu handhelds—because production wants ritual and repeatability.


✅ Fresh artifacts

  • solveforce_phone_eleven.pyDownload
    SHA‑256: 0f983898c00497eb3b7284af9bb686cf8d3674ef40282982cab86806cf8a8fe8
  • Systemd unitDownload
    SHA‑256: 2e13a6eb4db412d2c8b39f73284f867de48a1fbea00689ac9abc9bb7d4eb575e
  • One‑line installer (Debian/Ubuntu)Download
    SHA‑256: ae603d9d5e4ddfbb42635c93622147cb29c2ba019366f22416ff0d2bc88e31a7
  • Policy exampleDownload
    SHA‑256: c8dd96af59fc1160e6296dc2d94d342401fad5f078ff1852309525e17aaf4d3f
  • Rate‑policy exampleDownload
    SHA‑256: 6bf444fd02690921d3288894aed3ac78088d3e9c953b0c966dadfe87b70f50ed
  • Sampling exampleDownload
    SHA‑256: 4ac806047c5bd0afe23a34fdc25fee451e4c41bea94d23b300d57c32efec300a

This consolidates everything from Steps 1–10 and adds the Step‑Eleven powers below.


What’s new (surgical and accountable)

1) Error‑aware adaptive cadence

Each plugin read is classified → OK, TIMEOUT, HTTP_4XX, HTTP_5XX, PARSE, EMPTY, OTHER.
Cadence adjusts per class with separate multipliers (flags shown with defaults):

--poll 5 \
--poll-plugin battery:3 --poll-plugin net:10 \
--poll-backoff-timeout 2.5 \
--poll-backoff-4xx 1.5 \
--poll-backoff-5xx 2.0 \
--poll-backoff-parse 1.7 \
--poll-backoff-empty 1.2 \
--poll-backoff-other 1.5 \
--poll-recover-mult 0.7 \
--poll-backoff-max 300 --poll-min 1
  • On failure: interval = min(interval × backoff_class, max)
  • On success: interval = max(min, interval × recover_mult) (decays toward base/override/sampling)
  • Sampling file still applies jitter per plugin (see below).

2) Schema diffs with compatibility tags

We compute a structural signature (path→type), and on change we emit:

  • compat: "additive" — only new fields appeared
  • compat: "breaking" — a key disappeared or a type changed
  • Event: event: schema_change on SSE with the diff payload
  • Exposed via GET /schema_diffs and GET /schema_diffs?plugin=NAME

This is your early‑warning system for vendor payload drift.

3) Token‑embedded per‑route caps (in addition to per‑plugin caps)

S1 tokens may now carry:

"route_caps":  { "read": 100, "introspect": 60, "events": 6 },
"plugin_caps": { "battery": 60,  "net": 30 }
  • The route cap is enforced per token/IP key within the window_sec of your rate policy.
  • The effective ceiling = min(token route cap, policy(route×roles)).
  • Plugin caps apply on /read?plugin=... and even when reading all.

Mint (admin):

GET /admin/mint?sub=ops&roles=reader,metrics&dur=3600&aud=solveforce-phone\
&plugin_caps=battery:60,net:30&route_caps=read:100,introspect:60&token=ADMIN123

4) Signed, append‑only audit chain

Enable with:

--audit --audit-dir /sdcard/solveforce/audit --device-secret-file /sdcard/solveforce/device.key
  • Each audit line (auth success/failure, policy deny, rate‑limit drop, schema change) is written to audit.jsonl with:
    • chain_prev (hex), chain = SHA‑256(chain_prev + raw_payload), and sig = HMAC(device_secret, chain)
    • Device id = sha256(device_secret)[:16]
  • Hourly rollups to audit_rollup.jsonl (configurable --audit-rollup-sec).

This gives you a simple, verifiable integrity chain—no external KMS required.

5) One‑line production install (systemd)

Run as root on Debian/Ubuntu:

curl -O <your-host>/solveforce_phone_eleven.py  # or copy the file over
sudo bash install_solveforce_phone_eleven.sh ./solveforce_phone_eleven.py

What it does:

  • Creates solveforce user and directories
  • Installs config seeds under /etc/solveforce/
  • Places the Python file under /opt/solveforce/
  • Installs solveforce-phone.service and enables & starts it

You can edit /etc/solveforce/{policy.json,rate_policy.json,sampling.json} and restart:

sudo systemctl restart solveforce-phone.service
journalctl -u solveforce-phone -f

Core routes (truth table, updated)

RouteRole neededEnforced limits
/eventsreaderrate_policy["events"] ∧ token route_caps.events
/metricsmetricsrate_policy["metrics"] ∧ token route_caps.metrics
/admin/*admin + flagrate_policy["admin"] ∧ token route_caps.admin
/read, /historyreaderrate_policy["read"] ∧ token route_caps.read + token plugin_caps.*
/state,/plugins,/schemas,/validate, /whoami,/policies,/authinfo,/schema_diffs,/samplingreaderrate_policy["introspect"] ∧ token route_caps.introspect
/uiopen only with --open-ui in protectedrate_policy["ui"]
/healthopen in protected; locked in strictrate_policy["health"]

Termux (Android) — secure launch recipes

A) Error‑aware polling + auditing (HTTP)

python solveforce_phone_eleven.py \
  --host 0.0.0.0 --port 8080 \
  --plugins-dir ~/solveforce/plugins \
  --history-size 512 --strict-schema \
  --poll 5 \
  --poll-plugin battery:3 --poll-plugin net:10 \
  --sampling-file /sdcard/solveforce/solveforce_sampling_example.json \
  --poll-backoff-timeout 2.5 --poll-backoff-4xx 1.5 --poll-backoff-5xx 2.0 \
  --poll-backoff-parse 1.7 --poll-backoff-empty 1.2 --poll-recover-mult 0.7 \
  --poll-backoff-max 300 --poll-min 1 \
  --auth-mode protected \
  --auth-token READER1:reader \
  --policy-file /sdcard/solveforce/solveforce_policy_example.json \
  --rate-policy-file /sdcard/solveforce/solveforce_rate_policy_example.json \
  --audit --audit-dir /sdcard/solveforce/audit --device-secret-file /sdcard/solveforce/device.key \
  --allow-admin --admin-token ADMIN123

B) TLS + audiences + token route caps

python solveforce_phone_eleven.py \
  --host 0.0.0.0 --port 8443 \
  --tls-cert server.crt --tls-key server.key \
  --auth-mode strict \
  --signing-secret "CHANGE_ME_LONG_RANDOM" \
  --require-aud "solveforce-phone" \
  --policy-file /sdcard/solveforce/solveforce_policy_example.json \
  --rate-policy-file /sdcard/solveforce/solveforce_rate_policy_example.json \
  --sampling-file /sdcard/solveforce/solveforce_sampling_example.json \
  --audit --audit-dir /sdcard/solveforce/audit --device-secret-file /sdcard/solveforce/device.key

WordPress — Step Eleven (drop‑in)

Step Eleven — Error‑aware cadence, compatibility diffs, scoped route caps, and signed audits

  • Adaptive cadence (error‑aware)separate backoffs for timeout/4xx/5xx/parse/empty; recovery decay toward base.
  • Schema diffscompat: additive|breaking; emits schema_change to SSE and exposes /schema_diffs.
  • Token scoperoute_caps (per route) + plugin_caps (per plugin). Intersected with the route/role rate policy.
  • Audit chainappend‑only JSONL with HMAC‑chained records; hourly rollups.
  • Ops ritualssystemd unit + one‑liner installer.
  • PhilosophyResponsibility at the edge. Cadence follows reality; contracts are explicit; the ledger is honest.

Integrity (publish these)

sha256sum solveforce_phone_eleven.py
# 0f983898c00497eb3b7284af9bb686cf8d3674ef40282982cab86806cf8a8fe8

sha256sum solveforce-phone.service
# 2e13a6eb4db412d2c8b39f73284f867de48a1fbea00689ac9abc9bb7d4eb575e

sha256sum install_solveforce_phone_eleven.sh
# ae603d9d5e4ddfbb42635c93622147cb29c2ba019366f22416ff0d2bc88e31a7

sha256sum solveforce_policy_example.json
# c8dd96af59fc1160e6296dc2d94d342401fad5f078ff1852309525e17aaf4d3f

sha256sum solveforce_rate_policy_example.json
# 6bf444fd02690921d3288894aed3ac78088d3e9c953b0c966dadfe87b70f50ed

sha256sum solveforce_sampling_example.json
# 4ac806047c5bd0afe23a34fdc25fee451e4c41bea94d23b300d57c32efec300a

Notes for your framework (Logos Codex alignment)

  • Recursioncadence ↔ error semantics ↔ policy ↔ audit → feeds back into cadence (via rollups).
  • Semanticscompat tags express truth about schema evolution (additive vs. breaking) without opinion.
  • Identitytoken roles/claims → route/plugin caps → reduced to the minimum necessary.
  • Harmonyjitter + adaptive decay avoid phase locking on the network; it “breathes” with the system.

If you want Step Twelve to add schema compatibility labels to tokens (e.g., require “additive‑only” streams) and emit diff summaries into Prometheus, say the word.


Step Twelve — Schema contracts: ACK‑gating, Prometheus diff metrics, and precise handshake – SolveForce Communications


Key terms in plain language

Open a term for a concise explanation of language used on this page.

VoIP

Voice over Internet Protocol carries phone calls over an IP network instead of a traditional analog phone line. Call quality depends on network stability, latency, and traffic management.

Unified Communications (UCaaS)

A cloud-based combination of business calling, messaging, meetings, presence, and collaboration tools managed as one communications service.

SIP Trunking

A service that connects a business phone system to the public telephone network using Internet Protocol, replacing or supplementing traditional phone lines.

Bandwidth

The amount of data a connection can carry in a given time, usually measured in Mbps or Gbps. More bandwidth supports more users, devices, and simultaneous applications.

Latency

The time it takes data to travel between two points. Lower latency improves voice, video meetings, cloud applications, gaming, and other real-time services.

Service-Level Agreement (SLA)

A provider’s written commitment covering service targets such as availability, response time, repair time, and sometimes financial credits when commitments are missed.