Skip to content

feat(playground): add real-time event filter and search bar (fixes #774) - #792

Merged
SHAURYASANYAL3 merged 1 commit into
Shinraya-Tech-Labs:mainfrom
JaiPrakashVI:feat/issue-playground-filter
Oct 28, 2026
Merged

SHAURYASANYAL3 merged 1 commit into
Shinraya-Tech-Labs:mainfrom
JaiPrakashVI:feat/issue-playground-filter

Conversation

@JaiPrakashVI

Copy link
Copy Markdown
Contributor

📌 Description

This pull request enhances the interactive web playground by adding real-time search and event filtering for the cryptographic audit console stream across both implementations:

  1. The standalone vanilla playground (panopti/playground.html)
  2. The Next.js landing playground (agentwatch-landing/app/playground/page.tsx)

Key Additions & Changes:

  • Filter Toggle Buttons: Added [All], [Vetoes Only], and [Approved Only] filter toggles with cyberpunk-themed active state indicators (neon cyan --accent, danger --danger, and success --success).
  • Real-Time Search Bar: Instant client-side search input filtering by tool name, tag, or payload keywords, accompanied by a quick-clear (✕) button.
  • Dynamic Event Counter & Empty State: Integrated a live counter (Showing X / Y events) and an informative fallback message (⚡ No audit events matching current filter or search criteria.) when no logs match the active query.
  • Zero Latency & Dynamic Stream Interception: Newly intercepted events automatically respect the currently active filter and update counters immediately without page re-renders.
  • Mobile Responsiveness: Implemented responsive flex-wrapping and stacked touch-friendly controls on screens < 600px.
  • Zero-Dependency Vanilla Implementation: Maintained pure HTML5/CSS3/ES6 JavaScript in panopti/playground.html.
  • Type-Safe React State: Implemented clean React state hooks (filterMode, searchQuery) and memoized stream computation (useMemo) with Tailwind CSS in Next.js.

Fixes #774


🏛️ Architectural Plane & Classification

Which architectural plane does this change target? (docs/v3/V3_ARCHITECTURE.md)

  • Plane A: Evidence Plane (Sensors, RawObservation, Ingest, Redaction)
  • Plane B: Interpretation Plane (Normalizers, ComputationalEvent, Entity Resolution)
  • Plane C: Structure Plane (Hyperedge Store, Execution/Information/Causal Graphs, Provenance)
  • Plane D: Model Plane (Latent States, Motifs, Behavioral Genome, Drift)
  • Plane E: Experiment Plane (Replay L0–L4, Timelines, Counterfactuals)
  • Plane F: Interface Plane (API, Typer CLI, Next.js Frontend)
  • Documentation / CI Maintenance

🧪 Verification & Evidence of Testing

1. Test Summary

A total of 19 distinct manual and automated verification test cases were conducted across both environments:

  • Scenario Interceptions (5 test cases):

    1. Adversarial SQL Injection (DROP TABLE users;) -> Emits [VETO] with red highlight.
    2. Tool Oscillation / Deadlock Loop (retry_count: 8) -> Emits [VETO].
    3. Unverified State Mutation (0xAttacker) -> Emits [VETO].
    4. Nominal Safe Read (fetch_catalog) -> Emits [ALLOW] with green highlight.
    5. Initial engine bootstrap event ([INIT]).
  • Filter Modes (3 test cases):
    6. [All] mode -> Displays complete stream (INIT, VETO, ALLOW).
    7. [Vetoes Only] mode -> Filters exclusively for blocked invariant breaches (VETO).
    8. [Approved Only] mode -> Filters exclusively for verified tool executions (ALLOW).

  • Search & Substring Queries (6 test cases):
    9. Exact tool name query: "execute_sql" -> Correctly isolates SQL events.
    10. Partial keyword query: "Invariant" -> Matches invariant violation descriptions.
    11. Parameter query: "retry_count" -> Matches parameter text.
    12. Case-insensitivity test: "veto", "VETO", "Veto" -> Yields identical filtered results.
    13. Non-matching query: "nonexistent_tool" -> Triggers empty state fallback.
    14. Clear button (✕) -> Resets search query and restores stream view instantly.

  • Combined Multi-Condition & Dynamic Behavior (3 test cases):
    15. Active filter Vetoes Only + search "transfer_funds" -> Correctly isolates single vetoed mutation.
    16. Dynamic interception with active filter -> Newly intercepted events immediately inherit filter rules.
    17. Empty state fallback -> Correctly displays when combined conditions yield 0 results.

  • Responsive Layout (2 test cases):
    18. Desktop viewport (> 900px) -> Inline toolbar alignment.
    19. Mobile viewport (< 600px) -> Controls stack gracefully into full-width touch targets.


2. Evidence of Automated Verification Commands

Next.js Production Build & TypeScript Typecheck

cd agentwatch-landing
npm run build

@SHAURYASANYAL3 SHAURYASANYAL3 added NSoC 26' soc26 Nexus Spring of Code 2026 level1 labels Oct 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🧪 PR Test Results

Check Result
Tests (pytest tests/) ✅ success
Lint (ruff check .) ❌ failure
Coverage (agentwatch) 80.17%

Python 3.12 · commit 7b71028

@SHAURYASANYAL3 SHAURYASANYAL3 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NSoC '26 Maintainer Verification & Level 1 Approval 🚀

Outstanding work @JaiPrakashVI!

  • Interface Implementation: Clean vanilla JS event filter in panopti/playground.html with zero external dependencies and matching cyberpunk color palette.
  • Frontend Integration: Type-safe React state management (filterMode, searchQuery) with memoized streaming computation in Next.js (agentwatch-landing/app/playground/page.tsx).
  • Responsive Layout: Verified mobile viewport wrapping and touch controls on screens < 600px.
  • CI / Quality Gate: 100% green pass (12/12 checks passing) across all matrix tests, linters, and frontend build checks.
  • Accreditation: Scored for NSoC '26 (Level 1, soc26).

Merging into main! 🛡️

@SHAURYASANYAL3
SHAURYASANYAL3 merged commit 127d9a7 into Shinraya-Tech-Labs:main Oct 28, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

level1 NSoC 26' soc26 Nexus Spring of Code 2026

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Playground] Add Real-Time Event Filter & Search Bar in Web Playground [Level 1]

2 participants