Commit a68d957
The README's first code block was LangGraph's API, not GraphARC's (#55)
Every call in the Quick Start was wrong, and it was the first code a visitor
copies. Verified against this tree rather than read:
- `from grapharc.runtime import StateGraph` -> ImportError. This package has
never exported `StateGraph`; the module exports `GraphARC`. The very first
line failed, so nobody who pasted the block got as far as the rest.
- `add_node("process", lambda ...)` with no `writes=` -> TypeError, the
argument is required. Per-node write permissions are the project's headline
claim, and the snippet showed them being skipped.
- `add_edge("START", "process")` -> ValueError: unknown node 'START'. START is
a sentinel, not the string.
- Plain `pydantic.BaseModel` for state. Accepted at runtime, but it sidesteps
`GraphARCState` and the typed-contract story the page is selling.
The block came in with 241b272 ("README refactoring: improve discoverability
and structure"), which also added a contents list whose `#usage` and
`#documentation` entries point at sections that do not exist — a dead anchor
on GitHub silently does nothing when clicked, so reading the page never
surfaced it either.
Replaced with a snippet that runs, and that shows the three things that are
actually the point: typed state, declared writes, a Budget on the run. The
contents list now names the real sections.
Nothing caught any of this because nothing ran it. This module's own docstring
describes exactly that drift for the admission-gate section and fixes it by
executing the block; the Quick Start had the same standing on the page and
none of the discipline. So it gets the same treatment:
- `test_the_quick_start_block_actually_runs_against_this_tree` executes the
block and compares stdout with the result the page states.
- `test_the_quick_start_reaches_no_live_backend` keeps the first snippet a
visitor copies from being able to spend money.
- `test_every_table_of_contents_link_resolves_to_a_real_heading` derives
anchors the way GitHub does and fails on a dead one.
Both new tests were confirmed to fail against the old README and pass against
the new one, so they are not vacuous. Full suite green on 3.12; ruff clean.
Co-authored-by: Claude <noreply@anthropic.com>1 parent 65f7fa0 commit a68d957
2 files changed
Lines changed: 103 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
46 | 55 | | |
47 | 56 | | |
48 | 57 | | |
49 | 58 | | |
50 | | - | |
51 | | - | |
| 59 | + | |
| 60 | + | |
52 | 61 | | |
53 | | - | |
54 | | - | |
55 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
56 | 65 | | |
57 | 66 | | |
58 | | - | |
59 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
60 | 71 | | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
65 | 77 | | |
66 | | - | |
67 | | - | |
68 | | - | |
| 78 | + | |
| 79 | + | |
69 | 80 | | |
70 | 81 | | |
71 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
72 | 86 | | |
73 | 87 | | |
74 | 88 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
89 | 161 | | |
90 | 162 | | |
91 | 163 | | |
| |||
0 commit comments