Release v2.8.0: Authentic 2x2 homepage UI closeups and zero-synthetic-data market research & zero-PII telemetry suite (Strategies 1A/1B/2A/2B/2C/3A/3B/4B/4C/5A/5B)
This commit is contained in:
1 parent
6aeaf4bc6f
commit
50efacaba5
49 files changed
+748
-188
No files matched your search
@@ -542,6 +542,9 @@ def test_ipld_quant_and_mcp_server() -> None:
|
||||
|
||||
summary_before = get_api_telemetry_summary(tel_db)
|
||||
assert summary_before["total_requests"] == 5
|
||||
assert summary_before["internal_test_requests"] == 5
|
||||
assert summary_before["external_production_requests"] == 0
|
||||
assert summary_before["market_demand_confidence"] == "No data available"
|
||||
assert summary_before["ringbuffer_count"] == 5
|
||||
protocols_seen = {ep["protocol"] for ep in summary_before["endpoints"]}
|
||||
assert protocols_seen == {"rest_v1", "mcp_jsonrpc"}
|
||||
@@ -550,6 +553,7 @@ def test_ipld_quant_and_mcp_server() -> None:
|
||||
assert "/api/v1/quant/instruments/{symbol}" in patterns_seen
|
||||
assert "tools/list" in patterns_seen
|
||||
assert all(ev["isolation_ok"] == 1 for ev in summary_before["recent_audit_events"])
|
||||
assert all(ev["traffic_source"] == "internal_test" for ev in summary_before["recent_audit_events"])
|
||||
|
||||
# Verify logrotate.d file configuration (default 100M = 100MB, compress enabled, rotate >= 12) & no-op when below limit
|
||||
import gzip
|
||||
@@ -587,11 +591,43 @@ def test_ipld_quant_and_mcp_server() -> None:
|
||||
with sqlite3.connect(str(tel_db)) as check_conn:
|
||||
assert check_conn.execute("PRAGMA integrity_check;").fetchone()[0] == "ok"
|
||||
|
||||
s_post, _, _ = dispatch_rest_v1("GET", "/api/v1/status")
|
||||
s_post, _, _ = dispatch_rest_v1(
|
||||
"GET",
|
||||
"/api/v1/status?surface=quant&donate_from=quant&donate_copy=BTC&export_action=quant_csv&free_text_ignored=secret123",
|
||||
traffic_source="external_production",
|
||||
)
|
||||
assert s_post == 200
|
||||
assert get_api_telemetry_summary(tel_db)["total_requests"] == 1
|
||||
summary_ext = get_api_telemetry_summary(tel_db)
|
||||
assert summary_ext["total_requests"] == 1
|
||||
assert summary_ext["external_production_requests"] == 1
|
||||
assert summary_ext["internal_test_requests"] == 0
|
||||
assert summary_ext["market_demand_confidence"] == "No data available"
|
||||
assert summary_ext["recent_audit_events"][0]["traffic_source"] == "external_production"
|
||||
param_map = {(r["param_category"], r["param_value"]): r["external_requests"] for r in summary_ext["parameter_rollups"]}
|
||||
assert param_map.get(("surface", "quant")) == 1
|
||||
assert param_map.get(("donate_from", "quant")) == 1
|
||||
assert param_map.get(("donate_copy", "BTC")) == 1
|
||||
assert param_map.get(("export_action", "quant_csv")) == 1
|
||||
assert all(k[0] != "free_text_ignored" for k in param_map)
|
||||
|
||||
# Also verify second rotation shifts .1.gz -> .2.gz and writes new .1.gz
|
||||
# Verify Strategy 3A (ingest_caddy_route_counts) & Strategy 2C (get_longitudinal_telemetry_summary)
|
||||
from hyperstitionstud_io.db.sqlite_meta import (
|
||||
get_longitudinal_telemetry_summary,
|
||||
ingest_caddy_route_counts,
|
||||
)
|
||||
|
||||
sample_caddy_log = tmp_path / "sample-caddy-access.json"
|
||||
sample_caddy_log.write_text(
|
||||
'{"status":200,"request":{"uri":"/quant/index.html"}}\n'
|
||||
'{"status":200,"request":{"uri":"/zoology/proposal-fund-manager-novel-investment-discovery.pdf"}}\n'
|
||||
'{"status":304,"request":{"uri":"/"}}\n',
|
||||
encoding="utf-8",
|
||||
)
|
||||
c_ing = ingest_caddy_route_counts(sample_caddy_log, telemetry_db_path=tel_db)
|
||||
assert c_ing["matched_hits"] == 3
|
||||
assert sample_caddy_log.read_text(encoding="utf-8") == ""
|
||||
|
||||
# Also verify second rotation shifts .1.gz -> .2.gz and writes new .1.gz, and Strategy 2C aggregates across generations
|
||||
direct_trunc = truncate_telemetry_db_quiescent(tel_db, max_bytes=512, force=False)
|
||||
assert direct_trunc["truncated"] is True
|
||||
assert direct_trunc["quiescent"] is True
|
||||
@@ -599,6 +635,19 @@ def test_ipld_quant_and_mcp_server() -> None:
|
||||
assert Path(f"{tel_db}.1.gz").is_file()
|
||||
assert Path(f"{tel_db}.2.gz").is_file()
|
||||
|
||||
long_sum = get_longitudinal_telemetry_summary(tel_db)
|
||||
assert long_sum["generations_count"] >= 2
|
||||
assert long_sum["total_requests"] == 6
|
||||
assert long_sum["external_production_requests"] == 1
|
||||
assert long_sum["internal_test_requests"] == 5
|
||||
|
||||
# Verify Strategy 1B (compute_corpus_delta_report / --corpus-delta)
|
||||
from hyperstitionstud_io.publishing.highlights import compute_corpus_delta_report
|
||||
|
||||
cdelta = compute_corpus_delta_report()
|
||||
assert cdelta["llm_tokens_used"] == 0
|
||||
assert "deltas_since_baseline" in cdelta and "dossiers_count" in cdelta["deltas_since_baseline"]
|
||||
|
||||
# Verify regression guard: read-only / unwritable SQLite path (sqlite3.OperationalError) never causes 502/crash
|
||||
os.environ["HYPERSTITION_TELEMETRY_DB_PATH"] = "/sys/hyperstition-readonly-telemetry.db"
|
||||
ro_code, _, ro_body = dispatch_rest_v1("GET", "/api/v1/quant/timeseries?symbol=NVDA")
|
||||
|
||||
Reference in new issue
Block a user