fix: recover run runtime state and logs

This commit is contained in:
npc0-hue
2026-08-07 12:01:26 +08:00
parent 3818fa0344
commit b789925ae5
23 changed files with 297 additions and 78 deletions
+3
View File
@@ -62,6 +62,9 @@ type RunLifecycleReport struct {
Progress RunJobProgressReport
Message string
ErrorCode string
ManagedProcessID string
ObservationSeq uint64
ObservedAt time.Time
ExecutionResult JobExecutionResult
}
+18
View File
@@ -48,6 +48,24 @@ type LogStreamCursorResult struct {
LatestSeq uint64
}
// RunLogStreamProgress is a signed Run-only request for sequence recovery.
// It deliberately exposes no log body or host-local information.
type RunLogStreamProgress struct {
RunEndpointID string
SessionToken string
ServerInstanceID string
LogStreamID string
}
type RunLogStreamProgressResult struct {
Accepted bool
RunEndpointID string
ServerInstanceID string
LogStreamID string
LatestSeq uint64
ServerTime time.Time
}
type LogStreamEvent struct {
ServerInstanceID string
Stream LogStream
+16 -13
View File
@@ -777,19 +777,22 @@ type ServerInstance struct {
// DeploymentTargetID identifies an optional operator-selected deployment
// target for post-creation deployment operations. It never selects a
// distribution builder or replaces the server's generated Run endpoint.
DeploymentTargetID string
RunEndpointID string
Name string
OwnerUserID string
AdminUserIDs []string
State ServerInstanceState
ConfigVersion int
ConfigKey string
ConfigContent string
ConfigChecksum string
ConfigUpdatedAt time.Time
CreatedAt time.Time
UpdatedAt time.Time
DeploymentTargetID string
RunEndpointID string
Name string
OwnerUserID string
AdminUserIDs []string
State ServerInstanceState
LifecycleProcessID string
LifecycleObservationSeq uint64
LifecycleObservedAt time.Time
ConfigVersion int
ConfigKey string
ConfigContent string
ConfigChecksum string
ConfigUpdatedAt time.Time
CreatedAt time.Time
UpdatedAt time.Time
// Deployment stores operator-supplied deployment inputs. Its protected path
// and command values are never included in normal platform read projections.
Deployment ServerDeploymentDefinition