diff --git a/pkg/deploy/README.org b/pkg/deploy/README.org new file mode 100644 index 0000000..9c6046f --- /dev/null +++ b/pkg/deploy/README.org @@ -0,0 +1,41 @@ +* sighelp.go : GPT-Assistable Semantic Outline + + This file provides *non-functional symbolic structure* for the corresponding =.go= file (e.g. =init.go=), optimized for: + + - GPT parsing and assistance + - IDE symbol navigation (LSP) + - Type-checking to detect drift + - Readable overview for human developers + + Each =sighelp_XXX()= function: + + - Mirrors a real function (e.g. =InitRabbitMQ=) + - Calls it with placeholder arguments + - Discards the result to avoid side effects + - Includes structured GPT-readable comments in the form =// gpt:: …= + + This allows both humans and GPT tools to: + + - See what functions exist and what they do + - Understand return types and call relations + - Navigate codebases via structure, not prose + + **Example** + + #+BEGIN_SRC go + // gpt:flowinfo: InitMinIOArtifactStore returns a store configured via env vars + func sighelp_InitMinIOArtifactStore() { + var s artifactstore.Store + var err error + s, err = InitMinIOArtifactStore() + _ = s + _ = err + } + #+END_SRC + + **Style Guidelines** + + - Always use valid, compilable Go. + - Maintain one =sighelp_= per actual function. + - Add =// gpt:= comments to express intent or relationships. + - Avoid runtime logic — this file is for *structure*, not execution. diff --git a/pkg/deploy/sighelp.go b/pkg/deploy/sighelp.go new file mode 100644 index 0000000..ffaeefa --- /dev/null +++ b/pkg/deploy/sighelp.go @@ -0,0 +1,57 @@ +package deploy + +// gpt:summary: semantic outline of init.go functions and their primary responsibilities +// gpt:note: this file provides GPT-visible symbolic structure for deploy/init.go +// gpt:note: humans may benefit from reading this, but it's optimized for GPT + LSP + +import ( + "github.com/hohn/mrvacommander/pkg/artifactstore" + "github.com/hohn/mrvacommander/pkg/qldbstore" + "github.com/hohn/mrvacommander/pkg/queue" +) + +// gpt:flowinfo: validateEnvVars checks a fixed list of required environment variables +func sighelp_validateEnvVars() { + // gpt:note: env vars must exist or os.Exit(1) is triggered + _ = []string{"EXAMPLE_KEY"} // dummy use to retain type + validateEnvVars(nil) // intentionally nil: GPT infers signature +} + +// gpt:flowinfo: InitRabbitMQ creates a queue.Queue using RabbitMQ connection info +func sighelp_InitRabbitMQ() { + // gpt:note: requires 4 env vars: HOST, PORT, USER, PASSWORD + // gpt:returns: queue.Queue, error + var q queue.Queue + var err error + q, err = InitRabbitMQ(false) // false = isAgent = main mode + _ = q + _ = err +} + +// gpt:flowinfo: InitMinIOArtifactStore returns an artifactstore.Store from env config +func sighelp_InitMinIOArtifactStore() { + var s artifactstore.Store + var err error + s, err = InitMinIOArtifactStore() + _ = s + _ = err +} + +// gpt:flowinfo: InitMinIOCodeQLDatabaseStore returns a qldbstore.Store +func sighelp_InitMinIOCodeQLDatabaseStore() { + var s qldbstore.Store + var err error + s, err = InitMinIOCodeQLDatabaseStore() + _ = s + _ = err +} + +// gpt:flowinfo: InitHEPCDatabaseStore returns a qldbstore.Store (from Hepc impl) +// gpt:note: unlike others, this directly returns from NewHepcStore with fewer checks +func sighelp_InitHEPCDatabaseStore() { + var s qldbstore.Store + var err error + s, err = InitHEPCDatabaseStore() + _ = s + _ = err +}