plan

package
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package plan 提供 submit_plan 工具:计划文档提交(用户域 plans/<sid>/ <seq>.md 持久落盘)+ 挂起送审(Suspend → 引擎转 plan_request 事件卡 → approve 端点决议 → Resume 消费)。决议语义按提交时档位分叉:plan 批准 = 授权任务期全部写(GrantTask,只审这一次);manual 批准 = 仅确认方向不授权 (写操作仍逐写挂起);auto 不挂起(文档落档即走,供事后审计)。 写计划文档本身免审批(用户域过程态非产品数据;否则 manual 档死锁——批的 对象还没写出来)。修订 = 新序号文档,不改写旧稿(审计留痕)。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTools

func NewTools(cfg Config) ([]contract.Tool, error)

NewTools 构造 submit_plan(会话域件:不走审批名单,走挂起通道)。

Types

type Config

type Config struct {
	S      Session
	SID    string                              // 会话 ID(文档路径 plans/<sid>/<seq>.md)
	Writer func(rel string, data []byte) error // 用户域文件写入(Registry.Store().WriteUserTreeFile)
}

Config 构造配置。

type Decision

type Decision = contract.ApprovalDecision

Decision 决议(复用审批决议形态:Approve/Reason——挂起单通道,决议消费同源)。

type Session

type Session interface {
	TakeDecision() *Decision
	GrantTask()
	ModePublic() string
	NextPlanSeq() int
}

Session 会话域依赖(引擎装配注入:决议消费/任务授权/当前档位/序号取号)。

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL