gunk-dev/the-valley

README.md

source5aca492672b7main's published tip history
6.5 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
23Two typed edges exist, each a list of node ids in frontmatter.
24
25**Outcome nodes carry `blocked_by`**: the nodes an outcome waits on. The live outcome-DAG experiment
26([ideas/ida-3145b7a-demand-pressure.md](./ideas/ida-3145b7a-demand-pressure.md)) requires it.
27
28**Idea and decision nodes carry `supersedes`**: the nodes this one replaces. Ideas and decisions are
29the only types that carry it, because they are the only two whose status enum has a `superseded`
30value for the replaced node to land in. The lint requires that status to be set, so a supersession
31cannot be half-declared. Declaring it is the machine-readable half of the resolution rule below; the
32prose still has to be corrected too.
33
34The remaining typed edges (`closes`, …) come later; until then, prose links in the body are enough.
35
36## Types, directories, prefixes
37
38| Type | Directory | Prefix | Status enum |
39| -------- | ------------ | ------- | ------------------------------------------------- |
40| outcome | `outcomes/` | `oc-*` | `open` \| `in-progress` \| `done` \| `abandoned` |
41| bug | `bugs/` | `bd-*` | `open` \| `closed` |
42| idea | `ideas/` | `ida-*` | `raw` \| `exploring` \| `adopted` \| `superseded` |
43| decision | `decisions/` | `dcr-*` | `proposed` \| `decided` \| `superseded` |
44
45IDs are short and hash-derived (e.g. first 7 hex chars of a hash of the slug) — coordination-free,
46at the cost of prettiness. Filenames are `<id>-<slug>.md`.
47
48The same table in checkable form is [`schema/node.cue`](../schema/node.cue), which the knowledge
49lint vets every node's frontmatter against.
50
51## Writing a node
52
53**The graph at any commit presents the design as it stands now.** It carries no history of how the
54thinking got there. That history is in git history, and only there.
55
56- **Restate, don't accrete.** When thinking evolves, rewrite the node as the cleanest statement of
57 current understanding. No Addendum, Update, Revision or Correction sections, ever, and no
58 superseded framing left standing beside its replacement.
59- **A node never defines the design by contrast with an earlier or rejected version of itself.** No
60 "not one", no "rather than", no "as described above, but actually". A decision node records what
61 was decided, not the options weighed against it.
62- **Rationale stays; deliberation goes.** This is the distinction that makes the rule above usable.
63 A reason stated as a property of the current design belongs in the node; a record of a fork being
64 weighed and settled does not. When unsure, state the reason positively as a fact about the design
65 rather than as a comparison against something not chosen.
66- **A node must not assert something and then correct itself later in the same document.** State it
67 correctly where a reader meets it first. A reader who stops halfway must not be left with the
68 superseded version.
69- **Replacing something includes deleting what it replaces, in the same change.** This covers the
70 files a node points at as much as its prose — a superseded example left beside its replacement is
71 the same defect as a superseded paragraph.
72- **Where two documents make incompatible claims, the more recently written claim is the current
73 one.** `git blame` the lines carrying each claim rather than the files: a formatting sweep or an
74 edit elsewhere touches a file without changing what it asserts. Correcting the stale claim belongs
75 to the change that found the contradiction, not to a later one — that is the rule above, applied
76 across two documents instead of within one. The rule's limit, stated plainly: recency establishes
77 which claim was written later, never which one is right. Where the newer claim is the mistake, the
78 resolution is still a change that leaves the corpus saying one thing, and never an annotation
79 explaining the discrepancy.
80
81Two rules that govern the design documents govern nodes identically, and are stated once, where they
82already live:
83
84- **Disembodied voice** — [AGENTS.md](../AGENTS.md), writing standard. A node speaks about
85 the-valley itself: no names, no second person, no reference to project participants. Roles are
86 fine, as are external prior art and its authors. Frontmatter `source:` follows the same rule; it
87 names a date and a venue, never a person.
88- **Prose format** — [[ida-1ec03b1]]
89 ([ideas/ida-1ec03b1-path-scoped-verification-policy.md](./ideas/ida-1ec03b1-path-scoped-verification-policy.md)).
90 Markdown prose is filled paragraphs hard-wrapped at 100 characters. `nix run .#fmt` rewraps; the
91 flake's `prose-format` check enforces it.
92
93## The interface
94
95- **Creating a node is a commit.** Closing one is a commit that flips `status`.
96- **Listing is `ls`. Search is `grep`. History is `git log`.**
97- No indexer and no events.
98- **The convention is checked, not enforced.** `nix flake check` runs `knowledge-lint`: every node's
99 frontmatter vetted against [`schema/node.cue`](../schema/node.cue), every filename agreeing with
100 the frontmatter it carries, and every `[[wiki-link]]`, `blocked_by` id, `supersedes` id and
101 relative link resolving. A `supersedes` id must further name a node whose own status is
102 `superseded`. It reports; nothing stops a broken graph from landing until there is an integrator
103 to stop it.
104
105The lint is not this repo's alone. The flake exposes it as `lib.knowledgeLint`, so any project that
106keeps a graph gets the same check by taking the-valley as a flake input and instantiating it over
107its own tree — see the comment on that output in [flake.nix](../flake.nix) for the whole of a
108consuming flake, and [[ida-a9e274c]]
109([ideas/ida-a9e274c-mandated-checks-come-from-the-instance.md](./ideas/ida-a9e274c-mandated-checks-come-from-the-instance.md))
110for why the derivation travels rather than the convention.