carrick 0.3.184 → 0.3.186

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.
Files changed (88) hide show
  1. package/dist/facts/fetch.d.ts +1 -1
  2. package/dist/facts/fetch.js +1 -1
  3. package/dist/facts/fetch.js.map +1 -1
  4. package/dist/held/client.d.ts +1 -1
  5. package/dist/held/client.js +27 -19
  6. package/dist/held/client.js.map +1 -1
  7. package/dist/held/clone-worker.d.ts +1 -0
  8. package/dist/held/clone-worker.js +7 -0
  9. package/dist/held/clone-worker.js.map +1 -0
  10. package/dist/held/coverage.d.ts +3 -1
  11. package/dist/held/coverage.js +40 -7
  12. package/dist/held/coverage.js.map +1 -1
  13. package/dist/held/daemon.d.ts +92 -4
  14. package/dist/held/daemon.js +418 -74
  15. package/dist/held/daemon.js.map +1 -1
  16. package/dist/held/paths.d.ts +9 -0
  17. package/dist/held/paths.js +9 -0
  18. package/dist/held/paths.js.map +1 -1
  19. package/dist/held/registry.d.ts +8 -0
  20. package/dist/held/registry.js +28 -0
  21. package/dist/held/registry.js.map +1 -1
  22. package/dist/held/run.js +8 -0
  23. package/dist/held/run.js.map +1 -1
  24. package/dist/held/runtime.d.ts +5 -0
  25. package/dist/held/runtime.js +104 -19
  26. package/dist/held/runtime.js.map +1 -1
  27. package/dist/held/shadow.d.ts +62 -0
  28. package/dist/held/shadow.js +359 -1
  29. package/dist/held/shadow.js.map +1 -1
  30. package/dist/held/state.d.ts +2 -1
  31. package/dist/held/state.js.map +1 -1
  32. package/dist/hook/added.d.ts +51 -0
  33. package/dist/hook/added.js +96 -0
  34. package/dist/hook/added.js.map +1 -0
  35. package/dist/hook/edit-flow.d.ts +7 -0
  36. package/dist/hook/edit-flow.js +25 -8
  37. package/dist/hook/edit-flow.js.map +1 -1
  38. package/dist/hook/late.d.ts +5 -2
  39. package/dist/hook/late.js +35 -11
  40. package/dist/hook/late.js.map +1 -1
  41. package/dist/hook/not-checked.d.ts +13 -0
  42. package/dist/hook/not-checked.js +50 -1
  43. package/dist/hook/not-checked.js.map +1 -1
  44. package/dist/hook/post-edit.d.ts +2 -0
  45. package/dist/hook/post-edit.js +3 -1
  46. package/dist/hook/post-edit.js.map +1 -1
  47. package/dist/hook/post-read.js +8 -1
  48. package/dist/hook/post-read.js.map +1 -1
  49. package/dist/hook/rechecks.d.ts +23 -5
  50. package/dist/hook/rechecks.js +31 -6
  51. package/dist/hook/rechecks.js.map +1 -1
  52. package/dist/hook/refresh.d.ts +7 -2
  53. package/dist/hook/refresh.js +7 -2
  54. package/dist/hook/refresh.js.map +1 -1
  55. package/dist/hook/session-start.js +17 -1
  56. package/dist/hook/session-start.js.map +1 -1
  57. package/dist/hook/similar.d.ts +6 -3
  58. package/dist/hook/similar.js +10 -3
  59. package/dist/hook/similar.js.map +1 -1
  60. package/dist/hook/stop-wait.js +13 -4
  61. package/dist/hook/stop-wait.js.map +1 -1
  62. package/dist/hook/upgrade.d.ts +1 -1
  63. package/dist/hook/upgrade.js +4 -1
  64. package/dist/hook/upgrade.js.map +1 -1
  65. package/dist/hook/usage.d.ts +1 -1
  66. package/dist/hook/usage.js +1 -1
  67. package/dist/hook/usage.js.map +1 -1
  68. package/dist/hook/worktree-rules.d.ts +5 -0
  69. package/dist/hook/worktree-rules.js +30 -0
  70. package/dist/hook/worktree-rules.js.map +1 -0
  71. package/dist/hook/worktree.d.ts +5 -0
  72. package/dist/hook/worktree.js +7 -0
  73. package/dist/hook/worktree.js.map +1 -1
  74. package/dist/init/doctor.d.ts +1 -1
  75. package/dist/init/doctor.js +13 -3
  76. package/dist/init/doctor.js.map +1 -1
  77. package/dist/update.js +2 -1
  78. package/dist/update.js.map +1 -1
  79. package/package.json +6 -6
  80. package/plugin/.claude-plugin/plugin.json +1 -1
  81. package/sidecar/dist/src/engine-stamp.json +1 -1
  82. package/sidecar/dist/src/type-inferrer.d.ts +14 -2
  83. package/sidecar/dist/src/type-inferrer.js +32 -7
  84. package/sidecar/dist/src/types.d.ts +4 -2
  85. package/templates/skills/carrick-audit.md +325 -95
  86. package/templates/skills/carrick-census.md +11 -2
  87. package/templates/skills/carrick-drift.md +56 -13
  88. package/templates/skills/carrick-reuse.md +13 -28
@@ -80,8 +80,17 @@ get_operation({{SCOPE}}, method: "<METHOD>", path: "<path>")
80
80
  ```
81
81
 
82
82
  Read `consumers` only: service and `call_file_location`. Skip `unread_sites`.
83
- Where more than 10 endpoints were reached, do this for the 10 the question
84
- cares about most and say how many were not looked up.
83
+ Do this for every endpoint step 2 reached; there is no cap. Where there are
84
+ more than 15, say the number first (each lookup is one call of about 6,000
85
+ tokens) and split them into lots of 15. Where you can start sub-agents, give
86
+ each lot to its own sub-agent with this brief and nothing else:
87
+
88
+ > Call get_operation({{SCOPE}}, method, path) for each of these endpoints and
89
+ > return, for each, every consumer's service and call_file_location, or "no
90
+ > recorded caller": <the lot's methods and paths>
91
+
92
+ Where you cannot, do the lots yourself one after another. The report states
93
+ endpoints reached against endpoints looked up, and the two are equal.
85
94
 
86
95
  ## 4. Report
87
96
 
@@ -8,18 +8,34 @@ description: Use when the ask is whether a consumer and a producer still agree o
8
8
  {{SCOPE_NOTE}}
9
9
 
10
10
  `get_contract_pair` holds both sides and the verdict. It reports what the scan
11
- stored and computes no verdict of its own, and neither do you.
11
+ stored and computes no verdict of its own, and neither do you. Whether a
12
+ difference can break anything is a second question, answered in source in step
13
+ 4 and reported in its own column.
12
14
 
13
15
  ## 1. The pairs
14
16
 
15
17
  ```
16
- get_service_graph({{SCOPE}})
18
+ get_project_map({{SCOPE}})
17
19
  ```
18
20
 
19
- Each edge is a consumer and a producer. An edge carrying `via_sdk` reaches its
20
- producer through a published package and has no call site of its own. Page with
21
- `offset: <next_offset>` while the rows keep coming. To start from one service,
22
- pass `service: "<name>"`.
21
+ Each line under CONSUMERS is a producer and the services that call it: one pair
22
+ per consumer. Where the map cuts the list short, call it again with `detail:
23
+ true`. A consumer that reaches its producer through a published package has no
24
+ call site of its own.
25
+
26
+ Where the ask names one pair or one operation, do steps 2 to 4 for that. Where
27
+ it is about the whole project, every pair is read: say how many pairs there
28
+ are before you start, and do steps 2 to 4 for each. Where you can start
29
+ sub-agents, give each pair to its own sub-agent, six at a time at most, with
30
+ this brief and nothing else:
31
+
32
+ > Load the carrick-drift skill. Do its steps 2 to 4 for the one pair <consumer>
33
+ > to <producer>, every page, and return the rows, the count of operations
34
+ > returned against operations classed, and any refused calls. Do no other pair
35
+ > and start no sub-agents.
36
+
37
+ Where you cannot, do the pairs yourself one after another, and write each
38
+ pair's rows to the user before you start the next.
23
39
 
24
40
  ## 2. Each pair, operation by operation
25
41
 
@@ -74,12 +90,34 @@ A GET declares no request type by design, and `untyped_sides` already counts it
74
90
  that way. The wire note covers both readings above, so a `Date` on one side
75
91
  against a `string` on the other is not a difference.
76
92
 
77
- ## 4. Report
93
+ ## 4. Can it break: prove it in source
94
+
95
+ The classes above say what the index holds. For every DRIFT row, and every
96
+ row whose type texts differ, open source before you say it can break: the
97
+ producer's handler (how it reads the request, what it sends), the consumer's
98
+ call site, and the code that uses the response. A body the two sides describe
99
+ differently can still be read correctly, so look at how the producer parses it
100
+ (a validator, a form or multipart parser) before you call it a mismatch. Then
101
+ give the row one of these:
78
102
 
79
- | operation | class | producer type | consumer type | call site | verdict |
80
- |---|---|---|---|---|---|
81
- | GET /api/orders/:id | DRIFT | Order | OrderSummary | web/src/orders.ts:31 | incompatible |
82
- | POST /api/orders | UNRESOLVED | NewOrder | OrderDraft | web/src/orders.ts:52 | unresolved; type texts differ on `note` |
103
+ - **REAL**: the consumer reads a field the producer does not send, or one side
104
+ can send a value that breaks the other, such as a null passed to code that
105
+ needs a string. Quote the line that breaks.
106
+ - **TYPE-ONLY**: the types disagree and no value that is sent can break
107
+ anything: a null that is dropped or guarded before use, a string holding a
108
+ fixed set of values against a union of them. Quote the guard.
109
+ - **FALSE**: the index is wrong about one side: the field is sent, the body is
110
+ parsed the way the consumer sends it, or the type is misread. Quote the line.
111
+ - **CAN'T TELL**: the value comes from somewhere you cannot read. Say where.
112
+
113
+ Never write that a row can break, or is likely to, from the type texts alone.
114
+
115
+ ## 5. Report
116
+
117
+ | operation | class | producer type | consumer type | call site | verdict | can it break |
118
+ |---|---|---|---|---|---|---|
119
+ | GET /api/orders/:id | DRIFT | Order | OrderSummary | web/src/orders.ts:31 | incompatible | REAL: the page reads `total`, which the handler no longer sends (api/orders.ts:88) |
120
+ | POST /api/orders | UNRESOLVED | NewOrder | OrderDraft | web/src/orders.ts:52 | unresolved; type texts differ on `note` | TYPE-ONLY: the handler drops a null `note` (api/orders.ts:40) |
83
121
 
84
122
  Class words, and only these: MATCH, DRIFT, UNRESOLVED, NOT JUDGED, CONSUMER
85
123
  UNTYPED, PRODUCER UNTYPED. Every operation the answer returned carries one of
@@ -90,14 +128,19 @@ UNRESOLVED, NOT JUDGED, MATCH, because a stored incompatible verdict is the
90
128
  finding and a side carrying no type is why nothing past it could be judged.
91
129
  A reading of the two type texts goes in the verdict
92
130
  column beside the stored state, in the words "type texts differ", so nothing in
93
- the table reads as a verdict the index did not give you.
131
+ the table reads as a verdict the index did not give you. The last column
132
+ holds step 4's word and its quoted line for every DRIFT row and every row whose
133
+ type texts differ, and is empty for the rest.
134
+
135
+ For a whole-project ask, state pairs read against pairs the map lists, and put
136
+ the REAL rows first.
94
137
 
95
138
  State alongside it: `operations_total` against `operations_shown`,
96
139
  `matched_calls` and `unmatched_calls`, `dropped_rows`, and the `non_http_note`
97
140
  where the pair also carries GraphQL, socket or pub/sub operations, whose type
98
141
  text this surface does not hold.
99
142
 
100
- ## 5. Act
143
+ ## 6. Act
101
144
 
102
145
  Change no type unless you were asked to. Offer one issue per DRIFT, and one per
103
146
  UNRESOLVED or NOT JUDGED row whose type texts differ. File the ones accepted:
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: carrick-reuse
3
- description: Use at the end of a task that added or changed functions, and whenever the ask is whether something already exists, whether this duplicates code elsewhere, or where this project has built the same thing twice. Compares against the Carrick function index rather than by name.
3
+ description: Use at the end of a task that added or changed functions, and whenever the ask is whether something already exists or whether this code duplicates code elsewhere. Compares against the Carrick function index rather than by name. For where the whole project has built the same thing twice, use carrick-audit.
4
4
  ---
5
5
 
6
6
  # What already does this
@@ -45,28 +45,20 @@ name sits in front of the sentence, a renamed copy scores lower, and
45
45
  `intent_text` is the signal that still finds it. Read every score against the
46
46
  floor and the basis in the answer you got.
47
47
 
48
- ## Audit: the whole project
48
+ ## The whole project
49
49
 
50
- ```
51
- find_similar({{SCOPE}}, audit: true)
52
- ```
53
-
54
- `clusters` groups functions that describe the same behaviour, ordered by size.
55
- Call again with `offset: <next_offset>` for as long as the response carries
56
- `has_more`, and class what every page returned.
57
-
58
- Where the project is larger than one pass, the response carries `window`: the
59
- functions it compared, in path order, each against every function after them.
60
- Call again with `scan_from: <next_scan_from>` until a response carries no
61
- `next_scan_from`; the windows together compare every pair once. `path` narrows
62
- an audit to one directory. Where `truncated` is present the audit is partial,
63
- and its `scanned_functions` of `of` says by how much.
50
+ Where the ask is where the whole project has built the same thing twice, or
51
+ which duplicates are worth fixing, this skill is the wrong tool: one run cannot
52
+ page the whole list and open every member. Load the carrick-audit skill, which
53
+ reads every group in units, finds routes written twice and jobs done several
54
+ ways, and says what it will cost first. `find_similar({{SCOPE}}, audit: true,
55
+ limit: 1)` gives the number of groups, in `total_clusters`, if you want it
56
+ before you hand over.
64
57
 
65
58
  ## Class every row
66
59
 
67
- Every row the answer returned is classed here. In an audit the first member of a
68
- cluster is what the rest of that cluster is classed against; in a targeted call
69
- it is the function you asked about. Read that span at the file and line the
60
+ Every row the answer returned is classed here, against the function you asked
61
+ about. Read that span at the file and line the
70
62
  response gave, read each other row the same way, and take the first of these
71
63
  that holds:
72
64
 
@@ -81,27 +73,20 @@ that holds:
81
73
  - **DUPLICATE**: one contract, and nothing left to name. Two bodies that run
82
74
  the same once the identifiers are renamed land here.
83
75
 
84
- A cluster is transitive, so `lowest_similarity` can sit under the floor and a
85
- large group can hold more than one idea. A member that shares no contract with
86
- the first is FALSE POSITIVE on its own row, and stays in the table.
87
-
88
76
  `matched_on` says which signal joined a row. `similarity` is the intent vectors;
89
77
  `intent_text` is two identical intent sentences, which is the signal that still
90
78
  finds a copy somebody renamed.
91
79
 
92
80
  ## Report
93
81
 
94
- One row per match, and per cluster member beyond the first. The class column
95
- carries one of the three words and is never empty.
82
+ One row per match. The class column carries one of the three words and is
83
+ never empty.
96
84
 
97
85
  | class | member | file:line | against | why |
98
86
  |---|---|---|---|---|
99
87
  | DUPLICATE | slugify | src/util/url.ts:4 | src/text.ts:12 | same replacement rules |
100
88
  | VARIANT | slugTag | src/tags.ts:20 | src/text.ts:12 | documented mirror |
101
89
 
102
- State `total_clusters` from the response against the number of clusters carrying
103
- rows above. Where the two differ, name the clusters left out.
104
-
105
90
  Then relay the counts the response stated, in its numbers: `compared_functions`,
106
91
  and every key the answer carries under `not_compared` and under `excluded`.
107
92