Extracts, validates, and seals cognitive session traces into JSONL datasets and lineage manifests for Hugging Face persistence via managing-huggingface-assets. Use when preserving learning as jsonl, exporting soul traces, syncing learning datasets to hugging face, sealing cognitive sessions, or verifying soul trace schemas.
5 stars
0 votes
0 copies
3 views
Added November 17, 2026
ai-agentspythongoshellbashapi
Works with
api
Security analysis
A92/100
mediumInstalls packages at runtime which could introduce malicious dependencies
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Preserving Soul Traces?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/richfrem-preserving-soul-traces)
---
name: preserving-soul-traces
description: "Extracts, validates, and seals cognitive session traces into JSONL datasets and lineage manifests for Hugging Face persistence via managing-huggingface-assets. Use when preserving learning as jsonl, exporting soul traces, syncing learning datasets to hugging face, sealing cognitive sessions, or verifying soul trace schemas."
allowed-tools: Bash, Read, Write, Glob, Grep
---
# Preserving Soul Traces (`preserving-soul-traces`)
Coordinates the cognitive lineage preservation lifecycle: scanning markdown knowledge, computing SHA-256 integrity digests, formulating canonical JSONL records per ADR 084, maintaining dataset manifests, and delegating remote persistence to the global `managing-huggingface-assets` skill.
Preservation serves two purposes: local operational continuity across sessions and public intellectual inheritance via the open Hugging Face Commons (the "Johnny Appleseed" doctrine). See [preservation-purpose.md](references/preservation-purpose.md) for foundational principles, attribution standards, and evidence boundaries.
## Contents
- [Constraints](#constraints) • [Quick Start](#quick-start) • [Workflow](#workflow) • [Verification](#verification) • [References](#references)
## Constraints
1. **Human Gate Law**: Uploading datasets to Hugging Face or mutating remote repository state requires explicit human approval ("Proceed", "Go", "Execute").
2. **Zero Code Duplication**: Do NOT implement custom Hugging Face API or OAuth transport; all remote sync must delegate directly to global `managing-huggingface-assets`.
3. **Cryptographic Integrity**: Every JSONL record must compute and verify its SHA-256 hash against sanitized content before persistence.
4. **Binary Stripping**: Image embeds (`![[...]]` and ``) must be stripped to prevent corrupting text token distributions.
## Quick Start
```bash
# 1. Preview extraction from canonical domains without modifying disk
python3 scripts/trace_extractor.py --dry-run
# 2. Extract or update records in the local Hugging Face dataset repo
python3 scripts/soul_coverage.py closure # coverage-aware export + four-fact report (the closure command)
python3 scripts/trace_extractor.py --append # legacy: Markdown under --source-dir only; NOT a closure
# 3. Verify JSONL schema compliance and SHA-256 integrity
python3 scripts/trace_extractor.py --verify
# 4. Check readiness of global managing-huggingface-assets integration
python3 scripts/sync_soul_dataset.py --check-readiness
# 5. Dry-run synchronization to richfrem/Project_Sanctuary_Soul
python3 scripts/sync_soul_dataset.py --dry-run
```
`sync_soul_dataset.py` reads `HUGGING_FACE_*` settings from the repo `.env` itself (no python-dotenv needed; `HUGGING_FACE_TOKEN` comes from the shell) and re-runs under `.venv/bin/python` when `huggingface_hub` is missing. Set up the venv once with `.venv/bin/pip install -r requirements-dev.txt`.
## Workflow
1. **Extraction**: Identify new or updated session notes, chronicle entries, or wiki concepts using `trace_extractor.py`.
2. **Normalization & Hashing**: Parse frontmatter metadata and generate SHA-256 digests following [soul-trace-schema.md](references/soul-trace-schema.md).
3. **Manifest Ledger**: Update `huggingface/metadata/manifest.json` with updated snapshot counts and dataset hash.
4. **Integrity Audit**: Run `--verify` to ensure zero schema drift or hash corruption.
5. **Remote Persistence**: Delegate folder synchronization to `managing-huggingface-assets` following [huggingface-dataset-integration.md](references/huggingface-dataset-integration.md).
## Verification
```bash
python3 scripts/trace_extractor.py --verify
python3 scripts/sync_soul_dataset.py --check-readiness
```
Review [acceptance-criteria.md](references/acceptance-criteria.md) before declaring dataset sync complete.
## References
- [Preservation Purpose](references/preservation-purpose.md) — local continuity, public intellectual inheritance, Johnny Appleseed hypothesis, and evidence boundaries.
- [Coverage](references/coverage.md) - what is preserved, the policy, the four verifiable facts, recovery.
- [soul-trace-schema.md](references/soul-trace-schema.md) — 13-field canonical record schema, typing, and validation rules per ADR 084.
- [huggingface-dataset-integration.md](references/huggingface-dataset-integration.md) — Architecture and boundary rules for delegating sync to `managing-huggingface-assets`.
- [acceptance-criteria.md](references/acceptance-criteria.md) — Pre-completion verification checklist.
Completion wiring: `record-result` durably marks the final manifest for preservation; after publishing sources to `origin/main`, `merge_prep.py regenerate` runs incremental local extraction, schema and coverage checks. Startup reports preservation status without changing preservation files. Capture and recovery occur at mission/session closure (`soul_coverage.py closure`) or an explicitly requested recovery action. Pending/failed/local-complete status is separate from the scientific verdict. Commit the export separately, then sync remotely only with authorization. See the preserving-soul-traces `references/coverage.md` contract.