{"modulePath":"github.com/Agent-Field/codeaf","version":"v0.8.4","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package main\n\ncodeaf-changes is the changelog's gate, its scaffold and its typesetter.\n\nTHE CHANGELOG IN THIS REPOSITORY IS WRITTEN FOR A MODEL AND NOT FOR A RELEASE PAGE. Its job is not to say what shipped — \\`git log\\` says that, and says it better. Its job is to say WHAT SOMEBODY NOW BELIEVES WRONGLY: which branch stopped existing, which default moved, which refusal became a capability. That is the one thing no tool can derive from a diff and the one thing a session opening this repository with a fortnight-old memory of it most needs, so it is the field the format is built around.\n\nIt is not shipped. Like cmd/codeaf-demo-home this is a developer's binary and never a verb on codeaf, so it costs the product nothing on the SIZE-BUDGET.\n\nUsage:\n\n\tcodeaf-changes check [dir]                validate every entry\n\tcodeaf-changes render \u003cversion\u003e [date]    print one version's section\n\tcodeaf-changes roll   \u003cversion\u003e [date]    render into CHANGELOG.md, then\n\t                                          remove the entries it consumed\n\tcodeaf-changes new \u003ckind\u003e \u003cpr\u003e \u003cslug\u003e     scaffold an entry to fill in\n\tcodeaf-changes notes \u003ctag\u003e                print one released version's\n\t                                          section, shortened to fit a\n\t                                          GitHub release page\n\n## Functions\n\n```go\nfunc Insert(changelog, section string) (string, error)\n```\nInsert puts a rendered section into CHANGELOG.md at the marker, newest first.\n\n```go\nfunc Notes(changelog, tag string, capBytes int) (string, error)\n```\nNotes renders one version's section for the release page, under capBytes.\n\nThree shapes, tried in order, and the first that fits is the answer: the section as written; the section with its \\`\\\u003cdetails\u003e\\` folds removed, so every headline line and every kind heading survives; and that headline layer cut at a line boundary. The last two end with notesTail so nothing shortened pretends to be whole.\n\n```go\nfunc Render(version, date string, entries []Entry) string\n```\nRender turns a set of entries into one version's section.\n\nTWO LAYERS, BECAUSE THERE ARE TWO READERS AND THEY WANT OPPOSITE THINGS. A person scanning for what shipped wants one line per change and nothing else on the screen. A model that has to decide whether what it remembers is still true wants every claim, spelled out. So the line is always visible and the claims are always one fold away — neither reader pays for the other.\n\nAn entry with nothing to invalidate renders as a bare line. An empty disclosure triangle is a promise of detail that is not there, and after two of them nobody opens the third.\n\n```go\nfunc Section(changelog, tag string) (string, bool)\n```\nSection returns the body of one version's section of CHANGELOG.md: every line after \\`## \\\u003ctag\u003e \\` up to the next \\`## \\` heading. The trailing space in the match is deliberate — \\`v0.2.0\\` must not match \\`v0.2.0-rc.1\\`. ok is false when there is no such section, which is the workflow's cue to fall back to generated notes rather than publish a page that says nothing.\n\n## Types\n\n```go\ntype Entry struct {\n\tKind        string   `yaml:\"kind\"`\n\tTitle       string   `yaml:\"title\"`\n\tPR          int      `yaml:\"pr\"`\n\tSurface     []string `yaml:\"surface\"`\n\tInvalidates []string `yaml:\"invalidates\"`\n\n\t// Everything after the frontmatter: why, in a person's words. Optional, and\n\t// genuinely optional — most changes are exactly their title.\n\tBody string `yaml:\"-\"`\n\t// Where it was read from, so a failure can name the file to open.\n\tPath string `yaml:\"-\"`\n}\n```\nWHAT A CHANGE ENTRY IS FOR, WHICH IS NOT WHAT A COMMIT MESSAGE IS FOR. The commit says what somebody did. This says what somebody else — usually a model opening this repository with a fortnight-old memory of it — now believes wrongly. Those are different documents and only one of them can be generated.\n\nEverything here is small on purpose. Five fields, three of them usually, and a paragraph. A form long enough to resent is a form that gets a placeholder typed into it, and a changelog of placeholders is worse than none because it reads as though somebody checked.\n\n```go\nfunc LoadDir(dir string) ([]Entry, []error)\n```\nLoadDir reads every entry in a directory and reports every fault in all of them together, for the same reason validate does.\n\n```go\nfunc ParseEntry(path string) (Entry, []error)\n```\nParseEntry reads one entry and says everything wrong with it at once. Not the first thing wrong — everything, because a gate that reveals one fault per run is a gate somebody bounces off four times and then works around.\n\n","path":"github.com/Agent-Field/codeaf/cmd/codeaf-changes","name":"main","synopsis":"codeaf-changes is the changelog's gate, its scaffold and its typesetter.","isRedistributable":true}
