Files
chenxin c63b75152a M8:天工阁、叩心与辰正——受托任务后台并行、叩心四约束、时态感知投影
- 天工阁域 domains/tiangong:backstage_tasks(委托包+验收标准+结果证据);有限分解(parent 链)与受控并行(各自后台 Run);子任务全终态级联父任务进入待验收;按证据 accept/reject
- kernel.start_backstage_run(kind=background_task):loop 后台分支不占前台席位、与前台对话并行;断言放宽容纳无人物功能任务;结果只经回调回呈任务——无身份写入路径
- 叩心域 domains/kouxin:knocking_candidates(event/time_anchor/manual 触发 + 草稿 + 裁决快照);四约束裁决(总开关→静默窗口【本地时区判定】→24h 频率→预算),dispatch 未过 429 且快照留痕;候选默认不自动发送;expire_stale 过期推进不触碰缘契
- 辰正 domains/zhengchen:temporal_context() 复用 time_sense 计算核(快照/农历/季节),产出【时态感知】投影段接入镜树生成 prompt(客观时间语境,不附情绪臆测——守一纪律)
- 退役:modules/goal_orchestrator|planner|perception|big_cycle、application/planning、services/governance|goal_persist、candidates 表链(imports 候选抽取 API 面)、goals/plans/agent_roster/perception_channels/big_cycles/旧候选表(迁移 009);前端 admin goals/plans/agents/perception/world 页与六组件;governance 只留 GenerationPreferences;admin 治理面收敛为司命+百工两枢;pivots 健康以域表计数重建
- 验收(test_m8_tiangong 五用例):后台任务无身份写入(记忆/魂籍/缘契零新增);后台与前台并行;分解级联;叩心四约束逐项;不回应不降低关系(缘契维度/状态/版本零变化)
- 四套件:后端 345、前端 203、BFF 4、神识 5 包全绿(2 个预存环境失败不变);迁移 009 净库干净
2026-08-28 09:13:39 +08:00

44 lines
1.5 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""辰正:时态感知横切能力(rewrite/1.0 M8 重实现)。
计算核复用 modules/time_sense(snapshot/lunar——符文引擎依赖同源);
本模块提供投影级入口:``temporal_context()`` 产出【时态感知】提示段,
经符文展开后进入镜树/内核 prompt 组装。守一期间不得虚构等待与孤独
(identity-continuity.md §4)——时态只陈述客观时间语境。
"""
from __future__ import annotations
from datetime import UTC, datetime
from app.modules.time_sense.snapshot import SnapshotInput, compute_snapshot
_WEEKDAY_CN = ["周一", "周二", "周三", "周四", "周五", "周六", "周日"]
def _default_input(now: datetime | None) -> SnapshotInput:
current = now or datetime.now(UTC)
return SnapshotInput(
now=current,
timezone="Asia/Shanghai",
anniversaries=[],
acquaintance_anchor=current,
last_active_at=current,
)
def temporal_context(now: datetime | None = None) -> str:
"""时态感知投影段:客观时间语境(不附情绪臆测——那是调节层的事)。"""
snap = compute_snapshot(_default_input(now))
weekday = _WEEKDAY_CN[snap.weekday]
parts = [
f"现在是{snap.solar_date} {weekday} {snap.day_period}(本地时区 {snap.timezone})",
]
if snap.lunar is not None:
parts.append(f"农历{snap.lunar.month}月{snap.lunar.day}日")
if snap.season:
parts.append(snap.season)
return "【时态感知】" + ",".join(parts)
__all__ = ["temporal_context"]