feat(shm): arena + ContextPolicy(§13.2/§13.8)

- unified.go: arena 分配器 (alloc/write/read/reset)
- NewHost: 分配空间含 arena
- SDK ToolDef 加 ContextPolicy string
- StageAfterToolcall 后检查 prune 策略触发 RelevanceContext.Prune
This commit is contained in:
JianFeeeee
2026-09-10 15:49:47 +08:00
parent 772a494223
commit 9cfdfc9de8

View File

@ -53,7 +53,7 @@ type Host struct {
// (实验 2 已验证各进程 mmap 到不同虚拟地址时偏移解引用仍正确)。
func NewHost() (*Host, error) {
// 统一区域大小SuperBlock + StageContext segment + EvtRing segment
unifiedSize := superBlockSize + shmDefaultSize + evtTotalSize
unifiedSize := superBlockSize + shmDefaultSize + evtTotalSize + unifiedArenaSize
memfd, data, err := allocShm(unifiedSize)
if err != nil {
return nil, err