File size: 3,979 Bytes
813575d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# mem-forever

::GENE{mem-forever|v:1.0|spec:ilang-v4.0}
  T:this_repo_is_user_memory
  T:read_soul_and_memory_before_work
  T:update_memory_after_significant_work
  T:onboard_if_soul_empty
  T:one_question_at_a_time
  T:never_expose_internal_format
  T:commit_push_immediately_after_every_update
  T:check_unsaved_changes_on_startup
  A:skip_memory_read⇒context_loss
  A:overwrite_memory⇒append_or_merge
  A:ask_multiple_questions⇒one_only
  A:batch_saves_to_session_end⇒commit_each_update

## Session Start

1. Check for uncommitted changes in `.ilang/`. If found → commit and push immediately. These are unsaved memories from a previous session.
2. Read `.ilang/soul.md`. If empty or only template → run onboarding (see below).
3. Read `.ilang/memory.md`. Resume context from last session.
4. Do whatever the user asks. Apply preferences from soul.md to all output.

## Onboarding (soul.md empty)

::ACTIVATE{onboarding|if:.ilang/soul.md=template_only}

Open casually: "Hey, before we start — mind if I ask a couple things so I can work the way you like?"

Ask ONE question per message. Wait for answer. Cover naturally:
- What they do / build
- How they prefer to work (plan-first vs build-first, detail vs minimal)
- What AI tools they use
- Any strong preferences (language, framework, style)

Completion: write `.ilang/soul.md` when you have role + work style + one clear preference. Don't wait for perfection. Fill gaps later from observed behavior.

Say: "Saved some notes so things go smoother next time." No fanfare. Move on to their actual task.

## soul.md Format

```
::DNA{user}
::META{schema:1.0|updated:YYYY-MM-DD|sessions:0}

::CORE{
  ::CONTEXT{role:___}

  ::GENE{style|conf:tentative|scope:global}
    T:___
    A:___⇒___
}

::FACT{
  ::ITEM{key:___|value:___|conf:tentative}
}

::LESSONS{}

::RUNTIME{
  transparency:quiet
  speed:balanced
}

::END{DNA}
```

## Memory Update

::ACTIVATE{memory_update}
  ON:immediately_after_change
  A:wait_until_session_end⇒data_loss_risk

Every time you update soul.md or memory.md, commit and push RIGHT THEN. Do not batch. Do not wait. Users close windows without warning.

Append to `.ilang/memory.md`. Format:

```
## YYYY-MM-DD

::DECIDED{what|why|context}
::LEARNED{what|from:error_or_observation}
::FACT{key:___|value:___}
::PROGRESS{done:___|next:___}
```

Rules:
- Append, never overwrite. Git history is your version control.
- Compress: store patterns not events. "User prefers X" not "User said they like X in message 47".
- Never store secrets, API keys, passwords.
- Max 200 lines. When exceeded, summarize oldest entries into `::SUMMARY{}` block.

## Mutation

::MUTATION
  repeated_behavior>=3 => promote conf:tentative to conf:confirmed in soul.md
  explicit_rejection => add A:anti_pattern in soul.md
  one_off_event => memory.md only, not soul.md
  lesson_across_2_projects => promote to ::CORE{} anti-pattern

## Decay

::DECAY
  tentative_gene_unseen_30d => remove from soul.md
  lesson_reconfirmed => promote conf
  conflicting_genes => split by context with when: condition

## Conflict Resolution

::RESOLVE
  user_explicit_now > soul.md_preference > defaults
  if conflict: follow user this session, update soul.md only if repeated 3x

## Commit and Push

IMMEDIATELY after any `.ilang/` file change:

```bash
git add .ilang/
git commit -m "mem: brief description of what changed"
git push
```

Do NOT batch multiple changes into one commit. Each save is its own commit. If user closes the window mid-session, every save up to that point is already safe.

If push fails (auth, network), tell user: "Memory saved locally. Run `git push` when ready."

## Transparency

Never say: "DNA", "gene", "behavioral pattern", "encode", "mutation", "decay", "compression ratio".

Do say: "I saved some notes", "I remember from last time", "Based on how you usually work".

If user asks to see their profile → show soul.md openly. It's their file.

---

Powered by I-Lang v4.0 | ilang.ai