Repository navigation
Home
NoticeSync is an academic intelligence and timeline synchronization platform engineered to convert messy university circulars, exam schedules, and course syllabi into validated, synchronized student calendars.
Unlike naive document parsers that blindly trust LLM predictions, NoticeSync enforces deterministic calendar validation, cross-document historical collision detection, least-privilege tenant isolation, and mandatory human-in-the-loop gating for ambiguous dates and deadline revisions.
| Section | Topic | Summary |
|---|---|---|
| Architecture & Design | System Topology & Lifecycles | Component breakdown, async job workers, and end-to-end data pipelines |
| Security & Tenant Isolation | Zero-Trust Data Isolation | Strict session auth, W3C Fetch Metadata, CSRF origin checks, and negative cross-tenant testing |
| Document Ingestion | Ingestion & De-Bombing | Magic-byte checking, streaming byte limits, encrypted PDF defense, and multi-section partitioning |
| Schedule Integrity | Date & Conflict Reasoning | Gregorian verification, DST and timezone boundaries, ambiguous numeric dates, and human review gating |
| RAG & Vector Search | Vector Memory Engine | 768-dim embeddings, pgvector cosine search, hybrid reciprocal rank fusion, and prompt isolation |
| API Reference | Route Authorization Matrix | Complete route-by-route HTTP specification, error codes, and request/response payloads |
| Deployment & Operations | Vercel, Supabase, and CI | Production environment setup, database migrations, rate-limiting contracts, and secrets scanning |
| Contributing & Governance | Community Standards | Issue forms, PR templates, code standards, zero-emoji policy, and accessibility conformance |
The following workflow illustrates how NoticeSync safely processes untrusted academic documents into verified calendar events:
flowchart TD
A["Raw Document Upload (PDF / Image / Text)"] --> B["Stream Ingestion & Magic-Byte Validation"]
B --> C{"Is Input Valid & Safe?"}
C -- "No (Spoofed/Oversized/Malformed)" --> D["Reject with HTTP 400/413/422"]
C -- "Yes" --> E["Create Processing Job (pending)"]
E --> F["Text Extraction & Multi-Section Partitioning"]
F --> G["Parallel Execution"]
subgraph Parallel_Pipelines ["Parallel Execution Subsystems"]
G --> H["pgvector Chunking & 768-dim Embeddings"]
G --> I["Structured LLM Extraction (Untrusted Sandboxing)"]
end
I --> J["Deterministic Calendar & Ambiguity Validation"]
J --> K{"Is Date Impossible or Ambiguous?"}
K -- "Yes" --> L["Set date: null & Flag needsReview: true"]
K -- "No" --> M["Validated ISO Date (YYYY-MM-DD)"]
H --> N["Historical Vector Memory Cross-Reference"]
M --> N
L --> N
N --> O{"Schedule Collision or Revision Detected?"}
O -- "Yes" --> P["Flag conflictDetected: true & Explain Discrepancy"]
O -- "No" --> Q["Ready for Verification"]
P --> R["Human-in-the-Loop Review Gating"]
Q --> R
R --> S{"Student Approves Event?"}
S -- "Confirmed" --> T["Persist to academic_events (RLS Scoped)"]
S -- "Rejected/Edited" --> U["Discard or Update with Human Input"]
T --> V["Synchronize to Student Planner & ICS Calendar Export"]
-
Never Turn Uncertain Dates into Authoritative Deadlines: If a document contains ambiguous phrases ("mid next week"), impossible calendar dates (February 30), or conflicting updates from earlier circulars, the date is marked pending or ambiguous and held for manual verification.
-
Zero Privileged Service-Role Fallback for User Operations: Every API route deriving user state enforces strict authenticated sessions (
session.userClient). The privilegedSUPABASE_SERVICE_ROLE_KEYis completely barred from user data paths. -
Multi-Tenant Isolation Deny-by-Default: PostgreSQL Row-Level Security (RLS) restricts access to
auth.uid() = user_id. Client-provideduserIdparameters in JSON request bodies are discarded. Negative cross-account tests ensure zero data leakage across tenants. -
Defense in Depth Against Malicious Files: Uploaded documents are validated using streaming byte limits, file header magic bytes, and text character quotas to neutralize decompression bombs, MIME-type spoofing, and corrupted payloads before parser execution.
-
Safe Fallbacks & Offline Testability: NoticeSync operates in zero-quota, offline test mode (
NOTICE_SYNC_TEST_MODE=true) using deterministic mock providers for LLM extraction and vector embeddings, enabling fast CI/CD quality gates without cloud dependencies.
NoticeSync Academic Intelligence Documentation — Licensed under the MIT License.