The module's own manifest is embedded (package at the module's root); an event the gate hears from another module is the consumes entry with that event's name after its owner. No new seat, no second publisher on the seat git (the lead's ruling). Rows in the manifest test, which also reads the gate's sources for those names. Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ (Joined from 2de87fd8.) Builds: design 47 G §7, §146 (GATE16); the bridge's name stays in code for the old merge follower (eb131beb left out, G §167, §542) Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
24 lines
592 B
Go
24 lines
592 B
Go
// Package gate holds the delivery gate's own manifest, so its code takes from the manifest's declarations what it hears,
|
|
// never another module's name written in code.
|
|
package gate
|
|
|
|
import (
|
|
_ "embed"
|
|
"encoding/json"
|
|
"fmt"
|
|
)
|
|
|
|
//go:embed module.json
|
|
var manifest []byte
|
|
|
|
// Consumes is what the gate's manifest consumes, in its order.
|
|
func Consumes() ([]string, error) {
|
|
var m struct {
|
|
Consumes []string `json:"consumes"`
|
|
}
|
|
if err := json.Unmarshal(manifest, &m); err != nil {
|
|
return nil, fmt.Errorf("the gate's own manifest is not readable: %w", err)
|
|
}
|
|
return m.Consumes, nil
|
|
}
|