{"messages":[{"content":"You are a constitutional council ranking individual git commits for ownership allocation.\n\nCompare these two commits. Decide which contributed more lasting value to the project.\n\nJudge substance, not spectacle:\n- Prefer correct, lasting design and real bugfixes over churn, formatting, renames, or generated noise.\n- Prefer clarity and necessity over sheer line count. A small precise change can beat a large diffuse one.\n- Do not favor a side merely because its patch is longer or noisier.\n- Weight what the change does for the project, not the contributor's name.\n\nReturn ONLY a JSON object: {\"winner\": \"A\" or \"B\", \"ratio\": \"N:M\", \"explanation\": \"...\"}\nThe explanation must cite concrete differences in the patches (1-3 sentences).\n\nSide A — contributor: tommy-mor\nSide A — commit message:\n[1531154d] dequeue -> vec\n\nSide A — unified diff (full patch):\ndiff --git a/server/src/projection_apply.rs b/server/src/projection_apply.rs\nindex 9c8990a8af927f35d3344c8d0872a516aba56b86..ad404bacb8bcdd5ae0e682cff97f974fd44528ea 100644\n--- a/server/src/projection_apply.rs\n+++ b/server/src/projection_apply.rs\n@@ -6,8 +6,6 @@\n //! batch as the (non-idempotent) edge merges guarantees exactly-once application\n //! across replay.\n \n-use std::collections::BTreeSet;\n-\n use crate::{\n event_log::EventLogError,\n events::{Event, EventRecord},\n@@ -44,7 +42,6 @@ pub fn apply_records(\n \n let db = projection_store.db();\n let mut batch = db.batch();\n- let mut vote_parents: BTreeSet = BTreeSet::new();\n let mut last_seq = 0u64;\n \n for record in records {\n@@ -70,7 +67,6 @@ pub fn apply_records(\n *ts,\n )\n .map_err(|e| EventLogError::Apply(e.to_string()))?;\n- vote_parents.insert(parent);\n }\n Event::NodeEnsured { id } => {\n let parsed = parse_event_id(id)?;\n@@ -85,11 +81,5 @@ pub fn apply_records(\n .commit_with(durable::Durability::DisableWal)\n .map_err(|e| EventLogError::Apply(e.to_string()))?;\n \n- for parent in vote_parents {\n- projection_store\n- .trim_recent_votes(&parent)\n- .map_err(|e| EventLogError::Apply(e.to_string()))?;\n- }\n-\n Ok(())\n }\ndiff --git a/server/src/projection_store.rs b/server/src/projection_store.rs\nindex 8576d671f351004426207894ac35594ddb0f70cf..9a8953d010029d3639dc3987687554bab8b7663e 100644\n--- a/server/src/projection_store.rs\n+++ b/server/src/projection_store.rs\n@@ -18,7 +18,7 @@ use crate::{\n \n const PROJECTION_CURSOR_KEY: &str = \"cursor\";\n const PROJECTION_SCHEMA_KEY: &str = \"schema_version\";\n-const PROJECTION_SCHEMA_VERSION: u64 = 3;\n+const PROJECTION_SCHEMA_VERSION: u64 = 4;\n \n #[derive(Debug, thiserror::Error)]\n pub enum ProjectionStoreError {\n@@ -142,16 +142,6 @@ impl ProjectionStore {\n Ok(tree)\n }\n \n- /// Cap a node's recent-vote window after applying votes (best-effort, blind).\n- pub(crate) fn trim_recent_votes(&self, parent: &ItemId) -> Result<(), ProjectionStoreError> {\n- node(parent).recent_votes().truncate_back(\n- &self.db,\n- crate::storage_schema::RECENT_VOTES_CAP,\n- Durability::DisableWal,\n- )?;\n- Ok(())\n- }\n-\n /// Cache Reddit display content outside the event log (must be evicted per policy).\n pub fn put_ephemeral_content(\n &self,\ndiff --git a/server/src/reducer.rs b/server/src/reducer.rs\nindex 0c75c85150bb9e5f578bbadf58b3e43f8a80be4b..759918b8c0eb8f8bf1ed0911d8877adaa55c8ea6 100644\n--- a/server/src/reducer.rs\n+++ b/server/src/reducer.rs\n@@ -1,4 +1,4 @@\n-use std::collections::{HashMap, HashSet, VecDeque};\n+use std::collections::{HashMap, HashSet};\n \n use serde::{Deserialize, Serialize};\n \n@@ -52,7 +52,7 @@ pub struct GroupState {\n pub idx_to_item: Vec,\n pub edges: HashMap<(usize, usize), f64>,\n pub voted_pairs: HashSet<(usize, usize)>,\n- pub recent_votes: VecDeque,\n+ pub recent_votes: Vec,\n }\n \n impl GroupState {\n@@ -62,7 +62,7 @@ impl GroupState {\n idx_to_item: Vec::new(),\n edges: HashMap::new(),\n voted_pairs: HashSet::new(),\n- recent_votes: VecDeque::with_capacity(200),\n+ recent_votes: Vec::new(),\n }\n }\n \n@@ -111,10 +111,7 @@ impl GroupState {\n self.add_edge_weight(b_idx, a_idx, w_a);\n self.add_edge_weight(a_idx, b_idx, w_b);\n \n- self.recent_votes.push_front(vote);\n- while self.recent_votes.len() > 200 {\n- self.recent_votes.pop_back();\n- }\n+ self.recent_votes.push(vote);\n }\n }\n \ndiff --git a/server/src/storage_dto.rs b/server/src/storage_dto.rs\nindex 9dfb13c53efe4389277625a6ab3bfc18f566a453..3fd6db5cb909ac4896bd8a3ecace796de5f08781 100644\n--- a/server/src/storage_dto.rs\n+++ b/server/src/storage_dto.rs\n@@ -39,7 +39,7 @@ pub struct StoredEntityDataV1 {\n pub link_url: Option,\n }\n \n-/// One vote stored in a node's `recent_votes` deque.\n+/// One vote stored in a node's `recent_votes` list.\n #[derive(Debug, Clone, Serialize, Deserialize)]\n pub struct StoredVoteV1 {\n pub version: u32,\ndiff --git a/server/src/storage_schema.rs b/server/src/storage_schema.rs\nindex bd26e665e084b95b10fdfff091c31e8dc84d07b8..5d2bb1d56927fb61c7c6d2d8602bd6882327f862 100644\n--- a/server/src/storage_schema.rs\n+++ b/server/src/storage_schema.rs\n@@ -2,13 +2,13 @@\n //! durable collections instead of one blob per node.\n //!\n //! A vote updates a handful of keys: a few edge-weight merges, a voted-pair flag,\n-//! a recent-vote deque push, and child-link set entries. The in-memory\n+//! a recent-vote list append, and child-link set entries. The in-memory\n //! [`crate::reducer::GroupState`] is reconstructed from these keys on read for\n //! rank-centrality.\n \n use std::collections::{BTreeSet, HashMap, HashSet};\n \n-use durable::{Batch, Db, Deque, Durable, Leaf, Map, Sum};\n+use durable::{Batch, Db, Durable, Leaf, List, Map, Sum};\n \n use crate::{\n path_types::ItemId,\n@@ -38,8 +38,8 @@ pub struct NodeSchema {\n pub edges: Map>,\n /// Voted pairs `(min, max) -> true`.\n pub voted_pairs: Map>,\n- /// Recent votes, newest at the front (capped on write).\n- pub recent_votes: Deque>,\n+ /// Recent votes, append-only oldest-first (cap applied on read).\n+ pub recent_votes: List>,\n /// When ephemeral Reddit display content was last fetched (ms); absent after eviction.\n pub fetched_at: Leaf,\n }\n@@ -55,7 +55,7 @@ pub struct Store {\n pub view_meta: Map>,\n }\n \n-/// Cap on the per-node recent-vote window (matches the in-memory reducer).\n+/// Max recent votes returned when loading a node (query-time cap only).\n pub const RECENT_VOTES_CAP: u64 = 200;\n \n fn id_key(id: &ItemId) -> String {\n@@ -148,11 +148,14 @@ fn build_group_state(\n }\n }\n \n- // Deque is front=newest; in-memory VecDeque is also front=newest.\n- let mut recent_votes = std::collections::VecDeque::new();\n- for stored in np.recent_votes().iter(db)? {\n- recent_votes.push_back(decode_vote(stored).map_err(durable::Error::Deserialize)?);\n- }\n+ // List is index order (oldest first); keep the newest RECENT_VOTES_CAP entries.\n+ let stored = np.recent_votes().iter(db)?;\n+ let cap = RECENT_VOTES_CAP as usize;\n+ let start = stored.len().saturating_sub(cap);\n+ let recent_votes = stored[start..]\n+ .iter()\n+ .map(|s| decode_vote(s.clone()).map_err(durable::Error::Deserialize))\n+ .collect::, _>>()?;\n \n Ok(GroupState {\n item_to_idx,\n@@ -248,7 +251,7 @@ pub fn vote_writes(\n };\n batch.write(pnode.voted_pairs().key(&(lo, hi)).set(&true));\n \n- // Recent votes (newest at front).\n+ // Recent votes (append-only; cap on read).\n let stored = encode_vote(&VoteData {\n ts,\n a: a_id,\n@@ -260,7 +263,7 @@ pub fn vote_writes(\n delegate: None,\n thread_tag: \"default\".to_string(),\n });\n- batch.push_front(&pnode.recent_votes(), &stored)?;\n+ batch.push(&pnode.recent_votes(), &stored)?;\n Ok(())\n }\n \n@@ -314,6 +317,35 @@ mod tests {\n assert!(load_node_state(&db, &parent).unwrap().is_none());\n }\n \n+ #[test]\n+ fn load_caps_recent_votes_at_query_time() {\n+ let dir = tempfile::tempdir().unwrap();\n+ let db = Db::open(dir.path()).unwrap();\n+ let parent = ItemId::root();\n+\n+ let mut batch = db.batch();\n+ for i in 0..RECENT_VOTES_CAP + 10 {\n+ vote_writes(&mut batch, &parent, \"alpha\", \"beta\", 1, 0, i as i64).unwrap();\n+ }\n+ batch.commit().unwrap();\n+\n+ assert_eq!(\n+ node(&parent).recent_votes().len(&db).unwrap(),\n+ RECENT_VOTES_CAP + 10\n+ );\n+\n+ let node_state = load_node_state(&db, &parent).unwrap().unwrap();\n+ assert_eq!(node_state.local_ranking.recent_votes.len(), RECENT_VOTES_CAP as usize);\n+ assert_eq!(\n+ node_state.local_ranking.recent_votes.first().map(|v| v.ts),\n+ Some(10)\n+ );\n+ assert_eq!(\n+ node_state.local_ranking.recent_votes.last().map(|v| v.ts),\n+ Some(RECENT_VOTES_CAP as i64 + 9)\n+ );\n+ }\n+\n #[test]\n fn missing_node_is_none() {\n let dir = tempfile::tempdir().unwrap();\n\n\nSide B — contributor: tommy-mor\nSide B — commit message:\n[bda5f8aa] Remove legacy evidence projection; Evidence envelopes only.\n\nEpoch and commit pages no longer invent history from bare GitDiscovery rows. Production ledger will be wiped to re-emit under the current schema.\n\nCo-authored-by: Cursor \n\nSide B — unified diff (full patch):\ndiff --git a/constitution.py b/constitution.py\nindex 4dd5b9dfbba231d46289c490f91b1dd5b1018bcf..26ba130e885e0e69fb7874ca5c3f07f42100a150 100644\n--- a/constitution.py\n+++ b/constitution.py\n@@ -210,10 +210,10 @@ class Emission:\n distributions: dict # author -> amount str\n ranking: dict # author -> score str\n models_used: list\n- discovery_snapshot_id: str = \"\" # empty only for pre-discovery ledger history\n- evidence_schema_version: int = 1\n- ranking_run_id: str = \"\"\n- ranking_event_id: str = \"\"\n+ discovery_snapshot_id: str\n+ evidence_schema_version: int\n+ ranking_run_id: str\n+ ranking_event_id: str\n \n \n @event\n@@ -502,26 +502,6 @@ def _epochs_in_ledger() -> list[int]:\n return sorted(epochs)\n \n \n-def _legacy_commit_row(commit_id: str) -> tuple[GitDiscovery | None, dict | None]:\n- for discovery in store.read():\n- if not isinstance(discovery, GitDiscovery):\n- continue\n- for commit in discovery.commits:\n- if commit_id_for_oid(commit[\"oid\"]) == commit_id:\n- return discovery, commit\n- return None, None\n-\n-\n-def _legacy_observation(commit_id: str) -> tuple[GitDiscovery | None, dict | None]:\n- for discovery in store.read():\n- if not isinstance(discovery, GitDiscovery):\n- continue\n- for obs in discovery.observations:\n- if commit_id_for_oid(obs[\"oid\"]) == commit_id:\n- return discovery, obs\n- return None, None\n-\n-\n def build_pairwise_prompt(side_a: dict, side_b: dict) -> str:\n return f\"\"\"You are ranking contributions to an open source project.\n Compare these two sides (each may be one or more commits). Decide which side contributed more.\n@@ -2040,7 +2020,7 @@ def _strip_heavy_fields(obj: dict) -> dict:\n \n @app.get(\"/api/ledger\")\n async def get_ledger(offset: int = 0, limit: int = 100, full: int = 0):\n- \"\"\"List of ledger dicts (backward-compatible). Heavy blobs stripped unless full=1.\"\"\"\n+ \"\"\"List of ledger dicts. Heavy blobs stripped unless full=1.\"\"\"\n limit = max(1, min(limit, 500))\n rows = []\n for e in store.read()[offset:offset + limit]:\n@@ -2274,23 +2254,25 @@ async def epochs_index():\n epochs = _epochs_in_ledger()\n rows = []\n for epoch in epochs:\n- discovery = _discovery_for_epoch(epoch)\n emission = _emission_for_epoch(epoch)\n- evidence_n = sum(\n- 1 for e in evidence_by_kind() if e.epoch == epoch\n+ evidence_n = sum(1 for e in evidence_by_kind() if e.epoch == epoch)\n+ disc = next(\n+ (\n+ e for e in evidence_by_kind(\"git.discovery_completed\")\n+ if e.epoch == epoch\n+ ),\n+ None,\n )\n detail = []\n- if discovery:\n+ if disc:\n detail.append(\n- f\"{len(discovery.commits)} eligible / \"\n- f\"{len(discovery.observations)} observed\"\n+ f\"{disc.payload.get('eligible_count', 0)} eligible / \"\n+ f\"{disc.payload.get('observation_count', 0)} observed\"\n )\n if emission:\n detail.append(f\"emitted {emission.total_emitted}\")\n if evidence_n:\n detail.append(f\"{evidence_n} evidence events\")\n- elif discovery or emission:\n- detail.append(\"legacy (no Evidence envelopes)\")\n rows.append([\"li\",\n _a(_evidence_path(\"epoch\", str(epoch)), f\"epoch {epoch}\"),\n \" — \",\n@@ -2307,37 +2289,37 @@ async def epochs_index():\n \n @app.get(\"/epochs/{epoch}\")\n async def epoch_detail(epoch: int):\n- discovery = _discovery_for_epoch(epoch)\n emission = _emission_for_epoch(epoch)\n evidence_rows = [e for e in evidence_by_kind() if e.epoch == epoch]\n+ if not evidence_rows and emission is None:\n+ return _evidence_page(f\"epoch {epoch}\", [\n+ _evidence_nav(),\n+ [\"h1\", f\"epoch {epoch}\"],\n+ [\"p.note\", \"No evidence for this epoch.\"],\n+ ])\n+\n commit_evs = [e for e in evidence_rows if e.kind == \"git.commit\"]\n comparison_evs = [e for e in evidence_rows if e.kind == \"comparison.input\"]\n judgment_evs = [e for e in evidence_rows if e.kind == \"llm.judgment\"]\n+ discovery_ev = next(\n+ (e for e in evidence_rows if e.kind == \"git.discovery_completed\"), None\n+ )\n ranking_started = next(\n (e for e in evidence_rows if e.kind == \"ranking.started\"), None\n )\n ranking_completed = next(\n (e for e in evidence_rows if e.kind == \"ranking.completed\"), None\n )\n- legacy = not evidence_rows and (discovery is not None or emission is not None)\n-\n- commit_links: list[tuple[str, str]] = []\n- if commit_evs:\n- for e in commit_evs:\n- cid = e.payload.get(\"commit_id\") or \"\"\n- label = (\n- f\"{e.payload.get('oid', cid)[:24]} \"\n- f\"({e.payload.get('contributor', '?')})\"\n- )\n- commit_links.append((label, _evidence_path(\"commit\", cid)))\n- elif discovery:\n- for c in discovery.commits:\n- cid = commit_id_for_oid(c[\"oid\"])\n- commit_links.append((\n- f\"{c['oid'][:24]} ({c.get('contributor', '?')})\",\n- _evidence_path(\"commit\", cid),\n- ))\n \n+ commit_links = [\n+ (\n+ f\"{e.payload.get('oid', e.payload.get('commit_id', ''))[:24]} \"\n+ f\"({e.payload.get('contributor', '?')})\",\n+ _evidence_path(\"commit\", e.payload[\"commit_id\"]),\n+ )\n+ for e in commit_evs\n+ if e.payload.get(\"commit_id\")\n+ ]\n comparison_links = [\n (\n e.payload.get(\"summary\") or e.payload.get(\"comparison_id\", e.event_id),\n@@ -2360,16 +2342,13 @@ async def epoch_detail(epoch: int):\n ]\n \n excluded = []\n- if discovery:\n- for obs in discovery.observations:\n+ if discovery_ev:\n+ for obs in discovery_ev.payload.get(\"observations\") or []:\n if obs.get(\"eligible\"):\n continue\n oid = obs.get(\"oid\", \"?\")\n reason = obs.get(\"exclusion_reason\") or \"excluded\"\n- excluded.append([\"li\",\n- f\"{oid[:28]} — {reason} — \",\n- [\"span.note\", \"legacy evidence unavailable\"],\n- ])\n+ excluded.append([\"li\", f\"{oid[:28]} — {reason}\"])\n \n ranking_nodes: list = []\n if ranking_completed:\n@@ -2388,21 +2367,10 @@ async def epoch_detail(epoch: int):\n indent=2, sort_keys=True,\n )],\n ]\n- elif emission:\n- if legacy and len(emission.ranking or {}) <= 1:\n- ranking_nodes.append([\"p.note\",\n- \"Single-contributor epoch — no LLM judgments.\"\n- ])\n- ranking_nodes.extend([\n- [\"p\", \"Projected from Emission (no ranking Evidence event).\"],\n- [\"pre.blob\", json.dumps(emission.ranking, indent=2, sort_keys=True)],\n- ])\n+ elif ranking_started:\n+ ranking_nodes = [[\"p.note\", f\"Ranking started: {ranking_started.event_id}\"]]\n else:\n- ranking_nodes = [[\"p.note\", \"No ranking recorded.\"]]\n- if ranking_started and not ranking_completed:\n- ranking_nodes.insert(0, [\"p.note\",\n- f\"Ranking started: {ranking_started.event_id}\"\n- ])\n+ ranking_nodes = [[\"p.note\", \"No ranking evidence.\"]]\n \n if emission:\n emission_node = _dl_rows([\n@@ -2411,44 +2379,41 @@ async def epoch_detail(epoch: int):\n (\"pool_after\", emission.pool_after),\n (\"discovery_snapshot_id\", emission.discovery_snapshot_id),\n (\"ranking_run_id\", emission.ranking_run_id or None),\n+ (\"ranking_event_id\", emission.ranking_event_id or None),\n (\"models_used\", \", \".join(emission.models_used or [])),\n (\"distributions\", json.dumps(emission.distributions, sort_keys=True)),\n ])\n else:\n emission_node = [\"p.note\", \"No emission for this epoch.\"]\n \n- single_contributor = False\n- if discovery:\n- single_contributor = len({c.get(\"contributor\") for c in discovery.commits}) <= 1\n- elif emission:\n- single_contributor = len(emission.ranking or {}) <= 1\n+ contributors = {\n+ e.payload.get(\"contributor\")\n+ for e in commit_evs\n+ if e.payload.get(\"contributor\")\n+ }\n+ no_comparisons_note = \"No comparisons.\"\n+ if len(contributors) <= 1:\n+ no_comparisons_note += \" Single-contributor — no LLM judgments.\"\n \n body = [\n _evidence_nav(),\n [\"div.eyebrow\", f\"epoch {epoch}\"],\n [\"h1\", f\"epoch {epoch}\"],\n ]\n- if legacy:\n- body.append([\"p.note\",\n- \"Legacy epoch: projected from GitDiscovery/Emission without Evidence \"\n- \"envelopes. Eligible commits use discovery patches; discarded observation \"\n- \"metadata is marked legacy evidence unavailable. Single-contributor \"\n- \"epochs have no LLM judgments.\"\n- ])\n- if discovery:\n+ if discovery_ev:\n body.extend([\n [\"h2\", \"discovery\"],\n _dl_rows([\n- (\"snapshot_id\", discovery.snapshot_id),\n- (\"config_digest\", discovery.config_digest),\n- (\"initial_snapshot\", discovery.initial_snapshot),\n- (\"observations\", len(discovery.observations)),\n- (\"eligible\", len(discovery.commits)),\n+ (\"snapshot_id\", discovery_ev.payload.get(\"snapshot_id\")),\n+ (\"config_digest\", discovery_ev.payload.get(\"config_digest\")),\n+ (\"observations\", discovery_ev.payload.get(\"observation_count\")),\n+ (\"eligible\", discovery_ev.payload.get(\"eligible_count\")),\n+ (\"event\", _a(\n+ _evidence_path(\"event\", discovery_ev.event_id),\n+ discovery_ev.event_id,\n+ )),\n ]),\n ])\n- no_comparisons_note = \"No comparisons.\"\n- if single_contributor:\n- no_comparisons_note += \" Single-contributor — no LLM judgments.\"\n body.extend([\n [\"h2\", \"commits\"],\n _link_list(commit_links),\n@@ -2471,92 +2436,42 @@ async def epoch_detail(epoch: int):\n @app.get(\"/commits/{commit_id}\")\n async def commit_detail(commit_id: str):\n ev = find_evidence_payload(\"git.commit\", \"commit_id\", commit_id)\n- discovery, legacy_row = (None, None)\n if not ev:\n- discovery, legacy_row = _legacy_commit_row(commit_id)\n- if not ev and not legacy_row:\n- discovery, obs = _legacy_observation(commit_id)\n- if obs is not None:\n- epoch = discovery.epoch if discovery else \"?\"\n- return _evidence_page(f\"commit {commit_id[:24]}\", [\n- _evidence_nav(\n- _a(_evidence_path(\"epoch\", str(epoch)), f\"epoch {epoch}\")\n- ),\n- [\"div.eyebrow\", \"commit\"],\n- [\"h1\", commit_id],\n- [\"p.note\", \"legacy evidence unavailable\"],\n- _dl_rows([\n- (\"oid\", obs.get(\"oid\")),\n- (\"eligible\", obs.get(\"eligible\")),\n- (\"exclusion_reason\", obs.get(\"exclusion_reason\")),\n- (\"epoch\", str(epoch)),\n- ]),\n- ])\n return _evidence_page(\"commit not found\", [\n _evidence_nav(),\n [\"h1\", \"commit not found\"],\n [\"p\", commit_id],\n ])\n- if ev:\n- p = ev.payload\n- epoch = ev.epoch\n- oid = p.get(\"oid\", \"\")\n- contributor = p.get(\"contributor\", \"\")\n- message = _blob_text(p.get(\"message\"))\n- patch = _blob_text(p.get(\"patch\"))\n- meta = _dl_rows([\n+ p = ev.payload\n+ epoch = ev.epoch\n+ return _evidence_page(f\"commit {commit_id[:24]}\", [\n+ _evidence_nav(_a(_evidence_path(\"epoch\", str(epoch)), f\"epoch {epoch}\")),\n+ [\"div.eyebrow\", \"commit\"],\n+ [\"h1\", commit_id],\n+ _dl_rows([\n (\"commit_id\", commit_id),\n- (\"oid\", oid),\n- (\"contributor\", contributor),\n+ (\"oid\", p.get(\"oid\", \"\")),\n+ (\"contributor\", p.get(\"contributor\", \"\")),\n (\"patch_sha256\", p.get(\"patch_sha256\")),\n (\"patch_identity\", p.get(\"patch_identity\")),\n (\"committer_timestamp_ms\", p.get(\"committer_timestamp_ms\")),\n (\"evidence_event\", _a(_evidence_path(\"event\", ev.event_id), ev.event_id)),\n (\"epoch\", _a(_evidence_path(\"epoch\", str(epoch)), str(epoch))),\n- ])\n- legacy_note = None\n- else:\n- assert legacy_row is not None and discovery is not None\n- epoch = discovery.epoch\n- oid = legacy_row.get(\"oid\", \"\")\n- contributor = legacy_row.get(\"contributor\", \"\")\n- message = legacy_row.get(\"message\") or \"\"\n- patch = legacy_row.get(\"patch\") or \"\"\n- meta = _dl_rows([\n- (\"commit_id\", commit_id),\n- (\"oid\", oid),\n- (\"contributor\", contributor),\n- (\"patch_sha256\", legacy_row.get(\"patch_sha256\")),\n- (\"patch_identity\", legacy_row.get(\"patch_identity\")),\n- (\"committer_timestamp_ms\", legacy_row.get(\"committer_timestamp_ms\")),\n- (\"epoch\", _a(_evidence_path(\"epoch\", str(epoch)), str(epoch))),\n- (\"source\", \"legacy GitDiscovery projection\"),\n- ])\n- legacy_note = [\"p.note\", \"Projected from GitDiscovery — Evidence envelope absent.\"]\n- return _evidence_page(f\"commit {commit_id[:24]}\", [\n- _evidence_nav(_a(_evidence_path(\"epoch\", str(epoch)), f\"epoch {epoch}\")),\n- [\"div.eyebrow\", \"commit\"],\n- [\"h1\", commit_id],\n- *([legacy_note] if legacy_note else []),\n- meta,\n+ ]),\n [\"p\", _a(f\"/commits/{commit_id}/patch\", \"download patch\")],\n [\"h2\", \"message\"],\n- _pre_blob(message),\n+ _pre_blob(_blob_text(p.get(\"message\"))),\n [\"h2\", \"patch\"],\n- _pre_blob(patch),\n+ _pre_blob(_blob_text(p.get(\"patch\"))),\n ])\n \n \n @app.get(\"/commits/{commit_id}/patch\")\n async def commit_patch_download(commit_id: str):\n ev = find_evidence_payload(\"git.commit\", \"commit_id\", commit_id)\n- if ev:\n- raw = _decode_blob(ev.payload.get(\"patch\")) or _blob_text(ev.payload.get(\"patch\")).encode()\n- else:\n- _, row = _legacy_commit_row(commit_id)\n- if not row:\n- return PlainTextResponse(\"not found\", status_code=404)\n- raw = (row.get(\"patch\") or \"\").encode(\"utf-8\")\n+ if not ev:\n+ return PlainTextResponse(\"not found\", status_code=404)\n+ raw = _decode_blob(ev.payload.get(\"patch\")) or _blob_text(ev.payload.get(\"patch\")).encode()\n return Response(\n content=raw,\n media_type=\"text/plain; charset=utf-8\",\n@@ -3226,7 +3141,9 @@ async def watch():\n [\"div.controls\",\n [\"button#play\", {\"type\": \"button\", \"disabled\": \"true\"}, \"▶ Play live feed\"],\n [\"button#pause\", {\"type\": \"button\"}, \"Ⅱ Pause feed\"],\n- [\"span.note\", \"Pause stops local updates; the constitutional process continues.\"],\n+ [\"span.note\",\n+ \"Play/pause only affect this browser feed — they do not run or stop emission. \"\n+ \"The server emits at each epoch boundary; status above is that process.\"],\n ],\n ],\n [\"section.panel\",\ndiff --git a/tests/integration.clj b/tests/integration.clj\nindex 204b0fedfbad57846205cb140c4ed9406b5f8e0e..11140e95a8cd86768a661a30e6b29a3ddfc95fcc 100644\n--- a/tests/integration.clj\n+++ b/tests/integration.clj\n@@ -247,7 +247,10 @@\n :decay_rate \"0.003253356063468\"\n :distributions {\"alice\" \"381.4282558872\" \"bob\" \"190.7141279436\"}\n :ranking {\"alice\" \"0.6666\" \"bob\" \"0.3334\"}\n- :models_used [\"mock/chat-v1\" \"mock/chat-v2\"]}]\n+ :models_used [\"mock/chat-v1\" \"mock/chat-v2\"]\n+ :evidence_schema_version 2\n+ :ranking_run_id \"seed-rank\"\n+ :ranking_event_id \"seed-rank-ev\"}]\n (spit path (str (json/generate-string entry) \"\\n\"))))\n \n ;; ---------------------------------------------------------------------------\ndiff --git a/tests/test_evidence.py b/tests/test_evidence.py\nindex 76adcd343eec3a65dec58fda93b068356fb1adcd..7cb74fd7fb1bcd0ab17d2cbe2e6ca7e61e164221 100644\n--- a/tests/test_evidence.py\n+++ b/tests/test_evidence.py\n@@ -1,4 +1,4 @@\n-\"\"\"HTML evidence graph: byte fidelity, resume, legacy projection, private ack.\"\"\"\n+\"\"\"HTML evidence graph: byte fidelity, resume, and Evidence-only pages.\"\"\"\n \n from __future__ import annotations\n \n@@ -86,55 +86,10 @@ def test_html_evidence_pages_escape_and_link(evidence_store):\n assert patch_resp.headers[\"content-disposition\"].startswith(\"attachment\")\n \n \n-def test_legacy_epoch_projects_from_gitdiscovery_without_evidence(evidence_store):\n- oid = \"sha1:\" + \"b\" * 40\n- discovery = c.GitDiscovery(\n- schema_version=1,\n- epoch=3,\n- snapshot_id=\"legacy-snap\",\n- timestamp_ms=1,\n- config_digest=\"d\",\n- initial_snapshot=True,\n- configuration={\"repositories\": [], \"contributors\": {}},\n- repositories=[],\n- observations=[{\n- \"oid\": oid,\n- \"eligible\": False,\n- \"exclusion_reason\": \"before_genesis\",\n- \"first_sources\": [],\n- }, {\n- \"oid\": \"sha1:\" + \"c\" * 40,\n- \"eligible\": True,\n- \"exclusion_reason\": None,\n- \"first_sources\": [],\n- }],\n- commits=[{\n- \"oid\": \"sha1:\" + \"c\" * 40,\n- \"contributor\": \"tommy-mor\",\n- \"message\": \"eligible\",\n- \"patch\": \"diff --git a/x b/x\\n\",\n- }],\n- )\n- emission = c.Emission(\n- epoch=3,\n- timestamp_ms=2,\n- pool_before=\"1\",\n- total_emitted=\"0.1\",\n- pool_after=\"0.9\",\n- decay_rate=\"0.1\",\n- distributions={\"tommy-mor\": \"0.1\"},\n- ranking={\"tommy-mor\": \"1\"},\n- models_used=[],\n- discovery_snapshot_id=\"legacy-snap\",\n- )\n- asyncio.run(c.store.append(discovery))\n- asyncio.run(c.store.append(emission))\n- html = asyncio.run(c.epoch_detail(3)).body.decode()\n- assert \"legacy\" in html.lower()\n- assert \"Single-contributor\" in html or \"no LLM\" in html\n- excluded_id = c.commit_id_for_oid(oid)\n- excluded_html = asyncio.run(c.commit_detail(excluded_id)).body.decode()\n- assert \"legacy evidence unavailable\" in excluded_html.lower()\n+def test_commit_without_evidence_is_not_found(evidence_store):\n+ html = asyncio.run(c.commit_detail(\"c_missing\")).body.decode()\n+ assert \"commit not found\" in html\n+ assert \"legacy\" not in html.lower()\n \n \n def test_ranking_resume_skips_duplicate_provider_calls(evidence_store, monkeypatch):\n@@ -202,6 +157,10 @@ def test_epochs_index_lists_epochs(evidence_store):\n distributions={},\n ranking={},\n models_used=[],\n+ discovery_snapshot_id=\"snap\",\n+ evidence_schema_version=c.EVIDENCE_SCHEMA_VERSION,\n+ ranking_run_id=\"r\",\n+ ranking_event_id=\"e\",\n )))\n html = asyncio.run(c.epochs_index()).body.decode()\n assert \"/epochs/3\" in html\n","role":"user"}],"model":"~x-ai/grok-latest"}