Documentation
¶
Overview ¶
Package newcodebase is how Physa starts a map when there is nothing to recover (design 02 §2.8). It detects a new codebase from the gather, then asks a person a short round of numbered questions, each with a suggested answer, to write the product's promise and first terms, or reads the answers from a file. It never guesses for the person: a suggestion is used only when the person accepts it. It calls no agent and writes no file.
The answers file read by ReadAnswers has one answer per line, as `1: <answer>` to `3: <answer>`, numbered as Questions numbers them. Blank lines and lines starting with `#` are ignored. A number left out takes the suggestion of the questions passed in; with none to take, the name and the promise are errors and the terms are none. The first colon ends the number, so a term's own colon stays in the answer, as in `3: Cut list: The parts`.
Index ¶
Constants ¶
const FewChanges = 5
FewChanges is the most changes a new codebase may have had. It is a first guess, to be tuned against real repos.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Answers ¶
Answers is what the person said: the product's name and promise, and its first terms.
func Ask ¶
Ask prints each question as `1. <question>` and ` Suggested: <answer>`, and reads one line. An empty line or `yes` accepts the suggestion. An answer that fails its check (a promise still holding …, a term without a meaning) is asked again, at most twice, then it is an error. Input that ends before an answer is an error: Ask never answers for the person.
func ReadAnswers ¶
ReadAnswers reads the answers file at path, in the format above. Missing numbers take the suggestions in qs.
func (Answers) GlossaryTerms ¶
GlossaryTerms renders the terms as glossary.md wants them (design 01 §4): `**Name**: meaning`, one per paragraph.