feat(donate,quant,tutorials,citations): implement /donate/, Option 3 stadium-pill navbar, 5-episode /quant/ canvas tour, and passage-encoded deep citations (v2.0.19)
This commit is contained in:
1 parent
1182ba0cf2
commit
2114de35bb
17 files changed
+3270
-13
No files matched your search
@@ -19,6 +19,7 @@ import hashlib
|
||||
import json
|
||||
import math
|
||||
import re
|
||||
import urllib.parse
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
@@ -91,6 +92,51 @@ _DATED_NEWS_RE = re.compile(r"^(\d+)-dossier-news-(\d{4}-\d{2}-\d{2})\.md$")
|
||||
_EQ_LINE_RE = re.compile(r"^-\s+`([^`]+)`\s+\(\"([^\"]+)\"\)\s+—\s+`([^`]+)=\s*(333|666|777)`")
|
||||
|
||||
|
||||
GUILD_ENCYCLOPEDIA_VOLUME_MAP: dict[str, tuple[str, int, int, str]] = {
|
||||
"S1": ("03-machinic-phylum-singularities-s1-to-s5/s1-a-to-z-agentic-ai-to-weights.pdf", 1, 65, "292"),
|
||||
"S2": ("03-machinic-phylum-singularities-s1-to-s5/s2-a-to-z-algorithmic-liquidity-to-volatility.pdf", 1, 66, "193"),
|
||||
"S3": ("03-machinic-phylum-singularities-s1-to-s5/s3-a-to-z-asml-to-wor-masheen.pdf", 5, 67, "137"),
|
||||
"S4": ("03-machinic-phylum-singularities-s1-to-s5/s4-and-s5-a-to-z-carrier-wave-to-wetware.pdf", 1, 67, "211"),
|
||||
"S5": ("03-machinic-phylum-singularities-s1-to-s5/s4-and-s5-a-to-z-carrier-wave-to-wetware.pdf", 3, 69, "777"),
|
||||
"S6": ("04-apparatus-of-capture-s6/s6-a-to-m-acquisition-to-monopoly.pdf", 1, 68, "125"),
|
||||
}
|
||||
|
||||
|
||||
def build_instrument_doc_references(
|
||||
sym: str,
|
||||
ent_eng: str,
|
||||
ent_ing: str,
|
||||
ent_ing_aq: int,
|
||||
guilds: list[str],
|
||||
) -> dict[str, Any]:
|
||||
primary_g = guilds[0] if guilds else "S1"
|
||||
vol_rel, pg_num, dos_num, fallback_q = GUILD_ENCYCLOPEDIA_VOLUME_MAP.get(
|
||||
primary_g,
|
||||
("03-machinic-phylum-singularities-s1-to-s5/s1-a-to-z-agentic-ai-to-weights.pdf", 1, 65, "292"),
|
||||
)
|
||||
dos_file_map = {
|
||||
65: "65-dossier-technocapital-singularity-autoregressive-ai.md",
|
||||
66: "66-dossier-technocapital-singularity-flash-crash-liquidity.md",
|
||||
67: "67-dossier-technocapital-singularity-silicon-war-machine.md",
|
||||
68: "68-dossier-technocapital-singularity-apparatus-of-capture.md",
|
||||
69: "69-dossier-technocapital-singularity-vampiric-memetics.md",
|
||||
}
|
||||
dos_fname = dos_file_map.get(dos_num, "71-dossier-news-2026-11-29.md")
|
||||
dos_prefix = "/zoology/dossiers" if dos_num in dos_file_map else "/archive"
|
||||
q_enc = urllib.parse.quote(ent_ing)
|
||||
return {
|
||||
"encyclopedia_volume_rel": vol_rel,
|
||||
"encyclopedia_deep_link": f"/encyclopedia/{vol_rel}#page={pg_num}&search={q_enc}",
|
||||
"knowledge_graph_deep_link": f"/graph/index.html?select=aq:{ent_ing_aq}",
|
||||
"exemplar_dossier_deep_link": f"{dos_prefix}/{dos_fname}#:~:text={urllib.parse.quote(fallback_q)}",
|
||||
"rest_api_deep_link": f"/api/v1/dossiers/{dos_num}?highlight={urllib.parse.quote(fallback_q)}",
|
||||
"verbatim_citation_passage": (
|
||||
f"{sym} ({ent_eng} -> `{ent_ing}` = {ent_ing_aq}) indexed in Guilds [{', '.join(guilds)}] "
|
||||
f"and Volume `{vol_rel.split('/')[-1]}` (p.{pg_num}, Dossier {dos_num})."
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
def resolve_tradingview_target(symbol: str) -> dict[str, str]:
|
||||
tv_sym, tv_url = TRADINGVIEW_SYMBOL_MAP.get(
|
||||
symbol.upper(),
|
||||
@@ -155,12 +201,16 @@ def _extract_dated_news_dossiers(archive_dir: Path) -> dict[str, dict[str, Any]]
|
||||
for tv in token_vals:
|
||||
if tv in S1_S6_SIGNATURE_RINGS:
|
||||
coords_hit.add(tv)
|
||||
ring_hits = sorted(set(tv for tv in token_vals if tv in S1_S6_SIGNATURE_RINGS))
|
||||
eqs.append({
|
||||
"ing": ing_p,
|
||||
"eng": eng_p,
|
||||
"breakdown": breakdown.strip(),
|
||||
"target": tgt_s,
|
||||
"ring_coordinates": sorted(set(tv for tv in token_vals if tv in S1_S6_SIGNATURE_RINGS)),
|
||||
"ring_coordinates": ring_hits,
|
||||
"dossier_deep_link": f"/archive/{p.name}#:~:text={urllib.parse.quote(ing_p[:32])}",
|
||||
"api_highlight_link": f"/api/v1/dossiers/{dos_num}?highlight={urllib.parse.quote(ing_p[:24])}",
|
||||
"graph_hub_links": [f"/graph/index.html?select=aq:{c}" for c in ring_hits] + [f"/graph/index.html?select=aq:{tgt_s}"],
|
||||
})
|
||||
|
||||
for c_ring in S1_S6_SIGNATURE_RINGS:
|
||||
@@ -600,6 +650,7 @@ def build_quant_timeseries_bundle(
|
||||
regime_series=daily_regimes,
|
||||
)
|
||||
tv_info = resolve_tradingview_target(sym)
|
||||
doc_refs = build_instrument_doc_references(sym, ent_eng, ent_ing, ent_ing_aq, item["guilds"])
|
||||
inst_obj: dict[str, Any] = {
|
||||
"symbol": sym,
|
||||
"entity_eng": ent_eng,
|
||||
@@ -610,6 +661,7 @@ def build_quant_timeseries_bundle(
|
||||
"guilds": item["guilds"],
|
||||
"tradingview_symbol": tv_info["tradingview_symbol"],
|
||||
"tradingview_url": tv_info["tradingview_url"],
|
||||
"doc_references": doc_refs,
|
||||
"composite_score": comp_score,
|
||||
"structural_vector": struct_vec,
|
||||
"timeseries_moments": ts_moments,
|
||||
@@ -684,6 +736,13 @@ def build_quant_timeseries_bundle(
|
||||
"roster_slot": row.get("roster_slot"),
|
||||
"base_composite_score": base_eti,
|
||||
"live_timeseries_score": live_eti,
|
||||
"doc_references": {
|
||||
"encyclopedia_volume_rel": "07-ecological-trophic-index-and-assemblage-builds/a-to-z-apex-predator-to-tier-list.pdf",
|
||||
"encyclopedia_deep_link": f"/encyclopedia/07-ecological-trophic-index-and-assemblage-builds/a-to-z-apex-predator-to-tier-list.pdf#page=1&search={urllib.parse.quote(g_prefix)}",
|
||||
"knowledge_graph_deep_link": f"/graph/index.html?select=build:{g_prefix}",
|
||||
"exemplar_dossier_deep_link": f"/zoology/tier-list-technocapital-assemblage-builds.pdf#page=1&search={urllib.parse.quote(g_prefix)}",
|
||||
"rest_api_deep_link": f"/api/v1/zoology/tier-list?build_filter={urllib.parse.quote(g_prefix)}",
|
||||
},
|
||||
"structural_vector": b_struct,
|
||||
"timeseries_moments": b_ts,
|
||||
"lens_projections": apply_all_lenses(b_struct, b_ts, live_eti, active_lenses),
|
||||
|
||||
Reference in new issue
Block a user