From 056e89f61ae883a470306abba36254d0d48adcd4 Mon Sep 17 00:00:00 2001 From: Eric Rakestraw Date: Mon, 23 Nov 2026 19:19:51 +0000 Subject: [PATCH] Adopt ReleaseKit tool and runtime version identity --- cmd/scriptorium/main.go | 6 ++---- cmd/scriptorium/main_test.go | 5 +++-- docs/roadmap/implementation.md | 5 +++++ go.mod | 5 +++++ go.sum | 6 ++++++ 5 files changed, 21 insertions(+), 6 deletions(-) diff --git a/cmd/scriptorium/main.go b/cmd/scriptorium/main.go index 7be0698..42b674a 100644 --- a/cmd/scriptorium/main.go +++ b/cmd/scriptorium/main.go @@ -9,11 +9,9 @@ import ( "gitea.maximumdirect.net/eric/scriptorium/internal/adapter/cli" "go.maximumdirect.net/commandkit" + "go.maximumdirect.net/releasekit/buildinfo" ) -var version = "dev" -var revision = "" - func main() { os.Exit(runWithSignals(os.Args[1:], os.Stdout, os.Stderr)) } @@ -25,5 +23,5 @@ func runWithSignals(args []string, stdout, stderr io.Writer) int { } func run(ctx context.Context, args []string, stdout, stderr io.Writer) int { - return cli.Execute(ctx, commandkit.Identity{Name: "scriptorium", Version: version, Revision: revision}, args, stdout, stderr).Status + return cli.Execute(ctx, commandkit.Identity{Name: "scriptorium", Version: buildinfo.Version()}, args, stdout, stderr).Status } diff --git a/cmd/scriptorium/main_test.go b/cmd/scriptorium/main_test.go index 6f8146c..ee1cc66 100644 --- a/cmd/scriptorium/main_test.go +++ b/cmd/scriptorium/main_test.go @@ -13,15 +13,16 @@ import ( "path/filepath" "runtime" "slices" - "strings" "syscall" "testing" "time" + + "go.maximumdirect.net/releasekit/buildinfo" ) func TestProcessIdentityAndNativeStatus(t *testing.T) { var output, diagnostics bytes.Buffer - if status := run(context.Background(), []string{"version"}, &output, &diagnostics); status != 0 || !strings.Contains(output.String(), version) { + if status := run(context.Background(), []string{"version"}, &output, &diagnostics); status != 0 || output.String() != "scriptorium "+buildinfo.Version()+"\n" { t.Fatalf("version status=%d output=%q diagnostics=%q", status, output.String(), diagnostics.String()) } output.Reset() diff --git a/docs/roadmap/implementation.md b/docs/roadmap/implementation.md index 51acb94..ea3ebb0 100644 --- a/docs/roadmap/implementation.md +++ b/docs/roadmap/implementation.md @@ -64,6 +64,11 @@ native behavior instead of reconstructing it from Scriptorium's old script. ## Stage 1: Register The Tool And Adopt Runtime Version Identity +**Completed:** Entrypoint tests and a temporary application build passed with +Go 1.27.4; the built `version` command ran without configuration or credentials. +The registered host-target tool reported `releasekit v0.10.0`, and `go mod +tidy` retained its tool declaration. + **Primary files:** `go.mod`, `go.sum`, `cmd/scriptorium/main.go`, `cmd/scriptorium/main_test.go`. diff --git a/go.mod b/go.mod index b757153..78b4a61 100644 --- a/go.mod +++ b/go.mod @@ -8,6 +8,7 @@ require ( go.maximumdirect.net/commandkit v0.8.0 go.maximumdirect.net/configkit v1.4.0 go.maximumdirect.net/promptkit v0.25.0 + go.maximumdirect.net/releasekit v0.10.0 go.yaml.in/yaml/v4 v4.0.0 ) @@ -16,5 +17,9 @@ require ( github.com/santhosh-tekuri/jsonschema/v6 v6.0.3 // indirect github.com/spf13/cobra v1.10.2 // indirect github.com/spf13/pflag v1.1.0 // indirect + github.com/yuin/goldmark/v2 v2.1.16 // indirect + golang.org/x/mod v0.43.0 // indirect golang.org/x/text v0.44.0 // indirect ) + +tool go.maximumdirect.net/releasekit/cmd/releasekit diff --git a/go.sum b/go.sum index c3a6d14..2ed1785 100644 --- a/go.sum +++ b/go.sum @@ -11,6 +11,8 @@ github.com/spf13/cobra v1.10.2/go.mod h1:7C1pvHqHw5A4vrJfjNwvOdzYu0Gml16OCs2GRiT github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/pflag v1.1.0 h1:6W6MbVUrnMb8PEhjkqwsVLY7ryuzRfFHF4mQd7L94ag= github.com/spf13/pflag v1.1.0/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/yuin/goldmark/v2 v2.1.16 h1:MXvCVo+Cb2SVJ5cwJUzXetDjI7HECRJCkcqylEQtcJo= +github.com/yuin/goldmark/v2 v2.1.16/go.mod h1:G6M4/qOFtfn01/o14BU1UR2Lo5N3S9Qo7xCuz/sHjGQ= go.maximumdirect.net/ckconfig v0.11.0 h1:oTPW5R4vW5TNs97rqgABC/dir723rbGBz0FUyZ9QiNk= go.maximumdirect.net/ckconfig v0.11.0/go.mod h1:9phvXeLAgQSBKpJWqPyIQASKVJr0nRhiPMIQkfNhaRo= go.maximumdirect.net/ckprompt v0.12.0 h1:TPx4c0ohnG51F5eXk9SLHvkSKGNnWBhzkJAC5LdZCrE= @@ -21,9 +23,13 @@ go.maximumdirect.net/configkit v1.4.0 h1:TfOupZbQ23/ZMs+xt5lmyukCF11ekqKep8KbmFQ go.maximumdirect.net/configkit v1.4.0/go.mod h1:ewu6blSokUDCMovy8JBXAdXRikGmlHXAQpFghnPWRfs= go.maximumdirect.net/promptkit v0.25.0 h1:vJOfxauwASllOSDceR2oypJ4NEwIh2s6F8dDexEzdM8= go.maximumdirect.net/promptkit v0.25.0/go.mod h1:o2axdkV11KTPDgk81i2vrJ66dtcedXRhau/Ko3YSZ4A= +go.maximumdirect.net/releasekit v0.10.0 h1:3GOgaIigXTkvYaRkntWZASE//2NTR1+IhkoKmt64aJo= +go.maximumdirect.net/releasekit v0.10.0/go.mod h1:cT5NZNEcf7SKDx4MPG40YNK9V4bNyIxcLLFuNlbGQ90= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= go.yaml.in/yaml/v4 v4.0.0 h1:/LG1pNO84Z4l603j/xMn69CcS5OYhMQ/f7l2LoQUGuw= go.yaml.in/yaml/v4 v4.0.0/go.mod h1:aZqd9kCMsGL7AuUv/m/PvWLdg5sjJsZ4oHDEnfPPfY0= +golang.org/x/mod v0.43.0 h1:MFuq5J6s35W9D3IjkwyWc9vHh0nENOrt5K8Iof4ofmg= +golang.org/x/mod v0.43.0/go.mod h1:4ec1JnuyBz5+FIVhg86UsA39YG8BpnrZdJYSNHmGzHY= golang.org/x/text v0.44.0 h1:YItdp/mQNGnsmrgpcdA5yQ3bnRxCfo/Tj/iByGW9GGo= golang.org/x/text v0.44.0/go.mod h1:S4FR1waQ9LbjQTls97SyRjDaUUVkaM+cXwwuG/G+MwY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=