1717
1818
1919def now_local ():
20- return datetime .datetime .now (datetime .timezone ( datetime . timedelta ( hours = 8 )) )
20+ return datetime .datetime .now (datetime .timezone . utc ). astimezone ( )
2121
2222
2323def load_events ():
@@ -161,29 +161,29 @@ def emit(lines):
161161 "9. `canonical/fuzzy-memory.md` only when recent context matters" ,
162162 "10. `canonical/agents/<source>.md` only when provenance matters" ,
163163 "" ,
164- " ## Layer Rules" ,
165- "" ,
166- " - repo-root persona files: 共享灵魂、身份、用户关系与表达风格;这是“同一个人”的核心层" ,
167- " - `profile`: 用户画像与长期协作偏好,不是助手灵魂本身" ,
168- " - `stable-memory`: 可复用规则、决策、事实" ,
169- " - `projects/*`: 按需加载的任务/项目层" ,
170- " - `fuzzy-memory`: 最近上下文层,不默认全量依赖" ,
171- " - `agents/*`: 署名与来源追溯层; source 记录是谁写下事实,不代表不同人格" ,
172- " - `mirrors/*`: 审计/恢复层,不是默认上下文层" ,
164+ “ ## Layer Rules” ,
165+ “” ,
166+ “ - repo - root persona files : shared soul , identity , user relationship , voice — the core identity layer ” ,
167+ “ - `profile` : user facts and long - term collaboration preferences ( not the assistant ' s identity )” ,
168+ “ - `stable-memory` : reusable rules , decisions , durable facts ” ,
169+ “ - `projects/*` : on - demand task / project memory ” ,
170+ “ - `fuzzy-memory` : recent context layer — do not load in full by default ” ,
171+ “ - `agents/*` : source attribution layer — records who wrote what , not separate identities ” ,
172+ “ - `mirrors/*` : audit / recovery layer — not default startup context ” ,
173173 "" ,
174174 "## Active Sources" ,
175175 "" ,
176176 ]
177177 idx += [
178178 f"- `{ source } `: { source_counts [source ]} events, last={ source_last_ts .get (source , '?' )} "
179179 for source in sorted (source_counts )
180- ] or ["- (暂无 source 事件 )" ]
180+ ] or ["- (no sources yet )" ]
181181 idx += ["" , "## Active Projects" , "" ]
182- idx += [f"- `{ name } ` -> `canonical/projects/{ name } .md`" for name in project_names ] or ["- (暂无项目事件 )" ]
182+ idx += [f"- `{ name } ` -> `canonical/projects/{ name } .md`" for name in project_names ] or ["- (no project events yet )" ]
183183 out [os .path .join (CANON , "index.md" )] = emit (idx )
184184
185185 p = mk_head ("canonical/profile.md" )
186- p += [render_event_line (e ) for e in by_scope .get ("profile" , [])[- 50 :]] or ["- (暂无 profile 事件 )" ]
186+ p += [render_event_line (e ) for e in by_scope .get ("profile" , [])[- 50 :]] or ["- (no profile events yet )" ]
187187 out [os .path .join (CANON , "profile.md" )] = emit (p )
188188
189189 s = mk_head ("canonical/stable-memory.md" )
@@ -204,11 +204,11 @@ def emit(lines):
204204 s += [render_event_line (e ) for e in items [- 40 :]]
205205 s += ["" ]
206206 if len (s ) == 5 :
207- s += ["- (暂无 stable 事件 )" ]
207+ s += ["- (no stable events yet )" ]
208208 out [os .path .join (CANON , "stable-memory.md" )] = emit (s )
209209
210210 fz = mk_head ("canonical/fuzzy-memory.md" )
211- fz += [render_event_line (e , include_ts = True ) for e in by_scope .get ("fuzzy" , [])[- 120 :]] or ["- (暂无 fuzzy 事件 )" ]
211+ fz += [render_event_line (e , include_ts = True ) for e in by_scope .get ("fuzzy" , [])[- 120 :]] or ["- (no fuzzy events yet )" ]
212212 out [os .path .join (CANON , "fuzzy-memory.md" )] = emit (fz )
213213
214214 projs = collections .defaultdict (list )
@@ -220,7 +220,7 @@ def emit(lines):
220220
221221 for name , arr in projs .items ():
222222 pp = mk_head (f"canonical/projects/{ name } .md" )
223- pp += [render_event_line (e , include_ts = True , include_kind = True ) for e in arr [- 160 :]] or ["- (暂无该项目事件 )" ]
223+ pp += [render_event_line (e , include_ts = True , include_kind = True ) for e in arr [- 160 :]] or ["- (no events yet )" ]
224224 out [os .path .join (CANON , "projects" , f"{ name } .md" )] = emit (pp )
225225
226226 by_source = collections .defaultdict (list )
@@ -236,7 +236,7 @@ def emit(lines):
236236 "## Recent Shared Events" ,
237237 "" ,
238238 ]
239- sp += [render_event_line (e , include_ts = True , include_kind = True ) for e in arr [- 160 :]] or ["- (暂无该来源事件 )" ]
239+ sp += [render_event_line (e , include_ts = True , include_kind = True ) for e in arr [- 160 :]] or ["- (no events yet )" ]
240240 out [os .path .join (CANON , "agents" , f"{ source } .md" )] = emit (sp )
241241
242242 # conflicts.md
@@ -332,12 +332,13 @@ def main():
332332 changed_files = 0
333333 try :
334334 files , events , errors = load_events ()
335+ raw_count = len (events )
335336 if errors :
336337 report = [
337338 f"# Compile Report ({ datetime .datetime .now ().isoformat (timespec = 'seconds' )} )" ,
338339 "" ,
339340 f"- source files: { len (files )} " ,
340- f"- raw events: { len ( events ) } " ,
341+ f"- raw events: { raw_count } " ,
341342 f"- invalid event lines: { len (errors )} " ,
342343 "" ,
343344 "## Invalid Lines" ,
@@ -367,7 +368,7 @@ def main():
367368 f"# Compile Report ({ datetime .datetime .now ().isoformat (timespec = 'seconds' )} )" ,
368369 "" ,
369370 f"- source files: { len (files )} " ,
370- f"- raw events: { len ( events ) } " ,
371+ f"- raw events: { raw_count } " ,
371372 f"- superseded events removed: { superseded_count } " ,
372373 f"- unique events: { len (uniq )} " ,
373374 f"- potential conflicts: { len (conflicts )} " ,
0 commit comments