carrick 0.3.82 → 0.3.84

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/README.md +62 -30
  2. package/bin/carrick.mjs +45 -2
  3. package/dist/contract.d.ts +17 -0
  4. package/dist/contract.js.map +1 -1
  5. package/dist/hook/apply-patch.d.ts +13 -0
  6. package/dist/hook/apply-patch.js +100 -0
  7. package/dist/hook/apply-patch.js.map +1 -0
  8. package/dist/hook/post-edit.d.ts +30 -1
  9. package/dist/hook/post-edit.js +95 -24
  10. package/dist/hook/post-edit.js.map +1 -1
  11. package/dist/hook/reuse.d.ts +97 -0
  12. package/dist/hook/reuse.js +245 -0
  13. package/dist/hook/reuse.js.map +1 -0
  14. package/dist/hook/stop.d.ts +3 -0
  15. package/dist/hook/stop.js +76 -0
  16. package/dist/hook/stop.js.map +1 -0
  17. package/dist/hook/user-prompt.d.ts +9 -0
  18. package/dist/hook/user-prompt.js +79 -0
  19. package/dist/hook/user-prompt.js.map +1 -0
  20. package/dist/init/codex.d.ts +51 -0
  21. package/dist/init/codex.js +167 -0
  22. package/dist/init/codex.js.map +1 -0
  23. package/dist/init/connect.d.ts +13 -0
  24. package/dist/init/connect.js +21 -15
  25. package/dist/init/connect.js.map +1 -1
  26. package/dist/init/doctor.d.ts +57 -0
  27. package/dist/init/doctor.js +132 -3
  28. package/dist/init/doctor.js.map +1 -1
  29. package/dist/init/files.d.ts +15 -0
  30. package/dist/init/files.js +20 -1
  31. package/dist/init/files.js.map +1 -1
  32. package/dist/init/hosted.d.ts +30 -5
  33. package/dist/init/hosted.js +75 -9
  34. package/dist/init/hosted.js.map +1 -1
  35. package/dist/init/mcp.d.ts +45 -30
  36. package/dist/init/mcp.js +47 -88
  37. package/dist/init/mcp.js.map +1 -1
  38. package/dist/init/outdated.d.ts +54 -0
  39. package/dist/init/outdated.js +175 -0
  40. package/dist/init/outdated.js.map +1 -0
  41. package/dist/init/output.d.ts +72 -3
  42. package/dist/init/output.js +187 -23
  43. package/dist/init/output.js.map +1 -1
  44. package/dist/init/projects.d.ts +27 -13
  45. package/dist/init/projects.js +48 -50
  46. package/dist/init/projects.js.map +1 -1
  47. package/dist/init/remove.d.ts +0 -2
  48. package/dist/init/remove.js +61 -15
  49. package/dist/init/remove.js.map +1 -1
  50. package/dist/init/repos.d.ts +34 -0
  51. package/dist/init/repos.js +77 -0
  52. package/dist/init/repos.js.map +1 -1
  53. package/dist/init/run.d.ts +148 -26
  54. package/dist/init/run.js +577 -125
  55. package/dist/init/run.js.map +1 -1
  56. package/dist/init/settings.d.ts +20 -0
  57. package/dist/init/settings.js +42 -4
  58. package/dist/init/settings.js.map +1 -1
  59. package/dist/init/task-skills.d.ts +27 -0
  60. package/dist/init/task-skills.js +64 -1
  61. package/dist/init/task-skills.js.map +1 -1
  62. package/dist/init/workspace-file.d.ts +73 -0
  63. package/dist/init/workspace-file.js +173 -0
  64. package/dist/init/workspace-file.js.map +1 -0
  65. package/dist/render.d.ts +16 -0
  66. package/dist/render.js +57 -6
  67. package/dist/render.js.map +1 -1
  68. package/package.json +7 -6
  69. package/plugin/hooks/hooks.json +11 -0
  70. package/sidecar/dist/src/capture/api.d.ts +23 -1
  71. package/sidecar/dist/src/capture/check-classify.d.ts +10 -1
  72. package/sidecar/dist/src/capture/check-classify.js +96 -9
  73. package/sidecar/dist/src/capture/check-deep.d.ts +16 -4
  74. package/sidecar/dist/src/capture/check-deep.js +21 -17
  75. package/sidecar/dist/src/capture/check-fields.d.ts +112 -0
  76. package/sidecar/dist/src/capture/check-fields.js +311 -0
  77. package/sidecar/dist/src/capture/check-probe.d.ts +21 -1
  78. package/sidecar/dist/src/capture/check-probe.js +39 -0
  79. package/sidecar/dist/src/capture/check.js +14 -2
  80. package/sidecar/dist/src/capture/index.js +6 -1
  81. package/sidecar/dist/src/capture/self-check.d.ts +6 -1
  82. package/sidecar/dist/src/capture/self-check.js +65 -11
  83. package/sidecar/dist/src/validators.d.ts +40 -40
  84. package/sidecar/dist/src/validators.js +6 -1
  85. package/templates/skills/carrick-census.md +18 -9
  86. package/templates/skills/carrick-drift.md +7 -1
  87. package/templates/skills/carrick-impact.md +3 -1
  88. package/templates/skills/carrick-reuse.md +43 -26
@@ -7,8 +7,8 @@ description: Use at the end of a task that added or changed functions, and whene
7
7
 
8
8
  {{SCOPE_NOTE}}
9
9
 
10
- `find_similar` does the comparison. Your work is to read both spans and class
11
- each pair.
10
+ `find_similar` does the comparison. Your work is to read the spans it names
11
+ and class every row it returned.
12
12
 
13
13
  ## Targeted: the functions this task added or changed
14
14
 
@@ -26,10 +26,13 @@ An entry is either a `name` with a `file` for a function the index holds, or a
26
26
  the other in an entry, never both. A `name` that matches more than one
27
27
  definition comes back with its candidates on that entry's `error`.
28
28
 
29
- The two kinds are scored on different scales and the response states both
30
- floors: 0.85 between two indexed functions, 0.45 for a description. A stored
31
- vector carries the function's name in front of its intent and a bare sentence
32
- does not, so a description scoring 0.5 is a hit worth reading.
29
+ The two kinds are scored on different scales, and each result states the floor
30
+ it was ranked against. `vector_basis` says what the cosines are over. On
31
+ `intent` the vector is the intent sentence alone, and a copy somebody renamed
32
+ scores as close as one that kept its name. On `name_anchored` the function's
33
+ name sits in front of the sentence, a renamed copy scores lower, and
34
+ `intent_text` is the signal that still finds it. Read every score against the
35
+ floor and the basis in the answer you got.
33
36
 
34
37
  ## Audit: the whole project
35
38
 
@@ -38,9 +41,8 @@ find_similar({{SCOPE}})
38
41
  ```
39
42
 
40
43
  `clusters` groups functions that describe the same behaviour, ordered by size.
41
- Page with `offset: <next_offset>` while `has_more` is true. A group is
42
- transitive, so `lowest_similarity` can sit under the floor and a large group can
43
- hold more than one idea.
44
+ Call again with `offset: <next_offset>` for as long as the response carries
45
+ `has_more`, and class what every page returned.
44
46
 
45
47
  Where the project is larger than one pass, the response carries `error` in place
46
48
  of clusters and names the two routes under the ceiling: a `service`, or a higher
@@ -48,15 +50,28 @@ of clusters and names the two routes under the ceiling: a `service`, or a higher
48
50
  `truncated` is present the audit is partial, and its `scanned_functions` of `of`
49
51
  says by how much.
50
52
 
51
- ## Class each pair
52
-
53
- Read both spans in source, then class:
54
-
55
- - **DUPLICATE**: the same behaviour, and one call site could use the other.
56
- - **VARIANT**: near neighbours that cannot share an implementation. Say in one
57
- line why they cannot.
58
- - **FALSE POSITIVE**: the index describes them alike and the code does different
59
- work.
53
+ ## Class every row
54
+
55
+ Every row the answer returned is classed here. In an audit the first member of a
56
+ cluster is what the rest of that cluster is classed against; in a targeted call
57
+ it is the function you asked about. Read that span at the file and line the
58
+ response gave, read each other row the same way, and take the first of these
59
+ that holds:
60
+
61
+ - **FALSE POSITIVE**: the two contracts differ. Different inputs, a different
62
+ result, or a different effect, and the intent sentences alone brought them
63
+ together.
64
+ - **VARIANT**: one contract, and a behavioural difference you can name in a
65
+ clause. A different normalisation, a different error path, a different
66
+ default. Write the clause in the row. Where a comment on the member or at the
67
+ head of its file names the file it mirrors, the clause is "documented
68
+ mirror".
69
+ - **DUPLICATE**: one contract, and nothing left to name. Two bodies that run
70
+ the same once the identifiers are renamed land here.
71
+
72
+ A cluster is transitive, so `lowest_similarity` can sit under the floor and a
73
+ large group can hold more than one idea. A member that shares no contract with
74
+ the first is FALSE POSITIVE on its own row, and stays in the table.
60
75
 
61
76
  `matched_on` says which signal joined a row. `similarity` is the intent vectors;
62
77
  `intent_text` is two identical intent sentences, which is the signal that still
@@ -64,17 +79,19 @@ finds a copy somebody renamed.
64
79
 
65
80
  ## Report
66
81
 
67
- | class | function | file:line | pair | why |
82
+ One row per match, and per cluster member beyond the first. The class column
83
+ carries one of the three words and is never empty.
84
+
85
+ | class | member | file:line | against | why |
68
86
  |---|---|---|---|---|
69
- | DUPLICATE | slugify | src/text.ts:12 | src/util/url.ts:4 | same replacement rules |
87
+ | DUPLICATE | slugify | src/util/url.ts:4 | src/text.ts:12 | same replacement rules |
88
+ | VARIANT | slugTag | src/tags.ts:20 | src/text.ts:12 | documented mirror |
70
89
 
71
- Then relay the counts the response stated, in its numbers:
90
+ State `total_clusters` from the response against the number of clusters carrying
91
+ rows above. Where the two differ, name the clusters left out.
72
92
 
73
- - `compared_functions`, and `total_clusters` on an audit;
74
- - `not_compared`: `without_intent`, `intent_not_embedded`, `awaiting_embedding`,
75
- `model_mismatch`;
76
- - `excluded`: `below_min_lines`, `tests`, `generated`, `callbacks`,
77
- `other_service`.
93
+ Then relay the counts the response stated, in its numbers: `compared_functions`,
94
+ and every key the answer carries under `not_compared` and under `excluded`.
78
95
 
79
96
  Rows outside the comparison were not looked at, so an empty answer covers what
80
97
  was compared and nothing further.