gunk-dev/the-valley

README.md

source0c24854c6d3emain's published tip history
5.2 KiB · Rendered
1# .the-valley — knowledge v0
2
3The knowledge-graph convention from
4[user-scenarios.md § S1](../design/user-scenarios.md#s1--my-repos-live-on-my-infrastructure-and-i-can-never-lose-them):
5**a directory convention, not a system**. Issues, outcomes, ideas, and decisions live with the repo
6as plain files, cloned and backed up by the same motion that protects the code.
7
8## The convention
9
10One file per node. Each file is markdown with YAML frontmatter carrying the structured layer:
11
12```yaml
13---
14type: idea # outcome | bug | idea | decision
15id: ida-eac723e # <prefix>-<short hash>
16status: adopted # see enums below
17title: One-line human title
18created: 2026-07-02
19source: PR #1 # optional — where the content came from
20---
21```
22
23One typed edge exists now: **outcome nodes carry `blocked_by`** (a list of node ids) in frontmatter,
24because the live outcome-DAG experiment
25([ideas/ida-3145b7a-demand-pressure.md](./ideas/ida-3145b7a-demand-pressure.md)) requires it. The
26other typed edges (`closes`, `supersedes`, …) come later; until then, prose links in the body are
27enough.
28
29## Types, directories, prefixes
30
31| Type | Directory | Prefix | Status enum |
32| -------- | ------------ | ------- | ------------------------------------------------- |
33| outcome | `outcomes/` | `oc-*` | `open` \| `in-progress` \| `done` \| `abandoned` |
34| bug | `bugs/` | `bd-*` | `open` \| `closed` |
35| idea | `ideas/` | `ida-*` | `raw` \| `exploring` \| `adopted` \| `superseded` |
36| decision | `decisions/` | `dcr-*` | `proposed` \| `decided` \| `superseded` |
37
38IDs are short and hash-derived (e.g. first 7 hex chars of a hash of the slug) — coordination-free,
39at the cost of prettiness. Filenames are `<id>-<slug>.md`.
40
41The same table in checkable form is [`schema/node.cue`](../schema/node.cue), which the knowledge
42lint vets every node's frontmatter against.
43
44## Writing a node
45
46**The graph at any commit presents the design as it stands now.** It carries no history of how the
47thinking got there. That history is in git history, and only there.
48
49- **Restate, don't accrete.** When thinking evolves, rewrite the node as the cleanest statement of
50 current understanding. No Addendum, Update, Revision or Correction sections, ever, and no
51 superseded framing left standing beside its replacement.
52- **A node never defines the design by contrast with an earlier or rejected version of itself.** No
53 "not one", no "rather than", no "as described above, but actually". A decision node records what
54 was decided, not the options weighed against it.
55- **Rationale stays; deliberation goes.** This is the distinction that makes the rule above usable.
56 A reason stated as a property of the current design belongs in the node; a record of a fork being
57 weighed and settled does not. When unsure, state the reason positively as a fact about the design
58 rather than as a comparison against something not chosen.
59- **A node must not assert something and then correct itself later in the same document.** State it
60 correctly where a reader meets it first. A reader who stops halfway must not be left with the
61 superseded version.
62- **Replacing something includes deleting what it replaces, in the same change.** This covers the
63 files a node points at as much as its prose — a superseded example left beside its replacement is
64 the same defect as a superseded paragraph.
65
66Two rules that govern the design documents govern nodes identically, and are stated once, where they
67already live:
68
69- **Disembodied voice** — [AGENTS.md](../AGENTS.md), writing standard. A node speaks about
70 the-valley itself: no names, no second person, no reference to project participants. Roles are
71 fine, as are external prior art and its authors. Frontmatter `source:` follows the same rule; it
72 names a date and a venue, never a person.
73- **Prose format** — [[ida-1ec03b1]]
74 ([ideas/ida-1ec03b1-path-scoped-verification-policy.md](./ideas/ida-1ec03b1-path-scoped-verification-policy.md)).
75 Markdown prose is filled paragraphs hard-wrapped at 100 characters. `nix run .#fmt` rewraps; the
76 flake's `prose-format` check enforces it.
77
78## The interface
79
80- **Creating a node is a commit.** Closing one is a commit that flips `status`.
81- **Listing is `ls`. Search is `grep`. History is `git log`.**
82- No indexer and no events.
83- **The convention is checked, not enforced.** `nix flake check` runs `knowledge-lint`: every node's
84 frontmatter vetted against [`schema/node.cue`](../schema/node.cue), every filename agreeing with
85 the frontmatter it carries, and every `[[wiki-link]]`, `blocked_by` id and relative link
86 resolving. It reports; nothing stops a broken graph from landing until there is an integrator to
87 stop it.
88
89The lint is not this repo's alone. The flake exposes it as `lib.knowledgeLint`, so any project that
90keeps a graph gets the same check by taking the-valley as a flake input and instantiating it over
91its own tree — see the comment on that output in [flake.nix](../flake.nix) for the whole of a
92consuming flake, and [[ida-a9e274c]]
93([ideas/ida-a9e274c-mandated-checks-come-from-the-instance.md](./ideas/ida-a9e274c-mandated-checks-come-from-the-instance.md))
94for why the derivation travels rather than the convention.