HiNet.

Documentation  /  Track 2 — personal data

I'll write the full functional spec directly as my response. This is a documentation task — no tools needed since the context provides everything required.

HiNet Track 2 — Functional Specification

The Personal-Data & Agentic macOS Product

Document status: Draft v0.1 (functional spec) · Date: 2026-06-22 · Owner: HiNet / iCore product Scope: Track 2 only (the native macOS product). Track 1 (the iCore model science — DNA base, Δ tuning, composition mechanics) is referenced but not specified here. Networking/qCore, token economics, and inter-iCore composition over a network are explicit non-goals for this document.


1. Purpose & Scope

1.1 What Track 2 is

Track 2 is the product surface of HiNet: a native macOS application through which a single human (the owner) installs their personal iCore (a complete, standalone, continually-personalized LLM), opens up their personal data to it via local connectors, and then chats with and delegates to their iCore as a local, consent-gated agent.

The product is built on one non-negotiable invariant, inherited from the HiNet ethos ("not your weights, not your intelligence"):

Local-first, owner-sovereign. All tokens, raw data, derived embeddings, model deltas, and audit logs live on hardware the owner controls. HiNet (the company/network) never receives the owner's connector tokens or personal data. There is no server-side copy. Backups (VaultReplication) go only to owner-owned targets, as ciphertext.

1.2 The product loop

Onboard → Establish identity (Ed25519) → Install iCore (DNA + empty Δ)
   → Connect accounts (in-app OAuth / export import)
   → Consent + ingest → Vault (encrypted) → Build training views
   → Chat / delegate (agentic iCore) → Nightly sleep cycle (personalize Δ + RAG)
   → Repeat. Settings/kill-switch/backups always available.

1.3 MVP scope (must ship in Track 2 v1)

Area In MVP
Identity Ed25519 owner keypair, local; passphrase-unlocked vault (SQLCipher)
iCore install Pull DNA base (Qwen3-MoE, bf16), provision empty per-owner Δ, local inference via MLX
Connectors Telegram (Export Data JSON import + optional MTProto/Telethon), Google Drive (OAuth, multi-account), Gmail (OAuth, multi-account), WhatsApp (per-chat export import), Slack (OAuth user-token)
Ingestion pipeline SourceConnection · SourceRecord · ConsentGrant · sensitivity class · retention · dedupe · fact→RAG / skill→Δ classification
Vault SQLCipher encrypted store; embeddings index (local vector store); audit hash-chain
Agentic layer iCore-as-agent (Hermes-style), tools = connectors + RAG/memory + web fetch; conversation; bounded task delegation; per-tool consent gating
Sleep cycle Nightly local personalization: refresh RAG index + run Δ tuning (DoRA on laptop tier; full-FT where hardware allows)
App UX Onboarding, identity, connect-accounts (incl. multi-account), consent dashboard, chat/agent, training/sleep status, settings (kill-switch + VaultReplication)
Backups VaultReplication: encrypt-local → replicate ciphertext to owner-owned target (local disk / owner's cloud bucket)

1.4 Deferred (post-v1, out of scope for this spec)

1.5 Honesty note (carried from Track 1)

Track 1 sims validate mechanisms (injection, composition, conflict-based routing). Real-data eval, continual-learning stability, privacy guarantees at scale, and routing-at-scale remain open. Track 2 v1 therefore ships the plumbing (connectors → vault → training views → agent) as production-grade, while the Δ-tuning quality is treated as an evolving capability gated behind the nightly sleep cycle with measurable before/after recall checks (per Track 1 methodology).


2. Primary User Stories

Onboarding & identity - US-1 — As a new owner, I install the macOS app and it generates my Ed25519 identity locally, so my iCore is cryptographically bound to me without any server account. - US-2 — As an owner, I set a vault passphrase and the app provisions my iCore (DNA base + empty Δ), so I have a working personal LLM before connecting any data.

Connecting data - US-3 — As an owner, I connect my Gmail via in-app OAuth, and I can connect a second and third Gmail account (work + personal), each kept distinct. - US-4 — As an owner, I connect multiple Google Drives the same way and choose which folders each account exposes. - US-5 — As an owner, I connect Slack with a user token and choose which workspaces/channels to ingest. - US-6 — As an owner, I import my Telegram "Export Data" JSON (or optionally authorize a Telethon user session) and the app ingests my chats locally. - US-7 — As an owner with no WhatsApp API, I import per-chat "Export Chat" dumps and the app folds them into my vault.

Consent & control - US-8 — As an owner, before any source is ingested I see exactly what will be pulled, its sensitivity class, and its retention, and I must grant a ConsentGrant. - US-9 — As an owner, I open a consent dashboard and revoke a source; the app deletes its derived data and stops using it. - US-10 — As an owner, I hit a kill-switch that instantly halts ingestion + agent activity and locks the vault.

Using the iCore - US-11 — As an owner, I chat with my iCore and it answers in my voice using my own facts (RAG over my vault). - US-12 — As an owner, I delegate a task ("summarize last week's emails from X and draft a reply"), and the agent uses connector tools + RAG, asking consent before any send/write action. - US-13 — As an owner, I see the agent's tool calls and reasoning trace, and every privileged action is in my audit log.

Personalization & backups - US-14 — As an owner, I see nightly "sleep cycle" status: what was ingested, what RAG was refreshed, whether Δ was retrained, and a before/after recall delta. - US-15 — As an owner, I configure VaultReplication to my own cloud bucket and restore my iCore on a new Mac from that ciphertext backup + my key.


3. Connector Framework

3.1 Design

A connector is a local plugin that authenticates with the owner's own credentials, pulls data, and emits normalized SourceRecords into the ingestion pipeline. Connectors never transmit data off-device and never expose tokens to HiNet. They run inside the hinetd Python sidecar, supervised by the Rust security core.

Connector contract (interface):

Connector
  id:            stable connector type (e.g. "gmail", "gdrive", "slack", "telegram", "whatsapp")
  account model: single | multi
  auth():        establish/refresh credentials → store in OS keychain (token ref only)
  list_scopes(): enumerate selectable units (mailboxes, folders, workspaces, chats)
  preview():     describe what would be pulled + counts + sensitivity (for the consent screen)
  pull(scope, cursor) -> [SourceRecord]   # incremental, resumable
  normalize(raw) -> CanonicalItem         # the HiNet Canonical Record (HCR) — docs/specs/HiNet-Canonical-Record.md
  revoke(account): drop token, signal pipeline to purge derived data

Cross-cutting rules for every connector: 1. Local-only. All network calls go directly from the owner's machine to the provider. No proxy, no relay. 2. Token custody. OAuth tokens / session strings live in the macOS Keychain, referenced by handle; the Rust core mediates access. The Python sidecar receives short-lived access tokens only at call time. 3. Consent-before-pull. No connector pulls a single byte before a matching ConsentGrant exists for that account+scope. 4. Sensitivity tagging at the source. Each connector declares a default sensitivity class per record type; owner can override. 5. Incremental + resumable. pull() is cursor-based so re-runs are cheap and an interrupted ingest resumes. 6. Multi-account is first-class. A connector with account model: multi keeps each account as a separate SourceConnection with its own token, scopes, consent, and audit trail. Records carry their originating account_id. 7. ToS posture. We only use official APIs or official user-initiated exports. Where a provider forbids automation (WhatsApp), we are import-only and never automate the client.

3.2 Telegram

3.3 WhatsApp

3.4 Slack

3.5 Google Drive (multi-account)

3.6 Gmail (multi-account)

3.7 Connector capability matrix

Connector Auth Multi-account Live/incremental Default sensitivity ToS posture
Telegram Export JSON (A) / Telethon MTProto (B) Yes (per export / per session) A: no · B: yes Personal (1:1 = Sensitive) Official export or documented user API
WhatsApp Manual "Export Chat" Per-chat / per-number No (manual snapshot) Sensitive Official user export only; no automation
Slack OAuth user token (xoxp) / workspace export Yes (per workspace) Yes (API) Normal (DM/private = Sensitive) Official Web API
Google Drive OAuth (Drive v3) Yes (per Google account) Yes (Changes API) Normal (override per folder) Official API, read-only default
Gmail OAuth (Gmail API) Yes (per Google account) Yes (History API) Sensitive Official API, restricted-scope verified
Local files / iCloud Drive Filesystem read (~/Library/Mobile Documents for iCloud; Obsidian; code repos) Per-folder Yes (watch) Normal (override per folder) Local; the owner's own files
Google Calendar OAuth (Calendar API) Yes (per Google account) Yes Normal Official API, read-only
Platform export dumps One-shot import of owner-initiated exports (Gmail Takeout, X / LinkedIn / Instagram "download your data", ChatGPT export) Per export No (snapshot) Per-source ToS-clean (owner-initiated export) — the realistic socials path

Deferred — live social feed-slice capture. Each social account sees a different slice of the network (its feed, its connections' content) — a valuable differentiated signal — but official APIs rarely expose the feed-view and logged-in session capture is brittle/ToS-fragile. The clean path is export-dumps (own content) + the easy connectors; live feed-slice capture is a deferred, per-platform effort.


4. Ingestion → Vault → Training-Views Pipeline

4.1 Stages

Connector.pull()
   → raw payload (in-memory, never persisted raw to disk unprotected)
   → normalize() → SourceRecord (canonical)
   → consent gate (ConsentGrant for account+scope?)  ──no──▶ drop + audit
   → sensitivity classify (default + owner override)
   → dedupe (content hash + provider id)
   → persist to Vault (SQLCipher, encrypted at rest)
   → enrich: chunk + embed (local embedding model) → vector index
   → CLASSIFY for training: fact → RAG  |  skill/voice → Δ  |  conflicting → route
   → build/refresh Training Views (consumed by the nightly sleep cycle)
   → retention scheduler tags expiry
   → audit hash-chain append (no record content, just event + hash)

4.2 Key pipeline objects

4.3 Fact → RAG / Skill → Δ classification (the core routing decision)

Grounded in Track 1's validated finding: weight-merging facts caps out (~73%) while retrieval handles facts cleanly; voice/skill belongs in weights; conflicting deltas must be routed, not merged. The pipeline applies this at ingest, per chunk:

Content character Destination Rationale (from Track 1)
Facts / specifics (names, dates, contents of an email, a doc's figures, "who said what when") RAG (vault + vector index; retrieved at query time) Facts memorized in weights cap ~73% recall; retrieval-union is the validated approach for facts.
Voice / style / skill (how the owner writes, recurring reasoning patterns, domain skills, tone) Δ training-view (feeds nightly DoRA/full-FT into per-owner Δ) Fine-tuning genuinely injects (0.27→0.97 recall on the right recipe); voice/skill is durable, not lookup-shaped.
Conflicting signal (contradictory skills/styles across sources) Route (kept as separable view; spectrum router selects at inference) Routing 0.61 vs merge 0.04 on conflicting skills — merge destroys conflicting deltas.

Classifier mechanism. A local lightweight classifier (heuristic + small-model scoring) tags each chunk fact | skill | voice | mixed, with confidence. fact → RAG-only. skill/voice (high-confidence, non-conflicting) → Δ view. Conflict detection compares candidate skill/voice deltas against existing views; conflicts are flagged route and never merged. mixed is split where possible, else defaults RAG-only (safe: facts never silently enter weights). Sensitivity gates this too — Secret content is RAG-only by default (never enters Δ) unless the owner explicitly opts a source into training.

4.4 Training Views

A TrainingView is a consent- and sensitivity-filtered, classified, deduplicated projection of the vault that the nightly sleep cycle consumes. Two primary views: - RAGView — chunk+embedding corpus + metadata for retrieval. Refreshed every sleep cycle (cheap, incremental). - DeltaView — the skill/voice training set for Δ tuning, partitioned into merge-eligible (complementary) and route (conflicting) buckets per Track 1's composition mechanism.

The sleep cycle (§5.5 / §6.6) reads these views, never the raw connectors.


5. Agentic Layer

5.1 Model

The local iCore model (DNA + owner Δ, served via MLX) is the LLM backend for a Hermes-style agentic framework running entirely on-device. The iCore is not just a chat endpoint — it is an agent that holds conversations, plans, calls tools, and runs delegated tasks, all locally and consent-gated.

5.2 Tools available to the agent

  1. Connector tools — read and (optionally, gated) write through the same connectors: - read_email(account, query), draft_email / send_email(account, …) (send gated) - read_drive(account, query), read_telegram(scope), read_slack(workspace, scope), read_whatsapp(scope) - Write/send tools (send_email, post-to-Slack, etc.) are off by default and individually consent-gated.
  2. RAG / memory toolretrieve(query) over the owner's vault (the primary path for facts; see §4.3).
  3. Web toolweb_fetch(url) / web_search(query) for external info, clearly marked as off-device network egress (owner-toggleable; off-by-default for Secret-context tasks).
  4. Task/plan tools — scratch memory, multi-step planning, and a request_consent(action) tool the agent MUST call before any privileged/irreversible action.

5.4 Conversation & delegation

5.5 Relationship to the sleep cycle

The agent is inference-time; the sleep cycle is the offline learning loop. They share the vault but are separate: chatting/delegating never mutates Δ live. Improvements to voice/skill land via the nightly DeltaView training; new facts become available via the incremental RAGView refresh (often same-cycle).


6. macOS App UX (screen-by-screen)

Shell: Tauri (UI) + Rust security core (identity, keychain mediation, vault gatekeeper, audit) + Python hinetd sidecar (connectors, ingestion, embeddings, MLX inference, sleep cycle). The UI never touches tokens or raw vault data directly — it goes through the Rust core's mediated, audited API.

6.1 Onboarding

6.2 Identity

6.3 Install iCore

6.4 Connect accounts (incl. multi-account)

6.6 Chat / Agent

6.7 Training / Sleep status

6.8 Settings


7. Data Model / Key Objects

SourceRecord is now formally the HiNet Canonical Record (HCR) — the implemented, versioned pydantic schema (app/osx/hinetd/hinetd/canonical.py) that every connector's normalize() emits and the vault validates. The sketch below is the high-level view; the canonical doc + module are the source of truth (envelope, conversation/thread model, cross-source identity + entity resolution, stable-ID/dedupe, per-source mapping tables).

Owner
  ed25519_pubkey (identity)         # local, sovereign
  vault_key_ref                     # derived from passphrase; SQLCipher
  hardware_tier                     # pocket | laptop | cloud-eligible

SourceConnection
  id, connector_id                  # gmail | gdrive | slack | telegram | whatsapp
  account_id                        # distinguishes multi-account
  token_ref                         # Keychain handle (never the token)
  scopes[]                          # selected folders/labels/channels/chats
  cursor                            # incremental sync state
  status, created_at, last_sync_at

SourceRecord
  id, connection_id, account_id
  provider_id                       # original message/email/file id
  type                              # message | email_thread | file | doc
  participants[], timestamp
  content                           # normalized text (encrypted at rest)
  media_refs[]                      # optional, if opted in
  content_hash                      # dedupe
  sensitivity                       # Public|Normal|Personal|Sensitive|Secret
  retention_policy_ref
  classification                    # fact | skill | voice | mixed | route
  created_at

ConsentGrant
  id, connector_id, account_id, scope
  allowed_uses[]                    # ingest, rag, delta_train, agent_read, agent_write
  sensitivity_ceiling
  retention                         # keep_until | window | forever
  granted_at, revoked_at

RetentionPolicy
  id, mode (keep_until|window|forever), value, applies_to

EmbeddingChunk
  id, record_id, vector, text_span, sensitivity   # local vector index (RAGView)

TrainingView
  kind                              # RAGView | DeltaView
  partition                        # for DeltaView: merge_eligible | route
  built_at, record_refs[]

AuditEvent (hash-chain)
  id, prev_hash, hash
  event_type                        # ingest | consent_grant | consent_revoke |
                                    # purge | tool_read | tool_write | sleep_cycle |
                                    # kill_switch | backup | restore
  connector_id?, account_id?, tool?, timestamp
  # content-free: hashes/refs only, never record bodies

DeltaState
  base_dna_version (Qwen3-MoE bf16)
  delta_ref (per-owner Δ)
  last_trained_at, method (DoRA|full_ft), recall_probe_score

8.1 Privacy posture

8.3 Audit

8.4 Kill-switch


9. Explicit Non-Goals / Deferred

Item Status Note
Inter-iCore networking / composition (qCore, fractal-holographic whole) Deferred Track 2 v1 is single-owner, single-iCore. Composition is validated science (Track 1) but not productized here.
Token economics / monetization / marketplace Deferred No payments, credits, or markets in v1.
Attested cloud sandbox compute Deferred (seam present) ComputeBackend abstraction exists; v1 runs local. User-owned-cloud full-FT is the first extension.
Mobile / pocket-tier app Deferred v1 is macOS (Apple silicon). Phone/Jetson inference later.
WhatsApp / iMessage live sync Deferred / Not planned No personal API; import-only by design (ToS).
Cross-owner sharing, group agents, delegation to others' iCores Out of scope Single-owner product.
Server-hosted vault or "HiNet cloud account" Will not build Violates the local-first invariant. Backups are owner-owned only.
Δ-tuning quality guarantees at scale Open (honest) v1 ships the loop with before/after recall probes; quality matures over cycles.

10. Sovereign storage (VaultReplication) & the proprietary split

(Canonical home — merged from the former Personal-Data-and-Sovereignty doc.)

10.1 What is actually "proprietary"

Each owner does not build a fully private base model — if everyone had a private base, experts could never merge into a bigger model and the fractal thesis dies. The split:

Component Ownership Why
Shared anchor (Qwen3-MoE DNA) public, identical for all composability — deltas only merge against a common base
Δ_private (the private mind) proprietary, encrypted, never leaves the owner's raw personalization
Δ_public (the public twin) proprietary; only a leakage-gated, generalized projection is optionally shared what the owner chooses to teach
Vault (data, memory, embeddings) proprietary, encrypted the owner's experience

"Your little proprietary model" = your encrypted deltas + data on the commons anchor — what makes ownership and composition possible at once. (Ownership model: Foundational-Model-Plan §2A.)

10.2 VaultReplication — survive device loss without trusting HiNet

encrypt locally (owner's data key) → replicate CIPHERTEXT to N owner-owned targets
   target 0: local disk (primary)
   target 1: the owner's own cloud (Google Drive / S3 / Storj)
   target 2: a decentralized FS (IPFS-with-pinning / Arweave / Storj), ciphertext only

10.3 Keys & recovery (the sovereignty tradeoff)

10.4 Security-first sequencing

Ingesting real personal data is the highest-stakes privacy surface in the system: the consent + audit + encryption container must exist before any connector touches your Gmail. Connectors and replication are features of the node container, not standalone scripts — which is why the build order (Whitepaper §8) converges on the container first.


Appendix A — Mapping to existing HiNet primitives

End of Track 2 Functional Specification (Draft v0.1).


Next: Canonical record (HCR) →  ·  All documentation →