From 9616dd72ce676f9cc8e7cbb86bc752e8b7504c71 Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Mon, 9 Nov 2026 07:53:02 +1100 Subject: [PATCH] refactor(playbook): drop the directory loader and docs left by the playbooks command --- deployments/INSTRUCTIONS.md | 9 ------- go.mod | 4 ---- go.sum | 8 ------- internal/domain/eda/playbook/playbook.go | 30 ------------------------ 4 files changed, 51 deletions(-) diff --git a/deployments/INSTRUCTIONS.md b/deployments/INSTRUCTIONS.md index ce1b4fc85..6a15feb14 100644 --- a/deployments/INSTRUCTIONS.md +++ b/deployments/INSTRUCTIONS.md @@ -13,9 +13,6 @@ contracts (or NATS, for task actions): | `archie-messaging` | the Telegram, email and webhook channel connections | Gateway; State Store for channel settings | | `archie-ui` | the dashboard and the webhook capture receiver | Gateway; State Store | -`archied playbooks lint` checks playbook binding YAML before it reaches the -daemon, and `archied playbooks serve` is its language server for editors. - Without `archie-messaging` the channels are simply absent, so it needs a unit of its own (`deployments/systemd-user-service.md`). @@ -67,12 +64,6 @@ that reference is on a registry that needs a login -- see systemd user-unit runbook: . -## Verifying an install - -`archied playbooks lint -dir ` validates playbook binding YAML -against the same schema `archied` loads at startup — run it against your -playbooks directory before pointing `archied` at it. - ## Version This archive's binaries are built from the `archied` release tag in its diff --git a/go.mod b/go.mod index 2bdcab980..4e08f9643 100644 --- a/go.mod +++ b/go.mod @@ -22,7 +22,6 @@ require ( github.com/felixge/httpsnoop v1.1.0 // indirect github.com/fxamacker/cbor/v2 v2.9.6 // indirect github.com/go-git/gcfg/v2 v2.0.2 // indirect - github.com/go-json-experiment/json v0.0.0-20260820222146-c27c302e5fc3 // indirect github.com/go-logr/logr v1.4.4 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-viper/mapstructure/v2 v2.5.0 // indirect @@ -96,9 +95,6 @@ require ( github.com/opencontainers/image-spec v1.1.1 github.com/pressly/goose/v3 v3.29.0 github.com/samcharles93/ai-sdk v0.6.0 - go.lsp.dev/jsonrpc2 v1.0.1 - go.lsp.dev/protocol v1.0.1 - go.lsp.dev/uri v1.0.1 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.72.0 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.72.0 go.opentelemetry.io/otel v1.47.0 diff --git a/go.sum b/go.sum index 0d03f3626..73dc61fe4 100644 --- a/go.sum +++ b/go.sum @@ -69,8 +69,6 @@ github.com/go-git/go-git/v6 v6.0.0-beta.1 h1:1t+vJYGDBN6f9GRWskgWx5UjXPFUa7wfffZ github.com/go-git/go-git/v6 v6.0.0-beta.1/go.mod h1:ugDlr38Wwc+fOw85J+Oluh5TNXQtJgYMcriOljg3l4s= github.com/go-jose/go-jose/v4 v4.1.6 h1:sNRkftxFJxwsILiQukqp5z83QBSmntVwmgRY7AqBDO4= github.com/go-jose/go-jose/v4 v4.1.6/go.mod h1:x4oUasVrzR7071A4TnHLGSPpNOm2a21K9Kf04k1rs08= -github.com/go-json-experiment/json v0.0.0-20260820222146-c27c302e5fc3 h1:UADEEmDKgfXbtnGJZ97beY5XLo9ZechG1nlU4KnRrkE= -github.com/go-json-experiment/json v0.0.0-20260820222146-c27c302e5fc3/go.mod h1:tphK2c80bpPhMOI4v6bIc2xWywPfbqi1Z06+RcrMkDg= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.4 h1:tG4xh9yMsRCAiodLVTxyrkzSZ9+o0L1Kg/+cPVcbP/8= github.com/go-logr/logr v1.4.4/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -203,12 +201,6 @@ github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/yosida95/uritemplate/v3 v3.0.2 h1:Ed3Oyj9yrmi9087+NczuL5BwkIc4wvTb5zIM+UJPGz4= github.com/yosida95/uritemplate/v3 v3.0.2/go.mod h1:ILOh0sOhIJR3+L/8afwt/kE++YT040gmv5BQTMR2HP4= -go.lsp.dev/jsonrpc2 v1.0.1 h1:JZAchpm6RcOuwEOnZ7kF3kA1EpEjdJZ/6rMSfOF3+F4= -go.lsp.dev/jsonrpc2 v1.0.1/go.mod h1:WN+TesqrPumBmUdsuWyn9DHq3zl4i85L/qG0NLdj8qg= -go.lsp.dev/protocol v1.0.1 h1:kLWUIk1v/deXxo1D0VO4avjZnfeuZ82mouJgJd/NbdU= -go.lsp.dev/protocol v1.0.1/go.mod h1:e//i41aEqc9ml32xiNuneUwbjOjuvTA4+uv+AkssJgk= -go.lsp.dev/uri v1.0.1 h1:ywxJN1UXoQ+v0I9lkoQNMmsm7lub5G9ZG7KXT8YTx30= -go.lsp.dev/uri v1.0.1/go.mod h1:06a0ghafs4PuqkLsJGUmlgPHw6+kH79edRXjOT/rA8s= go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.72.0 h1:Tq+E65HaNbZTeqcLw6QUhsV+/EIWdkfUH2CQzcrlE5M= diff --git a/internal/domain/eda/playbook/playbook.go b/internal/domain/eda/playbook/playbook.go index 40d874767..bd1c41735 100644 --- a/internal/domain/eda/playbook/playbook.go +++ b/internal/domain/eda/playbook/playbook.go @@ -7,8 +7,6 @@ import ( "crypto/sha256" "fmt" "maps" - "os" - "path/filepath" "reflect" "slices" "strings" @@ -205,34 +203,6 @@ type Document struct { YAML []byte } -// Load reads and compiles every playbook in dir. Any invalid playbook fails -// the load. A missing directory is an empty store. -func Load(dir string, modules Modules) (*Store, error) { - entries, err := os.ReadDir(dir) - if os.IsNotExist(err) { - return &Store{modules: modules}, nil - } - if err != nil { - return nil, fmt.Errorf("read playbook dir %s: %w", dir, err) - } - - var docs []Document - for _, e := range entries { - if e.IsDir() { - continue - } - if ext := strings.ToLower(filepath.Ext(e.Name())); ext != ".yaml" && ext != ".yml" { - continue - } - data, err := os.ReadFile(filepath.Join(dir, e.Name())) - if err != nil { - return nil, fmt.Errorf("read playbook %s: %w", e.Name(), err) - } - docs = append(docs, Document{ID: e.Name(), YAML: data}) - } - return Compile(docs, modules) -} - // Compile validates and compiles playbook documents in id order. Any invalid // playbook fails the whole set: a partially valid set never runs. func Compile(docs []Document, modules Modules) (*Store, error) {