Skip to content

Docs/hackathon architecture - #3

Merged
amantebriwal4321 merged 3 commits into
mainfrom
docs/hackathon-architecture
Sep 8, 2026
Merged

amantebriwal4321 merged 3 commits into
mainfrom
docs/hackathon-architecture

Conversation

@amantebriwal4321

Copy link
Copy Markdown
Owner

No description provided.

amantebriwal4321 and others added 2 commits September 8, 2026 17:43
Adds a "Hackathon Architecture" README section for the MOSS Zero-Latency
Builder Sprint. Framed as a design proposal, not shipped code: documents
where the single Groq sentiment call actually sits and how a Moss (gRPC
retrieval) -> Guardrails -> Context Eval -> Latency Tracing "Trust Loop"
would wrap it. Includes an accurate current-state Mermaid diagram and
keeps the sprint's conceptual diagram under docs/architecture/ with a
note that its "existing infrastructure" boxes are a generic template.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ment call

Ships the Runtime Guardrails / Context-Eval half of the MOSS-sprint "Trust
Loop" as a working prototype rather than a diagram.

app/services/guardrails.py:
- SentimentVerdict (Pydantic v2) validates every row of the model's JSON
  response; malformed rows are dropped, an unparseable response rejects the
  whole batch, a verdict indexed outside the batch is discarded as a
  hallucinated index. Unaccepted items keep the safe neutral default.
- grounding check: a non-neutral verdict survives only if the source text
  mentions a tracked tool (scoring.classify_text_to_tools); otherwise it is
  quarantined to neutral before it can reach scoring / ToolSnapshot.
- traced(): dependency-free span-timing stub, same call sites a real
  OpenTelemetry exporter would use.

scraper.batch_sentiment_analysis now routes the model response through
validate_sentiment_batch and logs the GuardrailReport per batch; the old
ad-hoc json.loads + loose dict walk is gone.

scripts/check_guardrails.py: offline smoke test (no network, no API key) —
well-formed, malformed, hallucinated-index and ungrounded responses.

README: honest "Hackathon Architecture: Agent Reliability & Security"
section — Guardrails + grounding tagged shipped, Moss + full OTel tagged
proposed. Also refreshes two stale bits (tool count 54->30+, the removed
NEXT_PUBLIC_API_URL row -> BACKEND_ORIGIN).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
stack-radar Ready Ready Preview Sep 8, 2026 2:21pm UTC
stack-radar-a3jy Ready Ready Preview Sep 8, 2026 2:21pm UTC

…astra)

The submission form reveals the intended stack behind the arena's "Moss"
codename: Mastra (agent evals + tracing), Qdrant (gRPC vector retrieval),
Enkrypt AI (runtime guardrails). Update the README table + diagram and the
guardrails.py docstring to name these as the production targets, keeping
the honest prototype/proposed status tags. No behaviour change.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@amantebriwal4321
amantebriwal4321 merged commit 7ea87ef into main Sep 8, 2026
9 of 12 checks passed

This branch was successfully deployed

2 active deployments
Preview – stack-radar — 51c46744 Deployed Sep 8, 2026 by vercel[bot]
Preview – stack-radar-a3jy — 51c46744 Deployed Sep 8, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant