Documentation
¶
Overview ¶
Package reference derives a module's reference pages from the files it embeds, and answers the routing questions `pgedge llms` and the generator ask of them.
The layout is the contract. A package's llms.txt is its index page, and every llms/**/*.txt beneath it is one more page whose scope is the file path with the directory separators and the extension removed: llms/database/mcp.txt under "starfleet byoc" is the page for `pgedge starfleet byoc database mcp`. Nothing declares the set, so there is no list to fall behind the files, and every gate that needs the set reads it from here rather than keeping its own.
Index ¶
- Constants
- func Children(docs []module.Document, scope string) []module.Document
- func Find(docs []module.Document, scope string) (module.Document, bool)
- func FromFS(fsys fs.FS, dir, scope string) ([]module.Document, error)
- func LongestPrefix(docs []module.Document, scope string) (module.Document, bool)
- func Scopes(docs []module.Document) []string
- func TopicSummary(body []byte) (string, bool)
Constants ¶
const PageSizeBudget = 25 * 1024
PageSizeBudget bounds one reference page below the module index.
The split exists so an agent working on one resource reads that resource's page and nothing else; a page has to be small enough for that to be a saving. 25 KB is about 6k tokens. The module index is not bound by it: an index carries the cross-cutting prose every resource shares once, and its own budget is a separate question.
Variables ¶
This section is empty.
Functions ¶
func Children ¶
Children returns the pages one word below scope, in scope order. They are what a routing table lists and what Tab completion offers.
func FromFS ¶
FromFS returns the pages a package embeds, sorted by scope. dir is the package's path under the repository root and scope its command path under `pgedge`, "" for the root; both are recorded on every page so a caller can go from a served page back to its file.
func LongestPrefix ¶
LongestPrefix returns the page whose scope is the longest prefix of scope, word-wise, so a miss can be reported against the nearest page that does exist.
func Scopes ¶
Scopes returns every page's scope, in order, which is the set of ownership scopes the generator and the conformance gate share.
func TopicSummary ¶
TopicSummary reports whether a page is a topic page, one that documents a task spanning several resources rather than a command, and returns the summary its routing-table row shows. A topic page says so on its first line, `<!-- topic: <summary> -->`, because nothing else tells it apart from a resource page whose command was deleted.
Types ¶
This section is empty.