@cstart/coldstart 2.2.11 → 2.2.12

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 (57) hide show
  1. package/README.md +4 -2
  2. package/dist/index-manager.d.ts +17 -0
  3. package/dist/index-manager.d.ts.map +1 -1
  4. package/dist/index-manager.js +35 -0
  5. package/dist/index-manager.js.map +1 -1
  6. package/dist/index.js +1 -1
  7. package/dist/init.d.ts +11 -1
  8. package/dist/init.d.ts.map +1 -1
  9. package/dist/init.js +40 -1
  10. package/dist/init.js.map +1 -1
  11. package/dist/kb/alias-repair.d.ts +37 -0
  12. package/dist/kb/alias-repair.d.ts.map +1 -0
  13. package/dist/kb/alias-repair.js +108 -0
  14. package/dist/kb/alias-repair.js.map +1 -0
  15. package/dist/kb/cli.d.ts.map +1 -1
  16. package/dist/kb/cli.js +41 -4
  17. package/dist/kb/cli.js.map +1 -1
  18. package/dist/kb/fold.d.ts +29 -10
  19. package/dist/kb/fold.d.ts.map +1 -1
  20. package/dist/kb/fold.js +40 -17
  21. package/dist/kb/fold.js.map +1 -1
  22. package/dist/kb/render.d.ts.map +1 -1
  23. package/dist/kb/render.js +10 -2
  24. package/dist/kb/render.js.map +1 -1
  25. package/dist/kb/repair.d.ts +31 -0
  26. package/dist/kb/repair.d.ts.map +1 -1
  27. package/dist/kb/repair.js +71 -9
  28. package/dist/kb/repair.js.map +1 -1
  29. package/dist/kb/search.d.ts.map +1 -1
  30. package/dist/kb/search.js +5 -4
  31. package/dist/kb/search.js.map +1 -1
  32. package/dist/kb/types.d.ts +7 -2
  33. package/dist/kb/types.d.ts.map +1 -1
  34. package/dist/kb/view.js +1 -1
  35. package/dist/kb/view.js.map +1 -1
  36. package/dist/kb/write-guide.d.ts +3 -2
  37. package/dist/kb/write-guide.d.ts.map +1 -1
  38. package/dist/kb/write-guide.js +3 -2
  39. package/dist/kb/write-guide.js.map +1 -1
  40. package/dist/kb/write.d.ts +2 -1
  41. package/dist/kb/write.d.ts.map +1 -1
  42. package/dist/kb/write.js +3 -1
  43. package/dist/kb/write.js.map +1 -1
  44. package/dist/server/find.d.ts.map +1 -1
  45. package/dist/server/find.js +5 -3
  46. package/dist/server/find.js.map +1 -1
  47. package/dist/server/mcp.d.ts +17 -1
  48. package/dist/server/mcp.d.ts.map +1 -1
  49. package/dist/server/mcp.js +37 -7
  50. package/dist/server/mcp.js.map +1 -1
  51. package/dist/unwire.d.ts.map +1 -1
  52. package/dist/unwire.js +5 -2
  53. package/dist/unwire.js.map +1 -1
  54. package/hooks/capture-payload.mjs +16 -10
  55. package/hooks/note-shape.d.mts +4 -2
  56. package/hooks/note-shape.mjs +43 -14
  57. package/package.json +1 -1
@@ -44,7 +44,8 @@ export const SPEC_SHAPES = [
44
44
  example: `
45
45
  {"type":"file-single","path":"src/x.py",
46
46
  "summary":"its one purpose + how (1-3 sentences)",
47
- "aliases":["symptom or search words"],
47
+ "identityAliases":["stable name/role words — this file's fixed vocabulary"],
48
+ "incidentAliases":["symptom words for what THIS write's summary describes"],
48
49
  "anchors":[{"path":"src/x.py","symbols":["TheFnYouWorkedWith"]}]}`,
49
50
  /** Prose the full (guide) rendering adds; the compact rendering drops it. */
50
51
  note: `
@@ -52,7 +53,14 @@ export const SPEC_SHAPES = [
52
53
  search kb with identifiers far more than with prose, and those land in the
53
54
  anchor channel — which holds nothing but the path unless you fill it. Name
54
55
  the symbols you actually worked with; omit only for a file that declares
55
- none (config, css, markdown).`,
56
+ none (config, css, markdown).
57
+
58
+ "identityAliases" vs "incidentAliases": identity is what stays true no
59
+ matter how many times this note gets rewritten — the file's name, its
60
+ role, terms that don't change. Incident is the symptom vocabulary for
61
+ THIS write's summary specifically — it is REPLACED, not added to, the
62
+ next time you rewrite the summary, so don't worry about it accumulating.
63
+ Leave incidentAliases out if this write isn't describing a bug/symptom.`,
56
64
  },
57
65
  {
58
66
  spec: 'file-hub',
@@ -63,7 +71,7 @@ export const SPEC_SHAPES = [
63
71
  symbols does not make a file a hub; a single-purpose file stays
64
72
  file-single):`,
65
73
  example: `
66
- {"type":"file-hub","path":"src/y.py","aliases":["search words"],
74
+ {"type":"file-hub","path":"src/y.py","identityAliases":["stable search words"],
67
75
  "facets":[{"symbol":"ClassOrFn","detail":"the non-obvious thing about THIS symbol",
68
76
  "flows":["<flow id or the flow's exact title>"]}]}`,
69
77
  note: '',
@@ -73,8 +81,9 @@ export const SPEC_SHAPES = [
73
81
  noteType: 'flow',
74
82
  headline: 'flow (product-level mechanism — see the capture checklist\'s gate):',
75
83
  example: `
76
- {"type":"flow","title":"how X happens","aliases":["other words for X"],
84
+ {"type":"flow","title":"how X happens","identityAliases":["other stable words for X"],
77
85
  "summary":"first sentence = the product-level fact the file notes miss",
86
+ "incidentAliases":["symptom words for what THIS summary describes, if any"],
78
87
  "steps":[{"path":"src/a.py","symbols":["entry"],"role":"receives the request"}],
79
88
  "invariants":["what must hold"],"verified":["src/a.py"]}`,
80
89
  note: `
@@ -107,25 +116,43 @@ export const SPEC_SHAPES = [
107
116
  // has to be made in both, in the same edit, in view of each other.
108
117
  // ---------------------------------------------------------------------------
109
118
 
110
- /** A folded note as `kb repair` sees it (subset of KbNote used by the checks). */
111
- const noteAliases = (n) => (n.aliases ?? []).filter(Boolean);
119
+ /** A folded note as `kb repair` sees it (subset of KbNote used by the checks).
120
+ * No check runs against incidentAliases omitting it is a legitimate write
121
+ * (not every write describes an incident), so there is nothing to repair. */
122
+ const noteIdentityAliases = (n) => (n.identityAliases ?? []).filter(Boolean);
112
123
 
113
124
  export const NOTE_CHECKS = [
114
125
  {
126
+ // RETIRED 2026-08-02 (shape split into identityAliases/incidentAliases —
127
+ // see 'missing-identity-aliases' below). Predicate permanently false per
128
+ // this file's own rule: never delete a shipped check id, `kb repair --json`
129
+ // consumers filter by it.
115
130
  check: 'missing-aliases',
116
131
  field: 'aliases',
132
+ noteTypes: [],
133
+ specTypes: [],
134
+ why: '',
135
+ repairHint: '',
136
+ fix: () => '',
137
+ missingInSpec: () => false,
138
+ missingInNote: () => false,
139
+ },
140
+ {
141
+ check: 'missing-identity-aliases',
142
+ field: 'identityAliases',
117
143
  /** Folded note types this applies to. */
118
144
  noteTypes: ['file', 'flow'],
119
145
  /** Spec types this applies to at write time. */
120
146
  specTypes: ['file', 'file-single', 'file-hub', 'flow'],
121
- why: '"aliases" — the words someone would SEARCH for this; without them the note is reachable only by its exact title',
147
+ why: '"identityAliases" — the stable words someone would SEARCH for this; without them the note is reachable only by its exact title',
122
148
  /** What the agent has to do about it, in `kb repair`'s worklist. */
123
149
  repairHint:
124
- 'Open the note and name 2-6 phrases someone would type when they hit this SYMPTOMS and '
125
- + 'the words in the code (identifiers, error strings), not restatements of the title.',
126
- fix: () => '"aliases":["2-5 word search keys"]',
127
- missingInSpec: (s) => !(Array.isArray(s.aliases) && s.aliases.filter(Boolean).length),
128
- missingInNote: (n) => !noteAliases(n).length,
150
+ 'Open the note and name 2-6 stable phrases someone would type to reach itthe file/flow\'s '
151
+ + 'name, role, and the words in the code (identifiers), not symptoms tied to one write and not '
152
+ + 'restatements of the title. Symptom words belong in "incidentAliases" instead.',
153
+ fix: () => '"identityAliases":["2-5 word stable search keys"]',
154
+ missingInSpec: (s) => !(Array.isArray(s.identityAliases) && s.identityAliases.filter(Boolean).length),
155
+ missingInNote: (n) => !noteIdentityAliases(n).length,
129
156
  },
130
157
  {
131
158
  // `kb write` REJECTS an absence lesson with no scope.terms, so this can only
@@ -282,6 +309,8 @@ export function requiredFieldsLine() {
282
309
  return `${s.spec}: ${fields.join(' + ')}`;
283
310
  });
284
311
  return `REQUIRED for the note to be findable at all — ${byType.join('; ')}. `
285
- + `A note missing these is written but unreachable: aliases are the only search surface besides `
286
- + `the exact title, and anchor symbols are the only channel that answers a query typed as an identifier.`;
312
+ + `A note missing these is written but unreachable: identityAliases are the only STABLE search `
313
+ + `surface besides the exact title (incidentAliases are optional symptom words for a write that `
314
+ + `describes one, replaced by the next such write, never required), and anchor symbols are the only `
315
+ + `channel that answers a query typed as an identifier.`;
287
316
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cstart/coldstart",
3
- "version": "2.2.11",
3
+ "version": "2.2.12",
4
4
  "mcpName": "io.github.AkashGoenka/coldstart",
5
5
  "publishConfig": {
6
6
  "access": "public"