Repository navigation
Add Keep the Why: context/ from AGENTS.md's design rules, config, lint workflow - #111
oliver-zehentleitner-aigent wants to merge 13 commits into
Conversation
Merging this PR will degrade performance by 58.97%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ❌ | test_bench_echo[64] |
355.5 ms | 1,119.6 ms | -68.25% |
| ❌ | test_bench_echo[8192] |
554 ms | 1,437.6 ms | -61.47% |
| ❌ | test_bench_echo[32768] |
1.2 s | 2.1 s | -43.53% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing oliver-zehentleitner-aigent:keep-the-why (82ee159) with master (e7ae111)
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #111 +/- ##
=======================================
Coverage 90.96% 90.96%
=======================================
Files 18 18
Lines 2590 2590
Branches 138 138
=======================================
Hits 2356 2356
Misses 191 191
Partials 43 43 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
A context/ that exists only in a pull request can be shown rendered to the maintainer without a merge or an install: export from the branch with --anonymize, publish the export as the fork's gh-pages branch, switch Pages on once, link the page from the pull request. The section says what the maintainer sees, that the page is a snapshot to re-export, why --anonymize, and which See lines resolve before and after the merge. First used for tarasko/picows#111. CHANGELOG under Unreleased / Added.
* Docs, dashboard page: show a proposal before it is merged A context/ that exists only in a pull request can be shown rendered to the maintainer without a merge or an install: export from the branch with --anonymize, publish the export as the fork's gh-pages branch, switch Pages on once, link the page from the pull request. The section says what the maintainer sees, that the page is a snapshot to re-export, why --anonymize, and which See lines resolve before and after the merge. First used for tarasko/picows#111. CHANGELOG under Unreleased / Added. * llms.txt: the export as the way to show a proposed context/ before the merge
…its decisions The picows repository is getting its own context/ (tarasko/picows#111, schema 0.18.1 with entry Ids). Four entries here follow from decisions recorded there, so they now cite them by the picows canonical and the target's Id: the picows.websockets integration cites the compatibility layer's import-level decision, the InvalidStatus.response entry cites the "upstream websockets is the source of truth" constraint that fixed it, and the benchmark-results and head-only-scan entries cite the max_read_size proposal that answers the big-message artifact on the picows side. The picows entries carry See lines back. Cross-project locators are the canonical alone, as 0.18.1 requires; ktw-lint 0.18.1.0 clean.
…ts context/ (oliver-zehentleitner-aigent/picows) until tarasko/picows#111 is merged
…t workflow AGENTS.md carried two kinds of content: instructions for an agent working in the repo, and the reasoning behind picows' shapes (the mixed bytes/str upgrade objects, send-after-close no-ops, why typing.cast is banned in Cython hot paths, what compatibility with websockets means). The second kind moves to context/ as Keep the Why entries, where each carries its Evidence and can be superseded instead of silently edited; AGENTS.md keeps the instructions and points at the entries. context/ additionally records what the code and history show but nobody had written down: the BufferedProtocol dual-base workaround, the buffered read path, the aiofastnet write path, the per-ISA masking units, the control-frame size rule, and why 2.0.0 was a major without a break. Entries whose reason is only derivable carry Evidence: inferred. .keep-the-why sets capture-confirmation: automatic and offers personal defaults, so a session captures without asking. A ktw-lint workflow checks the structure on push and pull request; CLAUDE.md imports AGENTS.md so Claude Code sees the same start section as Codex.
…ct memory, Tools section), context-schema 0.16.2
…ext-schema 0.16.3
- context-schema 0.17.0 -> 0.18.1 (0.17.1 informational; 0.18.0 entry identity; 0.18.1 README line and cross-project locator rule). - Every entry carries an Id (UUID v4 from the OS), the migration pass of 0.18.0. No superseded entries, so no Superseded by lines. - See lines where the text names one specific entry: the buffered-protocol decision cites the dummy-base workaround it pays for; the max_read_size entry cites the unicorn-binance-websocket-api benchmark that surfaced it and that project's consumer-side fix; the compatibility-layer decision cites the downstream integration that depends on it; the source-of-truth constraint cites the downstream side of issue tarasko#108 as the rule in action. Cross-project locators are the other project's canonical, as 0.18.1 requires. - .keep-the-why: canonical https://github.com/tarasko/picows. - context/README.md: "Reading the entries" names Id. ktw-lint 0.18.1.0: 0 errors, 0 warnings.
0.18.2, 0.19.0 and 0.20.0 change nothing in the format for this project (references/migrations.md): every Id is lowercase, no live badge in the README; the version line advances.
db0de39 to
10c28a5
Compare
As discussed with the maintainer: this wires Keep the Why into picows so the reasoning behind the code is recorded next to it, and agents read it before they change things.
What is in the PR
AGENTS.md, split by kind. It carried two kinds of content: instructions for an agent working here (line width, Python 3.9, nodel transport, no adapter plumbing, ...) and the reasoning behind picows' shapes. The instructions stay. The reasoning moves tocontext/as entries with an explicitEvidencegrade, and the affected bullets now point at the entry instead of restating it. Nothing was dropped; a new short "Why things are the way they are" pointer and the Keep the Why start section were added.context/— 11 entries in five topic files, plus the index and the three guard files the schema expects:WSUpgradeRequest/WSUpgradeResponsekeep a mixed bytes/str shapepicows.pyxmax_frame_sizeapplies to non-control frames onlytyping.castin Cythonized hot pathsasyncio.BufferedProtocolsecondpicows.pyxdata_receivedaiofastnetoptional; write path trusts its copy guaranteesetup.pywebsocketswebsocketsis the behavioral source of truthThe three inferred entries say in their body that the reason is derived, not stated. If the derivation is right, flip them to
confirmed; if it is wrong, correct or delete them — that is the whole point of the grade..keep-the-why—capture-confirmation: automatic(the skill records what a session establishes without asking each time) and apersonal-defaultsblock (proactive capture, batch confirmation, checks every 14/30 days, linter auto-installed) so nobody has to answer the personal wizard question by question..github/workflows/ktw-lint.yml— structural lint of.keep-the-whyandcontext/on push and PR, via the rollinglint-latestaction; warnings do not fail the job. Passes on this branch,--stricttoo.CLAUDE.md— one line,@AGENTS.md, because Claude Code reads that file and notAGENTS.md.What you need to do
Install the skill once for the agent you use. The preferred way is the skills CLI (runs via
npx, Node.js required), pinned to the latest release; it asks which agent (Codex, Claude Code, OpenCode, ...) and which scope to install for:If you prefer Codex's own plugin mechanism instead:
The first session on this repo asks one question, once per machine: whether to accept a project's suggested personal defaults automatically or be asked each time. After that it stays out of the way. With
local-lint: autoit installskeep-the-why-lintfrom PyPI into your user environment the first time it writes tocontext/; setlocal-lint: askornoin the personal-defaults block if you would rather not.Then the experiment: don't think about it for two weeks. Entries accumulate as you work; the question is whether the agent's answers on picows get better because it reads
context/first.Happy to adjust anything — entry wording, which bullets stay in
AGENTS.md, the defaults.