Start adding sighelp*.go files for gpt assist

This commit is contained in:
Michael Hohn
2025-05-06 11:16:01 -07:00
committed by =Michael Hohn
parent 70c06e4fae
commit f7dc5318e4
2 changed files with 98 additions and 0 deletions

41
pkg/deploy/README.org Normal file
View File

@@ -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:<tag>: …=
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.

57
pkg/deploy/sighelp.go Normal file
View File

@@ -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
}