gunk-dev/the-valley

AGENTS.md

source9322091a28d0main's published tip history
8.8 KiB · Rendered
1# Working in this repository
2
3Most of the-valley is prose: design documents and knowledge-graph nodes. How you write is most of
4the work.
5
6## Writing standard
7
8Write clearly, simply, and without compression that would tax a knowledgeable software engineer.
9
10- Lead with the plain statement. Say what the thing is in ordinary words before qualifying,
11 justifying, or elaborating it.
12- One new idea per sentence. Density is fine when restating what the reader already knows; a new
13 concept gets its own sentence.
14- Unpack rather than compress. If a sentence stacks abstractions or asks the reader to infer an
15 unstated step, spell it out. Two plain sentences beat one dense one.
16- Use existing vocabulary. Coin a term only when the document defines it at first use and needs it
17 repeatedly. Prefer concrete words to abstract ones.
18- Anything a reader must act on — requirements, acceptance criteria, plans, decision records — gets
19 the plainest register of all.
20- When capturing someone else's idea, keep their words wherever they are clear enough to stand.
21- The docs speak from the project, never about its participants. State a position as the project's
22 own, and refer to people only by role (the integrator, the instance's human operator). Prior art
23 and external authors may be cited freely.
24- The repository names no deployment. Code, tests, fixtures, examples, docs, commit messages, and
25 knots never name a real host, project, person, account, address, or domain of anyone who runs the
26 valley. Use neutral names: projects `app` and `site`, the instance `valley`, hosts `valley-host`
27 and `workstation`, principals `operator` and `alice`, the domain `example.org`, and addresses from
28 the documentation range 192.0.2.0/24. Deployment specifics are configuration that a consuming
29 project supplies and documents.
30
31The test for every paragraph: could an engineer new to this repo read it once and correctly say it
32back?
33
34## A platform, not a deployment
35
36the-valley is software that other operators run, on hosts of any size, for projects of any shape.
37The deployment that motivates a change is one user among many. Build the mechanism that serves all
38of them, not the fix that fits the hosts in front of you.
39
40- Derive behaviour from what the host and the project declare or measure, never from constants tuned
41 to one deployment. Read capacity, such as CPUs and memory limits, from the system or from a
42 documented option. Choose defaults that are safe on a small host and still scale on a large one.
43- Prefer a general mechanism to a special case. A fix that works only because of one project's
44 checks, one host's memory, or one workload's timing is a workaround. Find the mechanism that holds
45 whatever those numbers are, or state the limit as a documented constraint.
46- Make limits visible to the people who hit them. When a host lacks the capacity for what is asked,
47 say so in output or telemetry, rather than failing in a way that is hard to trace, such as a
48 killed process or a stalled queue.
49- Give every option an operator may need to change a default, a documented meaning, and guidance on
50 how to size it.
51- Treat measurements from a real deployment as evidence for a change, cited in its message and knots
52 without naming the deployment. They are never design constants.
53
54For example, a lock that lets one evaluation run at a time is safe on one host and wasteful on
55another. Admitting evaluations by the memory budget the host declares serves both.
56
57## Document altitudes
58
59The docs are layered. Each document stays at its altitude:
60
611. **Premise** — [README.md](./README.md). What this is, how a change moves, and where to read next.
62 No mechanisms.
632. **Purpose and principles** — [docs/purpose.md](./docs/purpose.md). The operator's goals, the
64 principles that govern the system, ownership boundaries, and what makes a change fitting or
65 unfitting.
663. **Concepts and glossary** — [docs/concepts.md](./docs/concepts.md). Core concepts and every
67 project term defined before mechanism.
684. **Guide** — [docs/guide.md](./docs/guide.md). Setup and everyday workflows for authors,
69 reviewers, planners, administrators, and contributors.
705. **Reference** — [docs/reference.md](./docs/reference.md). CLI commands, environment variables,
71 ref layout, wire formats, JSON outputs, and CUE schemas.
726. **Architecture and security** — [docs/architecture.md](./docs/architecture.md) and
73 [docs/security.md](./docs/security.md). What runs in production, how each gate along the path of
74 a change protects the hosts, and which executable check verifies each guarantee.
757. **Archive** — [archive/design/](./archive/design/) and
76 [archive/.the-valley/](./archive/.the-valley/). Read-only historical exploration and
77 knowledge-graph nodes kept so stable node IDs (`dcr-*`, `ida-*`, `bd-*`, `oc-*`) cited in code,
78 schemas, and commit history continue to resolve.
79
80When you find detail at the wrong altitude, move it down rather than piling on. Prune elaboration
81freely — mechanics, taxonomies, and formats can be re-derived, and deleted text lives in git
82history. Never silently compress insight: a conceptual move or reframe does not re-derive on demand.
83
84## Knowledge-graph nodes
85
86Historical knowledge-graph nodes live under [archive/.the-valley/](./archive/.the-valley/), with
87node mechanics — types, IDs, frontmatter, and linking — defined in
88[archive/.the-valley/README.md](./archive/.the-valley/README.md). Each node opens with one plain
89paragraph stating the idea, decision, bug, or outcome, followed by context, implications, and open
90questions.
91
92`archive/.the-valley/` is frozen, read-only history, and nothing checks it against today's schema.
93Design decisions are recorded directly in [docs/architecture.md](./docs/architecture.md) and
94[docs/security.md](./docs/security.md). A question that is still open lives in the project's plan
95graph as a `question` knot, owned by whoever has to answer it. When its answer settles something
96about the design, the answer enters these docs through a change, and the knot links that change.
97
98## Documentation style and verification
99
1001. **Simple language, one new idea per sentence.** Lead every section with a plain statement of what
101 the thing is in ordinary words before qualifying it. Split sentences that stack abstractions.
1022. **Meaning before mechanism.** Say what a concept or command accomplishes for the reader before
103 explaining git refs, CUE unification, or Nix derivations.
1043. **Example before abstraction.** In guides and reference material, show a concrete command or a
105 short snippet before edge-case rules or schema tables.
1064. **Separate three kinds of claim.** Label code guarantees `implemented`, instance configuration
107 `deployment choice`, and mechanisms that do not work yet `not built`. Never present a deployment
108 choice or an unbuilt plan as a code guarantee. Configuration includes `valley.cue`,
109 `services.valley`, `policy/`, and `identity/`.
1105. **Carry a claim-to-code checklist.** Every documentation slice brief and change description must
111 list each factual claim added or modified, its kind, and an exact `file:line` citation verified
112 against HEAD before review. The checklist lives in a slice brief and the change description, not
113 in the docs themselves.
1146. **Present tense, no transition narration.** Describe what HEAD does today. Live plans and open
115 questions belong in `valley plan` (`refs/the-valley/knots`), not in prose docs. Do not compare
116 the-valley to other platforms; positioning is the operator's to write.
1177. **Use the project's vocabulary.** A change's recorded state is `draft`, `ready`, or `withdrawn`.
118 A version is `approved` when an integration request names it, and `submitted` once it has landed.
119 Never call a change a PR, <!-- prose-allow: vocabulary --> pull request, or branch; a git branch
120 may carry a change. A change **requires** checks; it never owes <!-- prose-allow: vocabulary -->
121 them. A plan item is never an issue, ticket, <!-- prose-allow: vocabulary --> or knowledgebase
122 entry; it is a **knot** in the **plan graph**. Operational refs (`refs/the-valley/*`) are
123 **project storage**, distinct from **the source** (`main` and release tags).
1248. **Keep the Taoist wink at thresholds.** One light sentence can introduce the valley as the low
125 place where streams of work converge, or knots as records named for knotted cords before writing.
126 Keep metaphor out of procedures, error messages, and security invariants.
127
128The `prose-format` check enforces the parts of rules 5, 6 and 7 that a pattern can catch: it fails
129on a source path followed by a line number anywhere, and, outside fenced code blocks, on common
130transition phrases and on the words rule 7 bans. To allow a legitimate use, such as quoting a banned
131word, put `<!-- prose-allow: <rule> -->` on its line, where the rule is `line-number`, `narration`
132or `vocabulary`; the marker allows that one rule on that line only.