carrick 0.3.187 → 0.3.188
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "carrick",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.188",
|
|
4
4
|
"carrickCache": {
|
|
5
5
|
"cache_version": 22,
|
|
6
6
|
"intent_cache_version": 2
|
|
@@ -111,11 +111,11 @@
|
|
|
111
111
|
"zod": "^3.23.0"
|
|
112
112
|
},
|
|
113
113
|
"optionalDependencies": {
|
|
114
|
-
"@carrick-tools/cli-darwin-arm64": "0.3.
|
|
115
|
-
"@carrick-tools/cli-darwin-x64": "0.3.
|
|
116
|
-
"@carrick-tools/cli-linux-arm64": "0.3.
|
|
117
|
-
"@carrick-tools/cli-linux-x64": "0.3.
|
|
118
|
-
"@carrick-tools/cli-win32-x64": "0.3.
|
|
114
|
+
"@carrick-tools/cli-darwin-arm64": "0.3.188",
|
|
115
|
+
"@carrick-tools/cli-darwin-x64": "0.3.188",
|
|
116
|
+
"@carrick-tools/cli-linux-arm64": "0.3.188",
|
|
117
|
+
"@carrick-tools/cli-linux-x64": "0.3.188",
|
|
118
|
+
"@carrick-tools/cli-win32-x64": "0.3.188"
|
|
119
119
|
},
|
|
120
120
|
"devDependencies": {
|
|
121
121
|
"@types/node": "^24.13.3"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "carrick",
|
|
3
3
|
"description": "Claude Code plugin for Carrick, which indexes TypeScript codebases across service and repository boundaries. After each edit it adds the file's routes, calls, and cross-service type mismatches to the session, and it registers Carrick's language server. It pairs with the Carrick MCP server, which lets agents search functions by intent rather than name.",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.188",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Carrick",
|
|
7
7
|
"email": "hello@carrick.tools"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: carrick-audit
|
|
3
|
-
description: Use when the ask is what is wrong in this codebase, what to clean up, a health check of the project, or where the whole project has built the same thing twice. A full audit from the Carrick index on main (calls that reach no route, type mismatches between endpoints and their callers, functions written twice, routes written twice, one job done several ways), with each item proven in source and a fix list at the end. It states its estimated tokens and minutes before it reads any source, then waits for a go-ahead.
|
|
3
|
+
description: Use when the ask is what is wrong in this codebase, what to clean up, a health check of the project, or where the whole project has built the same thing twice. A full audit from the Carrick index on main (calls that reach no route, type mismatches between endpoints and their callers, functions written twice, routes written twice, one job done several ways), with each item proven in source and a fix list at the end. It states its estimated tokens and minutes, and the leads the index already holds, before it reads any source, then waits for a go-ahead.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# A full audit from the index, proven in source
|
|
@@ -40,11 +40,18 @@ get_findings({{SCOPE}}, limit: 1)
|
|
|
40
40
|
Read these counts out of the answers:
|
|
41
41
|
|
|
42
42
|
- **Calls that reach no route**: in the graph's `unmatched_by_reason`, the sum
|
|
43
|
-
of `no_matching_producer`, `no_case_answers` and `procedure_unserved`.
|
|
44
|
-
`
|
|
43
|
+
of `no_matching_producer`, `no_case_answers` and `procedure_unserved`. Take
|
|
44
|
+
the count only: do not page `unmatched_calls` now, and do not use
|
|
45
|
+
`unmatched_by_service`, which counts every unmatched call, third-party and
|
|
46
|
+
unplaced-base calls included. Section A lists the rows after the go-ahead.
|
|
45
47
|
- **Pairs**: each consumer and producer pair under the map's CONSUMERS. Where
|
|
46
48
|
the map cuts the list short, call it again with `detail: true`.
|
|
47
|
-
- **Groups of similar functions**: `total_clusters` from `find_similar`.
|
|
49
|
+
- **Groups of similar functions**: `total_clusters` from `find_similar`. It
|
|
50
|
+
counts the first window of the list only: where the answer carries
|
|
51
|
+
`window.next_scan_from`, the project has further windows, so the number is a
|
|
52
|
+
floor (`has_more` alone does not say so: it only means this window has more
|
|
53
|
+
pages). Write it as `at least <n> (first of several windows)` and state the
|
|
54
|
+
estimate as `at least`. With no `window.next_scan_from` the number is exact.
|
|
48
55
|
- **Operations served**: the endpoint count per service in the map's SERVICES.
|
|
49
56
|
- The first line of the `get_findings` answer (`FINDINGS · project <slug> ·
|
|
50
57
|
index at <commits> · built <day>`): copy it to the top of the report, word
|
|
@@ -60,24 +67,42 @@ line: the duplicates most worth fixing sit low on the list, so its first page
|
|
|
60
67
|
does not answer the question. Any other ask runs all five.
|
|
61
68
|
|
|
62
69
|
Work out the estimate from the counts. New tokens are input read for the first
|
|
63
|
-
time plus output
|
|
70
|
+
time plus output. First count the sub-agents the audit will start, with the
|
|
71
|
+
unit rules of section 2: A is 1 unit, or 0 with no calls that reach no route
|
|
72
|
+
(and with more than 30 of them, 1 more for each 30); B is 1 for every 10 pairs;
|
|
73
|
+
C is 1 for the listing, and 1 more for every 20 groups
|
|
74
|
+
when there are more than 20 (none at all with no groups); D is 1; E is 1. Where you cannot start sub-agents
|
|
75
|
+
the count is 0.
|
|
64
76
|
|
|
65
77
|
| Section | Per item | New tokens |
|
|
66
78
|
|---|---|---|
|
|
67
79
|
| Counting and the report | once | 80,000 |
|
|
68
|
-
|
|
|
80
|
+
| Start-up of each sub-agent | each sub-agent the audit starts | 40,000 |
|
|
81
|
+
| A. Calls that reach no route | listing the rows, once (none with no such calls) | 97,500 |
|
|
69
82
|
| | each call that reaches no route | 6,000 |
|
|
70
|
-
| B. Type verdicts | each pair |
|
|
71
|
-
| C. Functions written twice | each group |
|
|
72
|
-
| D. Routes written twice | each
|
|
73
|
-
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
83
|
+
| B. Type verdicts | each pair | 5,500 |
|
|
84
|
+
| C. Functions written twice | each group | 5,000 |
|
|
85
|
+
| D. Routes written twice | listing, each service that serves operations | 11,000 |
|
|
86
|
+
| | proof, each candidate: not known before the listing, so the estimate leaves it out | 15,000 |
|
|
87
|
+
| E. One job, several answers | once | 73,500 |
|
|
88
|
+
|
|
89
|
+
The listing of D is all the estimate charges for D: how many candidates it
|
|
90
|
+
finds is known only once it has run, and the report states what the proof
|
|
91
|
+
cost. The rates for A to E leave start-up out: it has its own line. Start-up is what
|
|
92
|
+
a sub-agent loads before it does anything, and it depends on how much the
|
|
93
|
+
user's own setup puts into every sub-agent (long instruction files, many
|
|
94
|
+
tools, many skills): about 27,500 new tokens on a bare setup and about 57,000
|
|
95
|
+
on a heavy one, so 40,000 is the middle. Each turn also re-reads what the run
|
|
96
|
+
already holds from the cache: about 6 to 10 times the new tokens again (the
|
|
97
|
+
lower figure on the bare setup, the higher on the heavy one), at a tenth of the
|
|
98
|
+
price. Time is about 13 minutes for each million new tokens when the sections
|
|
99
|
+
run one after another, and about half of that with sub-agents. The rates come
|
|
100
|
+
from two measurements with Claude Sonnet on 25 Nov 2026: one full audit with
|
|
101
|
+
sub-agents on a project of 21 services (13 calls that reach no route, 6 pairs,
|
|
102
|
+
114 groups, 115 operations served) on a heavy setup, which took 8 minutes and
|
|
103
|
+
3.4 million new tokens; and one run of section A on a
|
|
104
|
+
bare test monorepo (6 calls that reach no route). D and E rest on one
|
|
105
|
+
measurement each, and the listing term of A on one.
|
|
81
106
|
|
|
82
107
|
The first thing the user reads from you is this block, filled in. Write it as
|
|
83
108
|
text in your reply, not only in your reasoning, before any source is opened:
|
|
@@ -86,42 +111,88 @@ once the first units have started and before any has returned.
|
|
|
86
111
|
|
|
87
112
|
```
|
|
88
113
|
Carrick audit: estimate, before any source is read
|
|
89
|
-
- Calls that reach no route: <n
|
|
114
|
+
- Calls that reach no route: <n>
|
|
90
115
|
- Consumer and producer pairs: <n>
|
|
91
116
|
- Groups of similar functions: <n>
|
|
92
117
|
- Operations served: <n>
|
|
93
|
-
|
|
94
|
-
|
|
118
|
+
Sub-agents to start: <k>, about 40,000 new tokens each to start up: <n>
|
|
119
|
+
Estimate: about <total> new tokens (A <n>, B <n>, C <n>, D <n> (the listing only; proof is 15,000 for each candidate the listing finds), E <n>, counting and report <n>, start-up <n>)
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Where the answer carries `window.next_scan_from`, the groups line reads
|
|
123
|
+
`Groups of similar functions: at least <n> (first of several windows)` and the
|
|
124
|
+
estimate line reads `Estimate: at least about <total> new tokens (...)`, with
|
|
125
|
+
the same parts.
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
Cached re-reads add about 6 to 10 times that again, at a tenth of the price.
|
|
95
129
|
Time: about <n> minutes with sub-agents, about <n> one section after another
|
|
96
130
|
```
|
|
97
131
|
|
|
98
|
-
|
|
132
|
+
Directly after the block, in the same text and whichever case below applies,
|
|
133
|
+
write what the index already shows, as three to five lines under this heading,
|
|
134
|
+
word for word: `What the index shows so far, before any source has been read.
|
|
135
|
+
These are leads, not verdicts:`. Build the lines only from the answers of the
|
|
136
|
+
four calls above: make no further tool call and open no source for them. Each
|
|
137
|
+
line gives a count and, where an answer carries one, one example with its
|
|
138
|
+
file and line. Take, in this order, the lines the answers can fill, and leave
|
|
139
|
+
out one whose answer holds nothing:
|
|
140
|
+
|
|
141
|
+
- Type mismatches between a route, event or procedure and its callers: the
|
|
142
|
+
count, and the first one with its endpoint and its caller's file and line.
|
|
143
|
+
- Calls that reach no route: the count from above, set against the calls to
|
|
144
|
+
third parties and to bases not yet placed that the map counts under
|
|
145
|
+
UNMATCHED.
|
|
146
|
+
- Groups of similar functions: the count, and the first group with one
|
|
147
|
+
member's name, file and line.
|
|
148
|
+
- Routes, events or procedures with no recorded caller: the count where an
|
|
149
|
+
answer gives one, and the first row with its file and line.
|
|
150
|
+
- Call sites the index could not resolve: the count.
|
|
151
|
+
|
|
152
|
+
Say each in plain words, as what the index holds. Do not class, rank or
|
|
153
|
+
recommend anything, do not call a lead a finding, and do not suggest narrowing
|
|
154
|
+
the audit: the audit proper has not run. Then follow with the case below.
|
|
155
|
+
|
|
156
|
+
After the leads, take the first case that fits:
|
|
99
157
|
|
|
100
158
|
- **The ask already says to go ahead**: it says to run the audit after seeing
|
|
101
159
|
the cost or without asking (for example "run the full audit", "go ahead",
|
|
102
160
|
"yes, run it", "don't ask, just run"). Carry on with section 2 in the same
|
|
103
161
|
turn. An ask the user has narrowed to one service or some sections is not a
|
|
104
|
-
go-ahead: work out the estimate for that scope, write the block
|
|
105
|
-
one of the cases below.
|
|
162
|
+
go-ahead: work out the estimate for that scope, write the block and the
|
|
163
|
+
leads, then take one of the cases below.
|
|
106
164
|
- **You have a tool for putting a question to the user** (such as
|
|
107
165
|
`AskUserQuestion`): use it to ask whether to go ahead, and wait for the
|
|
108
166
|
answer.
|
|
109
|
-
- **You have no such tool**: end your turn after the block
|
|
110
|
-
line: `Say "go" to run the audit.` Open no source, start no
|
|
111
|
-
make no further tool call in that turn. When the user's next
|
|
112
|
-
run from section 2 with the counts you already read, and do
|
|
113
|
-
Any other reply is the user's new ask.
|
|
167
|
+
- **You have no such tool**: end your turn after the block and the leads with
|
|
168
|
+
one closing line: `Say "go" to run the audit.` Open no source, start no
|
|
169
|
+
sub-agent and make no further tool call in that turn. When the user's next
|
|
170
|
+
message says go, run from section 2 with the counts you already read, and do
|
|
171
|
+
not count again. Any other reply is the user's new ask.
|
|
114
172
|
|
|
115
173
|
## 2. Run every section
|
|
116
174
|
|
|
117
175
|
Sections A to E do not depend on each other. Split them into units:
|
|
118
176
|
|
|
119
|
-
- **A**: one unit for
|
|
120
|
-
|
|
177
|
+
- **A**: one unit, for the whole of A. It lists the no-route rows itself. With
|
|
178
|
+
30 rows or fewer it proves them. With more than 30 it returns the row list at
|
|
179
|
+
once and you split the rows into units of 30, each given its rows inline. With
|
|
180
|
+
no no-route calls from step 1, section A has no unit and its count line says
|
|
181
|
+
so. Never start one sub-agent for each service.
|
|
121
182
|
- **B**: one unit for every 10 pairs.
|
|
122
|
-
- **C**: one unit for
|
|
123
|
-
|
|
124
|
-
|
|
183
|
+
- **C**: one listing unit, for the whole of C's list. It walks the list to its
|
|
184
|
+
end itself (section C says how) and returns each group once, as a number, a
|
|
185
|
+
key and its members. With 20 groups or fewer it proves them. With more than 20
|
|
186
|
+
it returns the list at once and you split it into units of 20 groups in the
|
|
187
|
+
order it came back, each given its groups inline. A unit never works out an
|
|
188
|
+
offset and never asks the index for the list again. With no groups, section C
|
|
189
|
+
has no unit and its count line says so.
|
|
190
|
+
- **D**: one unit, for the whole of D. Its sub-agent runs it. Its listing never
|
|
191
|
+
sits in the main agent: the unit lists per service with callbacks included
|
|
192
|
+
(section D says how), keeps only the groups with two or more route handlers
|
|
193
|
+
in different files, proves each candidate itself (both handlers opened, and
|
|
194
|
+
`get_operation` on the path) and returns its table. With
|
|
195
|
+
no candidate it returns `D: no candidate` and has opened no source.
|
|
125
196
|
- **E**: one unit.
|
|
126
197
|
|
|
127
198
|
Where you can start sub-agents, give each unit to its own sub-agent and start
|
|
@@ -131,8 +202,13 @@ yet. The brief for each is these words with the unit filled in, and nothing
|
|
|
131
202
|
else:
|
|
132
203
|
|
|
133
204
|
> Load the carrick-audit skill. Run only section <letter> of it, for <the
|
|
134
|
-
> unit:
|
|
135
|
-
>
|
|
205
|
+
> unit: the whole project for a unit that lists for itself (A, C's listing, D
|
|
206
|
+
> and E), or its no-route rows, its pairs or its groups, each named as the
|
|
207
|
+
> index spells it and given inline>. Where the unit is given rows, pairs or
|
|
208
|
+
> groups, take those and list nothing: call no listing tool for them. A unit
|
|
209
|
+
> that lists keeps the listing to itself and returns only its table and count
|
|
210
|
+
> line, or, for C's listing, its groups.
|
|
211
|
+
> Work to the end of the unit
|
|
136
212
|
> and return its table, its count line and any refused calls. Run no other
|
|
137
213
|
> section. Do not estimate, do not ask the user anything and do not start
|
|
138
214
|
> sub-agents.
|
|
@@ -141,23 +217,49 @@ Where you cannot start sub-agents, run the units yourself in the order above,
|
|
|
141
217
|
and write each unit's table and count line to the user before you start the
|
|
142
218
|
next unit.
|
|
143
219
|
|
|
220
|
+
**Second fair warning (C).** The listing unit can return far more groups than
|
|
221
|
+
step 1 could see. When it returns more than 1.5 times the group count step 1
|
|
222
|
+
printed, do not start C's proof units yet: let the units already running
|
|
223
|
+
finish, then write a short restated estimate for the rest of C: `The listing
|
|
224
|
+
found <n> groups of similar functions, not <m>: proving them is about <t> new
|
|
225
|
+
tokens more, in <k> sub-agents.` Here <n> is the number listed, <m> the number
|
|
226
|
+
step 1 printed, <k> is 1 for every 20 groups, rounded up, and <t> is <n> times
|
|
227
|
+
5,000 plus <k> times 40,000. Then take the first case that fits, as in step 1:
|
|
228
|
+
the user's first ask already said to go ahead or not to ask, so carry on; you
|
|
229
|
+
have a tool for putting a question to the user, so ask and wait; or you have
|
|
230
|
+
none, so end your turn with the restated estimate and one closing line, `Say
|
|
231
|
+
"go" to run the audit.`, make no further tool call in that turn, and, when the
|
|
232
|
+
next message says go, start the C units with the list you already hold,
|
|
233
|
+
listing nothing again. At or under 1.5 times, carry on without asking. A no
|
|
234
|
+
leaves C unproven and the report says so in C's count line; it changes
|
|
235
|
+
nothing else in the audit.
|
|
236
|
+
|
|
144
237
|
A unit is done when it has returned its count line and the two numbers in it
|
|
145
238
|
are equal. Run again any unit that came back without one.
|
|
146
239
|
|
|
147
240
|
## A. Calls that reach no route
|
|
148
241
|
|
|
149
|
-
|
|
242
|
+
If the unit was given rows, take those and read no others. Otherwise list them
|
|
243
|
+
from the index:
|
|
150
244
|
|
|
151
245
|
```
|
|
152
|
-
get_service_graph({{SCOPE}},
|
|
246
|
+
get_service_graph({{SCOPE}}, limit: 200)
|
|
153
247
|
```
|
|
154
248
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
`
|
|
159
|
-
|
|
160
|
-
|
|
249
|
+
Pass no `service`: the whole-project listing holds every row once, and a listing
|
|
250
|
+
per service reads the same rows again. Read `unmatched_calls` and nothing else:
|
|
251
|
+
the other arrays are for other questions, so never page for them. Follow the
|
|
252
|
+
`next_offset` each answer names
|
|
253
|
+
until there is none, and never work out an offset yourself: the server cuts a
|
|
254
|
+
page below `limit`. Keep only the rows whose `reason` is `no_matching_producer`,
|
|
255
|
+
`no_case_answers` or `procedure_unserved`: each names an operation no indexed
|
|
256
|
+
service serves. The other reasons go to third parties or to a base Carrick has
|
|
257
|
+
not placed, and are not evidence of a broken call. A row is one call site: where
|
|
258
|
+
its `services` names several, the call sits in a shared file and counts once.
|
|
259
|
+
Do not ask the index again for each service for rows you already hold, unless a
|
|
260
|
+
row lacks a field you need. Where you hold more than 30 rows, return them at
|
|
261
|
+
once as method, path, file, line and service, and stop: the caller splits them
|
|
262
|
+
into units.
|
|
161
263
|
|
|
162
264
|
For each row you took, open the call site at its file and line. Then ask the
|
|
163
265
|
index for the nearest thing that does exist, once for each service that serves
|
|
@@ -186,7 +288,8 @@ Class each row:
|
|
|
186
288
|
- **CAN'T TELL**: you cannot settle it. Say what you looked for.
|
|
187
289
|
|
|
188
290
|
Count line: `A <services>: <rows taken> no-route rows, <rows classed> classed,
|
|
189
|
-
<
|
|
291
|
+
<rows read> of <rows given> no-route rows read`. Across the units of A, the rows
|
|
292
|
+
read add up to the no-route count from step 1, with a call site counted once.
|
|
190
293
|
|
|
191
294
|
## B. Type verdicts, pair by pair
|
|
192
295
|
|
|
@@ -240,17 +343,53 @@ which is not agreement.
|
|
|
240
343
|
|
|
241
344
|
## C. Functions written twice
|
|
242
345
|
|
|
346
|
+
If the unit was given groups, take those and read no others: call
|
|
347
|
+
`find_similar` for none of them. Otherwise list the groups from the index, once:
|
|
348
|
+
|
|
243
349
|
```
|
|
244
|
-
find_similar({{SCOPE}}, audit: true,
|
|
350
|
+
find_similar({{SCOPE}}, audit: true, limit: 50)
|
|
245
351
|
```
|
|
246
352
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
353
|
+
How the list pages (measured on a project of 9,643 functions and on one of
|
|
354
|
+
2,221): on a large project the answer covers one window of functions, in path
|
|
355
|
+
order, within a time budget (`window`, with `next_scan_from`), and on a small
|
|
356
|
+
one it covers the whole project (no `window`). Inside a window the groups are
|
|
357
|
+
paged with `offset`; offsets start again at 0 in every window. A page is cut to
|
|
358
|
+
what one answer holds (13 to 16 groups, whatever `limit` asks), and `next_offset`
|
|
359
|
+
continues it. `total_clusters` is the group count of this window alone: it
|
|
360
|
+
differs from window to window and call to call, so size nothing from it once
|
|
361
|
+
the walk has started. A group has no id of its own, and a function that matched
|
|
362
|
+
one earlier in the path order appears again, in part, in a later window.
|
|
363
|
+
|
|
364
|
+
Walk it like this and no other way:
|
|
365
|
+
|
|
366
|
+
- Follow `next_offset` while the answer has `has_more`. Never work out an
|
|
367
|
+
offset.
|
|
368
|
+
- When the window's pages end and the answer carries `window.next_scan_from`,
|
|
369
|
+
call again with `scan_from: <next_scan_from>` and offset 0, and page that
|
|
370
|
+
window the same way.
|
|
371
|
+
- The walk is done when an answer has no `has_more` and no `next_scan_from`.
|
|
372
|
+
- The time budget can end a window at a different function on each call
|
|
373
|
+
(`window.functions_to`), so a window's later pages may not match its first.
|
|
374
|
+
Where `functions_to` or `total_clusters` changed between the pages of one
|
|
375
|
+
window, page that window again from offset 0 and keep the union by key,
|
|
376
|
+
until a whole pass adds no new key. Keep the `scan_from` chain unbroken
|
|
377
|
+
from one window to the next.
|
|
378
|
+
- A group's key is its members' `file_path:line_number`, sorted and joined with
|
|
379
|
+
`;`. Keep one entry for each key: a key seen again in a later window or page
|
|
380
|
+
is the same group, dropped from the list and counted as a repeat. Two groups
|
|
381
|
+
with different keys that share a member are two groups: keep both, and note
|
|
382
|
+
the shared member on the second.
|
|
383
|
+
- Keep from each group only its number (the order the walk first saw it), its
|
|
384
|
+
key and its members as name, file and line span. Read no source in the
|
|
385
|
+
listing.
|
|
386
|
+
|
|
387
|
+
Where you hold more than 20 groups, return the list at once as `<number> |
|
|
388
|
+
<key> | <name file:line-end>; ...` and stop: the caller splits it. Where you
|
|
389
|
+
hold 20 or fewer, prove them yourself.
|
|
390
|
+
|
|
391
|
+
For each group you hold, read every member at its file and line, also in a
|
|
392
|
+
group that lists its members as locators only, and diff the bodies. Class each group:
|
|
254
393
|
|
|
255
394
|
- **DUPLICATE**: the same job and the same result. Nothing to name apart.
|
|
256
395
|
- **DIVERGED**: the same job, the same kind of input and the same kind of
|
|
@@ -288,25 +427,40 @@ their package.json files for a package they already share. Where one exists,
|
|
|
288
427
|
the fix is to move the function there and import it; where none does, say so:
|
|
289
428
|
the fix is a new shared package.
|
|
290
429
|
|
|
291
|
-
Count line: `C
|
|
292
|
-
<
|
|
430
|
+
Count line: `C listing: <groups listed> groups listed
|
|
431
|
+
(<windows> windows, <pages> pages, <repeats> repeats dropped)`; for a unit: `C
|
|
432
|
+
<first number>-<last number>: <groups given> given, <groups classed> classed`.
|
|
433
|
+
Across section C the three numbers are equal: groups listed, groups given to
|
|
434
|
+
units, groups classed. A group seen twice is counted once, and a number that
|
|
435
|
+
differs names the group that went missing.
|
|
293
436
|
|
|
294
437
|
## D. Routes written twice
|
|
295
438
|
|
|
296
|
-
|
|
297
|
-
|
|
439
|
+
This section is one unit and runs in one place: the unit's own sub-agent, or,
|
|
440
|
+
where you cannot start sub-agents, you as D's unit. Route handlers are left out
|
|
441
|
+
of section C's list on purpose: the default list drops anonymous callbacks,
|
|
442
|
+
and every route handler the index names is one (on one project the same
|
|
443
|
+
service lists 27 groups by default and 68 with callbacks, and a route twin
|
|
444
|
+
sits only in the 68). The tool has no filter for route-handler rows and its
|
|
445
|
+
rows carry no role, so section C's walk cannot give D its candidates. List
|
|
446
|
+
them from the narrowest call the tool has, once for each service that serves
|
|
447
|
+
operations:
|
|
298
448
|
|
|
299
449
|
```
|
|
300
|
-
find_similar({{SCOPE}}, audit: true, include_callbacks: true, service: "<producer>", limit:
|
|
450
|
+
find_similar({{SCOPE}}, audit: true, include_callbacks: true, service: "<producer>", limit: 50)
|
|
301
451
|
```
|
|
302
452
|
|
|
303
|
-
Page with `next_offset` to the end
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
453
|
+
Page each service with `next_offset` to the end, and follow `next_scan_from`
|
|
454
|
+
as section C does where an answer carries a `window`. Keep only the groups
|
|
455
|
+
where two or more members are route handlers in different files: a route
|
|
456
|
+
handler's name starts with its method or operation kind and ends in `_handler`,
|
|
457
|
+
such as `post_orders_handler`. Drop every other group unread: section C covers
|
|
458
|
+
the named functions, and callbacks inside one function are not routes. These
|
|
459
|
+
are the candidates; give each a number and a key as section C does, and keep
|
|
460
|
+
each as its members' names, files and lines. Where you hold none, stop and open
|
|
461
|
+
no source: return `D: no candidate`.
|
|
308
462
|
|
|
309
|
-
For each
|
|
463
|
+
For each candidate, find the full path of each handler and who calls it:
|
|
310
464
|
|
|
311
465
|
```
|
|
312
466
|
get_api_endpoints({{SCOPE}}, service: "<producer>", path_contains: "<a word of the route's path>")
|
|
@@ -318,7 +472,7 @@ is not a copy. `consumer_count` on each operation says which copy the apps
|
|
|
318
472
|
call. Then read both handlers to their last line and diff them line by line.
|
|
319
473
|
Name a difference only where you quote the line from each copy; a line that is
|
|
320
474
|
only a comment or a log in one copy is not a difference in what the route
|
|
321
|
-
does. Class each
|
|
475
|
+
does. Class each candidate:
|
|
322
476
|
|
|
323
477
|
- **WRITTEN TWICE, DIFFERS**: two handlers serve the same thing and the bodies
|
|
324
478
|
differ in what they do. Quote a line that differs, and say which copy the
|
|
@@ -326,8 +480,10 @@ does. Class each group:
|
|
|
326
480
|
- **WRITTEN TWICE, SAME**: the same logic in two files.
|
|
327
481
|
- **NOT A COPY**: the handlers serve different things.
|
|
328
482
|
|
|
329
|
-
Count line: `D: <
|
|
330
|
-
|
|
483
|
+
Count line: `D: <services listed> services listed, <groups returned> groups
|
|
484
|
+
read, <candidates> candidates, <candidates classed> classed`; with no candidate
|
|
485
|
+
it is `D: no candidate`. Across section D the candidates found and classed are
|
|
486
|
+
equal.
|
|
331
487
|
|
|
332
488
|
## E. One job, several answers
|
|
333
489
|
|
|
@@ -363,7 +519,7 @@ classed`.
|
|
|
363
519
|
## 3. Report
|
|
364
520
|
|
|
365
521
|
Before you write, check that you hold a count line for every unit of every
|
|
366
|
-
section and that its numbers are equal. Run now any unit that is missing.
|
|
522
|
+
section and that its numbers are equal. Run now any unit that is missing, except C's proof units after a no to the second fair warning.
|
|
367
523
|
|
|
368
524
|
The report, in this order:
|
|
369
525
|
|