From e2f8ed5de09bebd1823dacff7794a58e9977aa61 Mon Sep 17 00:00:00 2001 From: jochen Date: Thu, 5 Nov 2026 15:07:57 +0100 Subject: [PATCH] mesh-delivery-contracts: the build seats' times are time.Time (seatgen writes date-time so; B5d; ADR 0634; issue 1966) Claude-Session: https://claude.ai/code/session_01NcbgfFSnn24M3GcqttoU7i --- contracts/go/seats/nodebuildgo/contract.go | 49 ++++++++++--------- contracts/go/seats/nodebuildimage/contract.go | 49 ++++++++++--------- contracts/go/seats/nodebuildnode/contract.go | 49 ++++++++++--------- 3 files changed, 75 insertions(+), 72 deletions(-) diff --git a/contracts/go/seats/nodebuildgo/contract.go b/contracts/go/seats/nodebuildgo/contract.go index a734103f..3a31416a 100644 --- a/contracts/go/seats/nodebuildgo/contract.go +++ b/contracts/go/seats/nodebuildgo/contract.go @@ -8,6 +8,7 @@ import ( "encoding/json" "errors" "strings" + "time" ) // Seat is the seat's name. @@ -213,18 +214,18 @@ type BuiltArtifact struct { // Capacity is how many steps the node runs at once. type Capacity struct { // when (RFC 3339 time) - At string `json:"at,omitempty"` - BuildHours string `json:"build-hours,omitempty"` - BuildHoursFault string `json:"build-hours-fault,omitempty"` - ByCpu int64 `json:"by-cpu,omitempty"` - Configured int64 `json:"configured"` - ConfiguredFrom string `json:"configured-from,omitempty"` - CoresPerStep float64 `json:"cores-per-step,omitempty"` - Effective int64 `json:"effective"` - Ineligible string `json:"ineligible,omitempty"` - OutsideHours bool `json:"outside-hours,omitempty"` - QuotaCores float64 `json:"quota-cores,omitempty"` - QuotaFrom string `json:"quota-from,omitempty"` + At *time.Time `json:"at,omitempty"` + BuildHours string `json:"build-hours,omitempty"` + BuildHoursFault string `json:"build-hours-fault,omitempty"` + ByCpu int64 `json:"by-cpu,omitempty"` + Configured int64 `json:"configured"` + ConfiguredFrom string `json:"configured-from,omitempty"` + CoresPerStep float64 `json:"cores-per-step,omitempty"` + Effective int64 `json:"effective"` + Ineligible string `json:"ineligible,omitempty"` + OutsideHours bool `json:"outside-hours,omitempty"` + QuotaCores float64 `json:"quota-cores,omitempty"` + QuotaFrom string `json:"quota-from,omitempty"` // the layout version V int64 `json:"v,omitempty"` Why string `json:"why"` @@ -318,9 +319,9 @@ type LevelAnswer struct { // Pause is whether the node takes no new ask. type Pause struct { // when (RFC 3339 time) - At string `json:"at,omitempty"` - By string `json:"by,omitempty"` - Paused bool `json:"paused"` + At *time.Time `json:"at,omitempty"` + By string `json:"by,omitempty"` + Paused bool `json:"paused"` // the layout version V int64 `json:"v,omitempty"` } @@ -328,17 +329,17 @@ type Pause struct { // Step is one step a build module runs on a node. type Step struct { // when (RFC 3339 time) - Ended string `json:"ended,omitempty"` - ID string `json:"id"` - Node string `json:"node"` - Owner string `json:"owner,omitempty"` - Phase string `json:"phase,omitempty"` + Ended *time.Time `json:"ended,omitempty"` + ID string `json:"id"` + Node string `json:"node"` + Owner string `json:"owner,omitempty"` + Phase string `json:"phase,omitempty"` // when (RFC 3339 time) - PhaseAt string `json:"phase-at,omitempty"` + PhaseAt *time.Time `json:"phase-at,omitempty"` Reason string `json:"reason,omitempty"` Result *StepResult `json:"result,omitempty"` // when (RFC 3339 time) - Started string `json:"started"` + Started time.Time `json:"started"` // running, passed, failed or refused State string `json:"state"` Tool string `json:"tool"` @@ -383,7 +384,7 @@ type StepAskCompose struct { type StepAsk struct { Asker string `json:"asker"` // when (RFC 3339 time) - At string `json:"at,omitempty"` + At *time.Time `json:"at,omitempty"` Build *StepAskBuild `json:"build,omitempty"` Check *StepAskCheck `json:"check,omitempty"` Compose *StepAskCompose `json:"compose,omitempty"` @@ -422,7 +423,7 @@ type StepResult struct { // Toolchain is the toolchain a node reports. type Toolchain struct { // when (RFC 3339 time) - At string `json:"at,omitempty"` + At *time.Time `json:"at,omitempty"` // go or typescript Language string `json:"language"` Recipe string `json:"recipe"` diff --git a/contracts/go/seats/nodebuildimage/contract.go b/contracts/go/seats/nodebuildimage/contract.go index db640ee3..e5445d8a 100644 --- a/contracts/go/seats/nodebuildimage/contract.go +++ b/contracts/go/seats/nodebuildimage/contract.go @@ -8,6 +8,7 @@ import ( "encoding/json" "errors" "strings" + "time" ) // Seat is the seat's name. @@ -213,18 +214,18 @@ type BuiltArtifact struct { // Capacity is how many steps the node runs at once. type Capacity struct { // when (RFC 3339 time) - At string `json:"at,omitempty"` - BuildHours string `json:"build-hours,omitempty"` - BuildHoursFault string `json:"build-hours-fault,omitempty"` - ByCpu int64 `json:"by-cpu,omitempty"` - Configured int64 `json:"configured"` - ConfiguredFrom string `json:"configured-from,omitempty"` - CoresPerStep float64 `json:"cores-per-step,omitempty"` - Effective int64 `json:"effective"` - Ineligible string `json:"ineligible,omitempty"` - OutsideHours bool `json:"outside-hours,omitempty"` - QuotaCores float64 `json:"quota-cores,omitempty"` - QuotaFrom string `json:"quota-from,omitempty"` + At *time.Time `json:"at,omitempty"` + BuildHours string `json:"build-hours,omitempty"` + BuildHoursFault string `json:"build-hours-fault,omitempty"` + ByCpu int64 `json:"by-cpu,omitempty"` + Configured int64 `json:"configured"` + ConfiguredFrom string `json:"configured-from,omitempty"` + CoresPerStep float64 `json:"cores-per-step,omitempty"` + Effective int64 `json:"effective"` + Ineligible string `json:"ineligible,omitempty"` + OutsideHours bool `json:"outside-hours,omitempty"` + QuotaCores float64 `json:"quota-cores,omitempty"` + QuotaFrom string `json:"quota-from,omitempty"` // the layout version V int64 `json:"v,omitempty"` Why string `json:"why"` @@ -318,9 +319,9 @@ type LevelAnswer struct { // Pause is whether the node takes no new ask. type Pause struct { // when (RFC 3339 time) - At string `json:"at,omitempty"` - By string `json:"by,omitempty"` - Paused bool `json:"paused"` + At *time.Time `json:"at,omitempty"` + By string `json:"by,omitempty"` + Paused bool `json:"paused"` // the layout version V int64 `json:"v,omitempty"` } @@ -328,17 +329,17 @@ type Pause struct { // Step is one step a build module runs on a node. type Step struct { // when (RFC 3339 time) - Ended string `json:"ended,omitempty"` - ID string `json:"id"` - Node string `json:"node"` - Owner string `json:"owner,omitempty"` - Phase string `json:"phase,omitempty"` + Ended *time.Time `json:"ended,omitempty"` + ID string `json:"id"` + Node string `json:"node"` + Owner string `json:"owner,omitempty"` + Phase string `json:"phase,omitempty"` // when (RFC 3339 time) - PhaseAt string `json:"phase-at,omitempty"` + PhaseAt *time.Time `json:"phase-at,omitempty"` Reason string `json:"reason,omitempty"` Result *StepResult `json:"result,omitempty"` // when (RFC 3339 time) - Started string `json:"started"` + Started time.Time `json:"started"` // running, passed, failed or refused State string `json:"state"` Tool string `json:"tool"` @@ -383,7 +384,7 @@ type StepAskCompose struct { type StepAsk struct { Asker string `json:"asker"` // when (RFC 3339 time) - At string `json:"at,omitempty"` + At *time.Time `json:"at,omitempty"` Build *StepAskBuild `json:"build,omitempty"` Check *StepAskCheck `json:"check,omitempty"` Compose *StepAskCompose `json:"compose,omitempty"` @@ -422,7 +423,7 @@ type StepResult struct { // Toolchain is the toolchain a node reports. type Toolchain struct { // when (RFC 3339 time) - At string `json:"at,omitempty"` + At *time.Time `json:"at,omitempty"` // go or typescript Language string `json:"language"` Recipe string `json:"recipe"` diff --git a/contracts/go/seats/nodebuildnode/contract.go b/contracts/go/seats/nodebuildnode/contract.go index 9b0c7ff8..9f2abc00 100644 --- a/contracts/go/seats/nodebuildnode/contract.go +++ b/contracts/go/seats/nodebuildnode/contract.go @@ -8,6 +8,7 @@ import ( "encoding/json" "errors" "strings" + "time" ) // Seat is the seat's name. @@ -213,18 +214,18 @@ type BuiltArtifact struct { // Capacity is how many steps the node runs at once. type Capacity struct { // when (RFC 3339 time) - At string `json:"at,omitempty"` - BuildHours string `json:"build-hours,omitempty"` - BuildHoursFault string `json:"build-hours-fault,omitempty"` - ByCpu int64 `json:"by-cpu,omitempty"` - Configured int64 `json:"configured"` - ConfiguredFrom string `json:"configured-from,omitempty"` - CoresPerStep float64 `json:"cores-per-step,omitempty"` - Effective int64 `json:"effective"` - Ineligible string `json:"ineligible,omitempty"` - OutsideHours bool `json:"outside-hours,omitempty"` - QuotaCores float64 `json:"quota-cores,omitempty"` - QuotaFrom string `json:"quota-from,omitempty"` + At *time.Time `json:"at,omitempty"` + BuildHours string `json:"build-hours,omitempty"` + BuildHoursFault string `json:"build-hours-fault,omitempty"` + ByCpu int64 `json:"by-cpu,omitempty"` + Configured int64 `json:"configured"` + ConfiguredFrom string `json:"configured-from,omitempty"` + CoresPerStep float64 `json:"cores-per-step,omitempty"` + Effective int64 `json:"effective"` + Ineligible string `json:"ineligible,omitempty"` + OutsideHours bool `json:"outside-hours,omitempty"` + QuotaCores float64 `json:"quota-cores,omitempty"` + QuotaFrom string `json:"quota-from,omitempty"` // the layout version V int64 `json:"v,omitempty"` Why string `json:"why"` @@ -318,9 +319,9 @@ type LevelAnswer struct { // Pause is whether the node takes no new ask. type Pause struct { // when (RFC 3339 time) - At string `json:"at,omitempty"` - By string `json:"by,omitempty"` - Paused bool `json:"paused"` + At *time.Time `json:"at,omitempty"` + By string `json:"by,omitempty"` + Paused bool `json:"paused"` // the layout version V int64 `json:"v,omitempty"` } @@ -328,17 +329,17 @@ type Pause struct { // Step is one step a build module runs on a node. type Step struct { // when (RFC 3339 time) - Ended string `json:"ended,omitempty"` - ID string `json:"id"` - Node string `json:"node"` - Owner string `json:"owner,omitempty"` - Phase string `json:"phase,omitempty"` + Ended *time.Time `json:"ended,omitempty"` + ID string `json:"id"` + Node string `json:"node"` + Owner string `json:"owner,omitempty"` + Phase string `json:"phase,omitempty"` // when (RFC 3339 time) - PhaseAt string `json:"phase-at,omitempty"` + PhaseAt *time.Time `json:"phase-at,omitempty"` Reason string `json:"reason,omitempty"` Result *StepResult `json:"result,omitempty"` // when (RFC 3339 time) - Started string `json:"started"` + Started time.Time `json:"started"` // running, passed, failed or refused State string `json:"state"` Tool string `json:"tool"` @@ -383,7 +384,7 @@ type StepAskCompose struct { type StepAsk struct { Asker string `json:"asker"` // when (RFC 3339 time) - At string `json:"at,omitempty"` + At *time.Time `json:"at,omitempty"` Build *StepAskBuild `json:"build,omitempty"` Check *StepAskCheck `json:"check,omitempty"` Compose *StepAskCompose `json:"compose,omitempty"` @@ -422,7 +423,7 @@ type StepResult struct { // Toolchain is the toolchain a node reports. type Toolchain struct { // when (RFC 3339 time) - At string `json:"at,omitempty"` + At *time.Time `json:"at,omitempty"` // go or typescript Language string `json:"language"` Recipe string `json:"recipe"`