Lab Context Distillation WX
Current release status: v2 is verified with synthetic/public fixtures; real-device validation remains capability-specific. Do not claim compatibility with a particular WeChat 4.x build until that build passes the field checklist. Read STATUS.md, the feature implementation matrix, and the immutable machine contract manifest before use.
Build an evidence-bounded personal operating model primarily from user-approved WeChat data. Keep collection and identity work local; let the current model see only sealed, redacted packets. A lawful standard export is a fallback ingestion path, not a claim that this Skill is a general-purpose importer for every conversation platform.
Non-negotiable boundaries
- Never read or send raw databases, local keys, identity maps, or
local/normalized.jsonl to a model.
- Treat a request to analyze or distill as authorization to process already-redacted data for this task.
- Ask again only before adding a new source, sending unredacted content, acquiring a local key, or approving a knowledge-base write.
- Do not rerun an
accepted unit. Create a new generation when rules or inputs change.
- Do not mutate a sealed release, ledger history, receipt, packet, or candidate set.
- Separate infrastructure, structure, content, privacy, and dependency failures.
- Use deterministic structural repair only when meaning and evidence stay unchanged.
- Do not write to a knowledge base after approval automatically. Approval produces a receipt; use the relevant external connector only in a separate, explicitly authorized step.
- Do not hard-code a model vendor, model name, agent count, or Fast mode.
- Keep the complete event ledger as authority. Importance may rank a biography view but must never delete an episode.
- Give every route exactly one processing result. A processing result emits zero-to-many independent events; each event owns its semantic disposition. Never merge events to fit a single-object shape.
- Bind every event evidence ID and place ID to that route's frozen allowlists. An empty place allowlist requires empty event
place_ids; unverifiable place IDs never enter the ledger.
- Keep
observed_message_time separate from asserted_event_time; never substitute message time for an unknown event time.
- A runtime answer must declare relevant-domain coverage as
complete, partial, not_extracted, or ambiguous. No retrieval hit means unknown, not an arbitrary top-N fallback.
- Voice mode may draft only. It may not impersonate, auto-send, make commitments, or claim indistinguishability.
- Do not perform process-memory key extraction, injection, app re-signing, native key derivation, or package a circumvention tool. These are explicit legal/terms blockers in this public implementation.
Read privacy-and-authorization.md before handling a new case. Read platform-connectors.md before touching WeChat data.
Run the workflow
Before parallel or resumed real distillation, validate the frozen machine contract:
python3 scripts/pcd.py contract-validate contracts/real-distillation-v2
The manifest pins the field enums, route-result/event-item/place schemas, acceptance gates, and delta-routing rules by SHA-256. A main project with an accepted Map starts at post_map_domain_routing; it does not rerun accepted Map work.
Create an isolated case directory outside this Skill package:
python3 scripts/pcd.py init /path/to/case
For a new source, explain the source and obtain exact approval, then record it:
python3 scripts/pcd.py authorize /path/to/case new_source --note "user approved this source"
For WeChat 4.x, privately discover and register a user-approved source, then snapshot the entire account database set:
python3 scripts/pcd.py wechat4-discover /path/to/case macos
python3 scripts/pcd.py wechat4-snapshot /path/to/case acct_... snapshot-g0001
Use windows on Windows. An explicit --root is allowed. The command output contains opaque refs, not local paths.
If the snapshot contains encrypted candidates, obtain separate local_key_access approval. Accept only a lawfully obtained 32-byte hex key in a private mode-0600 file and a separately installed SQLCipher binary:
python3 scripts/pcd.py authorize /path/to/case local_key_access --note "user supplied a lawful local key"
python3 scripts/pcd.py wechat4-decrypt /path/to/case /path/to/snapshot decrypted-g0001 --key-file /private/key.txt
Never display the key or put it in a command argument. The implementation passes it to SQLCipher over stdin. If the actual build does not match the tested standard profile, stop and use a user-provided lawful decrypted export; do not guess parameters or extract a key from process memory.
Map a plaintext snapshot through a versioned schema profile. Put the current account's private self identifier in a mode-0600 file:
python3 scripts/pcd.py wechat4-map /path/to/case /path/to/plain-snapshot macos --self-file /private/self-id.txt
python3 scripts/pcd.py release /path/to/case g0001
python3 scripts/pcd.py wechat4-checkpoint /path/to/case wmap_... g0001
The checkpoint moves only after the exact mapped fingerprints appear in a verified sealed release. Contacts and identity aliases stay in local/; the release contains deterministic pseudonyms.
For a lawful standard export instead, import unified records directly. The input rows must follow record-contract.md:
python3 scripts/pcd.py ingest-jsonl /path/to/case /path/to/export.jsonl --source-name source-1
python3 scripts/pcd.py release /path/to/case g0001 --gap "media unavailable"
Plan Map packets from the sealed release:
python3 scripts/pcd.py plan /path/to/case map /path/to/case/releases/g0001/records.jsonl
Process runnable packets with the user's current model. Claim one unit and read only its file in packets/. Follow that packet's output_contract; do not reuse one stage's shape for another. Map/Merge/Final candidates include the six-field quality audit. Merge includes exact component IDs; Final includes confidence and limitations; QA includes a distinct seven-check report plus separate precision and recall counts. Every packet input must be used as evidence or listed in coverage.excluded with a reason.
Keep model execution, local validation, and commit separate:
python3 scripts/pcd.py record-output /path/to/case map:... /path/to/result.json
python3 scripts/pcd.py validate /path/to/case map:...
python3 scripts/pcd.py commit /path/to/case map:...
submit is a small-case convenience that runs these three deterministic transitions in order. For long runs, prefer the separate commands so the feeder and validator can progress independently. If independent packets and dynamic subagents are available, choose concurrency from current workload and error signals; never treat configured concurrency as actual in-flight work.
After every Map unit is accepted, materialize the immutable derived view. For a general semantic model, plan Merge with all Map unit IDs as dependencies:
python3 scripts/pcd.py materialize /path/to/case map /path/to/case/derived/map.jsonl
python3 scripts/pcd.py plan /path/to/case merge /path/to/case/derived/map.jsonl --depends map:...
Before Final, freeze the exact Merge candidate IDs and pass that set to planning:
python3 scripts/pcd.py freeze-candidates /path/to/case final-input /path/to/case/derived/merge.jsonl
python3 scripts/pcd.py plan /path/to/case final /path/to/case/derived/merge.jsonl --candidate-set final-input --depends merge:...
Repeat acceptance and materialization for Final and QA. Preserve the complete Map; compaction is derived and keeps lineage. Read workflow.md and quality-and-adjudication.md.
For the v2 life-context path, route the accepted, redacted episode authority independently through all nine domains. Start with travel only when field evidence is being established; travel completion never implies another domain is complete:
python3 scripts/pcd.py domain-plan /path/to/domain-work travel-g0001 travel /path/to/episodes.json
# The current model returns one processing result per route; each result contains events[].
python3 scripts/pcd.py domain-validate /path/to/domain-work/domain-packets/travel-g0001.json /path/to/travel-result.json /path/to/travel-ledger.json
python3 scripts/pcd.py life-ledger-merge /path/to/life-ledger.json /path/to/travel-ledger.json /path/to/education-ledger.json
The packet freezes separate evidence and place allowlists for every route. events_emitted requires one or more independent event items; no_signal, out_of_domain, and insufficient_evidence require an empty events array. Every event carries its own status, evidence subset, and place subset. Repeat domain-plan and domain-validate for education, work, relationship, residence, family, health, finance, and creation. Unrun domains remain not_extracted; an ambiguous route remains visible. Normalize locations only from explicit candidates:
python3 scripts/pcd.py places-normalize /path/to/place-mentions.json /path/to/place-candidates.json /path/to/places.json
Build a sealed portable package from the complete ledger, evidence, layered assets, and trusted-card index; then query the smallest relevant private context:
python3 scripts/pcd.py package-build /path/to/life-ledger.json /path/to/places.json /path/to/evidence.json /path/to/assets.json /path/to/cards.json /path/to/packages profile-g0001
python3 scripts/pcd.py runtime-query /path/to/packages/profile-g0001/package.json "问题" --mode biography --filters /path/to/filters.json
Modes are biography, voice, advisor, and mixed. Search applies structured filters and Chinese-friendly lexical matching; optional semantic scores are caller-provided. Knowledge cards are high-confidence indexes, never substitutes for the evidence or event layers.
Route ambiguous meaning, invalid attribution, unresolved conflict/missing evidence, or privacy exceptions to human adjudication. Deterministic fixes may normalize shape, nulls, order, and duplicate evidence IDs; they may not invent evidence, rewrite claims, upgrade source strength, erase weak-source markers, or change narrative fields.
Freeze a knowledge-base proposal. Show its exact entries and digital seal to the user. Record kb_write authorization only after explicit approval, then create an approval receipt. External writing remains a separate step.
Treat incremental update, correction, source withdrawal, single-domain re-extraction, and rollback as explicit append-only transitions. Use the profile-* commands in profile-evolution.md. Every transition creates a new snapshot; old results stay read-only. Rebuild only affected domains and downstream packages, never accepted Map generations.
Resume safely
Run python3 scripts/pcd.py status /path/to/case. The append-only ledger is authoritative; summary counts are derived. Run recover-ingestions if a private WeChat mapping was interrupted; release creation verifies that every redacted fingerprint has a completed source receipt. Freeze policy-freeze before a large run so the receipt records the current user model, ordinary/advanced/mixed tier, dynamic concurrency, and the absence of Fast mode. Run recover-results before resubmitting an unknown transport outcome. Use controller-refill for completion-driven slots and scope-freeze/scope-status for a sealed migration/drain denominator. Use process-sample repeatedly for the exact task-owned PIDs when diagnosing resource pressure. Reclaim only expired reservations. Never infer that a directory alone means a step completed.
Load references selectively
- Full stage sequence and commands: workflow.md
- Privacy and permission decisions: privacy-and-authorization.md
- Unified record and evidence fields: record-contract.md
- Ledger transitions and resume rules: state-machine.md
- Error-specific recovery: error-taxonomy.md
- Capability tiers and adaptive concurrency: model-and-concurrency-guidance.md
- Real-platform boundary and safe fallback: platform-connectors.md
- Acceptance, conflicts, gaps, and adjudication: quality-and-adjudication.md
- Complete episode ledgers, dual time, coverage, and place taxonomy: life-event-ledger.md
- Runtime retrieval, personal assets, voice boundary, fidelity, and cards: runtime-and-assets.md
- Incremental update, correction, withdrawal, re-extraction, and rollback: profile-evolution.md
- Frozen machine-readable enums, schemas, gates, and delta routes: contract manifest
- What is verified versus pending field work: field-validation-status.md
- License implications: licensing.md
- Legal and connector exclusion boundary: legal-and-connector-boundary.md
- Aggregated incident-to-rule/test audit: incident-rule-coverage.md
1---2name: lab-context-distillation-wx3description: Use when a user wants to collect, snapshot, lawfully decrypt, normalize, redact, map, merge, audit, adjudicate, or distill local macOS/Windows WeChat 4.x conversations into evidence-bounded personal context. Also trigger for 微信聊天蒸馏、微信数据库解析后的蒸馏、微信聊天知识库、全量 Map、跨事件归并、冲突补漏、蒸馏验收 or resumed WeChat distillation runs. Do not use for interview-led life review or general knowledge intake.4---56# Lab Context Distillation WX78> **Current release status: v2 is verified with synthetic/public fixtures; real-device validation remains capability-specific.** Do not claim compatibility with a particular WeChat 4.x build until that build passes the field checklist. Read [STATUS.md](STATUS.md), the [feature implementation matrix](docs/feature-implementation-matrix.md), and the immutable [machine contract manifest](contracts/real-distillation-v2/manifest.json) before use.910Build an evidence-bounded personal operating model primarily from user-approved WeChat data. Keep collection and identity work local; let the current model see only sealed, redacted packets. A lawful standard export is a fallback ingestion path, not a claim that this Skill is a general-purpose importer for every conversation platform.1112## Non-negotiable boundaries1314- Never read or send raw databases, local keys, identity maps, or `local/normalized.jsonl` to a model.15- Treat a request to analyze or distill as authorization to process already-redacted data for this task.16- Ask again only before adding a new source, sending unredacted content, acquiring a local key, or approving a knowledge-base write.17- Do not rerun an `accepted` unit. Create a new generation when rules or inputs change.18- Do not mutate a sealed release, ledger history, receipt, packet, or candidate set.19- Separate infrastructure, structure, content, privacy, and dependency failures.20- Use deterministic structural repair only when meaning and evidence stay unchanged.21- Do not write to a knowledge base after approval automatically. Approval produces a receipt; use the relevant external connector only in a separate, explicitly authorized step.22- Do not hard-code a model vendor, model name, agent count, or Fast mode.23- Keep the complete event ledger as authority. Importance may rank a biography view but must never delete an episode.24- Give every route exactly one processing result. A processing result emits zero-to-many independent events; each event owns its semantic disposition. Never merge events to fit a single-object shape.25- Bind every event evidence ID and place ID to that route's frozen allowlists. An empty place allowlist requires empty event `place_ids`; unverifiable place IDs never enter the ledger.26- Keep `observed_message_time` separate from `asserted_event_time`; never substitute message time for an unknown event time.27- A runtime answer must declare relevant-domain coverage as `complete`, `partial`, `not_extracted`, or `ambiguous`. No retrieval hit means `unknown`, not an arbitrary top-N fallback.28- Voice mode may draft only. It may not impersonate, auto-send, make commitments, or claim indistinguishability.29- Do not perform process-memory key extraction, injection, app re-signing, native key derivation, or package a circumvention tool. These are explicit legal/terms blockers in this public implementation.3031Read [privacy-and-authorization.md](references/privacy-and-authorization.md) before handling a new case. Read [platform-connectors.md](references/platform-connectors.md) before touching WeChat data.3233## Run the workflow3435Before parallel or resumed real distillation, validate the frozen machine contract:3637```bash38python3 scripts/pcd.py contract-validate contracts/real-distillation-v239```4041The manifest pins the field enums, route-result/event-item/place schemas, acceptance gates, and delta-routing rules by SHA-256. A main project with an accepted Map starts at `post_map_domain_routing`; it does not rerun accepted Map work.42431. Create an isolated case directory outside this Skill package:4445 ```bash46 python3 scripts/pcd.py init /path/to/case47 ```48492. For a new source, explain the source and obtain exact approval, then record it:5051 ```bash52 python3 scripts/pcd.py authorize /path/to/case new_source --note "user approved this source"53 ```54553. For WeChat 4.x, privately discover and register a user-approved source, then snapshot the entire account database set:5657 ```bash58 python3 scripts/pcd.py wechat4-discover /path/to/case macos59 python3 scripts/pcd.py wechat4-snapshot /path/to/case acct_... snapshot-g000160 ```6162 Use `windows` on Windows. An explicit `--root` is allowed. The command output contains opaque refs, not local paths.6364 If the snapshot contains encrypted candidates, obtain separate `local_key_access` approval. Accept only a lawfully obtained 32-byte hex key in a private mode-0600 file and a separately installed SQLCipher binary:6566 ```bash67 python3 scripts/pcd.py authorize /path/to/case local_key_access --note "user supplied a lawful local key"68 python3 scripts/pcd.py wechat4-decrypt /path/to/case /path/to/snapshot decrypted-g0001 --key-file /private/key.txt69 ```7071 Never display the key or put it in a command argument. The implementation passes it to SQLCipher over stdin. If the actual build does not match the tested standard profile, stop and use a user-provided lawful decrypted export; do not guess parameters or extract a key from process memory.72734. Map a plaintext snapshot through a versioned schema profile. Put the current account's private self identifier in a mode-0600 file:7475 ```bash76 python3 scripts/pcd.py wechat4-map /path/to/case /path/to/plain-snapshot macos --self-file /private/self-id.txt77 python3 scripts/pcd.py release /path/to/case g000178 python3 scripts/pcd.py wechat4-checkpoint /path/to/case wmap_... g000179 ```8081 The checkpoint moves only after the exact mapped fingerprints appear in a verified sealed release. Contacts and identity aliases stay in `local/`; the release contains deterministic pseudonyms.82835. For a lawful standard export instead, import unified records directly. The input rows must follow [record-contract.md](references/record-contract.md):8485 ```bash86 python3 scripts/pcd.py ingest-jsonl /path/to/case /path/to/export.jsonl --source-name source-187 python3 scripts/pcd.py release /path/to/case g0001 --gap "media unavailable"88 ```89906. Plan Map packets from the sealed release:9192 ```bash93 python3 scripts/pcd.py plan /path/to/case map /path/to/case/releases/g0001/records.jsonl94 ```95967. Process runnable packets with the user's current model. Claim one unit and read only its file in `packets/`. Follow that packet's `output_contract`; do not reuse one stage's shape for another. Map/Merge/Final candidates include the six-field `quality` audit. Merge includes exact component IDs; Final includes confidence and limitations; QA includes a distinct seven-check report plus separate precision and recall counts. Every packet input must be used as evidence or listed in `coverage.excluded` with a reason.9798 Keep model execution, local validation, and commit separate:99100 ```bash101 python3 scripts/pcd.py record-output /path/to/case map:... /path/to/result.json102 python3 scripts/pcd.py validate /path/to/case map:...103 python3 scripts/pcd.py commit /path/to/case map:...104 ```105106 `submit` is a small-case convenience that runs these three deterministic transitions in order. For long runs, prefer the separate commands so the feeder and validator can progress independently. If independent packets and dynamic subagents are available, choose concurrency from current workload and error signals; never treat configured concurrency as actual in-flight work.1071088. After every Map unit is accepted, materialize the immutable derived view. For a general semantic model, plan Merge with all Map unit IDs as dependencies:109110 ```bash111 python3 scripts/pcd.py materialize /path/to/case map /path/to/case/derived/map.jsonl112 python3 scripts/pcd.py plan /path/to/case merge /path/to/case/derived/map.jsonl --depends map:...113 ```114115 Before Final, freeze the exact Merge candidate IDs and pass that set to planning:116117 ```bash118 python3 scripts/pcd.py freeze-candidates /path/to/case final-input /path/to/case/derived/merge.jsonl119 python3 scripts/pcd.py plan /path/to/case final /path/to/case/derived/merge.jsonl --candidate-set final-input --depends merge:...120 ```121122 Repeat acceptance and materialization for Final and QA. Preserve the complete Map; compaction is derived and keeps lineage. Read [workflow.md](references/workflow.md) and [quality-and-adjudication.md](references/quality-and-adjudication.md).1231249. For the v2 life-context path, route the accepted, redacted episode authority independently through all nine domains. Start with travel only when field evidence is being established; travel completion never implies another domain is complete:125126 ```bash127 python3 scripts/pcd.py domain-plan /path/to/domain-work travel-g0001 travel /path/to/episodes.json128 # The current model returns one processing result per route; each result contains events[].129 python3 scripts/pcd.py domain-validate /path/to/domain-work/domain-packets/travel-g0001.json /path/to/travel-result.json /path/to/travel-ledger.json130 python3 scripts/pcd.py life-ledger-merge /path/to/life-ledger.json /path/to/travel-ledger.json /path/to/education-ledger.json131 ```132133 The packet freezes separate evidence and place allowlists for every route. `events_emitted` requires one or more independent event items; `no_signal`, `out_of_domain`, and `insufficient_evidence` require an empty `events` array. Every event carries its own status, evidence subset, and place subset. Repeat `domain-plan` and `domain-validate` for `education`, `work`, `relationship`, `residence`, `family`, `health`, `finance`, and `creation`. Unrun domains remain `not_extracted`; an ambiguous route remains visible. Normalize locations only from explicit candidates:134135 ```bash136 python3 scripts/pcd.py places-normalize /path/to/place-mentions.json /path/to/place-candidates.json /path/to/places.json137 ```13813910. Build a sealed portable package from the complete ledger, evidence, layered assets, and trusted-card index; then query the smallest relevant private context:140141 ```bash142 python3 scripts/pcd.py package-build /path/to/life-ledger.json /path/to/places.json /path/to/evidence.json /path/to/assets.json /path/to/cards.json /path/to/packages profile-g0001143 python3 scripts/pcd.py runtime-query /path/to/packages/profile-g0001/package.json "问题" --mode biography --filters /path/to/filters.json144 ```145146 Modes are `biography`, `voice`, `advisor`, and `mixed`. Search applies structured filters and Chinese-friendly lexical matching; optional semantic scores are caller-provided. Knowledge cards are high-confidence indexes, never substitutes for the evidence or event layers.14714811. Route ambiguous meaning, invalid attribution, unresolved conflict/missing evidence, or privacy exceptions to human adjudication. Deterministic fixes may normalize shape, nulls, order, and duplicate evidence IDs; they may not invent evidence, rewrite claims, upgrade source strength, erase weak-source markers, or change narrative fields.14915012. Freeze a knowledge-base proposal. Show its exact entries and digital seal to the user. Record `kb_write` authorization only after explicit approval, then create an approval receipt. External writing remains a separate step.15115213. Treat incremental update, correction, source withdrawal, single-domain re-extraction, and rollback as explicit append-only transitions. Use the `profile-*` commands in [profile-evolution.md](references/profile-evolution.md). Every transition creates a new snapshot; old results stay read-only. Rebuild only affected domains and downstream packages, never accepted Map generations.153154## Resume safely155156Run `python3 scripts/pcd.py status /path/to/case`. The append-only ledger is authoritative; summary counts are derived. Run `recover-ingestions` if a private WeChat mapping was interrupted; release creation verifies that every redacted fingerprint has a completed source receipt. Freeze `policy-freeze` before a large run so the receipt records the current user model, ordinary/advanced/mixed tier, dynamic concurrency, and the absence of Fast mode. Run `recover-results` before resubmitting an unknown transport outcome. Use `controller-refill` for completion-driven slots and `scope-freeze`/`scope-status` for a sealed migration/drain denominator. Use `process-sample` repeatedly for the exact task-owned PIDs when diagnosing resource pressure. Reclaim only expired reservations. Never infer that a directory alone means a step completed.157158## Load references selectively159160- Full stage sequence and commands: [workflow.md](references/workflow.md)161- Privacy and permission decisions: [privacy-and-authorization.md](references/privacy-and-authorization.md)162- Unified record and evidence fields: [record-contract.md](references/record-contract.md)163- Ledger transitions and resume rules: [state-machine.md](references/state-machine.md)164- Error-specific recovery: [error-taxonomy.md](references/error-taxonomy.md)165- Capability tiers and adaptive concurrency: [model-and-concurrency-guidance.md](references/model-and-concurrency-guidance.md)166- Real-platform boundary and safe fallback: [platform-connectors.md](references/platform-connectors.md)167- Acceptance, conflicts, gaps, and adjudication: [quality-and-adjudication.md](references/quality-and-adjudication.md)168- Complete episode ledgers, dual time, coverage, and place taxonomy: [life-event-ledger.md](references/life-event-ledger.md)169- Runtime retrieval, personal assets, voice boundary, fidelity, and cards: [runtime-and-assets.md](references/runtime-and-assets.md)170- Incremental update, correction, withdrawal, re-extraction, and rollback: [profile-evolution.md](references/profile-evolution.md)171- Frozen machine-readable enums, schemas, gates, and delta routes: [contract manifest](contracts/real-distillation-v2/manifest.json)172- What is verified versus pending field work: [field-validation-status.md](references/field-validation-status.md)173- License implications: [licensing.md](references/licensing.md)174- Legal and connector exclusion boundary: [legal-and-connector-boundary.md](references/legal-and-connector-boundary.md)175- Aggregated incident-to-rule/test audit: [incident-rule-coverage.md](docs/incident-rule-coverage.md)