Download (fresh):
- solveforce_phone_four.py — Download
- SHA‑256:
7c8ee939136181522ccaa33a5e78770d9aa532c68d96e90c81ded1696be9389d
What Step Four adds (precise)
- In‑memory history ring buffer per plugin
- Configurable size:
--history-size N(default256). - Each plugin keeps the last N reads as canonical event objects.
- Configurable size:
- Replay endpoints
GET /history?plugin=<name>&n=100— lastnevents for one plugin.GET /history?plugin=all&n=50— lastnper plugin, returned as a map.- Admin clear (guarded):
POST /admin/clear_history?token=<secret>with body{"plugin":"all"}or{"plugin":"battery"}GET /admin/clear_history?plugin=all&token=<secret>(convenience)
- UI upgrades
- Plugin selector + “History” button (choose
nand fetch). - Works alongside live /events stream and the existing /read buttons.
- Plugin selector + “History” button (choose
Everything from Steps 1–3 remains intact: JSONL exports (--export / --export-dir), dynamic plugin loader (--plugins-dir), admin hot‑reload (/admin/refresh), scaffolder (CLI + HTTP), SSE events (/events), Prometheus metrics (/metrics), and the strictly read‑only posture.
Run it on Android (Termux)
pkg update -y && pkg upgrade -y
pkg install -y python
termux-setup-storage
# optional: for battery plugin
pkg install -y termux-api
Local only (no poller):
python solveforce_phone_four.py --host 127.0.0.1 --port 8080 --poll 0
LAN + exports + dynamic plugins + history 512 events:
mkdir -p /sdcard/solveforce/exports ~/solveforce/plugins
python solveforce_phone_four.py \
--host 0.0.0.0 --port 8080 --poll 5 \
--export --export-dir /sdcard/solveforce/exports \
--plugins-dir ~/solveforce/plugins \
--history-size 512
Open http://127.0.0.1:8080/ui (or http://PHONE_IP:8080/ui on the LAN).
Tap /plugins → pick a plugin → set n → tap History.
Tap Connect Events for the live SSE stream.
New endpoints & data shapes
History (JSON list per plugin):
GET /history?plugin=battery&n=5
[
{
"type": "plugin_read",
"plugin": "battery",
"_ts": "2025-08-19T08:44:11.123456+00:00",
"data": { "...": "..." }
}
]
All plugins at once (map):
GET /history?plugin=all&n=3
{
"battery": [ { ... }, { ... } ],
"net": [ { ... }, { ... } ]
}
Admin clear (guarded):
# Enable admin (example)
python solveforce_phone_four.py --allow-admin --admin-token S3cRet123
# Clear history for one plugin
curl -XPOST "http://127.0.0.1:8080/admin/clear_history?token=S3cRet123" \
-d '{"plugin":"battery"}' -H 'Content-Type: application/json'
# Or clear all via GET
curl "http://127.0.0.1:8080/admin/clear_history?plugin=all&token=S3cRet123"
Design truth: history is ephemeral (in RAM). For durable trails, keep
--exporton. JSONL exports are your append‑only audit spine; history is your fingertip buffer for fast local replay.
Dynamic plugins (unchanged, but now also recorded in history)
- Point at a folder:
--plugins-dir ~/solveforce/plugins - Check the runtime view:
GET /plugins - Hot‑reload safely:
GET /admin/refresh?token=...
Scaffold a plugin on‑device:
python solveforce_phone_four.py --plugins-dir ~/solveforce/plugins --scaffold hello
# creates ~/solveforce/plugins/hello.py
Minimal stub generated:
from solveforce_phone_four import Plugin
class Hello(Plugin):
NAME = "hello"
ORIGIN = "dynamic"
def read(self):
from datetime import datetime, timezone
return {"hello": "hello", "ts": datetime.now(timezone.utc).isoformat()}
PLUGIN = Hello
(Your file will be named hello.py; the class name is capitalized from your plugin name.)
Integrity check (publish this on your page)
sha256sum solveforce_phone_four.py
# Expect: 7c8ee939136181522ccaa33a5e78770d9aa532c68d96e90c81ded1696be9389d
Add this Step Four section to your WordPress page
Step Four — History & Replay (RAM ring buffer)
--history-sizecontrols a per‑plugin deque (default 256).GET /history?plugin=<name>&n=…returns normalized, timestamped reads.GET /history?plugin=all&n=…returns a map of deques.- Admin:
/admin/clear_history(token‑guarded) clears one or all. - Why: durable truth lives in JSONL; fast situational awareness lives in RAM.
What’s next (when you say “go”)
- Step Five — Typed SchemasJSON Schema per plugin + validation +
/schemasendpoint. - Step Six — Network readers (still read‑only)SNMP/NETCONF/gNMI/OpenADR/IEC‑61850/DNP3 as dynamic plugins.
- Step Seven — Auth layerbearer token and/or mTLS for LAN exposure.
Say “Step five” and I’ll ship typed schemas and validation immediately—clean, explicit, recursive, true.
Key terms in plain language
Open a term for a concise explanation of language used on this page.
API
An application programming interface is a defined way for software systems to exchange data or request functions from one another.
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.