Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Sandbox/Version demo: Difference between revisions

From OHC Network Wiki
More languages
Content deleted Content added
OHC identity seed
 
OHC identity seed
Line 4: Line 4:
|title=Version Demo
|title=Version Demo
|order=999
|order=999
|introduced=2.0
|introduced=4.0
}}
}}


This is a '''sandbox page''' demonstrating the wiki's copy-on-write versioning system. It is not real documentation.
{{Info|title=Sandbox page|1=This page demonstrates the wiki's '''copy-on-write versioning system'''. It is not real documentation. The frozen forks below show how content evolves across releases without duplicating the entire tree.}}


== Notification system (v4.0 — current) ==
== How it works ==


The notification system handles all outbound communication from the platform to users, providers, and external systems.
{{Info|title=Version history|1=This page was "introduced in 2.0". A frozen fork exists at [[Sandbox/Version demo/1.0]] representing the old v1.0 content. The version-switcher pills below the title are auto-generated from that subpage via a Cargo query.}}


=== Channels ===
The versioning model:


{| class="wikitable"
# '''Canonical page = latest.''' You are reading it now.
! Channel !! Added in !! v4.0 changes
# '''Fork only on divergence.''' When content changes between releases, the old text is snapshotted to a subpage (<code>Page/1.0</code>) and marked <code>status=frozen</code>.
|-
# '''Version switcher''' (rendered by <code><nowiki>{{Version switcher}}</nowiki></code>) queries Cargo for frozen subpages and shows clickable pills.
| Email || 1.0 || MJML templates + AMP for interactive emails
# '''Frozen banner''' on the old page links readers back here.
|-
| In-app || 2.0 || Unified inbox with thread grouping
|-
| SMS || 2.0 || Smart routing (cost-optimized per region)
|-
| Push (mobile) || 3.0 || Rich media attachments, action buttons
|-
| Webhook || 3.0 || Now supports HMAC signing + retry policies
|-
| WhatsApp || '''4.0''' || Via official Business API
|-
| Slack/Teams || '''4.0''' || Org-configurable bot integrations
|}


== What to observe ==
=== Scheduling & orchestration ===


New in v4.0 — notifications can be scheduled, cancelled, and A/B tested:
* '''On this page:''' look for the "Older versions: …" pill strip linking to <code>/1.0</code>.
* '''On the [[Sandbox/Version demo/1.0|frozen fork]]:''' look for the blue banner saying "You are viewing documentation frozen at …".


<syntaxhighlight lang="json">
== Cleanup ==
{
"template": "appointment_reminder",
"recipients": ["patient:uuid-123"],
"channels": ["email", "whatsapp"],
"schedule": {
"send_at": "2026-07-10T08:00:00Z",
"cancel_if": "appointment.status == 'cancelled'"
},
"variants": {
"control": { "subject": "Appointment tomorrow" },
"test_a": { "subject": "See you tomorrow, {{patient.first_name}}!" }
}
}
</syntaxhighlight>


=== Per-organization configuration ===
This page and its subpage can be deleted once the demonstration is no longer needed. They are excluded from search via <code>__NOINDEX__</code> on the frozen fork and categorized under [[Category:Sandbox]].

Organizations can now override global channel settings:

{| class="wikitable"
! Setting !! Scope !! Description
|-
| Enabled channels || Per org || Which channels are active
|-
| Sender identity || Per org || From address, WhatsApp number, bot name
|-
| Quiet hours || Per org || Suppress non-urgent sends during configured windows
|-
| Fallback chain || Per org || e.g. try Push → SMS → Email in order
|}

=== Architecture (v4.0) ===

<syntaxhighlight lang="text">
Action / Scheduler / API
Orchestrator (evaluates schedule, cancel_if, variant selection)
Fan-out (per recipient × channel, respects fallback chain)
Queue (Redis Streams, partitioned by priority)
Workers (channel-specific adapters, batch-aware)
Delivery tracker (status, attempts, receipts, analytics)
</syntaxhighlight>

== Evolution summary ==

{| class="wikitable"
! Version !! Key additions !! Pages in Docusaurus model !! Pages in wiki model
|-
| 1.0 || Email only, sync || 1 page × 1 version = '''1''' || [[Sandbox/Version demo/1.0|1 frozen fork]]
|-
| 2.0 || Async, SMS, in-app, preferences || copy entire tree = '''2''' total || [[Sandbox/Version demo/2.0|1 frozen fork]]
|-
| 3.0 || Templates, push, webhooks, tracking, batching || copy entire tree = '''3''' total || [[Sandbox/Version demo/3.0|1 frozen fork]]
|-
| 4.0 || WhatsApp, Slack, scheduling, A/B, per-org config || copy entire tree = '''4''' total || '''1 canonical page''' (you're reading it)
|-
! colspan="2" | '''Total file/page count''' !! '''4 full copies''' !! '''4 pages''' (1 current + 3 forks)
|}

{{Note|1=In a real doc site with 100 pages, Docusaurus would store '''400 files''' for 4 versions (most identical). This wiki stores '''103 pages''' — the 100 canonical pages plus only the 3 that actually diverged.}}

== How the versioning works ==

# '''Canonical page = latest.''' You are reading it.
# '''Fork only when content changes.''' Unchanged pages span all versions implicitly (their <code>IntroducedIn</code> field covers the full range).
# '''Version switcher''' (the pill strip below the title ↑) is auto-generated: <code><nowiki>{{Version switcher}}</nowiki></code> queries Cargo for subpages with <code>Status=frozen</code>.
# '''Frozen banner''' on old pages links readers back to this canonical page.
# '''"What changed in version X?"''' is a single Cargo query: <code><nowiki>{{#cargo_query: tables=Docs | where=IntroducedIn='4.0'}}</nowiki></code>

== Live query: all versions of this page ==

{{#cargo_query:tables=Docs
|fields=_pageName=Page,IntroducedIn=Introduced,DeprecatedIn=Deprecated,Status
|where=_pageName LIKE 'Sandbox/Version demo%'
|order by=IntroducedIn
|format=table
}}


[[Category:Sandbox]]
[[Category:Sandbox]]