arborist-viz/arborist_viz/views/claims.py
russell@unturf.com 0cd96ab1d7
Initial commit: arborist VIZ — Merkle command center
Pyramid web app for inspecting arborist Merkle trees over sharded SQLite:
document roots, inclusion proofs, an interactive 3D Merkle lattice
(six.js / WebGL with graceful fallback), audit-chain linkage, and a live
SSE event stream.

Generated artifacts (env/, vendored static/six/ bundles, demo databases)
are gitignored and rebuilt via the Makefile (venv, six, init-db, serve).
2026-05-28 09:22:59 -04:00

81 lines
2.4 KiB
Python

"""Claim, claim-neighborhood, graveyard endpoints (ticket §6.3, §6.4, §6.9).
#000059 coupling: the graveyard widget is one UI projection of the
bounded-ingestion graveyard. The Phase 0 stub honors that by labeling
the surface as "recurring-error" rather than "queries-ever".
"""
from __future__ import annotations
import json
from pyramid.response import Response
from pyramid.view import view_config
def _json(body) -> Response:
return Response(json_body=body)
@view_config(route_name="api_claim", request_method="GET")
def get_claim(request):
claim_id = request.matchdict["claim_id"]
return _json(
{
"claim_id": claim_id,
"canonical_claim": None,
"evidence_ids": [],
"source_roots": [],
"warrant_level": "UNGROUNDED",
"falsification_state": None,
"verifier_policy_hash": None,
"parent_claims": [],
"child_claims": [],
"counterclaims": [],
"status": "speculative",
"note": "Phase 0 stub.",
}
)
@view_config(route_name="api_claim_neighborhood", request_method="GET")
def get_claim_neighborhood(request):
claim_id = request.matchdict["claim_id"]
try:
depth = int(request.GET.get("depth", "2"))
except ValueError:
depth = 2
return _json(
{
"root_claim": claim_id,
"depth": depth,
"nodes": [],
"edges": [],
"source_roots": [],
"note": "Phase 0 stub.",
}
)
@view_config(route_name="api_graveyard_entry", request_method="GET")
def get_graveyard_entry(request):
claim_hash = request.matchdict["claim_hash"]
# #000059 hard constraint: surface recurring-error class, not raw
# query transcripts. We expose hashes + failure_class only.
return _json(
{
"failed_claim_hash": claim_hash,
"failure_class": None,
"falsifier_ids": [],
"defeating_evidence_ids": [],
"affected_descendants": [],
"created_at": None,
"reopen_conditions": [],
"appeal_status": None,
"source_roots": [],
"note": (
"Phase 0 stub. Per arborist #000059 bounded-ingestion: graveyard "
"exposes recurring-error class, not query transcripts."
),
}
)