Skip to content

feat: Bond, Skills/XP, Reincarnation, dna.md unpacking#39

Open
prakashUXtech wants to merge 1 commit intomainfrom
feat/soul-primitives-v2
Open

feat: Bond, Skills/XP, Reincarnation, dna.md unpacking#39
prakashUXtech wants to merge 1 commit intomainfrom
feat/soul-primitives-v2

Conversation

@prakashUXtech
Copy link
Contributor

Summary

Rebased version of #34 onto current main (4da5a96). The old branch diverged from a very early commit and would have reverted StrEnum, cognitive engine exports, self-model/general_events extraction, error handling, and CI pipeline changes.

This PR adds soul primitives on top of the full main codebase:

  • Bond model (bond.py) — Human-Soul relationship tracking with strengthen/weaken mechanics, 0-100 bond strength, interaction counter
  • Skills/XP system (skills.py) — Skill with level progression (1-10), exponential XP scaling, SkillRegistry collection
  • Reincarnation (soul.py) — Soul.reincarnate() classmethod creates a new soul from existing essence, preserves memories/personality/bond, tracks incarnation count and previous lives via Identity.previous_lives
  • Identity fields (types.py) — Added bond: Bond, incarnation: int, previous_lives: list[str] to Identity
  • dna.md unpacking (unpack.py) — Now reads dna.md from .soul archives into memory_data["dna_md"]
  • Public exports (__init__.py) — Added Bond, Skill, SkillRegistry to package API

Review fixes from #34 applied:

  • Relative import for Bond in types.py (from .bond import Bond)
  • Decision comment in reincarnate() explaining born reset
  • Passes core_values to MemoryManager.from_dict() in reincarnate()

Test plan

  • 16 bond tests (creation, strengthen, weaken, bounds validation)
  • 15 skill tests (XP, leveling, cap at 10, registry operations)
  • 9 reincarnation tests (lifecycle, memory/personality/bond preservation)
  • 2 E2E tests (full lifecycle + dna.md archive round-trip)
  • All 489 tests pass (43 new + 446 existing), zero regressions
  • Ruff lint clean

Rebased soul-primitives onto current main (4da5a96), preserving all
main's features (StrEnum, cognitive engine, psychology types, self-model,
general_events, error handling, CI pipeline) while adding:

- Bond model: human-soul relationship tracking with strengthen/weaken
- Skill & SkillRegistry: XP progression system with level cap at 10
- Soul.reincarnate(): lifecycle rebirth preserving memories, DNA, lineage
- Identity: bond, incarnation, previous_lives fields
- unpack.py: reads dna.md from .soul archives
- 43 new tests (bond, skills, reincarnation, e2e lifecycle)

Review fixes applied:
- Uses relative import for Bond in types.py (from .bond import Bond)
- Added decision comment in reincarnate() for born reset
- Passes core_values to MemoryManager.from_dict() in reincarnate()

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link

github-actions bot commented Mar 6, 2026

Security scan: review needed

Potentially dangerous code patterns detected in changed files. A maintainer should verify these are intentional and safe.### src/soul_protocol/soul.py

118:            search_strategy: Optional SearchStrategy for pluggable retrieval (v0.2.2).
311:            search_strategy: Optional SearchStrategy for pluggable retrieval (v0.2.2).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant