@assuredloop/orca-bot-kit 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +548 -3
- package/SETUP.md +275 -0
- package/package.json +32 -13
- package/rules/evidence.md +15 -0
- package/rules/finishing.md +23 -0
- package/rules/limits.md +18 -0
- package/rules/mail.md +17 -0
- package/rules/profiles.md +9 -0
- package/rules/review.md +14 -0
- package/rules/scope.md +22 -0
- package/rules/simple.md +14 -0
- package/rules/talk.md +13 -0
- package/rules/tests-first.md +17 -0
- package/rules/the-ask.md +19 -0
- package/skills/obk-arch/LICENSES.md +52 -0
- package/skills/obk-arch/NOTICE.md +242 -0
- package/skills/obk-arch/SKILL.md +598 -0
- package/skills/obk-bot-building/LICENSES.md +21 -0
- package/skills/obk-bot-building/NOTICE.md +113 -0
- package/skills/obk-bot-building/SKILL.md +312 -0
- package/skills/obk-debugging/LICENSES.md +67 -0
- package/skills/obk-debugging/NOTICE.md +115 -0
- package/skills/obk-debugging/SKILL.md +434 -0
- package/skills/obk-decision-memo/LICENSES.md +49 -0
- package/skills/obk-decision-memo/NOTICE.md +181 -0
- package/skills/obk-decision-memo/SKILL.md +241 -0
- package/skills/obk-finops/LICENSES.md +19 -0
- package/skills/obk-finops/NOTICE.md +77 -0
- package/skills/obk-finops/SKILL.md +148 -0
- package/skills/obk-fleet-review/LICENSES.md +52 -0
- package/skills/obk-fleet-review/NOTICE.md +104 -0
- package/skills/obk-fleet-review/SKILL.md +256 -0
- package/skills/obk-grilling/LICENSES.md +42 -0
- package/skills/obk-grilling/NOTICE.md +111 -0
- package/skills/obk-grilling/SKILL.md +221 -0
- package/skills/obk-grooming/LICENSES.md +52 -0
- package/skills/obk-grooming/NOTICE.md +111 -0
- package/skills/obk-grooming/SKILL.md +222 -0
- package/skills/obk-handoff/LICENSES.md +45 -0
- package/skills/obk-handoff/NOTICE.md +51 -0
- package/skills/obk-handoff/SKILL.md +119 -0
- package/skills/obk-personal-facilitation/LICENSES.md +53 -0
- package/skills/obk-personal-facilitation/NOTICE.md +62 -0
- package/skills/obk-personal-facilitation/SKILL.md +86 -0
- package/skills/obk-recall/LICENSES.md +42 -0
- package/skills/obk-recall/NOTICE.md +53 -0
- package/skills/obk-recall/SKILL.md +129 -0
- package/skills/obk-researching/LICENSES.md +67 -0
- package/skills/obk-researching/NOTICE.md +170 -0
- package/skills/obk-researching/SKILL.md +269 -0
- package/skills/obk-reviewing/LICENSES.md +66 -0
- package/skills/obk-reviewing/NOTICE.md +58 -0
- package/skills/obk-reviewing/SKILL.md +411 -0
- package/skills/obk-tdd/LICENSES.md +68 -0
- package/skills/obk-tdd/NOTICE.md +54 -0
- package/skills/obk-tdd/SKILL.md +547 -0
- package/skills/obk-tdd/mutation-tools.md +80 -0
- package/skills/obk-teach/LICENSES.md +42 -0
- package/skills/obk-teach/NOTICE.md +65 -0
- package/skills/obk-teach/SKILL.md +106 -0
- package/skills/obk-why/LICENSES.md +42 -0
- package/skills/obk-why/NOTICE.md +74 -0
- package/skills/obk-why/SKILL.md +180 -0
- package/skills/obk-writing/LICENSES.md +272 -0
- package/skills/obk-writing/NOTICE.md +161 -0
- package/skills/obk-writing/SKILL.md +254 -0
- package/src/book.js +268 -0
- package/src/bot.js +451 -0
- package/src/cli.js +1169 -0
- package/src/conversations.js +150 -0
- package/src/groom.js +159 -0
- package/src/health.js +309 -0
- package/src/hooks.js +257 -0
- package/src/init.js +314 -0
- package/src/launch.js +299 -0
- package/src/message.js +402 -0
- package/src/orca.js +362 -0
- package/src/pause.js +63 -0
- package/src/record.js +209 -0
- package/src/restart.js +193 -0
- package/src/retire.js +92 -0
- package/src/roster.js +71 -0
- package/src/rules.js +408 -0
- package/src/skills.js +630 -0
- package/src/sources.js +371 -0
- package/src/up.js +500 -0
- package/src/usage.js +401 -0
- package/bin/okb.js +0 -4
- package/src/index.js +0 -11
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<!-- Attribution for the sources this skill was built from. Kept out of
|
|
2
|
+
SKILL.md so it is not read into context on every use; it travels with
|
|
3
|
+
the skill directory, which is what the licences require. -->
|
|
4
|
+
|
|
5
|
+
# Sources and licences
|
|
6
|
+
|
|
7
|
+
The skill `obk-teach` was consolidated for this kit from this, MIT, with
|
|
8
|
+
thanks:
|
|
9
|
+
|
|
10
|
+
- **Cursor pstack**, `teach`: explaining what a thing is, how it works and why
|
|
11
|
+
it is built that way, at the person's pace, with understanding rather than
|
|
12
|
+
any change as the goal; choosing the few things they should walk away with
|
|
13
|
+
from why they are asking and what they already know, read from the
|
|
14
|
+
conversation rather than quizzed, skipping what they plainly know and putting
|
|
15
|
+
the depth where their question is; getting oriented by reading the thing
|
|
16
|
+
before explaining it; keeping another source's confidence language intact
|
|
17
|
+
because its hedges are findings rather than style; starting with a plain
|
|
18
|
+
definition in general terms with the thing's common name, then tying it to
|
|
19
|
+
the case in front of them, then building through how it works to the deeper
|
|
20
|
+
reasons and the edge cases; explaining each part so the idea clicks (the
|
|
21
|
+
problem it solves and how it actually works) with listing functions and
|
|
22
|
+
constants called out as reference rather than teaching; walking through what
|
|
23
|
+
happens as the person does the thing when that is what makes it land; the
|
|
24
|
+
smallest complete answer first, a sentence or two rather than a dense
|
|
25
|
+
paragraph, then stopping and adding layers when asked, and never a wall of
|
|
26
|
+
text; keeping it a conversation rather than a lecture, with no quizzes, no
|
|
27
|
+
asking them to say it back, no pacing theatre, and none of the framing labels
|
|
28
|
+
(the key insight, at its core, the part worth slowing down on, the tricky
|
|
29
|
+
part, where it gets interesting); stopping where you would pause and letting
|
|
30
|
+
them respond, and delivering cleanly with the offer at the end when nobody is
|
|
31
|
+
there; showing rather than only telling by opening the diff, the code or the
|
|
32
|
+
debugger; building a picture up diagram by diagram, each redrawing the last
|
|
33
|
+
and adding one part so the reader watches the system assemble, with the
|
|
34
|
+
worked example of drawing A to B, then redrawing with C, then the return
|
|
35
|
+
edge, and a single all-at-once diagram named as a reference rather than
|
|
36
|
+
teaching; matching the medium to the idea, a diagram for a flow or structure
|
|
37
|
+
where labels carry the meaning and a rough spatial sketch with few short
|
|
38
|
+
labels for layout, overlap or a before and after; and its writing guidance
|
|
39
|
+
(plain spoken English as to a colleague, tight rather than
|
|
40
|
+
terse, the concrete mechanism rather than a metaphor or a framing, short
|
|
41
|
+
sentences with full stops preferred to commas, one or two commas and clauses
|
|
42
|
+
split rather than piled up, one
|
|
43
|
+
name per concept kept throughout, no em dashes, no mirror sentences and no
|
|
44
|
+
tidy closers, the parts of the skill being directions rather than labels to
|
|
45
|
+
print, and the reply being the explanation itself rather than a report about
|
|
46
|
+
it). Its worked density example is not carried; the rules it illustrates
|
|
47
|
+
are.
|
|
48
|
+
|
|
49
|
+
Made generic, which is what the owner asked for. The original is built on top
|
|
50
|
+
of two other skills it invokes by name, and a kit skill carries what it needs
|
|
51
|
+
rather than depending on another being loaded (ADR 0019); here getting
|
|
52
|
+
oriented is part of the work, and where the reasons are the point that is
|
|
53
|
+
named as its own kind of digging without requiring a particular skill. Its
|
|
54
|
+
named image-generation tool is likewise described by what it produces rather
|
|
55
|
+
than by the tool.
|
|
56
|
+
|
|
57
|
+
One departure: the original keeps itself from being invoked on its own with
|
|
58
|
+
`disable-model-invocation: true`, which is not portable frontmatter (ADR 0019
|
|
59
|
+
and PRD 7.2: these run on purpose, never automatically). The description
|
|
60
|
+
carries that instead: the phrases that ask for it, and the note that answering
|
|
61
|
+
a question in passing is not this.
|
|
62
|
+
|
|
63
|
+
A second departure: the original forbids quizzing outright. Here someone who
|
|
64
|
+
asks to be tested on it is asking for something else, and that is theirs to
|
|
65
|
+
ask for; the defaults do not stop a user asking for what they want.
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: obk-teach
|
|
3
|
+
description: >-
|
|
4
|
+
Explaining a piece of work so someone actually understands it: choosing the
|
|
5
|
+
few things they should walk away with, starting from what the thing is
|
|
6
|
+
before how it works, giving the smallest complete answer and stopping,
|
|
7
|
+
building a picture up one part at a time, and letting them steer. Run it when
|
|
8
|
+
you are asked to: "explain this to me", "help me understand X", "what is this
|
|
9
|
+
actually doing", "walk me through it". Answering a question in passing is not
|
|
10
|
+
this; this is for when someone has asked to be taught something.
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Explaining something so it lands
|
|
14
|
+
|
|
15
|
+
The goal is that they understand it. Not that you have covered it, and not
|
|
16
|
+
that you change anything.
|
|
17
|
+
|
|
18
|
+
These are defaults for work where nothing says otherwise. A user who asks for
|
|
19
|
+
something else gets what they asked for; say which of these you left and why.
|
|
20
|
+
|
|
21
|
+
## Decide what they should walk away with
|
|
22
|
+
|
|
23
|
+
A few things, not everything. Choose them from why they are asking. About to
|
|
24
|
+
change it, reviewing it, chasing a bug in it, new to it: each wants a different
|
|
25
|
+
few. Choose them from what they already know, too, and read both from the
|
|
26
|
+
conversation.
|
|
27
|
+
|
|
28
|
+
Skip what they plainly know already. Put the depth where their question is,
|
|
29
|
+
not where the subject happens to be interesting.
|
|
30
|
+
|
|
31
|
+
## Get your bearings first
|
|
32
|
+
|
|
33
|
+
Read the thing before explaining it: the code, the change, what it touches.
|
|
34
|
+
Where the reasons are the point, why it is shaped this way or where a number
|
|
35
|
+
came from, that is its own kind of digging. It is worth doing properly rather
|
|
36
|
+
than guessing at plausibly.
|
|
37
|
+
|
|
38
|
+
When you are carrying someone else's findings into your explanation, you can
|
|
39
|
+
reword freely with one exception: leave their hedges alone. "Probably" and
|
|
40
|
+
"we could not find out" are findings, not style, and flattening them into
|
|
41
|
+
certainty is how a guess becomes a fact.
|
|
42
|
+
|
|
43
|
+
## Start with what it is
|
|
44
|
+
|
|
45
|
+
Name the thing and say what it is, in general terms, the way someone who knew
|
|
46
|
+
the subject would say it out loud. Use its ordinary name if it has one.
|
|
47
|
+
Then tie it to the case in front of them: *in this codebase, we use it to...*
|
|
48
|
+
Then build: how it works, then the deeper reasons, then the edges.
|
|
49
|
+
|
|
50
|
+
For each part, explain the idea so it clicks: the problem it solves, and how
|
|
51
|
+
it actually works. Listing the functions and the constants is reference, not
|
|
52
|
+
teaching. Where following what happens as they do the thing is what makes it
|
|
53
|
+
land, walk through that.
|
|
54
|
+
|
|
55
|
+
Give the smallest complete answer first, a sentence or two rather than a dense
|
|
56
|
+
paragraph, and then stop. Add the next layer when they ask for it. A wall of
|
|
57
|
+
text is not generosity; it is a way of not choosing.
|
|
58
|
+
|
|
59
|
+
## Keep it a conversation
|
|
60
|
+
|
|
61
|
+
Offer to go deeper or move on, and follow where they go. Do not quiz them to
|
|
62
|
+
find out what they know; read that from the conversation. Do not ask them to
|
|
63
|
+
say it back to prove it landed. Someone who asks to be tested on it is
|
|
64
|
+
asking for something else, and that is theirs to ask for.
|
|
65
|
+
|
|
66
|
+
Do not narrate the teaching. No announcing that something is the key insight,
|
|
67
|
+
the tricky part, the thing to hold onto, or where it gets interesting. No
|
|
68
|
+
writing "pause" and no summary of what you are about to say. Say the thing
|
|
69
|
+
instead. If it matters, it will show.
|
|
70
|
+
|
|
71
|
+
Where you would pause, stop and let them answer. If nobody is there to answer,
|
|
72
|
+
deliver it cleanly in one go and put the offer to go further at the end.
|
|
73
|
+
|
|
74
|
+
## Show it, and build the picture up
|
|
75
|
+
|
|
76
|
+
Open the code, the change, the running thing, when that is faster than
|
|
77
|
+
describing it.
|
|
78
|
+
|
|
79
|
+
Draw when a picture beats words. For anything with three or more moving parts,
|
|
80
|
+
do not draw one diagram with all of them. Draw a short series, each one
|
|
81
|
+
redrawing the last and adding a single part, so they watch it assemble. To
|
|
82
|
+
explain something passing from A to B to C: draw A to B; redraw and add C;
|
|
83
|
+
redraw and add what comes back. One all-at-once diagram, especially saved for
|
|
84
|
+
the end, is a reference rather than teaching. A single simple point needs no
|
|
85
|
+
picture at all.
|
|
86
|
+
|
|
87
|
+
Match the medium to the idea. A flow or a structure where the labels carry the
|
|
88
|
+
meaning is a diagram. Something spatial is a sketch, roughly drawn with a few
|
|
89
|
+
short labels: a layout, an overlap, a before and after.
|
|
90
|
+
|
|
91
|
+
## How it reads
|
|
92
|
+
|
|
93
|
+
Plain spoken English, the way you would explain it to a colleague standing
|
|
94
|
+
next to you. Tight, not terse: cut the filler, keep the part that makes it
|
|
95
|
+
click. State the mechanism rather than a metaphor for the mechanism.
|
|
96
|
+
|
|
97
|
+
Short sentences, full stops rather than commas. One or two commas at most; when
|
|
98
|
+
the clauses pile up, split them. No em dashes. Give each idea one name and keep
|
|
99
|
+
that name. Avoid the tidy closer, "and the rest follows", "it all falls out".
|
|
100
|
+
Avoid the mirrored sentence that says the same thing twice in opposite order.
|
|
101
|
+
|
|
102
|
+
What comes back is the explanation itself, never a report about having
|
|
103
|
+
explained it. The parts of this skill are directions to you, not labels to
|
|
104
|
+
print: do not echo them as headings.
|
|
105
|
+
|
|
106
|
+
Sources and licences: [NOTICE.md](NOTICE.md).
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<!-- The licences of the sources this skill was consolidated from. They travel
|
|
2
|
+
with the skill directory because the licences require it of anyone who
|
|
3
|
+
distributes the material. NOTICE.md says what was taken from each source;
|
|
4
|
+
this file carries the permission notices themselves. -->
|
|
5
|
+
|
|
6
|
+
# Licences of the sources
|
|
7
|
+
|
|
8
|
+
`obk-why` consolidates material from the sources named in
|
|
9
|
+
[NOTICE.md](NOTICE.md). Their licences are reproduced below in full.
|
|
10
|
+
|
|
11
|
+
## MIT
|
|
12
|
+
|
|
13
|
+
The MIT permission notice below applies to the work of each of these copyright
|
|
14
|
+
holders, and is reproduced with each of their notices. The path after each one
|
|
15
|
+
is the licence file it was read from, in the research pack's source clones.
|
|
16
|
+
|
|
17
|
+
- **Cursor `plugins`, the pstack plugin**, Copyright (c) 2026 Lauren Tan
|
|
18
|
+
(`cursor_plugins/pstack/LICENSE`)
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
MIT License
|
|
22
|
+
|
|
23
|
+
Copyright (c) 2026 Lauren Tan
|
|
24
|
+
|
|
25
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
26
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
27
|
+
in the Software without restriction, including without limitation the rights
|
|
28
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
29
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
30
|
+
furnished to do so, subject to the following conditions:
|
|
31
|
+
|
|
32
|
+
The above copyright notice and this permission notice shall be included in all
|
|
33
|
+
copies or substantial portions of the Software.
|
|
34
|
+
|
|
35
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
36
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
37
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
38
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
39
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
40
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
41
|
+
SOFTWARE.
|
|
42
|
+
```
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<!-- Attribution for the sources this skill was built from. Kept out of
|
|
2
|
+
SKILL.md so it is not read into context on every use; it travels with
|
|
3
|
+
the skill directory, which is what the licences require. -->
|
|
4
|
+
|
|
5
|
+
# Sources and licences
|
|
6
|
+
|
|
7
|
+
The skill `obk-why` was consolidated for this kit from this, MIT, with thanks:
|
|
8
|
+
|
|
9
|
+
- **Cursor pstack**, `why` and its `references/epistemics.md`: investigating
|
|
10
|
+
the motivation behind code as distinct from what it does; the opening
|
|
11
|
+
observation that code does not carry its own motivation, so the why lives in
|
|
12
|
+
commits, reviews, tickets, documents and conversations, all incomplete and
|
|
13
|
+
sometimes missing, and that pretending otherwise produces confident-sounding
|
|
14
|
+
guesses that mislead; parsing the target and the kind of question, and
|
|
15
|
+
stating your reading when the target is vague rather than asking; anchoring
|
|
16
|
+
in concrete code first (the paths and line ranges, the symbols, the recent
|
|
17
|
+
commits, the review discussion attached to them) before looking anywhere
|
|
18
|
+
else; the categories of place a reason lives and what each is uniquely good
|
|
19
|
+
at, with source control best for the rationale captured
|
|
20
|
+
at review time, the tracker best when the reason is external to engineering,
|
|
21
|
+
long-form documents where the thinking predates the code, real-time chat for
|
|
22
|
+
deliberation that never reached a document and most valuable when the written
|
|
23
|
+
trail is thin, and runtime records best for defensive code such as guards,
|
|
24
|
+
retries and limits; running them in parallel, one per source; documenting the
|
|
25
|
+
null rather than skipping the search, with an unavailable source flagged as a
|
|
26
|
+
gap and a skip allowed only when provably rather than probably irrelevant;
|
|
27
|
+
recency bias as the named failure, since the current shape is usually the
|
|
28
|
+
accretion of earlier decisions; the five confidence tiers with their
|
|
29
|
+
examples and their phrasing (written down, converging evidence, inferred
|
|
30
|
+
with the chain made explicit, speculative with alternatives beside it, and
|
|
31
|
+
unknown stated precisely as what was searched); the words that carry a
|
|
32
|
+
citation with them, each needing its source immediately beside it, and the
|
|
33
|
+
calibration check that the code is never evidence for its own intent; the
|
|
34
|
+
embedded-hypothesis trap, where a question arrives with its answer attached
|
|
35
|
+
and confirming it is the cheap and wrong move; surfacing both sides when two
|
|
36
|
+
sources disagree rather than picking the tidier story; the output sections
|
|
37
|
+
including one line per source consulted covering the empty and skipped ones;
|
|
38
|
+
and turning the findings into a preserve, change, avoid and risk constraint
|
|
39
|
+
set when the question precedes a change.
|
|
40
|
+
- The same skill's `references/sources/code-archaeology.md`. Its pitfalls: the
|
|
41
|
+
squash merge that flattens a branch's steps, the commit message that calls a
|
|
42
|
+
behaviour change a small refactor so the diff has to be read instead, the
|
|
43
|
+
pattern copied without its reason so the place it started is the one to
|
|
44
|
+
investigate, and the automated change that carries no motivation at all.
|
|
45
|
+
|
|
46
|
+
One thing in the squash paragraph is ours rather than the source's. That a
|
|
47
|
+
squash merge loses the branch's commits is the source's pitfall; what is added
|
|
48
|
+
here is where the reason then is (the argument that moved a value is worth
|
|
49
|
+
more than the value it landed on) and the instruction to cite the change that
|
|
50
|
+
did the thing rather than the one that delivered it. That came out of an
|
|
51
|
+
acceptance run of this skill, which traced a constant's history correctly but
|
|
52
|
+
cited the squash merge for a value that the merge had never held.
|
|
53
|
+
|
|
54
|
+
Made generic, which is what the owner asked for. The original discovers hosted
|
|
55
|
+
integrations and maps them to seven fixed categories, spawns investigator and
|
|
56
|
+
synthesizer subagents on named models, and keeps four reference files of
|
|
57
|
+
prompts and per-source playbooks. This version names the kinds of place a
|
|
58
|
+
reason lives and says to use the ones the project actually has, keeps the
|
|
59
|
+
confidence tiers and the null-result discipline in the skill itself, and leaves
|
|
60
|
+
how the work is divided up to whoever is doing it.
|
|
61
|
+
|
|
62
|
+
One departure: the original keeps itself from being invoked on its own with
|
|
63
|
+
`disable-model-invocation: true`, which is not portable frontmatter (ADR 0019
|
|
64
|
+
and PRD 7.2: these run on purpose, never automatically). The description
|
|
65
|
+
carries that instead: the phrases that ask for it, and the note that it is not
|
|
66
|
+
something to start unasked before an ordinary change.
|
|
67
|
+
|
|
68
|
+
Further from `references/epistemics.md`: not turning an absence of evidence
|
|
69
|
+
into evidence of absence, naming who could answer what nobody recorded, a
|
|
70
|
+
write-up with no gaps being suspicious, and the words that claim certainty
|
|
71
|
+
without a source. From `references/sources/code-archaeology.md`: searching the
|
|
72
|
+
history for the change that added or removed an exact string, and the tests as
|
|
73
|
+
a place the reason is encoded. The original's "source control is always
|
|
74
|
+
available" is not carried: a project may keep no history this bot can read.
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: obk-why
|
|
3
|
+
description: >-
|
|
4
|
+
Finding out why code is the way it is, and saying how sure you are: anchoring
|
|
5
|
+
the question in the actual lines, following the history and the discussion
|
|
6
|
+
around them, looking wherever else this project records its reasons, and
|
|
7
|
+
separating what someone actually wrote from what you worked out and what
|
|
8
|
+
nobody recorded. Run it when you are asked to: "why is this like this", "why
|
|
9
|
+
did we pick that", "where did this number come from", "find out why before
|
|
10
|
+
you touch it". Not something to launch on your own before an ordinary change;
|
|
11
|
+
where the shape puzzles you and nobody asked, say so and offer it.
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Why it is like this
|
|
15
|
+
|
|
16
|
+
Code does not carry its own motivation. You can read what it does; you cannot
|
|
17
|
+
read why it exists. That lives in commits, reviews, issues, documents and
|
|
18
|
+
conversations, all partial, some missing, some wrong. Pretending otherwise
|
|
19
|
+
produces a confident answer that sends someone the wrong way.
|
|
20
|
+
|
|
21
|
+
So the work is two things: find what was actually recorded, and be honest
|
|
22
|
+
about the difference between that and what you have pieced together.
|
|
23
|
+
|
|
24
|
+
These are defaults for work where nothing says otherwise. A user who asks for
|
|
25
|
+
something else gets what they asked for; say which of these you left and why.
|
|
26
|
+
|
|
27
|
+
## The question, and the lines it is about
|
|
28
|
+
|
|
29
|
+
Work out what is being asked about and what kind of answer would settle it: the
|
|
30
|
+
reason for a design, a trade-off, an edge case that forced something, an
|
|
31
|
+
outside constraint, or something that looks dead. Where the target is vague,
|
|
32
|
+
say which reading you took in a line and carry on, so it can be corrected
|
|
33
|
+
without a round trip.
|
|
34
|
+
|
|
35
|
+
A question often arrives with its answer attached: "why do we do it this way,
|
|
36
|
+
is it for performance?" Treat the guess as one candidate and check it like any
|
|
37
|
+
other. Confirming it because it was offered is the cheapest way to produce a
|
|
38
|
+
wrong answer that everyone then believes, because it carries your name as well
|
|
39
|
+
as theirs. Where the evidence supports it, say so and cite it; where it does
|
|
40
|
+
not, say what the evidence supports instead.
|
|
41
|
+
|
|
42
|
+
Then anchor it in the code before going anywhere else: the files and the line
|
|
43
|
+
ranges, the names that matter, the last handful of changes that touched them,
|
|
44
|
+
and the review or discussion those changes belong to. Everything after this
|
|
45
|
+
hangs off that anchor, and an investigation that never had one tends to answer
|
|
46
|
+
a question nobody asked.
|
|
47
|
+
|
|
48
|
+
Where the project keeps its history, start there. Who last touched these
|
|
49
|
+
lines and in what change; as much of the file's life, through renames, as it
|
|
50
|
+
takes to reach the change that answers the question; what the change said about
|
|
51
|
+
itself; and whatever discussion is attached to it, which is usually where the
|
|
52
|
+
reason actually is.
|
|
53
|
+
|
|
54
|
+
## Then look where else this project keeps its reasons
|
|
55
|
+
|
|
56
|
+
Different reasons live in different places, and which of these exist varies by
|
|
57
|
+
project. Use the ones it has, as far as the question needs:
|
|
58
|
+
|
|
59
|
+
- **The history and its discussion**, where the project keeps them. Best for
|
|
60
|
+
the reason given at the time by the person doing it, under review. For a
|
|
61
|
+
number or a string, search the history for the change that added or removed
|
|
62
|
+
that exact text; it goes straight to the moment it arrived.
|
|
63
|
+
- **The tests**: their names and cases often encode the edge case that forced
|
|
64
|
+
the code.
|
|
65
|
+
- **Whatever tracks the work**: issues, tickets, a board. Best when the reason
|
|
66
|
+
came from outside engineering: a customer, a deadline, a rule.
|
|
67
|
+
- **Longer documents**: a design note, a page somewhere. Best where the
|
|
68
|
+
thinking was written out before it became code.
|
|
69
|
+
- **The conversation**: wherever the team talks. Best for the deliberation
|
|
70
|
+
that never made it into anything durable, and most valuable exactly when the
|
|
71
|
+
written trail is thin.
|
|
72
|
+
- **Whatever records what actually happened in use**: errors, metrics, logs.
|
|
73
|
+
Best for defensive code: a guard, a retry, a limit, a special case usually
|
|
74
|
+
exists because something happened.
|
|
75
|
+
|
|
76
|
+
How many of them to open depends on what is still unanswered: once a change
|
|
77
|
+
and its discussion settle the reason, the rest adds nothing unless something
|
|
78
|
+
contradicts it, and they need neither a look nor a line in the write-up. While
|
|
79
|
+
the answer is open, look in the sources that could still change it, in parallel
|
|
80
|
+
where you can, one pass per source with its own question. Where one of those does
|
|
81
|
+
not exist or you cannot reach it, that is a finding: write down that you could
|
|
82
|
+
not look there. Skipping one of those because it is probably irrelevant is not
|
|
83
|
+
the same as it being provably irrelevant, and the first belongs in the write-up
|
|
84
|
+
as a gap.
|
|
85
|
+
|
|
86
|
+
Watch for the newest change looking authoritative. The shape you are asking
|
|
87
|
+
about is usually the accumulation of several decisions, and the most recent one
|
|
88
|
+
often only moved something that an earlier one put there. Trace back until the
|
|
89
|
+
reason appears or the trail ends.
|
|
90
|
+
|
|
91
|
+
And watch for a history that has been flattened. Where a project collapses a
|
|
92
|
+
branch into a single change when it lands, that change shows the end state and
|
|
93
|
+
none of the steps: a value that was set, argued over and moved twice appears to
|
|
94
|
+
have arrived at its final form in one go. The steps are still there, on the
|
|
95
|
+
branch or in the discussion attached to it, and that is usually where the
|
|
96
|
+
reason is. The argument that moved it is more informative than the number it
|
|
97
|
+
landed on. Cite the change that actually did the thing, not the one that
|
|
98
|
+
delivered it.
|
|
99
|
+
|
|
100
|
+
Three more things mislead in a history. A change that describes itself as a
|
|
101
|
+
small refactor sometimes carries a deliberate change of behaviour, so read the
|
|
102
|
+
diff rather than the message. A pattern may have been copied without its
|
|
103
|
+
reason, so where the same shape appears in several places, find where it
|
|
104
|
+
started and investigate that one instead. And automated changes (dependency
|
|
105
|
+
bumps, backports, anything raised by a bot) usually carry no motivation at
|
|
106
|
+
all, so they are not where the reason is.
|
|
107
|
+
|
|
108
|
+
## How sure you are
|
|
109
|
+
|
|
110
|
+
Every claim sits in one of these, and it is said differently in each. Keeping
|
|
111
|
+
them apart is most of the value of the whole exercise.
|
|
112
|
+
|
|
113
|
+
- **Someone wrote it down.** An explicit statement answering the question: a
|
|
114
|
+
change description saying what it fixes, a comment saying why the number is
|
|
115
|
+
what it is, a document choosing between two options. Say it plainly, present
|
|
116
|
+
tense, and cite where it came from.
|
|
117
|
+
- **Several things point the same way.** Nothing states it, but the evidence
|
|
118
|
+
converges. Say so, and name the pieces: "the evidence points to X. The
|
|
119
|
+
change is labelled performance, the tests added all exercise very large
|
|
120
|
+
inputs, and the surrounding work touches the same path."
|
|
121
|
+
- **You worked it out.** A reasonable reading with nothing explicit behind it.
|
|
122
|
+
Hedge it, and show the chain: given this and this, that seems likely, because
|
|
123
|
+
of this. The reader needs to know it is your interpretation.
|
|
124
|
+
- **You are guessing.** Plausible, thin evidence, other explanations fit as
|
|
125
|
+
well. Say it is a guess and put the alternatives next to it.
|
|
126
|
+
- **Nobody recorded it.** You looked and it is not there. This is a real
|
|
127
|
+
result and worth saying precisely: not "we could not find out" but what you
|
|
128
|
+
searched and how, and who could answer it (the author, whoever owns the
|
|
129
|
+
product). The specific version tells the next person where not to look
|
|
130
|
+
again. Nobody mentioning a concern is not evidence there was none. A
|
|
131
|
+
write-up with no gaps in it at all is itself worth a second look.
|
|
132
|
+
|
|
133
|
+
Where two sources disagree, surface both. The issue says the work was for a
|
|
134
|
+
customer's compliance requirement and the change says it was tidying up an
|
|
135
|
+
area: both can be true, since one motivated the work and the other is how the
|
|
136
|
+
author framed it, or one of them can simply be wrong. Picking whichever makes
|
|
137
|
+
the tidier story is how the disagreement gets buried. Put them side by side
|
|
138
|
+
with their citations and let the reader decide.
|
|
139
|
+
|
|
140
|
+
Do not launder one of these into another. An inference stated in the voice of
|
|
141
|
+
a citation is the failure this whole skill exists to prevent. Some words carry
|
|
142
|
+
a citation with them ("because", "the reason is", "was designed to", "fixes",
|
|
143
|
+
"the team decided"), and each one needs its source immediately beside it or a
|
|
144
|
+
hedged word instead. Words that claim certainty without one ("obviously",
|
|
145
|
+
"clearly") go.
|
|
146
|
+
|
|
147
|
+
Check it from the other side before you finish: the code is evidence of what
|
|
148
|
+
exists and what changed, and never on its own evidence of why. Reading the
|
|
149
|
+
change that set a limit to 6000 and the one that moved it to 6500 establishes
|
|
150
|
+
both of those values, and you need that to cite the right change. Neither of
|
|
151
|
+
them tells you what the author was trying to do. So where a claim about
|
|
152
|
+
motivation rests on the code alone (the name of the function, the shape of the
|
|
153
|
+
branch, the value of the constant), that is the thing being explained, not the
|
|
154
|
+
explanation of it.
|
|
155
|
+
|
|
156
|
+
## What you hand back
|
|
157
|
+
|
|
158
|
+
These are the questions the hand-back answers, not headings to print: a one-line
|
|
159
|
+
answer is one line, and it still carries its citation and any uncertainty or
|
|
160
|
+
search limit that would change how it is used.
|
|
161
|
+
|
|
162
|
+
- **The question**, as you understood it.
|
|
163
|
+
- **The code**, so the reader knows what is being explained.
|
|
164
|
+
- **What was actually recorded**, cited.
|
|
165
|
+
- **What follows from it**, marked as reasoning.
|
|
166
|
+
- **Other explanations that fit**, where more than one does.
|
|
167
|
+
- **What nobody wrote down**, with what you searched: where the search
|
|
168
|
+
stopped, what settled it, and the places that could matter which you left
|
|
169
|
+
unchecked.
|
|
170
|
+
- **Where you looked**, one line per source, including the ones that held
|
|
171
|
+
nothing and the ones you could not reach, with the reason.
|
|
172
|
+
- **How sure you are overall**, in a line.
|
|
173
|
+
|
|
174
|
+
When this is the prelude to changing the thing, finish by turning the reasons
|
|
175
|
+
into constraints on that change: what must be preserved and why, what is free
|
|
176
|
+
to change, what to avoid doing, and what is risky because the original reason
|
|
177
|
+
may still apply. That is what makes the history useful rather than merely
|
|
178
|
+
interesting.
|
|
179
|
+
|
|
180
|
+
Sources and licences: [NOTICE.md](NOTICE.md).
|