Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,11 @@ jobs:
- name: Test
working-directory: ${{ matrix.crate }}
run: cargo test --locked

public-site-preview:
name: hub public-site truthfulness (python)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check preview cannot masquerade as a live Hub
run: python3 -m unittest discover -s hub/site -p 'test_*.py'
23 changes: 23 additions & 0 deletions hub/site/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Hub public website — first implementation slice

Companion to [member website PRD](../docs/PRD_MEMBER_WEBSITE_FIRST_USER_2026-11-11.md) and Web4 #990/#991.

## What this is
A static, responsive, accessible **public visitor shell**, located in the canonical `web4/hub` tree. It shows the intended member-facing information architecture without fabricating membership, admissions, profiles or witnessed outcomes. It runs without Hestia or private credentials.

Preview locally: from this directory, `python3 -m http.server 8000`, then visit `http://localhost:8000`. This is **not** a production deployment and is not yet served by the Hub daemon.

## Next binding slice (blocking release)
- Render site name, purpose, public charter and governing disclosure from a server-side **public projection**; do not accept browser-supplied law or identity.
- Keep `/admin/*`, operator keys and member-only tools completely outside the public-site bundle and public plane. No browser direct calls to loopback operator APIs.
- Treat locked, maintenance and unavailable states explicitly; never turn an unavailable read into a clean/empty membership claim.
- Add explicit admission choices only after API-level consent, CSRF/replay protection, authentication and authorization tests exist.
- Cross-browser privacy tests: no member-only or self-only profile fields in HTML, preload, cache, logs, or public JSON.
- Add read-only committees/ownership/events backed by governed projections, followed by real officer workflow and channel coexistence.
- Verify reverse-proxy HTTPS, CSP, no unsafe inline scripts, keyboard navigation and mobile before claiming public deployment.

## Acceptance
1. Visitor sees purpose and preview limitations without logging in.
2. No fake join, no member listing, no invented action receipts.
3. No JavaScript or access token is required to render the page.
4. The future live endpoint must pass a fresh-user path on a real chapter, not merely this static preview.
38 changes: 38 additions & 0 deletions hub/site/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="referrer" content="no-referrer">
<title>Community Hub — public site preview</title>
<style>
:root { color-scheme: light; font: 16px/1.55 system-ui,sans-serif; color:#20302b; background:#f7f7f2 }
body { margin:0 } header, main, footer { max-width:900px; margin:auto; padding:1.5rem }
header { display:flex; gap:1rem; align-items:center; justify-content:space-between; border-bottom:1px solid #d0d5d0 }
main { padding-top:3rem; padding-bottom:3rem }
.eyebrow { text-transform:uppercase; letter-spacing:.09em; font-size:.78rem; font-weight:700 }
h1 { font-size:clamp(2rem,6vw,3.5rem); line-height:1.1; max-width:16ch }
.grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(230px,1fr)); gap:1rem; margin-top:2rem }
article { background:white; border:1px solid #dce2dc; border-radius:14px; padding:1.3rem }
a { color:#145741 } a:focus-visible { outline:3px solid #157852; outline-offset:4px }
.notice { padding:1rem; border-left:4px solid #5a725d; background:#eaf0e9 }
small { color:#4b5d55 }
</style>
</head>
<body>
<header><strong>Community Hub</strong><span class="eyebrow">Public-site preview</span></header>
<main>
<p class="eyebrow">A home for communities that govern themselves</p>
<h1>Find your people. Know how your community works.</h1>
<p>Hub is an open-source foundation for community sites with explicit membership, roles, decisions, and accountable activity. Each community controls its own site and rules.</p>
<p class="notice" role="status"><strong>Preview, not a live community.</strong> This page contains no member data, registration, or admissions. It does not connect to a Hub daemon. A live service must verify membership and disclosure on its server before showing private information.</p>
<div class="grid">
<article><h2>Discover</h2><p>Learn about a community, its purpose and its published rules before deciding whether to participate.</p><small>Public description and charter: integration pending</small></article>
<article><h2>Participate</h2><p>See community workgroups, ownership and events when the site supports those governed capabilities.</p><small>Committees and events: not enabled in this preview</small></article>
<article><h2>Accountability</h2><p>Understand decisions and evidence, without confusing an approved action with a verified outcome.</p><small>Human-readable receipt integration pending</small></article>
</div>
<section aria-labelledby="next"><h2 id="next">What happens next?</h2><p>A visitor should be able to read public information without installing Hestia. Future membership and participation actions must use authenticated, governed Hub endpoints. There is deliberately no fake Join button here.</p></section>
</main>
<footer><small>Independent, self-hosted communities. Preview content is illustrative, not operational evidence.</small></footer>
</body>
</html>
25 changes: 25 additions & 0 deletions hub/site/test_site.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env python3
"""Zero-dependency regression: the public preview must not masquerade as a live community."""
from pathlib import Path
import unittest

PAGE = Path(__file__).with_name("index.html")

class PublicSiteTests(unittest.TestCase):
def test_public_readable_without_js_or_login(self):
html = PAGE.read_text()
self.assertIn('<html lang="en">', html)
self.assertIn('name="viewport"', html)
self.assertNotIn("<script", html.lower())
self.assertNotIn('type="password"', html.lower())

def test_truthful_nonoperational_state(self):
html = PAGE.read_text()
self.assertIn("Preview, not a live community", html)
self.assertIn("There is deliberately no fake Join button", html)
self.assertIn("does not connect to a Hub daemon", html)
self.assertNotIn("/admin/api/", html)
self.assertNotIn("localStorage", html)

if __name__ == "__main__":
unittest.main()
Loading