DEV-000063 intent work planning foundation
CI / test (push) Successful in 16s
CI / test (pull_request) Successful in 14s

This commit is contained in:
m
2026-08-17 15:10:43 +03:00
parent 18750c2ae6
commit 4fc85511c4
19 changed files with 1128 additions and 10 deletions
+13
View File
@@ -7,6 +7,7 @@ import (
type CapabilityID ids.ID
type CapabilityBindingID ids.ID
type CapabilityKind string
type BindingState string
type BindingProtocol string
@@ -16,6 +17,18 @@ const (
BindingRetired BindingState = "RETIRED"
ProtocolIdempotentReceiptV1 BindingProtocol = "IDEMPOTENT_RECEIPT_V1"
CapabilityKindReadEmail CapabilityKind = "READ_EMAIL"
CapabilityKindSendEmail CapabilityKind = "SEND_EMAIL"
CapabilityKindReadDatabase CapabilityKind = "READ_DATABASE"
CapabilityKindQueryLogs CapabilityKind = "QUERY_LOGS"
CapabilityKindInspectProject CapabilityKind = "INSPECT_PROJECT"
CapabilityKindModifyCode CapabilityKind = "MODIFY_CODE"
CapabilityKindRunTests CapabilityKind = "RUN_TESTS"
CapabilityKindWebResearch CapabilityKind = "WEB_RESEARCH"
CapabilityKindCognitiveReasoning CapabilityKind = "COGNITIVE_REASONING"
CapabilityKindScheduleReminder CapabilityKind = "SCHEDULE_REMINDER"
CapabilityKindVerifyFact CapabilityKind = "VERIFY_FACT"
)
// Binding is Capability-owned correctness state. SecretRef is an opaque
+1
View File
@@ -12,6 +12,7 @@ const (
VerificationUnverified VerificationState = "UNVERIFIED"
VerificationVerified VerificationState = "VERIFIED"
VerificationRejected VerificationState = "REJECTED"
VerificationUnknown VerificationState = "UNKNOWN"
VerificationNotApplicable VerificationState = "NOT_APPLICABLE"
ClaimSourceAuthenticatedHuman ClaimSourceKind = "AUTHENTICATED_HUMAN"
+2
View File
@@ -128,4 +128,6 @@ type ChatMessageResponse struct {
ActiveProjectName string
ProjectProvenance situation.ProjectResolutionProvenance
Clarification ClarificationState
WorkPlanned bool
PlanningReply string
}
+184
View File
@@ -2,13 +2,88 @@ package work
import (
"git.cin.su/m/Assistant/contracts/authority"
"git.cin.su/m/Assistant/contracts/capability"
"git.cin.su/m/Assistant/contracts/epistemics"
"git.cin.su/m/Assistant/contracts/identity"
"git.cin.su/m/Assistant/platform/ids"
)
type GoalID ids.ID
type TaskID ids.ID
type DecisionID ids.ID
type PlanCandidateID ids.ID
type WorkPlanID ids.ID
type PlanStepID ids.ID
type CapabilityRequirementID ids.ID
type DelegationCandidateID ids.ID
type TaskRevision uint64
type GoalRevision uint64
type PlanRevision uint64
type GoalState string
type PlanCandidateState string
type PlanStepKind string
type CapabilityRequirementState string
type DelegationCandidateState string
type DelegationKind string
type SourceIntentRef string
type SourceUtteranceRef string
type ConversationRef string
type ProjectRef string
type ProjectProvenanceRef string
type SpeechActRef string
type HelpPathKind string
const (
GoalProposed GoalState = "PROPOSED"
GoalUnderstood GoalState = "UNDERSTOOD"
GoalPlanning GoalState = "PLANNING"
GoalReady GoalState = "READY"
GoalInProgress GoalState = "IN_PROGRESS"
GoalBlocked GoalState = "BLOCKED"
GoalCompleted GoalState = "COMPLETED"
GoalFailed GoalState = "FAILED"
GoalCancelled GoalState = "CANCELLED"
GoalSuperseded GoalState = "SUPERSEDED"
PlanCandidateProposed PlanCandidateState = "PROPOSED"
PlanCandidateValidated PlanCandidateState = "VALIDATED"
PlanCandidateAccepted PlanCandidateState = "ACCEPTED"
PlanCandidateRejected PlanCandidateState = "REJECTED"
PlanStepInvestigate PlanStepKind = "INVESTIGATE"
PlanStepObserve PlanStepKind = "OBSERVE"
PlanStepVerify PlanStepKind = "VERIFY"
PlanStepReason PlanStepKind = "REASON"
PlanStepReport PlanStepKind = "REPORT"
PlanStepPrepare PlanStepKind = "PREPARE"
PlanStepCommunicate PlanStepKind = "COMMUNICATE"
PlanStepSchedule PlanStepKind = "SCHEDULE"
PlanStepModify PlanStepKind = "MODIFY"
PlanStepRunChecks PlanStepKind = "RUN_CHECKS"
PlanStepClarify PlanStepKind = "CLARIFY"
PlanStepNoExecution PlanStepKind = "NO_EXECUTION"
CapabilityRequirementRequired CapabilityRequirementState = "REQUIRED"
CapabilityRequirementAvailable CapabilityRequirementState = "AVAILABLE"
CapabilityRequirementMissing CapabilityRequirementState = "MISSING"
CapabilityRequirementBlocked CapabilityRequirementState = "BLOCKED"
DelegationCandidateProposed DelegationCandidateState = "PROPOSED"
DelegationCandidateSelected DelegationCandidateState = "SELECTED"
DelegationCandidateBlocked DelegationCandidateState = "BLOCKED"
DelegationKindAgent DelegationKind = "AGENT"
DelegationKindTool DelegationKind = "TOOL"
DelegationKindAdapter DelegationKind = "ADAPTER"
DelegationKindHuman DelegationKind = "HUMAN"
DelegationKindUnavailable DelegationKind = "UNAVAILABLE"
HelpPathAnswer HelpPathKind = "ANSWER"
HelpPathCognition HelpPathKind = "COGNITION"
HelpPathDirectCapability HelpPathKind = "DIRECT_CAPABILITY"
HelpPathDurableWork HelpPathKind = "DURABLE_WORK"
HelpPathCapabilityGap HelpPathKind = "CAPABILITY_GAP"
)
// TaskTarget carries the integrity context that a work-owned mutation must match.
type TaskTarget struct {
@@ -17,3 +92,112 @@ type TaskTarget struct {
ScopeID authority.ScopeID
Revision TaskRevision
}
type Goal struct {
ID GoalID
SourceIntentID SourceIntentRef
SourceUtteranceID SourceUtteranceRef
ActorID identity.ActorID
PrincipalID identity.PrincipalID
ScopeID authority.ScopeID
ProjectID ProjectRef
ProjectDisplayName string
DesiredOutcome string
Constraints string
State GoalState
Provenance ProjectProvenanceRef
Revision GoalRevision
CreatedAtUnixMillis int64
UpdatedAtUnixMillis int64
}
type CapabilityRequirement struct {
ID CapabilityRequirementID
PlanCandidateID PlanCandidateID
CapabilityKind capability.CapabilityKind
CapabilityID capability.CapabilityID
Purpose string
State CapabilityRequirementState
EpistemicPrecondition epistemics.VerificationState
RecordedAtUnixMillis int64
}
type PlanStep struct {
ID PlanStepID
PlanCandidateID PlanCandidateID
Ordinal int
Kind PlanStepKind
Description string
RequiresCapabilityID CapabilityRequirementID
RecordedAtUnixMillis int64
}
type DelegationCandidate struct {
ID DelegationCandidateID
PlanCandidateID PlanCandidateID
CapabilityRequirementID CapabilityRequirementID
Kind DelegationKind
ExecutorHint string
State DelegationCandidateState
Reason string
RecordedAtUnixMillis int64
}
type PlanCandidate struct {
ID PlanCandidateID
GoalID GoalID
Source string
State PlanCandidateState
Summary string
ValidationSummary string
RequiresClarification bool
AcceptedAtUnixMillis int64
RecordedAtUnixMillis int64
Steps []PlanStep
Requirements []CapabilityRequirement
Delegations []DelegationCandidate
}
type WorkPlan struct {
ID WorkPlanID
GoalID GoalID
AcceptedCandidateID PlanCandidateID
Revision PlanRevision
State PlanCandidateState
Summary string
RecordedAtUnixMillis int64
}
type PlanningInput struct {
ConversationID ConversationRef
UtteranceID SourceUtteranceRef
IntentID SourceIntentRef
ActorID identity.ActorID
PrincipalID identity.PrincipalID
ScopeID authority.ScopeID
ProjectID ProjectRef
ProjectDisplayName string
ProjectProvenance ProjectProvenanceRef
Message string
SpeechAct SpeechActRef
AssertionVerification epistemics.VerificationState
ReceivedAtUnixMillis int64
}
type PlanningResult struct {
Goal Goal
Candidate PlanCandidate
Plan WorkPlan
Reply string
}
type HelpPath struct {
Kind HelpPathKind
NeedsDurableGoal bool
NeedsDurableWork bool
NeedsDurablePlan bool
SuggestedCapabilityKinds []capability.CapabilityKind
CapabilityGap bool
Reason string
Reply string
}