@bevel-software/platform-core-backend 0.25.2 → 0.26.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.
Files changed (248) hide show
  1. package/agent-guide/access-control.md +234 -0
  2. package/agent-guide/conventions.md +27 -0
  3. package/agent-guide/directory-structure.md +145 -0
  4. package/agent-guide/finding-things.md +7 -0
  5. package/agent-guide/introduction.md +27 -0
  6. package/agent-guide/skills.md +47 -0
  7. package/agent-guide/tool-manuals.md +217 -0
  8. package/agent-guide/where-a-new-file-goes.md +36 -0
  9. package/dist/assets.d.ts +7 -0
  10. package/dist/assets.d.ts.map +1 -1
  11. package/dist/assets.js +9 -0
  12. package/dist/assets.js.map +1 -1
  13. package/dist/core/core-ports.d.ts +11 -0
  14. package/dist/core/core-ports.d.ts.map +1 -1
  15. package/dist/core/core-ports.js.map +1 -1
  16. package/dist/core/create-core-server.d.ts.map +1 -1
  17. package/dist/core/create-core-server.js +13 -2
  18. package/dist/core/create-core-server.js.map +1 -1
  19. package/dist/core/create-core-services.d.ts +9 -0
  20. package/dist/core/create-core-services.d.ts.map +1 -1
  21. package/dist/core/create-core-services.js +14 -4
  22. package/dist/core/create-core-services.js.map +1 -1
  23. package/dist/index.d.ts +1 -1
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js +2 -2
  26. package/dist/index.js.map +1 -1
  27. package/dist/modules/access/access-control.interface.d.ts +9 -0
  28. package/dist/modules/access/access-control.interface.d.ts.map +1 -1
  29. package/dist/modules/access/access-control.service.d.ts +1 -0
  30. package/dist/modules/access/access-control.service.d.ts.map +1 -1
  31. package/dist/modules/access/access-control.service.js +16 -0
  32. package/dist/modules/access/access-control.service.js.map +1 -1
  33. package/dist/modules/agent-guide/agent-guide.d.ts +139 -0
  34. package/dist/modules/agent-guide/agent-guide.d.ts.map +1 -0
  35. package/dist/modules/agent-guide/agent-guide.js +191 -0
  36. package/dist/modules/agent-guide/agent-guide.js.map +1 -0
  37. package/dist/modules/agent-guide/agent-guide.tools.d.ts +24 -0
  38. package/dist/modules/agent-guide/agent-guide.tools.d.ts.map +1 -0
  39. package/dist/modules/agent-guide/agent-guide.tools.js +100 -0
  40. package/dist/modules/agent-guide/agent-guide.tools.js.map +1 -0
  41. package/dist/modules/agent-guide/index.d.ts +4 -0
  42. package/dist/modules/agent-guide/index.d.ts.map +1 -0
  43. package/dist/modules/agent-guide/index.js +4 -0
  44. package/dist/modules/agent-guide/index.js.map +1 -0
  45. package/dist/modules/agent-instructions/agent-instructions.routes.d.ts +3 -2
  46. package/dist/modules/agent-instructions/agent-instructions.routes.d.ts.map +1 -1
  47. package/dist/modules/agent-instructions/agent-instructions.routes.js +3 -2
  48. package/dist/modules/agent-instructions/agent-instructions.routes.js.map +1 -1
  49. package/dist/modules/agent-instructions/compose.d.ts +9 -6
  50. package/dist/modules/agent-instructions/compose.d.ts.map +1 -1
  51. package/dist/modules/agent-instructions/compose.js +9 -6
  52. package/dist/modules/agent-instructions/compose.js.map +1 -1
  53. package/dist/modules/agent-instructions/index.d.ts +1 -1
  54. package/dist/modules/agent-instructions/index.d.ts.map +1 -1
  55. package/dist/modules/agent-instructions/index.js +1 -1
  56. package/dist/modules/agent-instructions/index.js.map +1 -1
  57. package/dist/modules/agent-instructions/shared-file-rules.d.ts +10 -50
  58. package/dist/modules/agent-instructions/shared-file-rules.d.ts.map +1 -1
  59. package/dist/modules/agent-instructions/shared-file-rules.js +32 -85
  60. package/dist/modules/agent-instructions/shared-file-rules.js.map +1 -1
  61. package/dist/modules/mcp/mcp.service.d.ts +29 -2
  62. package/dist/modules/mcp/mcp.service.d.ts.map +1 -1
  63. package/dist/modules/mcp/mcp.service.js +113 -16
  64. package/dist/modules/mcp/mcp.service.js.map +1 -1
  65. package/dist/modules/mcp/tool-schema-guard.d.ts +105 -0
  66. package/dist/modules/mcp/tool-schema-guard.d.ts.map +1 -0
  67. package/dist/modules/mcp/tool-schema-guard.js +171 -0
  68. package/dist/modules/mcp/tool-schema-guard.js.map +1 -0
  69. package/dist/modules/plugins/plugins.tools.d.ts +36 -2
  70. package/dist/modules/plugins/plugins.tools.d.ts.map +1 -1
  71. package/dist/modules/plugins/plugins.tools.js +71 -14
  72. package/dist/modules/plugins/plugins.tools.js.map +1 -1
  73. package/dist/modules/settings/deployment-settings.service.d.ts +0 -7
  74. package/dist/modules/settings/deployment-settings.service.d.ts.map +1 -1
  75. package/dist/modules/settings/deployment-settings.service.js +14 -53
  76. package/dist/modules/settings/deployment-settings.service.js.map +1 -1
  77. package/dist/modules/settings/setup.routes.d.ts.map +1 -1
  78. package/dist/modules/settings/setup.routes.js +3 -6
  79. package/dist/modules/settings/setup.routes.js.map +1 -1
  80. package/dist/modules/skills/skills.tools.d.ts.map +1 -1
  81. package/dist/modules/skills/skills.tools.js +58 -16
  82. package/dist/modules/skills/skills.tools.js.map +1 -1
  83. package/dist/modules/tool-manuals/tool-manuals.contract.d.ts +23 -4
  84. package/dist/modules/tool-manuals/tool-manuals.contract.d.ts.map +1 -1
  85. package/dist/modules/tool-manuals/tool-manuals.contract.js.map +1 -1
  86. package/dist/modules/tool-manuals/tool-manuals.service.d.ts +4 -0
  87. package/dist/modules/tool-manuals/tool-manuals.service.d.ts.map +1 -1
  88. package/dist/modules/tool-manuals/tool-manuals.service.js +14 -0
  89. package/dist/modules/tool-manuals/tool-manuals.service.js.map +1 -1
  90. package/dist/modules/tool-manuals/tool-manuals.tools.d.ts +7 -0
  91. package/dist/modules/tool-manuals/tool-manuals.tools.d.ts.map +1 -1
  92. package/dist/modules/tool-manuals/tool-manuals.tools.js +66 -36
  93. package/dist/modules/tool-manuals/tool-manuals.tools.js.map +1 -1
  94. package/dist/modules/tool-registry/description-length.d.ts +14 -14
  95. package/dist/modules/tool-registry/description-length.d.ts.map +1 -1
  96. package/dist/modules/tool-registry/description-length.js +24 -26
  97. package/dist/modules/tool-registry/description-length.js.map +1 -1
  98. package/dist/modules/tool-registry/guide-first.d.ts +23 -0
  99. package/dist/modules/tool-registry/guide-first.d.ts.map +1 -0
  100. package/dist/modules/tool-registry/guide-first.js +32 -0
  101. package/dist/modules/tool-registry/guide-first.js.map +1 -0
  102. package/dist/modules/tool-registry/tool-registry.d.ts +6 -0
  103. package/dist/modules/tool-registry/tool-registry.d.ts.map +1 -1
  104. package/dist/modules/tool-registry/tool-registry.js +9 -2
  105. package/dist/modules/tool-registry/tool-registry.js.map +1 -1
  106. package/dist/modules/workflow/agent-tools/change-request-read-shape.d.ts +449 -0
  107. package/dist/modules/workflow/agent-tools/change-request-read-shape.d.ts.map +1 -0
  108. package/dist/modules/workflow/agent-tools/change-request-read-shape.js +481 -0
  109. package/dist/modules/workflow/agent-tools/change-request-read-shape.js.map +1 -0
  110. package/dist/modules/workflow/agent-tools/change-request-read.tools.d.ts +73 -0
  111. package/dist/modules/workflow/agent-tools/change-request-read.tools.d.ts.map +1 -0
  112. package/dist/modules/workflow/agent-tools/change-request-read.tools.js +582 -0
  113. package/dist/modules/workflow/agent-tools/change-request-read.tools.js.map +1 -0
  114. package/dist/modules/workflow/agent-tools/change-request-summary.d.ts +12 -1
  115. package/dist/modules/workflow/agent-tools/change-request-summary.d.ts.map +1 -1
  116. package/dist/modules/workflow/agent-tools/change-request-summary.js +5 -1
  117. package/dist/modules/workflow/agent-tools/change-request-summary.js.map +1 -1
  118. package/dist/modules/workflow/agent-tools/workflow.tools.d.ts.map +1 -1
  119. package/dist/modules/workflow/agent-tools/workflow.tools.js +9 -0
  120. package/dist/modules/workflow/agent-tools/workflow.tools.js.map +1 -1
  121. package/dist/modules/workflow/git/git.service.d.ts +210 -13
  122. package/dist/modules/workflow/git/git.service.d.ts.map +1 -1
  123. package/dist/modules/workflow/git/git.service.js +456 -91
  124. package/dist/modules/workflow/git/git.service.js.map +1 -1
  125. package/dist/modules/workflow/git/merge-commit.d.ts +73 -0
  126. package/dist/modules/workflow/git/merge-commit.d.ts.map +1 -0
  127. package/dist/modules/workflow/git/merge-commit.js +89 -0
  128. package/dist/modules/workflow/git/merge-commit.js.map +1 -0
  129. package/dist/modules/workflow/git/pull-request.service.d.ts +94 -1
  130. package/dist/modules/workflow/git/pull-request.service.d.ts.map +1 -1
  131. package/dist/modules/workflow/git/pull-request.service.js +332 -37
  132. package/dist/modules/workflow/git/pull-request.service.js.map +1 -1
  133. package/dist/modules/workflow/review-workflow/review-workflow.service.d.ts +35 -0
  134. package/dist/modules/workflow/review-workflow/review-workflow.service.d.ts.map +1 -1
  135. package/dist/modules/workflow/review-workflow/review-workflow.service.js +178 -12
  136. package/dist/modules/workflow/review-workflow/review-workflow.service.js.map +1 -1
  137. package/dist/modules/workflow/workflow.routes.d.ts +6 -2
  138. package/dist/modules/workflow/workflow.routes.d.ts.map +1 -1
  139. package/dist/modules/workflow/workflow.routes.js +7 -2
  140. package/dist/modules/workflow/workflow.routes.js.map +1 -1
  141. package/dist/modules/workflow/workflow.service.d.ts +4 -0
  142. package/dist/modules/workflow/workflow.service.d.ts.map +1 -1
  143. package/dist/modules/workflow/workflow.service.js +3 -0
  144. package/dist/modules/workflow/workflow.service.js.map +1 -1
  145. package/dist/modules/workspace/startup/steps/seed-tree.d.ts.map +1 -1
  146. package/dist/modules/workspace/startup/steps/seed-tree.js +22 -27
  147. package/dist/modules/workspace/startup/steps/seed-tree.js.map +1 -1
  148. package/dist/modules/workspace/startup/steps/template-files.step.d.ts +58 -52
  149. package/dist/modules/workspace/startup/steps/template-files.step.d.ts.map +1 -1
  150. package/dist/modules/workspace/startup/steps/template-files.step.js +209 -223
  151. package/dist/modules/workspace/startup/steps/template-files.step.js.map +1 -1
  152. package/dist/modules/workspace/startup/steps/template-source.d.ts +5 -3
  153. package/dist/modules/workspace/startup/steps/template-source.d.ts.map +1 -1
  154. package/dist/modules/workspace/startup/steps/template-source.js +5 -3
  155. package/dist/modules/workspace/startup/steps/template-source.js.map +1 -1
  156. package/dist/modules/workspace/workspace.tools.d.ts +10 -1
  157. package/dist/modules/workspace/workspace.tools.d.ts.map +1 -1
  158. package/dist/modules/workspace/workspace.tools.js +211 -18
  159. package/dist/modules/workspace/workspace.tools.js.map +1 -1
  160. package/dist/shared/domain-errors.d.ts +11 -0
  161. package/dist/shared/domain-errors.d.ts.map +1 -1
  162. package/dist/shared/domain-errors.js +14 -0
  163. package/dist/shared/domain-errors.js.map +1 -1
  164. package/dist/shared/hidden-tools.d.ts +44 -0
  165. package/dist/shared/hidden-tools.d.ts.map +1 -0
  166. package/dist/shared/hidden-tools.js +13 -0
  167. package/dist/shared/hidden-tools.js.map +1 -0
  168. package/kb-template/.bevelignore +0 -5
  169. package/package.json +4 -3
  170. package/src/__tests__/kb-layout-config.test.ts +10 -100
  171. package/src/__tests__/packaged-assets-ship.test.ts +54 -0
  172. package/src/assets.ts +10 -0
  173. package/src/core/core-ports.ts +11 -0
  174. package/src/core/create-core-server.ts +13 -2
  175. package/src/core/create-core-services.ts +28 -4
  176. package/src/index.ts +2 -2
  177. package/src/modules/access/__tests__/access-control.atref-batch.test.ts +58 -0
  178. package/src/modules/access/__tests__/access-control.platform-restore.test.ts +8 -7
  179. package/src/modules/access/__tests__/access-personal-plugin.test.ts +1 -18
  180. package/src/modules/access/access-control.interface.ts +15 -0
  181. package/src/modules/access/access-control.service.ts +21 -0
  182. package/src/modules/agent-guide/__tests__/agent-guide.test.ts +328 -0
  183. package/src/modules/agent-guide/__tests__/agent-guide.tools.test.ts +189 -0
  184. package/src/modules/agent-guide/agent-guide.tools.ts +122 -0
  185. package/src/modules/agent-guide/agent-guide.ts +291 -0
  186. package/src/modules/agent-guide/index.ts +21 -0
  187. package/src/modules/agent-instructions/__tests__/shared-file-rules.test.ts +28 -121
  188. package/src/modules/agent-instructions/agent-instructions.routes.ts +3 -2
  189. package/src/modules/agent-instructions/compose.ts +9 -6
  190. package/src/modules/agent-instructions/index.ts +0 -3
  191. package/src/modules/agent-instructions/shared-file-rules.ts +31 -93
  192. package/src/modules/mcp/__tests__/fake-downstream-mcp-server.ts +14 -3
  193. package/src/modules/mcp/__tests__/mcp.e2e.test.ts +250 -0
  194. package/src/modules/mcp/__tests__/mcp.service.test.ts +31 -23
  195. package/src/modules/mcp/__tests__/tool-schema-guard.test.ts +266 -0
  196. package/src/modules/mcp/mcp.service.ts +137 -19
  197. package/src/modules/mcp/tool-schema-guard.ts +196 -0
  198. package/src/modules/plugins/__tests__/plugins.tools.test.ts +154 -4
  199. package/src/modules/plugins/plugins.tools.ts +75 -15
  200. package/src/modules/settings/__tests__/deployment-settings.service.test.ts +26 -55
  201. package/src/modules/settings/deployment-settings.service.ts +13 -54
  202. package/src/modules/settings/setup.routes.ts +3 -6
  203. package/src/modules/skills/__tests__/skills.tools.description.test.ts +91 -0
  204. package/src/modules/skills/skills.tools.ts +62 -16
  205. package/src/modules/tool-manuals/__tests__/tool-manuals.detail.route.test.ts +57 -0
  206. package/src/modules/tool-manuals/__tests__/tool-manuals.tools.test.ts +73 -4
  207. package/src/modules/tool-manuals/tool-manuals.contract.ts +24 -4
  208. package/src/modules/tool-manuals/tool-manuals.service.ts +17 -0
  209. package/src/modules/tool-manuals/tool-manuals.tools.ts +74 -36
  210. package/src/modules/tool-registry/__tests__/own-tool-schemas.test.ts +160 -0
  211. package/src/modules/tool-registry/__tests__/tool-description-length.test.ts +61 -59
  212. package/src/modules/tool-registry/description-length.ts +24 -26
  213. package/src/modules/tool-registry/guide-first.ts +34 -0
  214. package/src/modules/tool-registry/tool-registry.ts +9 -2
  215. package/src/modules/workflow/__tests__/apply-failure.test.ts +6 -1
  216. package/src/modules/workflow/agent-tools/__tests__/change-request-read-shape.test.ts +705 -0
  217. package/src/modules/workflow/agent-tools/__tests__/change-request-read.tools.test.ts +1518 -0
  218. package/src/modules/workflow/agent-tools/__tests__/workflow.tools.test.ts +23 -2
  219. package/src/modules/workflow/agent-tools/change-request-read-shape.ts +712 -0
  220. package/src/modules/workflow/agent-tools/change-request-read.tools.ts +724 -0
  221. package/src/modules/workflow/agent-tools/change-request-summary.ts +5 -1
  222. package/src/modules/workflow/agent-tools/workflow.tools.ts +8 -0
  223. package/src/modules/workflow/git/__tests__/git.service.appliedChange.test.ts +285 -0
  224. package/src/modules/workflow/git/__tests__/git.service.changedFilesForPr.test.ts +124 -0
  225. package/src/modules/workflow/git/__tests__/git.service.mergeChangeRequest.test.ts +334 -0
  226. package/src/modules/workflow/git/__tests__/pull-request.service.list-fetch.test.ts +72 -2
  227. package/src/modules/workflow/git/__tests__/pull-request.service.placeholder.test.ts +24 -2
  228. package/src/modules/workflow/git/__tests__/pull-request.service.test.ts +620 -1
  229. package/src/modules/workflow/git/git.service.ts +537 -94
  230. package/src/modules/workflow/git/merge-commit.ts +88 -0
  231. package/src/modules/workflow/git/pull-request.service.ts +380 -54
  232. package/src/modules/workflow/review-workflow/__tests__/approval-states.test.ts +7 -1
  233. package/src/modules/workflow/review-workflow/__tests__/merge-records-own-commit.test.ts +407 -0
  234. package/src/modules/workflow/review-workflow/review-workflow.service.ts +189 -11
  235. package/src/modules/workflow/workflow.routes.ts +7 -2
  236. package/src/modules/workflow/workflow.service.ts +7 -0
  237. package/src/modules/workspace/__tests__/escape-sequences.routes.test.ts +4 -3
  238. package/src/modules/workspace/__tests__/workspace.routes.move-platform-files.test.ts +21 -10
  239. package/src/modules/workspace/__tests__/workspace.tools.agents-file.test.ts +33 -55
  240. package/src/modules/workspace/__tests__/workspace.tools.test.ts +255 -22
  241. package/src/modules/workspace/startup/steps/__tests__/steps.test.ts +191 -489
  242. package/src/modules/workspace/startup/steps/seed-tree.ts +21 -27
  243. package/src/modules/workspace/startup/steps/template-files.step.ts +217 -249
  244. package/src/modules/workspace/startup/steps/template-source.ts +5 -3
  245. package/src/modules/workspace/workspace.tools.ts +226 -16
  246. package/src/shared/domain-errors.ts +15 -0
  247. package/src/shared/hidden-tools.ts +45 -0
  248. package/kb-template/AGENTS.md +0 -730
@@ -0,0 +1,449 @@
1
+ /**
2
+ * The mapping from Hexis's change-request types to the shapes the five agent
3
+ * read tools answer in.
4
+ *
5
+ * The tools are named and shaped after GitHub's pull-request API — one tool per
6
+ * GitHub endpoint, the same filters, the same paging — but they SPEAK HEXIS
7
+ * (decision by Razvan, 2026-10-02, on the review of PR #347). An agent opens a
8
+ * change request with `open_change_request` and reads it back with these five;
9
+ * answering the first in Hexis's words and the second in GitHub's would make
10
+ * one request two vocabularies. So every field these answers share with
11
+ * `open_change_request`'s summary takes that summary's name — `url`, `number`,
12
+ * `title`, `state`, `sourceBranch`, `targetBranch`, `approvals`,
13
+ * `mergeBlockedReasons`, `files[].path`, `files[].change` — and the rest follow
14
+ * the same style (camelCase, Hexis's own words for Hexis's own facts).
15
+ *
16
+ * What that changed, against GitHub, and why each is the better answer here:
17
+ *
18
+ * - **State is Hexis's own.** GitHub has two states and a `merged` flag;
19
+ * Hexis has three — `open`, `merged`, `closed` — and reports them. A merged
20
+ * request is `state: "merged"`, not `closed` with `merged: true`: the flag
21
+ * exists on GitHub only because its model has nowhere else to put the fact,
22
+ * and an agent reading `state` should not have to read a second field to
23
+ * learn whether the change landed.
24
+ * - **One name per path.** GitHub names a pull-request file's path `filename`
25
+ * and a review comment's `path`; mirroring that inconsistency was the point
26
+ * while these tools wore GitHub's names, and is now just a trap. Every path
27
+ * in every answer is `path`, and a moved file's old name is `previousPath`,
28
+ * as `open_change_request` names them.
29
+ * - **A file's kind of change** is `change` — `added` / `changed` / `deleted`
30
+ * / `moved`, from the very function `open_change_request` uses
31
+ * ({@link changeKindOf}), not git's seven-way `status`. One request, one
32
+ * spelling of what happened to a file.
33
+ * - **Approvals are per FILE**, not per review submission, because that is
34
+ * what Hexis records. A reviewer's approvals at one staleness are gathered
35
+ * into one entry naming the files, which is as close to a GitHub review as
36
+ * Hexis's model honestly gets.
37
+ * - **`stale`, not `DISMISSED`.** Hexis's word for an approval a later push
38
+ * invalidated is `isStale`; a review entry reports `stale: true` rather
39
+ * than borrowing GitHub's review state.
40
+ * - **A reply names its parent `parentId`**, which is the argument
41
+ * `post_change_request_comment` takes to create one. Reading a comment and
42
+ * replying to it use the same word for the same thing.
43
+ *
44
+ * The tools' INPUTS are untouched and stay GitHub's (`state`, `head`, `base`,
45
+ * `author`, `per_page`, `page`, `include`): the ticket pins them by name, and
46
+ * they are the one part of the surface where matching GitHub's spelling helps —
47
+ * an agent that knows GitHub's list filters can use these without reading the
48
+ * schema. Only the ANSWERS are Hexis's.
49
+ *
50
+ * Pure, and deliberately so: every judgement these tools make about what a
51
+ * caller may see is either an access lookup (which belongs to the service) or
52
+ * one of the functions below (which belongs to a test that can read it). The
53
+ * tools file does the IO and calls in here for every decision.
54
+ */
55
+ import type { ChangeRequest, ChangeRequestComment, ChangeRequestDetail, ChangeRequestState, ChangedFile, FileApproval } from '@bevel-software/platform-shared';
56
+ import { type ChangeKind } from './change-request-summary.js';
57
+ /** A person on a change request, a review or a comment. */
58
+ export interface CrUser {
59
+ /** Hexis's author login — `user-<first 12 of the email hash>`, no raw email. */
60
+ login: string;
61
+ /** Display name, when Hexis knows one. */
62
+ name?: string;
63
+ /**
64
+ * The person's address, for a comment author and an approver — the two
65
+ * places the app's own change-request surfaces already show it, and what an
66
+ * agent needs to address a reply to a reviewer. Never set on a change
67
+ * request's `author`, which carries a hash-derived login only.
68
+ */
69
+ email?: string;
70
+ }
71
+ /**
72
+ * A change request as a LIST row.
73
+ *
74
+ * `url` first, for the reason `open_change_request` puts it first: it is the
75
+ * one field an agent must be able to hand a person, so it survives a truncation
76
+ * of anything after it.
77
+ */
78
+ export interface CrSummary {
79
+ url: string;
80
+ /** Present only when `url` is relative — how to get absolute links. */
81
+ urlNote?: string;
82
+ number: number;
83
+ title: string;
84
+ /** Hexis's own three states. A merged request says so; there is no flag. */
85
+ state: ChangeRequestState;
86
+ author: CrUser;
87
+ sourceBranch: string;
88
+ targetBranch: string;
89
+ createdAt: string;
90
+ updatedAt: string;
91
+ /** How many of this request's files the CALLER may read. */
92
+ changedFiles: number;
93
+ /** How many it may not. Never named. */
94
+ withheldFiles: number;
95
+ /**
96
+ * The most recent apply attempt that did not land, while the request is
97
+ * open — as the app shows it. Its `reason` can name files, so it is the
98
+ * author's words only for a caller who may read EVERY file of a request
99
+ * that has some; otherwise the reason is the withheld line the app shows.
100
+ */
101
+ lastApplyFailure?: {
102
+ reason: string;
103
+ conflicts: boolean;
104
+ at: string;
105
+ };
106
+ }
107
+ /** What the app says in place of an apply-failure reason the caller may not read. */
108
+ export declare const APPLY_FAILURE_REASON_WITHHELD = "The reason names files you do not have access to read.";
109
+ /** A change request read by number: the row, its description, and the gate. */
110
+ export interface CrDetail extends CrSummary {
111
+ body: string;
112
+ /** The source tip the answer describes. Absent when no ref could be resolved. */
113
+ headSha?: string;
114
+ /** The target tip it is read against. Absent when no ref could be resolved. */
115
+ baseSha?: string;
116
+ /**
117
+ * Whether Hexis's merge gate would let this be applied — which, unlike
118
+ * GitHub's `mergeable`, also waits on the per-file approvals. Kept beside the
119
+ * blockers because a filtered `mergeBlockedReasons` can be empty while the
120
+ * gate is still shut: see {@link visibleBlockers}.
121
+ */
122
+ mergeable: boolean;
123
+ /**
124
+ * Why it cannot be applied yet, in the gate's own words — the detail's list,
125
+ * minus any line naming a file the caller may not read.
126
+ */
127
+ mergeBlockedReasons: string[];
128
+ /** How many blockers were withheld because they name a withheld file. */
129
+ withheldMergeBlockedReasons: number;
130
+ /** What this caller, specifically, may do with the request. */
131
+ viewer: CrViewer;
132
+ }
133
+ /** What the caller may do — Hexis's own facts, under Hexis's own names. */
134
+ export interface CrViewer {
135
+ /** Whether the caller may approve at least one file they are shown. */
136
+ mayApprove: boolean;
137
+ /** Whether the caller's Apply would be accepted right now. */
138
+ mayMerge: boolean;
139
+ /** Whether the caller opened this request (their agent counts as them). */
140
+ isAuthor: boolean;
141
+ }
142
+ export interface CrFile {
143
+ path: string;
144
+ /** Where a `moved` file came from. */
145
+ previousPath?: string;
146
+ /** `added` | `changed` | `deleted` | `moved` — `open_change_request`'s four. */
147
+ change: ChangeKind;
148
+ additions: number;
149
+ deletions: number;
150
+ /** Unified diff. Only on `include: ["patches"]`, and absent for binaries. */
151
+ patch?: string;
152
+ isBinary: boolean;
153
+ /** Who must approve this file for the request to be applied. */
154
+ requiredApprovers: {
155
+ roles: string[];
156
+ users: CrUser[];
157
+ };
158
+ /**
159
+ * Present when the approver set could not be resolved — then an empty
160
+ * `requiredApprovers` means "not known", NOT "nobody has to approve". Same
161
+ * name and same fail-closed reading as `open_change_request`'s.
162
+ */
163
+ approversUnknown?: true;
164
+ /** Who has approved this file, and when. */
165
+ approvedBy: CrFileApproval[];
166
+ /** Whether a current approval by an eligible approver stands. */
167
+ approved: boolean;
168
+ /** Whether the merge gate waits on this file at all. */
169
+ inMergeGate: boolean;
170
+ /** Whether the caller may approve this file. */
171
+ viewerMayApprove: boolean;
172
+ }
173
+ export interface CrFileApproval {
174
+ user: CrUser;
175
+ approvedAt: string;
176
+ /** True when the approval was given against a head that has since moved. */
177
+ stale: boolean;
178
+ /** True when the approver is the request's own author. */
179
+ selfApproval: boolean;
180
+ }
181
+ export interface CrReview {
182
+ /** Stable within the request: the reviewer, and whether their approvals stand. */
183
+ id: string;
184
+ reviewer: CrUser;
185
+ /** True once a later push invalidated the approvals gathered here. */
186
+ stale: boolean;
187
+ /** The most recent of the approvals gathered into this entry. */
188
+ submittedAt: string;
189
+ /** The files this reviewer approved — the readable ones. */
190
+ files: string[];
191
+ /** How many further files of this review the caller may not read. */
192
+ withheldFiles: number;
193
+ }
194
+ export interface CrComment {
195
+ id: string;
196
+ author: CrUser;
197
+ body: string;
198
+ /** Set on a file-level or inline comment. */
199
+ path?: string;
200
+ /** Set on an inline comment. */
201
+ line?: number;
202
+ /**
203
+ * The comment this one replies to — the same `parentId`
204
+ * `post_change_request_comment` takes to post the reply.
205
+ */
206
+ parentId?: string;
207
+ /** The head the comment was anchored to. */
208
+ headSha: string;
209
+ createdAt: string;
210
+ /** Present once edited. */
211
+ updatedAt?: string;
212
+ }
213
+ /** One page of a list, and whether there is another. */
214
+ export interface CrPage<T> {
215
+ items: T[];
216
+ totalCount: number;
217
+ page: number;
218
+ perPage: number;
219
+ hasNextPage: boolean;
220
+ }
221
+ export declare const PER_PAGE_DEFAULT = 30;
222
+ export declare const PER_PAGE_MAX = 100;
223
+ /**
224
+ * GitHub's `per_page` (default 30, at most 100) and `page` (from 1), read off
225
+ * whatever the caller sent. A value out of range is clamped rather than
226
+ * refused, because a tool call that asks for 500 wants as many as it can have.
227
+ */
228
+ export declare function pagingOf(args: {
229
+ per_page?: unknown;
230
+ page?: unknown;
231
+ }): {
232
+ perPage: number;
233
+ page: number;
234
+ };
235
+ /**
236
+ * One page out of an already-filtered list. Paging runs AFTER the access
237
+ * filter, always: a page sliced before it would say by its own short length
238
+ * how many entries were withheld, which is the count's job to say and nobody
239
+ * else's.
240
+ */
241
+ export declare function pageOf<T>(all: T[], perPage: number, page: number): CrPage<T>;
242
+ /**
243
+ * The Hexis states the `state` FILTER selects. The filter keeps GitHub's three
244
+ * words because the ticket names them, and `closed` there means "not open" —
245
+ * which over Hexis's states is `closed` (declined) and `merged` alike. The
246
+ * ANSWER still reports which of the two a request is.
247
+ */
248
+ export declare function statesFor(filter: 'open' | 'closed' | 'all'): ChangeRequestState[];
249
+ /** The request's author: a hash-derived login, never an email. */
250
+ export declare function crAuthor(cr: Pick<ChangeRequest, 'author' | 'appAuthor'>): CrUser;
251
+ /**
252
+ * Whether `needle` names this request's author — an email (compared as the
253
+ * author hash, since the request stores no raw address) or a login. Mirrors
254
+ * `listPrsAuthoredBy`, so the tool's `author` filter and the app's "mine" list
255
+ * agree on who wrote what.
256
+ */
257
+ export declare function matchesAuthor(cr: Pick<ChangeRequest, 'author' | 'authorId'>, needle: string): boolean;
258
+ /** Whether `viewerEmail` opened this request. */
259
+ export declare function isAuthor(cr: Pick<ChangeRequest, 'authorId'>, viewerEmail: string | undefined): boolean;
260
+ /**
261
+ * Whether the caller may SEE a change request at all.
262
+ *
263
+ * Readable files, or authorship. Nothing else: a request every file of which
264
+ * is closed to the caller tells them, by existing, that somebody proposed a
265
+ * change to something they may not look at, and requirement 7 answers that
266
+ * with a 404 rather than an empty shell.
267
+ *
268
+ * A request with NO files resolved is not visible to a non-author either, and
269
+ * that is deliberate rather than an oversight: an empty file set is what both a
270
+ * request that genuinely changes nothing and a request whose diff could not be
271
+ * computed look like, and the two are indistinguishable from here. So an empty
272
+ * set proves no read access — the same rule `scopeApplyFailures` applies to the
273
+ * same question on the same lists.
274
+ *
275
+ * Since the 2026-10-02 decision this is a far smaller class than it was: a
276
+ * MERGED request's files are recovered from its merge commit, so being applied
277
+ * no longer hides a request from everyone but its author. What is left is a
278
+ * DECLINED request (no merge commit was ever written, and its branch is gone)
279
+ * and a clone that cannot resolve the commit at all.
280
+ */
281
+ export declare function maySeeChangeRequest(input: {
282
+ readableFiles: number;
283
+ isAuthor: boolean;
284
+ }): boolean;
285
+ /** A list row. `readable` / `withheld` come from the access filter. */
286
+ export declare function toCrSummary(cr: ChangeRequest, counts: {
287
+ readable: number;
288
+ withheld: number;
289
+ }): CrSummary;
290
+ /** A detail: the row, the author's description, and the gate as this caller sees it. */
291
+ export declare function toCrDetail(detail: ChangeRequestDetail, counts: {
292
+ readable: number;
293
+ withheld: number;
294
+ }, blockers: {
295
+ visible: string[];
296
+ withheld: number;
297
+ }, viewer: CrViewer): CrDetail;
298
+ /**
299
+ * The part of a change-request body its AUTHOR wrote.
300
+ *
301
+ * A Hexis body is part human and part machine: `openChangeRequest` appends an
302
+ * `## Affected owners` block — one line per changed path, naming that path and
303
+ * its eligible approvers — to whatever the author typed. Returning the body
304
+ * verbatim NAMED every file of the request, including the ones this caller may
305
+ * not read: Local Testing caught a GTM-team reader being handed
306
+ * `- \`KnowledgeBase/Engineering/…\` — Admin` out of a request whose file list
307
+ * had correctly withheld that very path.
308
+ *
309
+ * So the generated block goes, and NOTHING ELSE does. The first cut at this
310
+ * copied the app's dialog, which drops everything from the first `##` heading
311
+ * on; Razvan's review (2026-10-02) asked for the narrower cut, because an
312
+ * author who writes their description in sections loses it from that heading
313
+ * onwards and is never told. The generated block is appended LAST and begins
314
+ * with a line that is exactly `## Affected owners`, so cutting at the LAST such
315
+ * line removes the machinery and keeps every heading a person wrote. (An author
316
+ * who writes that exact heading themselves loses their text from there — the
317
+ * safe direction, and the only way this can err.)
318
+ *
319
+ * Hexis's OWN hidden markers go too — the `<!--hexis:…-->` / `<!--bevel:…-->`
320
+ * comments older bodies carry identity in — and no other comment: an HTML
321
+ * comment the author wrote is the author's prose, like the rest.
322
+ *
323
+ * Who must approve each file is NOT lost by this — it is what
324
+ * `list_change_request_files` answers under `requiredApprovers`, per file and
325
+ * access-filtered, which is where a caller should read it from anyway.
326
+ *
327
+ * Two things this deliberately does not do. It does not vary by caller: one
328
+ * body for everyone is a body nobody has to reason about. And it does not touch
329
+ * the author's own prose, which may mention any path they chose to write about —
330
+ * that is a person's sentence, shown to every viewer in the app, not Hexis
331
+ * naming a file it was asked to withhold.
332
+ */
333
+ export declare function authorsDescription(body: string): string;
334
+ /**
335
+ * What this caller may do with the request.
336
+ *
337
+ * `mayMerge` reproduces what `mergePr` would accept, from the detail's own
338
+ * published fields: no hard block, and either nothing missing or an admin who
339
+ * may bypass what is. Deriving it here rather than asking a second time keeps
340
+ * the answer and the enforcement reading the same gate.
341
+ *
342
+ * `mayApprove` answers over `shownApprovals` — the approvals of the files this
343
+ * caller is SHOWN — and not over the request's whole approval set, which is why
344
+ * the set is passed in rather than read off `detail`. The two differ:
345
+ * `viewerCanApprove` is a WRITE grant at `origin/<base>`, and a write grant can
346
+ * hold for a file whose read verdict withholds it. Answering true off such a
347
+ * file would both contradict the contract ("at least one file they are shown")
348
+ * and tell the caller something about a file they were refused.
349
+ */
350
+ export declare function toCrViewer(detail: Pick<ChangeRequestDetail, 'state' | 'mergeBlockedReasons' | 'mergeWarnings' | 'viewerCanBypassMerge'>, viewerIsAuthor: boolean, shownApprovals: Pick<FileApproval, 'viewerCanApprove'>[]): CrViewer;
351
+ /**
352
+ * The merge blockers the caller may read.
353
+ *
354
+ * A gate warning quotes the path it waits on (`Waiting on approval for
355
+ * X from …`), so a blocker about a withheld file would name that file. Each
356
+ * blocker mentioning any withheld path is dropped and counted. Matching on the
357
+ * text rather than rebuilding the gate's sentences is deliberate: the gate owns
358
+ * its wording, and the only way this can err is by withholding a line that
359
+ * contains a withheld path as a substring — which is the safe direction.
360
+ */
361
+ export declare function visibleBlockers(reasons: string[], withheldPaths: string[]): {
362
+ visible: string[];
363
+ withheld: number;
364
+ };
365
+ /**
366
+ * Whether the caller may read a changed file AT ALL.
367
+ *
368
+ * Both of its names must be readable. A moved file carries its old path in
369
+ * `previousPath`, and the diff of a move shows the content that was at that
370
+ * old path — so a file moved OUT of a folder the caller may not read is not
371
+ * readable here either, however open its new home is, and `previousPath` can
372
+ * never name a path they were refused. Fail-closed in the one direction that
373
+ * matters: a file with nowhere to hide is listed, a file with a hidden side is
374
+ * withheld and counted.
375
+ */
376
+ export declare function fileIsReadable(file: Pick<ChangedFile, 'path' | 'previousPath'>, mayRead: (path: string) => boolean): boolean;
377
+ /** Every path a changed file names — both sides of a move. */
378
+ export declare function pathsOf(file: Pick<ChangedFile, 'path' | 'previousPath'>): string[];
379
+ /** A changed file plus its approval state. */
380
+ export declare function toCrFile(file: ChangedFile, approval: FileApproval | undefined,
381
+ /** `open`: whether the request still is — an approval can be given on an open request only. */
382
+ opts: {
383
+ patches: boolean;
384
+ open: boolean;
385
+ }): CrFile;
386
+ /** The same hash-derived login the change-request summaries carry. */
387
+ export declare function loginFor(email: string): string;
388
+ /**
389
+ * The reviews of a change request, gathered out of its per-file approvals.
390
+ *
391
+ * Hexis records an approval per FILE; a review list wants one entry per review.
392
+ * One entry per (reviewer, staleness) is the closest honest join: it names the
393
+ * reviewer once and the files they approved, which is what the ticket's
394
+ * scenario asks to read back. A reviewer holding both a current and a stale
395
+ * approval appears twice — one entry for the files that still stand and one
396
+ * with `stale: true` for the ones the latest push invalidated.
397
+ *
398
+ * `mayShow` decides, per file, what this caller may be told. A review keeps the
399
+ * files they may read and counts the rest in its own `withheldFiles`; a review
400
+ * EVERY file of which is withheld is dropped and counted in `withheldReviews`,
401
+ * because naming the reviewer would itself say that somebody approved a change
402
+ * to something the caller may not look at. `submittedAt` is taken from the
403
+ * readable approvals alone, for the same reason.
404
+ *
405
+ * Hexis records nothing about who DECLINED a request — a rejection closes it
406
+ * and stores no reviewer — so no review entry can report one. A reviewer's
407
+ * objection lives in a comment, which `list_change_request_comments` returns.
408
+ */
409
+ export declare function toCrReviews(approvals: FileApproval[], mayShow?: (path: string) => boolean): {
410
+ reviews: CrReview[];
411
+ withheldReviews: number;
412
+ };
413
+ /** A comment. Covers the file-anchored and the general ones — Hexis has one table. */
414
+ export declare function toCrComment(comment: ChangeRequestComment): CrComment;
415
+ /**
416
+ * The comments the caller may read, replies included in the answer only when
417
+ * the comment they reply to is.
418
+ *
419
+ * A comment with no path is about the request as a whole, and a comment with
420
+ * one is as readable as that path is NAMEABLE here (`mayShow`, so a comment
421
+ * anchored to the new name of a file withheld for its old one goes with the
422
+ * file rather than announcing it). A REPLY is neither, quite: it carries no
423
+ * path of its own when it was posted without one, so judged on itself it is a
424
+ * general comment — and `post_change_request_comment` takes `parentId` without
425
+ * requiring `path`, so a reply to a comment on a withheld file was returned
426
+ * with its body and a `parentId` naming a comment the caller cannot see.
427
+ * Razvan's review (2026-10-02) asked for the rule the ticket states: a reply is
428
+ * shown only when its parent is.
429
+ *
430
+ * So a comment is visible when its OWN path may be shown (if it has one) AND
431
+ * its parent is visible, all the way up the chain. Both halves are needed:
432
+ * inheriting only would show a reply naming a withheld file under a readable
433
+ * parent, and checking only its own path would show it under a withheld one.
434
+ *
435
+ * Fail-closed at the edges. A `parentId` naming a comment that is not in this
436
+ * request's list (deleted, or from somewhere this answer cannot see) is not
437
+ * provably pathless, so the reply goes. A cycle — which the schema does not
438
+ * permit and a corrupted row could still hold — is unresolvable, so it goes
439
+ * too. Both are counted in the withheld total, never named.
440
+ */
441
+ export declare function visibleComments<T extends {
442
+ id: string;
443
+ path?: string;
444
+ parentId?: string;
445
+ }>(comments: T[], mayShow: (path: string) => boolean): {
446
+ visible: T[];
447
+ withheld: number;
448
+ };
449
+ //# sourceMappingURL=change-request-read-shape.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"change-request-read-shape.d.ts","sourceRoot":"","sources":["../../../../src/modules/workflow/agent-tools/change-request-read-shape.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AAEH,OAAO,KAAK,EACV,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACX,YAAY,EACb,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAE5E,2DAA2D;AAC3D,MAAM,WAAW,MAAM;IACrB,gFAAgF;IAChF,KAAK,EAAE,MAAM,CAAC;IACd,0CAA0C;IAC1C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,uEAAuE;IACvE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,4EAA4E;IAC5E,KAAK,EAAE,kBAAkB,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,4DAA4D;IAC5D,YAAY,EAAE,MAAM,CAAC;IACrB,wCAAwC;IACxC,aAAa,EAAE,MAAM,CAAC;IACtB;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,OAAO,CAAC;QAA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