Skip to content

WhatsApp Onboarding Spec v0.3 — Layer B/C scripts + PA push

Choose a tag to compare

@iPythoning iPythoning released this 21 May 15:59
· 256 commits to main since this release

The v0.3 release closes the gap between a spec and a real end-to-end pipeline. `bootstrap.sh` now drives a complete customer delivery in one command — exports go in, MemOS-ready profiles + KB chunks come out, and (optionally) push to PulseAgent on the spot.

Pipeline at a glance

```
exports/.txt
→ parsed/
.jsonl (PII-redacted turns)
→ profiles/.yaml Layer A — MemOS
→ golden/
.yaml Layer B — sales_playbook (human review gate)
→ layer-c-chunks.jsonl Layer C — conversation_history
→ (optional) push to PulseAgent
```

New scripts

  • `mine-golden-segments.py` — Two-pass Layer B miner.
    • Pass 1: sliding-window keyword detection across five tag classes (deal_close / objection_resolved / dunning_recovered / relationship_warmup / cross_sell) in EN / ZH / ES
    • Pass 2: Claude Haiku 4.5 scores each candidate 1-5, retags false positives, extracts 1-3 concrete tactical moves
    • Drops anything < 3, emits YAML with `_human_reviewed: false` flag for the audit step
  • `memos-upsert.py` — Posts `profiles/*.yaml` to PulseAgent `/api/memos/upsert`. Respects the strict `_auto_onboard` gate. `--force` for override, `--dry-run` to preview payloads.
  • `bulk-embed.py` — Chunks `parsed/*.jsonl` into KB records (chunk_size + overlap configurable). Embedding is deliberately left to the PulseAgent backend so every tenant stays consistent. Two modes: emit JSONL for offline import or `--upload` to push directly.

Config

All three PA-talking scripts honor: CLI flags > `pa-config.json` (cwd or `~`) > `PA_*` env vars. See `samples/pa-config.example.json`.

Fixes

  • Export parser MEDIA regex now eats outer `<>` around omitted-media markers — chunked text comes out clean.
  • bulk-embed dropped a duplicated media tag in the chunked text body.

Self-test

Validated end-to-end on synthetic iOS + Android exports (`/tmp/wa-selftest`):

  • Parser: 2 customers × 19 turns, PII redaction + session split + sender attribution all clean
  • Miner: 4 candidate segments emitted dry-run (matches expectations)
  • bulk-embed: 5 chunks from 19 turns at `chunk_size=6 overlap=2`

Compatibility

Drop-in extension of v0.2. No schema changes for parser, extractor, or customer profile format. New scripts honor the same salt and the same MemOS upsert convention used in earlier docs.

See `CHANGELOG.md` → 2026-05-21 v0.3 entry for the full list.