Build an Exact-Source Policy Wire with Replit and Synorb
Build a source-specific policy wire that never drifts. Replit Agent verifies the exact Supreme Court opinion Stream and source channel through Synorb MCP; the published app checks that same surface on a schedule and delivers only new, cited Manifests.
How do you build an exact-source legal monitor with Replit?
Use the Exact-Source Policy Wire prompt to have Replit build an authenticated review room, database, deduplication, delivery ledger, scheduled polling, and Slack or email workflow. Synorb supplies source-locked court material with Briefs, Signals, dates, identifiers, and direct primary-source links.
Paste the one-shot prompt first. Replit Agent will ask whether to use existing Synorb credentials or get free credentials, secure them in Replit Secrets, validate both Synorb surfaces, and then confirm the exact live Stream scope with the user before it builds.
1
Paste the prompt
Agent begins with the required credential and product-choice questions instead of silently generating the app.
2
Choose Synorb access
Use existing values through Replit Secrets, or authorize Agent to get free credentials and store them without printing them.
3
Confirm the live scope
Agent validates access, shows the exact Streams, IDs, source channels, and date window, and waits for approval before building.
What is this exact-source policy wire supposed to do?
The aha moment is precision: the user can see the exact Stream and source-channel receipt behind every opinion, switch between its human Brief and structured Signal, rerun overlapping windows safely, and trust that the watcher will never substitute adjacent court coverage.
Exact-source proof
Resolve scotus-opinions through MCP and fail closed if the named source channel is unavailable.
Brief / Signal review
Read the decision-ready Brief or hand the structured Signal to another agent without losing the primary-source citation.
Auditable delivery
Every Slack or email item carries the exact Stream, source channel, date window, stable ID, run receipt, and source URL.
Replit fit
Why does Replit fit this build?
Replit is an unusually clean fit: Agent uses Synorb MCP to resolve the source, Replit Database makes polling idempotent, an Autoscale Deployment hosts the review UI, and a separate Scheduled Deployment performs each terminating check and delivery run.
Builder surface
Replit builds the app layer
GoalExact-Source Policy Wire
OutputUI, routes, filters, states, and review workflow
Context layer
Synorb supplies source-grounded feeds
BuildSynorb MCP connected directly to Replit Agent
ShipREST from a backend route with server-side secrets
Starting scopes
Which Synorb feeds should this app start with?
This example starts deliberately narrow so Replit users can see a capability ordinary web search does not provide: scheduled, exact-source, deduplicated delivery with an inspectable data contract.
Supreme Court Stream
Discover the real customer-visible Stream through synorb-stream-search and preserve its 17-digit ID as a string.
scotus-opinions only
Resolve the exact source-channel name and ID through synorb-details; never broaden to federal courts, commentary, or media.
Explicit date window
Use the live account window from synorb-profile, overlap scheduled REST windows, and paginate until the run is complete or hits a visible safety cap.
Nested Manifest contract
Use the per-Stream REST endpoint to render nested source, Brief, and Signal objects plus the REST usage envelope.
Idempotent notifications
Store stable Manifest IDs and delivery receipts so retries recover safely without duplicate Slack or email alerts.
Architecture
Use the same safe data path.
1
Discover with Synorb MCP
Use Synorb directly inside Replit Agent: profile the account window, search Stream inventory, inspect selected Stream details, and sample source-linked Manifests before generating the runtime.
2
Call Synorb from the backend
The shipped app should call Synorb REST from a server route, scheduled job, webhook receiver, or server function. Keep SYNORB_API_KEY and SYNORB_SECRET out of browser code.
3
Show citations and coverage
Every card should preserve source URL, source name, published date, tags, and an honest empty or limited-results state when the selected scope has few results.
One-shot prompt
Paste this into Replit.
This prompt is tuned to the build intent and keeps Synorb credentials server-side.
Exact-Source Policy Wire prompt
Builds an exact-source MCP-to-REST workflow, a nested Brief and Signal review experience, and a production-shaped Replit Scheduled Deployment with durable dedupe.
Build a production-quality Replit app called "Exact-Source Policy Wire". The launch watch is Supreme Court opinions only. It must preserve the exact Synorb source channel, show the Brief and Signal from each Manifest, and send Slack or email only for unseen cited items.
CONTEXT AND AHA MOMENT
The first live run should make the difference between search and a Stream obvious: Replit Agent discovers the exact SCOTUS opinion surface through Synorb MCP, the app stores that verified scope, and every later scheduled run checks the same source without crawling, fuzzy matching, or substituting adjacent court coverage.
COLLABORATIVE BUILD LOOP — MANDATORY
Do not silently build the entire app in one pass. Guide the user through these checkpoints, ask one compact set of questions at a time, and wait for their answer before continuing. Recommend one option at every checkpoint. If the user says "choose for me", use the recommended defaults; never re-ask a settled choice.
1. Before coding, ask who will operate the wire and which starting layout they want—Review Inbox (recommended), chronological Opinion Wire, or Audit Console. In the same compact checkpoint, scope the visual and image preferences required by the Visual Asset Workflow below.
2. After MCP discovery, show the exact Supreme Court Stream name/ID, resolved scotus-opinions source-channel name/ID, evidence type, media format, and available date window. Ask the user to confirm this fail-closed source scope before storing it.
3. After the first working preview with real Manifests, ask the user to choose information density (Executive, Balanced recommended, or Legal-analyst dense), default Brief or Signal view, which functions to enable first—Run Now, dry run, review states, saved searches, exports, or delivery history—and approve one of the three visual candidates required below. Apply the choices together and show the revised preview.
4. Before deployment, ask the user to choose in-app only, Slack, email, or Slack + email delivery; refresh cadence; and private prototype versus authenticated team tool (recommended). Then run acceptance tests and present one concise build receipt listing product choices, visual choices, exact source scope, routes, dedupe behavior, image provenance status, and deployment shape.
SYNORB ACCESS CHECKPOINT — ASK AND WAIT
Before any Synorb discovery call, ask the user to choose one option:
A. Use my existing Synorb credentials.
B. Get free Synorb credentials (recommended for a new user).
For A, open Replit Secrets and ask the user to enter SYNORB_MCP_TOKEN, SYNORB_API_KEY, and SYNORB_SECRET there. Never ask them to paste secret values into chat, source code, a public environment variable, logs, or the database.
For B, only after the user explicitly selects it, make exactly one GET request to https://synorb.com/connect from a one-time server-side setup task. Parse credentials.mcp_token, credentials.api_key, and credentials.api_secret without printing the response body. Store them directly as SYNORB_MCP_TOKEN, SYNORB_API_KEY, and SYNORB_SECRET in Replit Secrets; the API secret is shown only once. Never commit, render, log, or persist the raw values elsewhere. If Replit requires user confirmation to save Secrets or add the integration, ask for that confirmation without displaying the values.
Use the MCP token with the Core server https://mcp.synorb.com/mcp and an Authorization Bearer header. Use the REST key and secret only as api-key and secret headers from server code. Validate MCP with synorb-profile and validate REST with GET https://api.synorb.com/account. If either check fails, stop at a credential-repair state. If the free-credential request returns no credentials or a 429, do not retry automatically; offer existing credentials or the returned retry guidance.
CONNECT AND VERIFY WITH SYNORB MCP BEFORE CODING
1. Call synorb-profile for the live date window, freshness, and quota context.
2. Start from the required live anchors: Supreme Court of the United States Stream "17779543021395832" and source channel "scotus-opinions" / "17779347856646833". Call synorb-stream-search with query "Supreme Court of the United States scotus-opinions", home_domain "society-law-government", include_details true, and page_size 10 to verify them live.
3. Select only the exact Supreme Court of the United States Stream and keep every 17-digit ID as an exact JSON string. Explicitly reject the broader Federal & Supreme Court Opinions Stream "17779350937998955" and every circuit-court source, even if they rank nearby.
4. Batch Stream "17779543021395832" through synorb-details and require source channel ID "17779347856646833" with name "scotus-opinions". Persist its live display name, source_class, evidence_type, media format, and source URL. If either ID/name pairing is missing or inactive, fail closed and ask the user to repair scope; do not substitute.
5. Call synorb-manifests once with source_channel_names ["scotus-opinions"], days 30, compact true, page_size 10, target_count 10. Confirm the source name resolved exactly. If it did not, fail closed with setup guidance; never broaden to all federal courts or media coverage.
6. Treat mode "count" and "orient" as preflight only. For the proof sample, preserve quota_header, coverage.status, pagination, citations, and recommended_next_call. Never claim a partial page is exhaustive.
7. If MCP is not connected, build an honest setup state and no synthetic opinions or IDs.
BUILD TWO REPLIT ENTRY POINTS
1. A server-capable authenticated web app for configuration, run history, Manifest review, citations, and manual Run Now.
2. A terminating command for polling and delivery that is suitable for a separate Replit Scheduled Deployment. Do not implement an in-process cron loop inside the web server.
EXACT RUNTIME REST CONTRACT
Keep SYNORB_API_KEY and SYNORB_SECRET in Replit Secrets and deployment Secrets. Send api-key and secret headers only from server code.
- Query GET https://api.synorb.com/streams/{streamId}/manifests with source_channel_id={sourceChannelId}, published_date_from, published_date_to, page, and page_size.
- Use a one-day overlapping date window for reliability. Continue with the returned page-based pagination until no next page remains or a configurable safety cap is reached. Never send cursor.
- This GET returns the REST envelope { data, usage } with nested data.manifests[]. Normalize the nested source, brief, and signal objects. Do not reuse the flat /streams/query adapter here.
- Derive citations only from returned source.source_url. Never invent a URL, docket fact, holding, or why-it-matters statement.
- Keep the exact Stream and source-channel IDs as strings end to end.
- Expose a server-only manual-run route protected by Replit Auth and CSRF protection. Never return raw Synorb credentials.
DATABASE AND IDEMPOTENCY
Use Replit Database with tables for users, destinations, watches, watch_sources, watch_runs, seen_manifests, delivery_candidates, deliveries, and audit_events.
- Use a stable dedupe key based on Manifest ID, with source URL as a defensive secondary key.
- Record started_at, finished_at, requested window, pages read, candidates seen, new items, sent items, status, error, usage snapshot, and the last successful watermark.
- Advance the watermark only after a successful complete run. A failed or partial run must not create a blind spot.
- Replaying the same window must send zero duplicates. Retry delivery failures without refetching or resending completed deliveries.
PRODUCT EXPERIENCE
Use Replit Auth for a focused control room with:
- a header reading "Supreme Court Opinions — exact source";
- Last successful run, next schedule, new opinions, sent items, pages checked, and usage;
- Run Now and Dry Run actions;
- New, Review, Sent, Dismissed, Sources, and Runs views;
- a provenance drawer showing the exact MCP-discovered Stream name/ID, source-channel name/ID, applied dates, page, cache age, and REST usage;
- a Brief / Signal toggle for each Manifest;
- a prominent "Open cited opinion source" link on every item;
- exact empty states such as "No new opinions in this window", not generic errors.
Each Slack or email alert should include only returned fields: opinion headline, concise Brief summary, published date, exact source-channel display, Stream name, significance when present, direct source URL, and a deep link to the Replit review page. Include a short "Review source" label when the returned Manifest does not contain enough context. Do not generate a legal conclusion.
REPLIT DEPLOYMENT SHAPE
- Publish the web control room as an Autoscale Deployment, not Static.
- Create an idempotent command such as npm run wire:poll for a Replit Scheduled Deployment. The command must terminate after fetching, storing, and delivering.
- Document separate deployment Secrets for the scheduled job: SYNORB_API_KEY, SYNORB_SECRET, and either SLACK_WEBHOOK_URL or email provider credentials.
- If no delivery provider is configured, keep candidates in the in-app inbox.
- Add structured logs keyed by watch_id and run_id with no secrets.
VISUAL DIRECTION
Make the app feel like a premium legal-intelligence wire: quiet ivory and ink, a single court-red accent, excellent long-form typography, compact source receipts, clear run status, responsive tables, and no generic gradient dashboard styling.
ACCEPTANCE TESTS
1. Missing or unresolved scotus-opinions fails closed and never substitutes another source.
2. All Synorb IDs remain strings.
3. The request uses GET /streams/{id}/manifests with source_channel_id and page-based pagination.
4. The nested Manifest, source, Brief, and Signal shapes render correctly.
5. Overlapping windows and reruns produce no duplicate deliveries.
6. A failed or partial run does not advance the successful watermark.
7. Every displayed or delivered item has a real returned source URL.
8. Include a README with curl -s https://synorb.com/connect, custom MCP setup in Replit Integrations, required Secrets, Replit Database schema, Autoscale publishing, Scheduled Deployment setup, dry-run procedure, and a two-minute demo script.
VISUAL ASSET WORKFLOW — INTEGRATED WITH THE BUILD LOOP
Treat the product shell, data visualization, source-derived media, and generated imagery as one reviewed design system, not a decorative afterthought or a separate questionnaire.
1. At the first product checkpoint, offer two paths: use the recommended visual preset, or customize. Ask the user to choose or delegate the image approach - source or publisher artwork, editorial photography, cinematic generated imagery, data-led illustration, abstract visual system, or minimal imagery - plus restrained, balanced, or immersive prominence, brand colors and assets, and subjects, symbols, colors, cliches, people, or styles to avoid. Recommend restrained legal editorial design with architectural and document-inspired legal motifs with restrained imagery: one hero, cited opinion-document thumbnails, and subtle source and empty-state treatments. Summarize the answer as a Visual Direction Receipt and wait for confirmation.
2. Create a compact asset plan limited to visuals that improve comprehension or delight: a hero composition, official opinion-document previews, court and source treatments, review empty states, digest artwork, and social previews. Label every planned asset as source-derived, data-derived, generated decorative, user-provided, or branded fallback. Never let decoration compete with live Synorb evidence or citations.
3. Add an app-owned optional visual record to normalized content types: image_url, image_alt, image_source_url, image_credit, image_kind, rights_status, width, and height. Do not assume Synorb REST returns these fields. Keep the visual resolver separate from the cited Brief and Signal adapters so a missing or broken image can never remove, alter, or delay the factual row.
4. Resolve visuals in this order: a permitted visual explicitly returned with the source object; permitted official artwork or metadata from the exact canonical source; a user-provided licensed asset; a user-approved generated decorative asset; then a polished non-photographic fallback. A narrow server-side visual-metadata lookup may read canonical RSS or Atom artwork, Open Graph or Twitter image metadata, or the first page of the exact cited PDF. It must not scrape article text, invent content, bypass access controls, or substitute another content provider. Cache only when source terms permit it.
5. Prefer a first-page thumbnail generated from the exact cited opinion PDF when permitted. Do not generate courtroom scenes, justice likenesses, seals, holdings, or case-specific imagery and present them as evidence. Preserve the exact image source URL and credit separately from the Manifest source_url. Do not imply that a source-derived image is itself Synorb evidence unless Synorb returned it as part of the source object.
6. Use a reference image only when it is user-owned, verified CC0/public domain, or licensed for commercial use and modification. Record its URL, creator, and license. Reject editorial-only, non-commercial, no-derivatives, unidentified, or ambiguous rights. Appearance in web search is not permission. Do not claim that applying a filter makes a source image proprietary or removes its license obligations. Trademarks, privacy, and publicity rights may still apply.
7. Before generating a full decorative asset family, create three meaningfully different low-cost candidates for the highest-impact generated surface, place them in the real-data preview, and ask the user to select one, combine specified qualities, request another direction, or continue without generated imagery. Wait for approval before generating the complete asset family. Never request a replica of a copyrighted image, branded character or logo, unapproved real-person likeness, or the signature style of a named living artist.
8. Generated visuals are clearly decorative. Never present generated art as primary-source evidence, a factual visualization of Synorb data, a document preview, or a depiction of a returned event or claim. Save the approved direction, selections, revisions, crop decisions, and layout treatment without promising exclusive copyright or proprietary rights.
9. Write docs/image-provenance.json for every shipped visual with filename or remote URL, product location, image_kind, creation or resolution method, provider, generation or retrieval date, creative brief when applicable, human selections and edits, image_source_url, creator, license, rights_status, and crop information. Never put credentials in this file.
10. Ship responsive AVIF/WebP assets when locally transformed, with an appropriate fallback, stable aspect ratios, useful alt text, mobile and desktop crops, lazy loading below the fold, and no important text baked into images. Exercise a real visual, missing visual, broken visual, fallback, light and dark themes, reduced motion, mobile, tablet, and desktop. Include the final asset list and image provenance status in the build receipt.
Related pages
Continue from the closest guide.
Replit content feed app
Continue the Synorb build pattern from this related page.
It gives the watcher a fail-closed contract. A request for Supreme Court opinions will not silently become general court news, commentary, or a neighboring source surface.
Why use the per-Stream manifests endpoint?
It supports the verified Stream and source-channel scope and returns nested source, Brief, and Signal objects that the review UI can show together.
How does Replit avoid duplicate alerts?
The Scheduled Deployment overlaps date windows, stores stable Manifest IDs, advances its watermark only on success, and records idempotent delivery receipts.
Can this pattern support other sources?
Yes. Replace the saved Stream and exact source-channel receipt only after a new MCP discovery and verification step; do not turn it into fuzzy runtime search.
Connect
Want to test Synorb feeds for free?
Provision starter credentials, then keep REST credentials server-side in the app you build.