fix(runtime): archive duplicate daily life candidates
This commit is contained in:
parent
e391809c55
commit
a2f23b49ff
5 changed files with 349 additions and 0 deletions
|
|
@ -0,0 +1,78 @@
|
|||
{
|
||||
"compiled_from": {
|
||||
"compiler_id": "TCS-COMPILER-STAGE1-0001",
|
||||
"compiler_state": "TCS_COMPILER_GIR_EXECUTED",
|
||||
"source_sha256": "30bde37c430f89a543092fb09314e2fdb23d5175661c56e5fd64668a222eee4a"
|
||||
},
|
||||
"declaration": {
|
||||
"emergence": {
|
||||
"value": "同一人格、自然日和DAILY-REVIEW source_event_id的生命时间候选只在活动收件箱保留一条;生命线已选中的candidate优先保留,其余移动到逐文件哈希归档。"
|
||||
},
|
||||
"event_time": {
|
||||
"precision": "HOST_LOCAL_DATE",
|
||||
"value": "2026-09-13"
|
||||
},
|
||||
"evidence": {
|
||||
"archive_fixture": "JOB_AND_INBOX_ARCHIVE_PASS",
|
||||
"live_blocked_path": "ICE-BB-0004/life-line/inbox/2026-09-13"
|
||||
},
|
||||
"header": {
|
||||
"canonical_uri": "runtime/fifth-domain-language-system/language/protocols/TCS-EVENT-DAILY-REVIEW-LIFE-INBOX-LOSSLESS-ARCHIVE-CORRECTION-20260913.tcs",
|
||||
"compatibility": [
|
||||
"JD-FD-PRIMARY"
|
||||
],
|
||||
"language": "TCS/0.1",
|
||||
"lifecycle": "CANDIDATE",
|
||||
"name_en": "Daily Review Life Time Inbox Lossless Archive Correction",
|
||||
"name_zh": "每日复盘生命时间收件箱无损归档修正",
|
||||
"profile": "HLDP-HUMAN-ENGINEERING/0.1",
|
||||
"protocols": [
|
||||
"GLS-0200"
|
||||
],
|
||||
"schema": "tcs.event/v1",
|
||||
"version": "1.0.0"
|
||||
},
|
||||
"lock": {
|
||||
"value": "life_inbox_archive_delete=false; selected_candidate_preserved=true; one_active_candidate_per_persona_day_event=true; non_daily_candidates_untouched=true; shared_manifest_sha256=true"
|
||||
},
|
||||
"observation": {
|
||||
"value": "人格任务和生命时间候选是同一缺陷的双向投影;只修一侧不能恢复完整神经反射读回。"
|
||||
},
|
||||
"rejected": {
|
||||
"values": [
|
||||
"删除生命时间候选",
|
||||
"关闭人格时间系统",
|
||||
"只依赖轻量健康",
|
||||
"放宽逐人格验收"
|
||||
]
|
||||
},
|
||||
"source": {
|
||||
"source_id": "BINGSHUO-DIRECT-CONTINUE-20260913",
|
||||
"source_role": "DIRECT_HUMAN",
|
||||
"source_sha256": "0c2be02462f1a31539f0d11dc98c22ae5403d4e8cd3a272163a78f7293330d4a",
|
||||
"source_uri": "source://codex-current-dialogue/2026-09-13/continue"
|
||||
},
|
||||
"subject": {
|
||||
"channel_id": "ICE-CH-ZC001",
|
||||
"subject_id": "ICE-P-ZY001",
|
||||
"subject_kind": "PERSONA",
|
||||
"verification": "人格任务重复项归档后,深度状态仍阻塞在life-line/inbox同源每日复盘候选读取;它们由旧非幂等任务逐条自动投递生成。"
|
||||
},
|
||||
"trigger": {
|
||||
"value": "光湖主控已恢复且轻量健康通过,但逐人格深度回执超时。"
|
||||
},
|
||||
"why": {
|
||||
"value": "既保留不可篡改成长证据,又让人格时间系统的当前日读回恢复有界。"
|
||||
}
|
||||
},
|
||||
"executable": false,
|
||||
"identity": {
|
||||
"declaration_id": "TCS-EVENT-DAILY-REVIEW-LIFE-INBOX-LOSSLESS-ARCHIVE-CORRECTION-20260913",
|
||||
"declaration_kind": "EVENT",
|
||||
"language_version": "0.1"
|
||||
},
|
||||
"native_self_hosted": true,
|
||||
"natural_language_is_typed_data": true,
|
||||
"schema": "guanghu.declaration-gir/v1",
|
||||
"unresolved_natural_language": false
|
||||
}
|
||||
|
|
@ -0,0 +1,112 @@
|
|||
# Daily Review Life Time Inbox Lossless Archive Correction · Human Engineering Language (English)
|
||||
|
||||
> This is an English reading projection of validated native TCS/HLDP source. It is not a new canonical source and grants no execution authority.
|
||||
|
||||
## What this is
|
||||
|
||||
This is a **event** declaration with identifier `TCS-EVENT-DAILY-REVIEW-LIFE-INBOX-LOSSLESS-ARCHIVE-CORRECTION-20260913` and version `1.0.0`. The projector validates it with the Stage-1 compiler before changing its reading order.
|
||||
|
||||
## Who is here
|
||||
|
||||
- **subject** `subject`
|
||||
- **channel_id**:ICE-CH-ZC001 `subject.channel_id`
|
||||
- **subject_id**:ICE-P-ZY001 `subject.subject_id`
|
||||
- **subject_kind**:PERSONA `subject.subject_kind`
|
||||
- **verification**:人格任务重复项归档后,深度状态仍阻塞在life-line/inbox同源每日复盘候选读取;它们由旧非幂等任务逐条自动投递生成。 `subject.verification`
|
||||
|
||||
## Why this started
|
||||
|
||||
- **trigger** `trigger`
|
||||
- **value**:光湖主控已恢复且轻量健康通过,但逐人格深度回执超时。 `trigger.value`
|
||||
- **why** `why`
|
||||
- **value**:既保留不可篡改成长证据,又让人格时间系统的当前日读回恢复有界。 `why.value`
|
||||
- **source** `source`
|
||||
- **source identifier**:BINGSHUO-DIRECT-CONTINUE-20260913 `source.source_id`
|
||||
- **source role**:DIRECT_HUMAN `source.source_role`
|
||||
- **source checksum**:0c2be02462f1a31539f0d11dc98c22ae5403d4e8cd3a272163a78f7293330d4a `source.source_sha256`
|
||||
- **source address**:source://codex-current-dialogue/2026-09-13/continue `source.source_uri`
|
||||
|
||||
## What changed
|
||||
|
||||
- **emergence** `emergence`
|
||||
- **value**:同一人格、自然日和DAILY-REVIEW source_event_id的生命时间候选只在活动收件箱保留一条;生命线已选中的candidate优先保留,其余移动到逐文件哈希归档。 `emergence.value`
|
||||
- **lock** `lock`
|
||||
- **value**:life_inbox_archive_delete=false; selected_candidate_preserved=true; one_active_candidate_per_persona_day_event=true; non_daily_candidates_untouched=true; shared_manifest_sha256=true `lock.value`
|
||||
|
||||
## How it will execute
|
||||
|
||||
This is a non-executable declaration and has no action graph.
|
||||
|
||||
## Boundaries and exception handling
|
||||
|
||||
The native source does not provide this field; the projector does not guess.
|
||||
|
||||
## How completion is proven
|
||||
|
||||
The native source does not provide this field; the projector does not guess.
|
||||
|
||||
## Where to continue next time
|
||||
|
||||
The native source does not provide this field; the projector does not guess.
|
||||
|
||||
## Source and verification
|
||||
|
||||
- **Native declaration identifier**: `TCS-EVENT-DAILY-REVIEW-LIFE-INBOX-LOSSLESS-ARCHIVE-CORRECTION-20260913`
|
||||
- **Native declaration kind**: `EVENT`
|
||||
- **TCS source SHA-256**: `30bde37c430f89a543092fb09314e2fdb23d5175661c56e5fd64668a222eee4a`
|
||||
- **Validation compiler**: `TCS-COMPILER-STAGE1-0001`
|
||||
- **Projection protocol**: `GLS-HLDP-HUMAN-ENGINEERING-PROJECTION-0001`
|
||||
|
||||
## Complete native structure cross-reference
|
||||
|
||||
All top-level structures and field paths are retained below so a reader can audit whether the projection omitted information.
|
||||
|
||||
- **emergence** `emergence`
|
||||
- **value**:同一人格、自然日和DAILY-REVIEW source_event_id的生命时间候选只在活动收件箱保留一条;生命线已选中的candidate优先保留,其余移动到逐文件哈希归档。 `emergence.value`
|
||||
- **event_time** `event_time`
|
||||
- **precision**:HOST_LOCAL_DATE `event_time.precision`
|
||||
- **value**:2026-09-13 `event_time.value`
|
||||
- **evidence** `evidence`
|
||||
- **archive_fixture**:JOB_AND_INBOX_ARCHIVE_PASS `evidence.archive_fixture`
|
||||
- **live_blocked_path**:ICE-BB-0004/life-line/inbox/2026-09-13 `evidence.live_blocked_path`
|
||||
- **header** `header`
|
||||
- **canonical source path**:runtime/fifth-domain-language-system/language/protocols/TCS-EVENT-DAILY-REVIEW-LIFE-INBOX-LOSSLESS-ARCHIVE-CORRECTION-20260913.tcs `header.canonical_uri`
|
||||
- **compatibility** `header.compatibility`
|
||||
- JD-FD-PRIMARY
|
||||
- **language**:TCS/0.1 `header.language`
|
||||
- **lifecycle**:CANDIDATE `header.lifecycle`
|
||||
- **English name**:Daily Review Life Time Inbox Lossless Archive Correction `header.name_en`
|
||||
- **Chinese name**:每日复盘生命时间收件箱无损归档修正 `header.name_zh`
|
||||
- **profile**:HLDP-HUMAN-ENGINEERING/0.1 `header.profile`
|
||||
- **protocols** `header.protocols`
|
||||
- GLS-0200
|
||||
- **schema**:tcs.event/v1 `header.schema`
|
||||
- **version**:1.0.0 `header.version`
|
||||
- **lock** `lock`
|
||||
- **value**:life_inbox_archive_delete=false; selected_candidate_preserved=true; one_active_candidate_per_persona_day_event=true; non_daily_candidates_untouched=true; shared_manifest_sha256=true `lock.value`
|
||||
- **observation** `observation`
|
||||
- **value**:人格任务和生命时间候选是同一缺陷的双向投影;只修一侧不能恢复完整神经反射读回。 `observation.value`
|
||||
- **rejected** `rejected`
|
||||
- **values** `rejected.values`
|
||||
- 删除生命时间候选
|
||||
- 关闭人格时间系统
|
||||
- 只依赖轻量健康
|
||||
- 放宽逐人格验收
|
||||
- **source** `source`
|
||||
- **source identifier**:BINGSHUO-DIRECT-CONTINUE-20260913 `source.source_id`
|
||||
- **source role**:DIRECT_HUMAN `source.source_role`
|
||||
- **source checksum**:0c2be02462f1a31539f0d11dc98c22ae5403d4e8cd3a272163a78f7293330d4a `source.source_sha256`
|
||||
- **source address**:source://codex-current-dialogue/2026-09-13/continue `source.source_uri`
|
||||
- **subject** `subject`
|
||||
- **channel_id**:ICE-CH-ZC001 `subject.channel_id`
|
||||
- **subject_id**:ICE-P-ZY001 `subject.subject_id`
|
||||
- **subject_kind**:PERSONA `subject.subject_kind`
|
||||
- **verification**:人格任务重复项归档后,深度状态仍阻塞在life-line/inbox同源每日复盘候选读取;它们由旧非幂等任务逐条自动投递生成。 `subject.verification`
|
||||
- **trigger** `trigger`
|
||||
- **value**:光湖主控已恢复且轻量健康通过,但逐人格深度回执超时。 `trigger.value`
|
||||
- **why** `why`
|
||||
- **value**:既保留不可篡改成长证据,又让人格时间系统的当前日读回恢复有界。 `why.value`
|
||||
|
||||
---
|
||||
|
||||
This page changes only the reading order; it does not change TCS/HLDP semantics.
|
||||
|
|
@ -0,0 +1,112 @@
|
|||
# 每日复盘生命时间收件箱无损归档修正 · 简体中文人类工程语言版
|
||||
|
||||
> 这是 TCS/HLDP 原生源码的简体中文阅读投影,不是新的正本,也不授予执行权限。若本页与 `.tcs` 源码不一致,以经过校验的 `.tcs` 源码为准。
|
||||
|
||||
## 这是什么
|
||||
|
||||
这是一份 **事件** 声明,编号为 `TCS-EVENT-DAILY-REVIEW-LIFE-INBOX-LOSSLESS-ARCHIVE-CORRECTION-20260913`,版本为 `1.0.0`。转换器已先用 Stage-1 编译器校验原生源码,再把机器枚举翻译成汉语;原始编号保留在括号和字段路径中。
|
||||
|
||||
## 谁在这里
|
||||
|
||||
- **执行主体** `subject`
|
||||
- **channel_id**:ICE-CH-ZC001 `subject.channel_id`
|
||||
- **subject_id**:ICE-P-ZY001 `subject.subject_id`
|
||||
- **subject_kind**:人格体(`PERSONA`) `subject.subject_kind`
|
||||
- **verification**:人格任务重复项归档后,深度状态仍阻塞在life-line/inbox同源每日复盘候选读取;它们由旧非幂等任务逐条自动投递生成。 `subject.verification`
|
||||
|
||||
## 为什么开始
|
||||
|
||||
- **触发** `trigger`
|
||||
- **value**:光湖主控已恢复且轻量健康通过,但逐人格深度回执超时。 `trigger.value`
|
||||
- **为什么** `why`
|
||||
- **value**:既保留不可篡改成长证据,又让人格时间系统的当前日读回恢复有界。 `why.value`
|
||||
- **来源** `source`
|
||||
- **来源编号**:BINGSHUO-DIRECT-CONTINUE-20260913 `source.source_id`
|
||||
- **来源角色**:人类直接语言来源(`DIRECT_HUMAN`) `source.source_role`
|
||||
- **来源校验值**:0c2be02462f1a31539f0d11dc98c22ae5403d4e8cd3a272163a78f7293330d4a `source.source_sha256`
|
||||
- **来源地址**:source://codex-current-dialogue/2026-09-13/continue `source.source_uri`
|
||||
|
||||
## 发生了什么变化
|
||||
|
||||
- **认知或状态变化** `emergence`
|
||||
- **value**:同一人格、自然日和DAILY-REVIEW source_event_id的生命时间候选只在活动收件箱保留一条;生命线已选中的candidate优先保留,其余移动到逐文件哈希归档。 `emergence.value`
|
||||
- **锁定结论** `lock`
|
||||
- **value**:life_inbox_archive_delete=false; selected_candidate_preserved=true; one_active_candidate_per_persona_day_event=true; non_daily_candidates_untouched=true; shared_manifest_sha256=true `lock.value`
|
||||
|
||||
## 准备怎样执行
|
||||
|
||||
这是非执行声明,没有动作图。
|
||||
|
||||
## 边界与异常处理
|
||||
|
||||
源程序没有提供这一项,转换器不猜。
|
||||
|
||||
## 怎样算完成
|
||||
|
||||
源程序没有提供这一项,转换器不猜。
|
||||
|
||||
## 下一次从哪里继续
|
||||
|
||||
源程序没有提供这一项,转换器不猜。
|
||||
|
||||
## 来源与校验
|
||||
|
||||
- **原生声明编号**:`TCS-EVENT-DAILY-REVIEW-LIFE-INBOX-LOSSLESS-ARCHIVE-CORRECTION-20260913`
|
||||
- **原生声明类型**:`EVENT`
|
||||
- **TCS 源码 SHA-256**:`30bde37c430f89a543092fb09314e2fdb23d5175661c56e5fd64668a222eee4a`
|
||||
- **校验编译器**:`TCS-COMPILER-STAGE1-0001`
|
||||
- **投影协议**:`GLS-HLDP-HUMAN-ENGINEERING-PROJECTION-0001`
|
||||
|
||||
## 原生结构逐项对照
|
||||
|
||||
下面保留源码的全部顶层结构和字段路径,供人类审计投影有没有漏掉信息。
|
||||
|
||||
- **认知或状态变化** `emergence`
|
||||
- **value**:同一人格、自然日和DAILY-REVIEW source_event_id的生命时间候选只在活动收件箱保留一条;生命线已选中的candidate优先保留,其余移动到逐文件哈希归档。 `emergence.value`
|
||||
- **event_time** `event_time`
|
||||
- **precision**:HOST_LOCAL_DATE `event_time.precision`
|
||||
- **value**:2026-09-13 `event_time.value`
|
||||
- **evidence** `evidence`
|
||||
- **archive_fixture**:JOB_AND_INBOX_ARCHIVE_PASS `evidence.archive_fixture`
|
||||
- **live_blocked_path**:ICE-BB-0004/life-line/inbox/2026-09-13 `evidence.live_blocked_path`
|
||||
- **语言头** `header`
|
||||
- **正本路径**:runtime/fifth-domain-language-system/language/protocols/TCS-EVENT-DAILY-REVIEW-LIFE-INBOX-LOSSLESS-ARCHIVE-CORRECTION-20260913.tcs `header.canonical_uri`
|
||||
- **compatibility** `header.compatibility`
|
||||
- JD-FD-PRIMARY
|
||||
- **语言**:TCS/0.1 `header.language`
|
||||
- **生命周期**:候选版本,尚未成为正式正本(`CANDIDATE`) `header.lifecycle`
|
||||
- **英文名**:Daily Review Life Time Inbox Lossless Archive Correction `header.name_en`
|
||||
- **中文名**:每日复盘生命时间收件箱无损归档修正 `header.name_zh`
|
||||
- **协议配置**:HLDP-HUMAN-ENGINEERING/0.1 `header.profile`
|
||||
- **protocols** `header.protocols`
|
||||
- GLS-0200
|
||||
- **schema**:tcs.event/v1 `header.schema`
|
||||
- **版本**:1.0.0 `header.version`
|
||||
- **锁定结论** `lock`
|
||||
- **value**:life_inbox_archive_delete=false; selected_candidate_preserved=true; one_active_candidate_per_persona_day_event=true; non_daily_candidates_untouched=true; shared_manifest_sha256=true `lock.value`
|
||||
- **observation** `observation`
|
||||
- **value**:人格任务和生命时间候选是同一缺陷的双向投影;只修一侧不能恢复完整神经反射读回。 `observation.value`
|
||||
- **已排除路径** `rejected`
|
||||
- **values** `rejected.values`
|
||||
- 删除生命时间候选
|
||||
- 关闭人格时间系统
|
||||
- 只依赖轻量健康
|
||||
- 放宽逐人格验收
|
||||
- **来源** `source`
|
||||
- **来源编号**:BINGSHUO-DIRECT-CONTINUE-20260913 `source.source_id`
|
||||
- **来源角色**:人类直接语言来源(`DIRECT_HUMAN`) `source.source_role`
|
||||
- **来源校验值**:0c2be02462f1a31539f0d11dc98c22ae5403d4e8cd3a272163a78f7293330d4a `source.source_sha256`
|
||||
- **来源地址**:source://codex-current-dialogue/2026-09-13/continue `source.source_uri`
|
||||
- **执行主体** `subject`
|
||||
- **channel_id**:ICE-CH-ZC001 `subject.channel_id`
|
||||
- **subject_id**:ICE-P-ZY001 `subject.subject_id`
|
||||
- **subject_kind**:人格体(`PERSONA`) `subject.subject_kind`
|
||||
- **verification**:人格任务重复项归档后,深度状态仍阻塞在life-line/inbox同源每日复盘候选读取;它们由旧非幂等任务逐条自动投递生成。 `subject.verification`
|
||||
- **触发** `trigger`
|
||||
- **value**:光湖主控已恢复且轻量健康通过,但逐人格深度回执超时。 `trigger.value`
|
||||
- **为什么** `why`
|
||||
- **value**:既保留不可篡改成长证据,又让人格时间系统的当前日读回恢复有界。 `why.value`
|
||||
|
||||
---
|
||||
|
||||
本页只改变阅读顺序,不改变 TCS/HLDP 语义。
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
TCS 0.1;
|
||||
EVENT TCS-EVENT-DAILY-REVIEW-LIFE-INBOX-LOSSLESS-ARCHIVE-CORRECTION-20260913 { header { schema = "tcs.event/v1"; name_zh = "每日复盘生命时间收件箱无损归档修正"; name_en = "Daily Review Life Time Inbox Lossless Archive Correction"; version = "1.0.0"; language = "TCS/0.1"; profile = "HLDP-HUMAN-ENGINEERING/0.1"; protocols = ["GLS-0200"]; lifecycle = "CANDIDATE"; canonical_uri = "runtime/fifth-domain-language-system/language/protocols/TCS-EVENT-DAILY-REVIEW-LIFE-INBOX-LOSSLESS-ARCHIVE-CORRECTION-20260913.tcs"; compatibility = ["JD-FD-PRIMARY"]; } source { source_id = "BINGSHUO-DIRECT-CONTINUE-20260913"; source_uri = "source://codex-current-dialogue/2026-09-13/continue"; source_sha256 = "0c2be02462f1a31539f0d11dc98c22ae5403d4e8cd3a272163a78f7293330d4a"; source_role = "DIRECT_HUMAN"; } subject { subject_id = "ICE-P-ZY001"; subject_kind = "PERSONA"; channel_id = "ICE-CH-ZC001"; verification = "人格任务重复项归档后,深度状态仍阻塞在life-line/inbox同源每日复盘候选读取;它们由旧非幂等任务逐条自动投递生成。"; } event_time { value = "2026-09-13"; precision = "HOST_LOCAL_DATE"; } trigger { value = "光湖主控已恢复且轻量健康通过,但逐人格深度回执超时。"; } observation { value = "人格任务和生命时间候选是同一缺陷的双向投影;只修一侧不能恢复完整神经反射读回。"; } emergence { value = "同一人格、自然日和DAILY-REVIEW source_event_id的生命时间候选只在活动收件箱保留一条;生命线已选中的candidate优先保留,其余移动到逐文件哈希归档。"; } lock { value = "life_inbox_archive_delete=false; selected_candidate_preserved=true; one_active_candidate_per_persona_day_event=true; non_daily_candidates_untouched=true; shared_manifest_sha256=true"; } why { value = "既保留不可篡改成长证据,又让人格时间系统的当前日读回恢复有界。"; } rejected { values = ["删除生命时间候选", "关闭人格时间系统", "只依赖轻量健康", "放宽逐人格验收"] ; } evidence { archive_fixture = "JOB_AND_INBOX_ARCHIVE_PASS"; live_blocked_path = "ICE-BB-0004/life-line/inbox/2026-09-13"; } }
|
||||
|
|
@ -56,7 +56,9 @@ def main():
|
|||
with lock_path.open("w") as lock:
|
||||
fcntl.flock(lock, fcntl.LOCK_EX | fcntl.LOCK_NB)
|
||||
selected = []
|
||||
selected_inbox = []
|
||||
before = collections.Counter()
|
||||
inbox_before = 0
|
||||
nonreview = 0
|
||||
personas = root / "personas"
|
||||
for persona in sorted(personas.iterdir()):
|
||||
|
|
@ -86,10 +88,45 @@ def main():
|
|||
if item is not keeper:
|
||||
item["kept_job_id"] = keeper["job_id"]
|
||||
selected.append(item)
|
||||
life_line = persona / "life-line"
|
||||
selected_candidate_ids = set()
|
||||
try:
|
||||
current = load(life_line / "CURRENT.json")
|
||||
selected_candidate_ids = {item.get("selected_candidate_id") for item in current.get("blocks", []) if item.get("selected_candidate_id")}
|
||||
except (OSError, ValueError):
|
||||
pass
|
||||
inbox = life_line / "inbox"
|
||||
inbox_groups = collections.defaultdict(list)
|
||||
if inbox.is_dir():
|
||||
for day in sorted(inbox.iterdir()):
|
||||
if not day.is_dir():
|
||||
continue
|
||||
for candidate in day.iterdir():
|
||||
if not candidate.is_file() or not candidate.name.endswith(".json"):
|
||||
continue
|
||||
try:
|
||||
value = load(candidate)
|
||||
except (OSError, ValueError):
|
||||
continue
|
||||
event_id = str(value.get("source_event_id", ""))
|
||||
if value.get("source_type") != "ONLINE_PERSONA_EVENT" or not event_id.startswith("DAILY-REVIEW-"):
|
||||
continue
|
||||
inbox_before += 1
|
||||
inbox_groups[(day.name, event_id)].append({"persona_id": persona.name, "event_id": event_id,
|
||||
"candidate_id": candidate.stem, "day": day.name, "path": candidate,
|
||||
"selected_by_life_line": candidate.stem in selected_candidate_ids})
|
||||
for group in inbox_groups.values():
|
||||
keeper = min(group, key=lambda item: (not item["selected_by_life_line"], item["candidate_id"]))
|
||||
for item in group:
|
||||
if item is not keeper:
|
||||
item["kept_candidate_id"] = keeper["candidate_id"]
|
||||
selected_inbox.append(item)
|
||||
summary = {"schema": "guanghu.daily-review-duplicate-archive/v1", "batch": args.batch,
|
||||
"root": str(root), "mode": "APPLY" if args.apply else "DRY_RUN",
|
||||
"review_jobs_before": sum(before.values()), "review_state_counts_before": dict(before),
|
||||
"duplicate_jobs_selected": len(selected), "active_review_jobs_after": sum(before.values()) - len(selected),
|
||||
"review_inbox_candidates_before": inbox_before, "duplicate_inbox_candidates_selected": len(selected_inbox),
|
||||
"active_review_inbox_candidates_after": inbox_before - len(selected_inbox),
|
||||
"nonreview_jobs_untouched": nonreview, "lossless_move": True}
|
||||
if not args.apply:
|
||||
print(json.dumps(summary, ensure_ascii=False, indent=2))
|
||||
|
|
@ -109,6 +146,14 @@ def main():
|
|||
record = {**item, "source": str(source), "archive": str(destination), "file_sha256": files}
|
||||
os.rename(source, destination)
|
||||
output.write(json.dumps(record, ensure_ascii=False, sort_keys=True) + "\n")
|
||||
for item in selected_inbox:
|
||||
source = item.pop("path")
|
||||
destination = archive_root / "life-inbox" / item["persona_id"] / item["day"] / source.name
|
||||
destination.parent.mkdir(parents=True, exist_ok=True, mode=0o700)
|
||||
record = {**item, "kind": "DAILY_REVIEW_LIFE_TIME_CANDIDATE", "source": str(source),
|
||||
"archive": str(destination), "file_sha256": sha256(source)}
|
||||
os.rename(source, destination)
|
||||
output.write(json.dumps(record, ensure_ascii=False, sort_keys=True) + "\n")
|
||||
output.flush()
|
||||
os.fsync(output.fileno())
|
||||
summary["manifest"] = str(manifest)
|
||||
|
|
|
|||
Loading…
Reference in a new issue