UniExp HK 實驗港
- Next.js
- TypeScript
- Tailwind CSS
- Self-hosted Supabase
- Cloudflare
- Gemini
- Agent Harness
- Policy Gate
- Quality Workbench
A live trilingual platform that helps Hong Kong researchers publish studies and recruit participants. I built the product, publishing-review process, and a guarded AI review layer that suggests updates only after evidence checks and human approval.
At a glance
Role Sole founder & builder — product design, front end, back end, launch, daily maintenance
Problem
HK research recruitment is scattered across chat groups, ad-hoc forms, aggregate pages, posters, and bilingual source pages; researchers struggle to fill studies, while participants and operators need reliable evidence before anything is published.
Solution
I built the full platform around two simple flows: researchers publish and manage studies; participants browse, sign up, and rate them. An evidence-gated AI review layer sits behind admin review so automation can surface candidates without directly changing production truth.
Impact
Live trilingual platform · 115 merged PRs (latest #120) · solo-built and operated
My contribution
- Study posting + time-slot scheduling + enrolment review for researchers
- Browse / filter / sign-up / rating for participants
- Full trilingual i18n (EN / 繁中 / 简中)
- External Study Ops Agent with a layered autonomy ladder: L1 shadow → L1.5 cross-check → L1.6 Codex replacement check → L2 proposal queue → L3 guarded write (≤1 pending item per queue per run)
- Multi-queue agent: one external entry, internal supervisor + four workers (new_study_lead / published_change / source_candidate / seed_candidate), each bounded to a specific Admin pending table
- Scheduled guarded review: a daily VPS cron (22:05 UTC) runs the L1 shadow, emits read-only evidence, and writes nothing to production — explicitly not autonomous production control
- Production Explore truth source, quality workbench, section-level evidence, signup freshness, visual/OCR/QR review, and a feedback-audit ledger
Technical evidence
- Agent safety model: every queue proposal passes a deterministic evaluateQueueProposalPolicy() gate that stamps writeEligible; L1 only writes local noProductionWrite=true reports; autonomy stops at Admin pending queues — experiments, source registry, and approve/reject stay human-reviewed
- Truth discipline: production Explore (published experiments) is the only source of truth; the legacy pipeline, source/seed discovery, and agent shadow reports are candidate generators, never allowed to overwrite truth
- Evaluation & readiness gates: daily-cron evidence distinguishes real_cron from manual runs; L3 readiness requires ≥10 reviewed proposals, ≥80% acceptance, zero stale/bad-source false positives, and no production-write incident over 30 days
- Failure→gate discipline: a proposal that mistook an HKD 80 baseline for the total compensation became a permanent compensation-component policy check, downgrading that class to report-only
- Reasoner reliability: the Gemini reasoner must return structured JSON; on bad output or failure it falls back to a deterministic reasoner and keeps running read-only — model participation never implies execution permission
- Self-hosted Supabase (auth + Postgres + maintenance) + Cloudflare for edge acceleration and abuse protection; sustained solo through 115 merged PRs (latest #120, Cloudflare deploy Node patch)
From a pipeline to a harness
External study collection isn't a one-off cold start — recruitment pages expire, forms close, one aggregate page hosts many studies, and the legacy pipeline can misjudge sources or duplicates. Letting an agent write the production database directly is too risky, so the agent is wrapped in a harness: policy gates, a truth source, a quality workbench, and Admin review decide what's actually executable.
The autonomy ladder
Autonomy is layered, not all-or-nothing: L1 shadow (local reports only, noProductionWrite=true) → L1.5 cross-check → L1.6 Codex replacement check → L2 proposal queue → L3 guarded write, at most one pending item per queue per run. Each rung is gated, and the agent's authority stops at Admin pending queues — experiments, the source registry, and approve/reject stay human-reviewed.
Multi-queue design and truth discipline
There's one external entry, but internally a supervisor splits work across four workers — new_study_lead, published_change, source_candidate, seed_candidate — each bounded to a specific Admin pending table. A deterministic evaluateQueueProposalPolicy() gate stamps write-eligibility, so no worker can self-certify a candidate as writable.
Production Explore — already-published experiments — is the only source of truth. The legacy pipeline, source/seed discovery, and agent shadow reports are candidate generators that can never overwrite truth.
A failure that became a gate
One proposal mistook an HKD 80 baseline for the total compensation, ignoring a second optional HKD 80 follow-up. The fix wasn't a one-off correction — the policy gate gained a compensation-component semantic check that downgrades that whole class to report-only. A failure turned into a reusable gate, which is the point of the harness.
Daily guarded review
A VPS cron runs the L1 shadow daily at 22:05 UTC, emitting read-only evidence and writing nothing to production. A separate read-only checker distinguishes a real cron run from a manual one; three consecutive days of passing real-cron evidence, with zero policy violations, is the gate into L2 readiness review — not an automatic upgrade. It is scheduled guarded review, explicitly not autonomous production control.
Screenshots