Public coordination layer

The DueCare Hub is the public spine that everyone runs against.

The hub is a small, public, append-only service. It signs and serves context packs, holds the global registry of grep rules and tools, accepts anonymized opt-in signals from partner deployments, and exposes a live audit feed. It does not see worker messages, names, or case content; those stay on the partner side.

One-line glossary
KnowledgeObject: the canonical envelope (v1.0). Every reusable artefact ships in this shape. Spec →
Knowledge pack: a versioned, downloadable bundle of KnowledgeObjects the hub serves.
Corridor pack: a knowledge pack scoped to one migration corridor (e.g. PHL-KWT).
Context pack: a knowledge pack when retrieval is loading it into a model prompt.
Vetted pack: a knowledge pack a curator has approved (see § Vetting). Default for client pulls.
Unvetted pack: a proposed or community-submitted pack. Pre-anonymized; downloadable with disclaimers.
KnowledgeObject taxonomy — 7 branches, 28 leaves
matching_knowledge grep_rule, glob_rule, classifier_rule, heuristic_rule
grounding_knowledge rag_doc, citation_edge, corridor_profile, ngo_directory
reasoning_knowledge persona_block, context_snippet, reasoning_step, rubric_dimension, modus_operandi
evaluation_knowledge evaluation_dimension, evaluation_prompt, evaluation_metric, evaluation_weighting
tool_knowledge tool_definition, tool_example, tool_chain
input_knowledge fact_template, extracted_fact, entity_signal, upload_schema, prompt_template
output_knowledge envelope_schema, audit_template, submission_schema
01a · Vetting process

From proposal to vetted release. Manual today; auditable end-to-end.

Every knowledge pack moves through five stages before clients pull it as vetted. Unvetted (proposed / community-submitted) packs remain downloadable for researchers and integration partners who explicitly opt in — pre-anonymized, with clear status flags so a recipient never confuses a community draft with a curator-approved release.

STAGE 01 · Proposed

Submission lands

A kernel client (POST /api/submit/knowledge) or a curator opens a proposal. PII is regex-redacted client-side; the hub re-runs the same redactor server-side before write.

STAGE 02 · Schema check

Envelope validated

Automated: each KnowledgeObject must validate (schema_version: "1.0", recognized knowledge_object_type, kebab-case id, well-formed content). Failures bounce with reasons.

STAGE 03 · PII scan

Hard gate

Server-side regex + entity pass for PERSON / EMAIL / PHONE / AMOUNT / ID / EMPLOYER. Any detection blocks the proposal until the submitter re-anonymizes; the audit log records a sha256 of the offending fragment, never the raw value.

STAGE 04 · Curator review

Manual today

A curator reads the proposal end-to-end, checks citations, verifies corridor scope, and either accepts, requests changes, or rejects with a reason. Decisions are recorded as JSONL entries with curator key + timestamp + decision.

STAGE 05 · Vetted release

Signed + published

Curator signs the content hash. The pack is published with status vetted. Default client pulls from /api/hub/knowledge/download serve only vetted entries; clients can opt in to unvetted with ?vetted=false for research / integration.

Why explain a manual process

Vetting is human-driven today and we say so publicly. An NGO caseworker or compliance reviewer should know exactly which stage their submission is at, who the curators are, and how to reproduce a decision. Automating Stage 04 with model-assisted review is the planned upgrade; nothing about the policy changes — only the cycle time.

Anonymized aggregate signals (Stage 01 & 02 outputs) flow into /stats so researchers can observe what the system sees without ever touching raw cases.

01 · What the hub is

A small, append-only public service. Not a database of cases.

The hub holds public source material, vetted pack manifests, the registry of grep rules and tools, and an anonymized trend rollup. It is intentionally narrow: anything that could identify a worker or case is rejected at the schema boundary before it ever touches storage.

What it serves Public, vetted knowledge No user-data table exists. Nothing about a worker or case lives here.
History Nothing is overwritten Every pack and rule keeps every prior version. Corrections ship as new versions.
Reads Public · unauthenticated Anyone can pull packs, manifests, rules, and rollups by hash.
Writes Curator-vetted Pack and rule writes require a curator key. Signal writes require a deployment key.
02 · What the hub facilitates

Three jobs, no more.

If a feature can't be expressed as one of these three jobs, it does not belong on the hub. New behavior moves into the harness or stays in the partner deployment instead.

Job 01

Distribute vetted context packs

Versioned bundles of public source material (laws, advisories, embassy notices) scoped to a corridor and frozen at a known date.

  • Pack manifest: corridor, jurisdiction, version, hash, signer
  • Diff review on every pack before publication
  • Pin a version; reproduce the same answer later
Job 02

Hold the global rule and tool registry

The grep rules every harness deployment runs, plus the catalog of tools deployments may call. One source of truth, mirrored on pull.

  • Rule: id, scope, severity, citation, version
  • Tool: name, schema, allowed callers, version
  • Public diff log; review queue for proposed changes
Job 03

Aggregate anonymized opt-in signals

Partner deployments may post anonymized pattern counts (e.g. fee_request per corridor, per week) so curators can see trends and regulators can act on them.

  • Schema rejects free text, names, IDs, contracts
  • K-anonymity floor (k≥30) before any rollup is published
  • Opt-in per deployment; revocable per signal type
03 · What the hub gives you

Vetted knowledge in. Verifiable answers out.

Four things any deployment can rely on. Read access is open and unauthenticated; everything you pull is curator-vetted, every version stays available, and nothing about a worker is ever stored. Implementation details live in /docs.

For deployers

Pull a knowledge pack

Download any version of any corridor pack as a single file. Pin it by version, verify it against the public curator key, ship updates on your own schedule.

Try it

duecare pull phl-kwt-domestic@1.7.2

For partners

Send an anonymized usage signal

Tell the hub which pattern fired and in which corridor, after your local anonymizer redacts everything else. Used for trends and research, never to identify a worker.

Privacy floor

k-anonymity ≥ 30. Aggregate only. No times, no contacts, no text.

For everyone

Verify any release

Every pack and rule carries a public signature. Run one command and your client tells you whether the file came from the curator or someone in the middle.

Verify

duecare verify pack.json

For auditors

Replay any decision

Every version of every pack stays available forever. Pin a release by hash, point a fresh runtime at it, get the same answer the harness gave six months ago.

Why

No deletes, no overwrites. Corrections ship as new versions.

Layer 05 · Audit

Public audit feed

Every write produces an audit row exposed on a public feed. Anyone can replay the feed and reproduce the current state of the hub.

Feed

/audit/stream.ndjson

04 · How to integrate with the hub

Pull packs. Verify them. Optionally share usage trends.

Most integrations are read-only: pull a pack, verify it, run locally. Partners who want to contribute trend data add one extra step: share an anonymized usage signal so the field can study which patterns are firing where.

Pull the latest version of a pack

Resolve the latest version of any corridor pack by id. The body is JSON; mirror it locally and your runtime stays offline-capable.

# latest version of the PHL→KWT corridor pack
curl https://gemma4-comp.onrender.com/api/hub/packs/phl-kwt-domestic

Filter the registry by characteristic

Combine any of kind, jurisdiction, corridor, tag, status_. The response also lists the discoverable values for each filter so a UI can populate dropdowns.

# every grep-rule pack vetted for any jurisdiction
curl "https://gemma4-comp.onrender.com/api/hub/packs?kind=GrepRulePack&status_=vetted"

# every pack tagged 'fees' for the Philippines
curl "https://gemma4-comp.onrender.com/api/hub/packs?tag=fees&jurisdiction=PHL"

Pin a specific version for reproducibility

List every known version, then pin the one you want. The pinned URL is stable forever; nothing is overwritten.

# every version of a pack
curl https://gemma4-comp.onrender.com/api/hub/packs/phl-kwt-domestic/versions

# pull a specific version
curl https://gemma4-comp.onrender.com/api/hub/packs/phl-kwt-domestic/1.7.2

Auto-sync only what changed

Tell the hub the timestamp of your last successful sync. The response lists every vetted pack vetted after that and gives you the next cursor.

# first sync (no cursor): list every vetted pack
curl https://gemma4-comp.onrender.com/api/hub/sync

# subsequent sync: pass the next_cursor from the previous response
curl "https://gemma4-comp.onrender.com/api/hub/sync?since=2026-04-12T09:14:00%2B00:00"

Recommended: poll every 6 hours from a cron and atomic-swap the pack file on disk only when the hash differs.

Send an anonymized usage signal

Aggregate counts only. Free text, identifiers, and case content are rejected at the schema boundary. The hub re-checks for PII even after your local anonymizer runs.

curl -X POST https://gemma4-comp.onrender.com/api/hub/signals \
  -H 'content-type: application/json' \
  -d '{
    "source": "ngo_case_intake",
    "jurisdiction": "Hong Kong",
    "corridor": "PH-HK domestic work",
    "risk_tags": ["recruitment_fee", "passport_retention"],
    "summary": "Aggregate pattern: high recruitment fees plus passport-retention requests in this corridor this month.",
    "consent_basis": "explicit_opt_in"
  }'

Opt out of sending signals

Three levels of opt-out, from least to most restrictive. None of them require you to call the hub; you control the runtime config.

  1. Per turn. Default. The runtime asks the operator before sending any signal. Operator clicks no, nothing leaves the device.
  2. Per corridor. Set signals.disabled_corridors = ["PHL-KWT"] in your runtime config. Anything matching that corridor is never proposed for sending.
  3. Per deployment. Set signals.enabled = false in your runtime config. The hub never receives a signal from this deployment, period. Pulls keep working.

There is no "force send" override. Local config wins.

Submit a public-source proposal

Same endpoint the website's contribute form posts to. The server-side automation triages the summary; the curator queue is shared. kind picks the proposal type.

curl -X POST https://gemma4-comp.onrender.com/api/hub/client/submission \
  -H 'content-type: application/json' \
  -d '{
    "kind": "context",
    "deployment_id": "ngo-helpdesk-bd",
    "organization": "Migrant Forum BD",
    "jurisdiction": "BGD",
    "corridor": "BGD-SAU",
    "public_source_url": "https://example.gov/bd-sau-advisory-2026",
    "summary": "New regulator advisory clarifies the placement-fee cap for the BGD-SAU domestic corridor.",
    "consent_public_proposal": true
  }'

Retract a submission before vetting

Only succeeds while the submission is still proposed or needs_review. Once a curator approves or rejects, the record is immutable.

curl -X POST https://gemma4-comp.onrender.com/api/hub/client/submission/retract \
  -H 'content-type: application/json' \
  -d '{
    "submission_id": "cli_abc123def456",
    "reason": "operator changed their mind after submitting"
  }'
05 · How the hub is run

Five operating rules. Every one is enforceable.

These are not values; they are constraints in code. If a pull request tries to add behavior that breaks one of them, the hub does not ship it.

01

Public source only

Every pack input is a public document with a citable URL. Curator review is recorded on the diff that brings it in.

02

No PII column

The JSONL append-only store has no name, message, contact, ID, or employer column. There is nothing for a misconfigured client to populate.

03

Nothing is overwritten

Every pack, rule, and tool keeps every prior version. Corrections ship as new versions; the old ones stay available so a six-month-old advisory can still be reproduced.

04

K-anonymity floor on rollups

Trend slices below k≥30 are not published. The floor is applied before any aggregate leaves the storage layer.

05

Curator key rotation

Signing keys rotate on a fixed schedule. Old keys are revoked but remain in the public log so historical packs stay verifiable.

06

You can replay every release

Every change shows up in the public history feed before anyone can read the result. Pin a release to a hash, point a fresh runtime at it, get the exact same answer the harness gave at the time.

Ready to integrate?

Start with the API client guide for pulling packs and verifying signatures, or read the safe-use checklist for partner deployments.