@ddtcorex/dsh-maestro-review 0.12.0 → 0.14.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 (162) hide show
  1. package/README.md +31 -58
  2. package/cordis.patch.yml +23 -18
  3. package/lib/config-store.d.ts +9 -1
  4. package/lib/config-store.d.ts.map +1 -1
  5. package/lib/config-store.js +1 -1
  6. package/lib/config-store.js.map +1 -1
  7. package/lib/events.d.ts +5 -45
  8. package/lib/events.d.ts.map +1 -1
  9. package/lib/host-orchestrator.d.ts +128 -0
  10. package/lib/host-orchestrator.d.ts.map +1 -0
  11. package/lib/host-orchestrator.js +408 -0
  12. package/lib/host-orchestrator.js.map +1 -0
  13. package/lib/index.d.ts +7 -2
  14. package/lib/index.d.ts.map +1 -1
  15. package/lib/index.js +7 -43
  16. package/lib/index.js.map +1 -1
  17. package/lib/review-intake.d.ts +1 -1
  18. package/lib/review-intake.d.ts.map +1 -1
  19. package/lib/settings-rpc.js +1 -1
  20. package/lib/settings-rpc.js.map +1 -1
  21. package/package.json +19 -36
  22. package/src/client/index.tsx +1 -1
  23. package/src/host/augment.d.ts +3 -1
  24. package/src/host/config-store.ts +2 -2
  25. package/src/host/events.ts +5 -45
  26. package/src/host/host-orchestrator.ts +461 -0
  27. package/src/host/index.ts +7 -35
  28. package/src/host/providers/gitlab.ts +1 -1
  29. package/src/host/review-intake.ts +1 -1
  30. package/src/host/settings-rpc.ts +1 -1
  31. package/lib/ci-clone.d.ts +0 -21
  32. package/lib/ci-clone.d.ts.map +0 -1
  33. package/lib/ci-clone.js +0 -35
  34. package/lib/ci-clone.js.map +0 -1
  35. package/lib/ci-coexist.d.ts +0 -11
  36. package/lib/ci-coexist.d.ts.map +0 -1
  37. package/lib/ci-coexist.js +0 -38
  38. package/lib/ci-coexist.js.map +0 -1
  39. package/lib/gitlab-auth.d.ts +0 -11
  40. package/lib/gitlab-auth.d.ts.map +0 -1
  41. package/lib/gitlab-auth.js +0 -15
  42. package/lib/gitlab-auth.js.map +0 -1
  43. package/lib/gitlab-client.d.ts +0 -78
  44. package/lib/gitlab-client.d.ts.map +0 -1
  45. package/lib/gitlab-client.js +0 -270
  46. package/lib/gitlab-client.js.map +0 -1
  47. package/lib/govard-lint-detection.d.ts +0 -20
  48. package/lib/govard-lint-detection.d.ts.map +0 -1
  49. package/lib/govard-lint-detection.js +0 -48
  50. package/lib/govard-lint-detection.js.map +0 -1
  51. package/lib/hyva-csp-scan-tool.d.ts +0 -11
  52. package/lib/hyva-csp-scan-tool.d.ts.map +0 -1
  53. package/lib/hyva-csp-scan-tool.js +0 -193
  54. package/lib/hyva-csp-scan-tool.js.map +0 -1
  55. package/lib/hyva-theme-inspect-tool.d.ts +0 -10
  56. package/lib/hyva-theme-inspect-tool.d.ts.map +0 -1
  57. package/lib/hyva-theme-inspect-tool.js +0 -299
  58. package/lib/hyva-theme-inspect-tool.js.map +0 -1
  59. package/lib/incremental.d.ts +0 -28
  60. package/lib/incremental.d.ts.map +0 -1
  61. package/lib/incremental.js +0 -62
  62. package/lib/incremental.js.map +0 -1
  63. package/lib/layout-xml-tool.d.ts +0 -11
  64. package/lib/layout-xml-tool.d.ts.map +0 -1
  65. package/lib/layout-xml-tool.js +0 -239
  66. package/lib/layout-xml-tool.js.map +0 -1
  67. package/lib/module-check-tool.d.ts +0 -11
  68. package/lib/module-check-tool.d.ts.map +0 -1
  69. package/lib/module-check-tool.js +0 -303
  70. package/lib/module-check-tool.js.map +0 -1
  71. package/lib/orchestrator.d.ts +0 -357
  72. package/lib/orchestrator.d.ts.map +0 -1
  73. package/lib/orchestrator.js +0 -1497
  74. package/lib/orchestrator.js.map +0 -1
  75. package/lib/perf-log-stats-tool.d.ts +0 -13
  76. package/lib/perf-log-stats-tool.d.ts.map +0 -1
  77. package/lib/perf-log-stats-tool.js +0 -245
  78. package/lib/perf-log-stats-tool.js.map +0 -1
  79. package/lib/phtml-escape-scan-tool.d.ts +0 -11
  80. package/lib/phtml-escape-scan-tool.d.ts.map +0 -1
  81. package/lib/phtml-escape-scan-tool.js +0 -166
  82. package/lib/phtml-escape-scan-tool.js.map +0 -1
  83. package/lib/providers/ci-trigger.d.ts +0 -44
  84. package/lib/providers/ci-trigger.d.ts.map +0 -1
  85. package/lib/providers/ci-trigger.js +0 -150
  86. package/lib/providers/ci-trigger.js.map +0 -1
  87. package/lib/review-findings-tool.d.ts +0 -20
  88. package/lib/review-findings-tool.d.ts.map +0 -1
  89. package/lib/review-findings-tool.js +0 -39
  90. package/lib/review-findings-tool.js.map +0 -1
  91. package/lib/review-history.d.ts +0 -40
  92. package/lib/review-history.d.ts.map +0 -1
  93. package/lib/review-history.js +0 -136
  94. package/lib/review-history.js.map +0 -1
  95. package/lib/review-marker.d.ts +0 -17
  96. package/lib/review-marker.d.ts.map +0 -1
  97. package/lib/review-marker.js +0 -23
  98. package/lib/review-marker.js.map +0 -1
  99. package/lib/review-signals.d.ts +0 -17
  100. package/lib/review-signals.d.ts.map +0 -1
  101. package/lib/review-signals.js +0 -79
  102. package/lib/review-signals.js.map +0 -1
  103. package/lib/scope-split-tool.d.ts +0 -42
  104. package/lib/scope-split-tool.d.ts.map +0 -1
  105. package/lib/scope-split-tool.js +0 -108
  106. package/lib/scope-split-tool.js.map +0 -1
  107. package/lib/search-tool.d.ts +0 -15
  108. package/lib/search-tool.d.ts.map +0 -1
  109. package/lib/search-tool.js +0 -144
  110. package/lib/search-tool.js.map +0 -1
  111. package/lib/skill-provider.d.ts +0 -19
  112. package/lib/skill-provider.d.ts.map +0 -1
  113. package/lib/skill-provider.js +0 -101
  114. package/lib/skill-provider.js.map +0 -1
  115. package/lib/skills-tool.d.ts +0 -29
  116. package/lib/skills-tool.d.ts.map +0 -1
  117. package/lib/skills-tool.js +0 -185
  118. package/lib/skills-tool.js.map +0 -1
  119. package/lib/source.d.ts +0 -23
  120. package/lib/source.d.ts.map +0 -1
  121. package/lib/source.js +0 -16
  122. package/lib/source.js.map +0 -1
  123. package/lib/tool-policy.d.ts +0 -20
  124. package/lib/tool-policy.d.ts.map +0 -1
  125. package/lib/tool-policy.js +0 -42
  126. package/lib/tool-policy.js.map +0 -1
  127. package/presets/maestro-auditor.patch.yml +0 -54
  128. package/presets/maestro-coder/agent.cordis.yml +0 -223
  129. package/presets/maestro-coder/preset.yml +0 -2
  130. package/presets/maestro-reviewer.patch.yml +0 -55
  131. package/profiles/reviewer-ci/cordis.patch.yml +0 -78
  132. package/profiles/reviewer-ci/package.json +0 -19
  133. package/profiles/reviewer-ci/pnpm-lock.yaml +0 -8207
  134. package/profiles/reviewer-ci/pnpm-workspace.yaml +0 -36
  135. package/skills/dsh-native-tools/SKILL.md +0 -80
  136. package/src/host/ci-clone.ts +0 -54
  137. package/src/host/ci-coexist.ts +0 -45
  138. package/src/host/dsh-skill.d.ts +0 -72
  139. package/src/host/gitlab-auth.ts +0 -13
  140. package/src/host/gitlab-client.ts +0 -332
  141. package/src/host/govard-lint-detection.ts +0 -47
  142. package/src/host/hyva-csp-scan-tool.ts +0 -165
  143. package/src/host/hyva-theme-inspect-tool.ts +0 -258
  144. package/src/host/incremental.ts +0 -86
  145. package/src/host/layout-xml-tool.ts +0 -190
  146. package/src/host/module-check-tool.ts +0 -187
  147. package/src/host/orchestrator.ts +0 -1641
  148. package/src/host/perf-log-stats-tool.ts +0 -224
  149. package/src/host/phtml-escape-scan-tool.ts +0 -112
  150. package/src/host/providers/ci-trigger.ts +0 -168
  151. package/src/host/review-findings-tool.ts +0 -59
  152. package/src/host/review-history.ts +0 -168
  153. package/src/host/review-marker.ts +0 -25
  154. package/src/host/review-signals.ts +0 -83
  155. package/src/host/scope-split-tool.ts +0 -109
  156. package/src/host/search-tool.ts +0 -152
  157. package/src/host/skill-provider.ts +0 -94
  158. package/src/host/skills-tool.ts +0 -218
  159. package/src/host/source.ts +0 -26
  160. package/src/host/tool-policy.ts +0 -49
  161. package/templates/reviewer-project.gitlab-ci.yml +0 -93
  162. package/templates/source-project.gitlab-ci.yml +0 -48
package/README.md CHANGED
@@ -1,78 +1,51 @@
1
1
  # @ddtcorex/dsh-maestro-review
2
2
 
3
- Automated merge-request review for the [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness):
4
- a GitLab merge-request pipeline, an orchestrator that spins up reviewer/auditor
5
- child agents on fresh worktrees, webhook intake for GitLab events, and a settings/tunnel
6
- client UI injected into the DSH Web slots.
7
-
8
- Part of the Maestro Harness suite (`dsh-maestro-*`). Cordis patch rows:
9
- `maestro-review-host` (package root, bundled skills), `maestro-review-webhook` (intake),
10
- `maestro-review-orchestrator` (pipeline), `maestro-review-settings-rpc` (settings UI),
11
- all served by this npm package.
3
+ Maestro Review on a [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)
4
+ (DSH) web host: GitLab webhook intake, project mappings with local worktrees,
5
+ the Maestro Review Settings section and Telegram review digests. Every review
6
+ runs through the engine of [`@ddtcorex/maestro-reviewer`](https://github.com/ddtcorex/maestro-reviewer),
7
+ which also carries the GitLab CI flow.
12
8
 
13
9
  ## What it provides
14
10
 
15
- - **GitLab pipeline**: webhook and CI intake, MR diff/thread tools and finding posting for GitLab.
16
- - **Orchestrator** — reviewer + auditor agent runs against a disposable worktree of the MR,
17
- model selection overridable globally (`reviewModel`) and per project mapping.
18
- - **Webhook intake** — receives GitLab MR events, enqueues reviews (dedup + retention).
19
- - **Review findings/history/signals**: findings written through the `report_review_findings`
20
- tool by tool-only review subagents (never free text); history + signals tracked per MR.
21
- - **Review tools** (workspace search, Magento/Hyva scans, query-log stats, GitLab diff tools) mounted into review runs.
22
- - **Client half** — settings section rendered into DSH Web slots; notification copy stays
23
- here, delivery goes through the optional `maestroNotifier` service.
24
-
25
- ## CI reviewer (no local checkout)
26
-
27
- The same pipeline also runs headless from GitLab CI: a shared reviewer
28
- project (holds secrets + image) serves any number of source projects through
29
- a small bridge job — no DSH host, no project mapping needed. Quick runs
30
- diff-only (or on a real checkout when `REVIEW_PROFILE` is set — reviewer-only,
31
- no auditor); on-demand deep clones the MR head and reviews reviewer-only with
32
- a static-only audit (no govard runtime in the container).
33
-
34
- Full setup, per-case trigger workflows (quick/deep × CI/webhook), model
35
- selection, and troubleshooting: [`docs/ci-reviewer-setup.md`](docs/ci-reviewer-setup.md).
36
- Templates live in `templates/`, the image in `docker/`.
37
-
38
- ## Settings
39
-
40
- Reads its configuration through the **shared namespaced settings store**
41
- (`~/.dsh/dsh-maestro-config/settings.json`) via the flat adapter in
42
- `src/host/config-store.ts`, over the embedded store copy `src/host/vendor/store.ts`
43
- (generated from `dsh-maestro-core`, no runtime dependency); machine runtime state stays in a
44
- package-local sidecar.
11
+ - **Webhook intake** (row `maestro-review-webhook`): `/hooks/gitlab-mr` on the
12
+ raw DSH webserver, authenticated by `X-Gitlab-Token`. An `@<bot>` mention
13
+ asks for a quick review, `/maestro deep` or "deep review" for a deep one;
14
+ reviewer assignment and pushes trigger reviews when enabled.
15
+ - **Host orchestrator** (row `maestro-review-host-orchestrator`): reads the
16
+ settings, applies the trigger gates, prunes history, and calls the engine's
17
+ `reviewEngine` service. A mapped project is reviewed on a worktree of its
18
+ local checkout (vendor and `app/etc/env.php` linked, a per-MR govard
19
+ environment for the deep auditor, torn down afterwards); a missing branch
20
+ falls back to a diff-only review. An unmapped project gets a diff-only
21
+ review on mention and a "Not started" note for deep.
22
+ - **Settings** (row `maestro-review-settings-rpc`, channel
23
+ `/dsh-maestro-review`, Settings section `maestro-review`): GitLab URL,
24
+ token, bot username, webhook secret, project mappings, trigger defaults,
25
+ review model, agent timeout and history retention, stored in the shared
26
+ Maestro settings store.
27
+ - **Telegram digest**: one message per finished review when enabled, through
28
+ the optional `maestroNotifier` service of `@ddtcorex/dsh-maestro-notifier`.
45
29
 
46
30
  ## Install
47
31
 
48
32
  ```sh
49
- dsh plugin --profile web add @ddtcorex/dsh-maestro-review
33
+ dsh plugin --profile web add @ddtcorex/maestro-reviewer @ddtcorex/dsh-maestro-review
50
34
  ```
51
35
 
36
+ Both packages are needed: the engine rows (`maestro-review-host`,
37
+ `maestro-review-engine`) come from `@ddtcorex/maestro-reviewer`.
38
+
52
39
  ## Development
53
40
 
54
41
  ```sh
42
+ pnpm --dir ../../maestro-reviewer build # the engine's lib/ first
55
43
  pnpm install
56
- pnpm verify # tsc --noEmit
57
- pnpm test # vitest run
58
- pnpm build # tsc -> lib/, plus the browser bundle lib/client.js
44
+ pnpm verify
45
+ pnpm build # host lib/ plus the client bundle lib/client.js
46
+ pnpm test
59
47
  ```
60
48
 
61
- See AGENTS.md for conventions (host/client split, secrets handling, live-validation rules).
62
-
63
- ## Release
64
-
65
- A release ships **two artifacts that must stay in lockstep**: the npm
66
- package and the `ddtcorex/maestro-reviewer` Docker image — the image
67
- installs the npm package from the registry rather than copying source, so
68
- tagging a release alone is not enough to ship it to CI users. In short:
69
- bump `package.json` + `CHANGELOG.md` + the three image-tag references →
70
- tag `vX.Y.Z` (triggers npm publish + GitHub Release) → bump
71
- `profiles/reviewer-ci/package.json`'s own pin to match → rebuild and push
72
- the Docker image. Full step-by-step checklist, including the pnpm
73
- supply-chain age-gate workaround and how to live-test a fix in the image
74
- before a full release: see **Release checklist** in [`AGENTS.md`](AGENTS.md).
75
-
76
49
  ## License
77
50
 
78
51
  MIT
package/cordis.patch.yml CHANGED
@@ -1,27 +1,23 @@
1
- # dsh-maestro-review bundle patch: 4 rows, maestro-review-host, maestro-review-webhook,
2
- # maestro-review-orchestrator, maestro-review-settings-rpc
1
+ # dsh-maestro-review bundle patch: the DSH host rows of Maestro Review. The
2
+ # engine rows (maestro-review-host, maestro-review-engine) come from the
3
+ # @ddtcorex/maestro-reviewer bundle, which the profile lists too.
3
4
  # RPC channel: /dsh-maestro-review (see src/host/settings-rpc.ts)
4
5
  - insert:
5
- # Mounts the package root (lib/index.js -> apply()). Required: `dsh plugin add`
6
- # applies ONLY the rows in this file, so without it the skill-provider
7
- # registration inside apply() never runs and the bundled dsh-native-tools
8
- # skill is silently absent. `skills` is the only service apply() reads, and
9
- # it is declared rather than softly read so the provider registers after the
10
- # skills service exists — a headless/CI profile has no web `connection`, and
11
- # declaring that unused service left this row pending forever (boot failed
12
- # with "1 entry did not activate ... waiting for service: connection"):
13
- # apply() never touches it, and the settings RPC that does lives in its own
14
- # row (maestro-review-settings-rpc), which such a profile disables.
15
- - id: maestro-review-host
6
+ # The package root. DSH serves a package's dsh.client bundle (the Settings
7
+ # section) only when a row names the bare package; subpath rows below do
8
+ # not register it. apply() itself registers nothing.
9
+ - id: maestro-review-plugin
16
10
  name: '@ddtcorex/dsh-maestro-review'
17
- inject: ['skills']
11
+ # GitLab webhook intake on the raw webserver (/hooks/gitlab-mr*).
18
12
  - id: maestro-review-webhook
19
13
  name: '@ddtcorex/dsh-maestro-review/lib/providers/gitlab.js'
20
14
  config:
21
15
  secret: !!js process.env.MAESTRO_GITLAB_WEBHOOK_SECRET
22
16
  botUsername: maestro-bot
23
- - id: maestro-review-orchestrator
24
- name: '@ddtcorex/dsh-maestro-review/lib/orchestrator.js'
17
+ # Settings, mappings, trigger gates and worktrees, then the engine.
18
+ - id: maestro-review-host-orchestrator
19
+ name: '@ddtcorex/dsh-maestro-review/lib/host-orchestrator.js'
20
+ inject: ['reviewEngine', 'agentDefaultModel']
25
21
  config:
26
22
  gitlabBaseUrl: https://gitlab.example.com
27
23
  gitlabToken: !!js process.env.MAESTRO_GITLAB_TOKEN
@@ -30,6 +26,15 @@
30
26
  - id: maestro-review-settings-rpc
31
27
  name: '@ddtcorex/dsh-maestro-review/lib/settings-rpc.js'
32
28
  # rpc.handle registers a webServer route inside an effect fiber which carries only the row's inject (not the module's);
33
- # without webServer the row fails on harnesses that provide webServer after rows apply
34
- # (DSH 0.1.5-rc.1+).
29
+ # on DSH 0.2.x that is not sufficient on its own, see the `connection` entry at the end of this file.
35
30
  inject: ['connection', 'webServer']
31
+
32
+ # DSH 0.2.x resolves `webServer` for `ctx.connection.rpc.handle` on the
33
+ # `connection` row own fiber, so a row-level inject cannot reach it. `inject`
34
+ # replaces the base list, hence `webStartup` (the base row needs it for
35
+ # trustedHosts) is repeated. Identical in every maestro package that registers
36
+ # RPC channels, so each one stays installable alone.
37
+ - id: connection
38
+ inject:
39
+ - webStartup
40
+ - webServer
@@ -1,4 +1,4 @@
1
- import type { ReviewSkillProfile } from './skills-tool.js';
1
+ import type { ReviewSkillProfile } from '@ddtcorex/maestro-reviewer/lib/skills-tool.js';
2
2
  export interface ReviewModelSelection {
3
3
  provider: string;
4
4
  model: string;
@@ -53,6 +53,14 @@ export interface MaestroUserConfig {
53
53
  /** Also notify this chat when a review finishes. Default false. */
54
54
  telegramReviewNotifications?: boolean;
55
55
  }
56
+ /**
57
+ * Settings live in the SHARED namespaced store (`~/.dsh/dsh-maestro-config/settings.json`,
58
+ * owned by dsh-maestro-core and embedded here at `src/host/vendor/store.ts`); this store is a thin adapter that
59
+ * keeps the package's flat `MaestroUserConfig` API while delegating persistence.
60
+ * Machine runtime state (RUNTIME_KEYS) never enters settings — it stays in this
61
+ * package's own sidecar so a settings edit can never silently flip tunnel state.
62
+ */
63
+ export declare function runtimeStatePath(dshHome?: string): string;
56
64
  export declare function loadUserConfig(dshHome?: string): Promise<MaestroUserConfig>;
57
65
  export declare function saveUserConfig(patch: MaestroUserConfig, dshHome?: string): Promise<MaestroUserConfig>;
58
66
  //# sourceMappingURL=config-store.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config-store.d.ts","sourceRoot":"","sources":["../src/host/config-store.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAO1D,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB;AAED,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,CAAA;IACnB,aAAa,EAAE,MAAM,CAAA;IACrB,aAAa,CAAC,EAAE,kBAAkB,CAAA;IAClC,WAAW,CAAC,EAAE,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BAA0B,CAAC,EAAE,MAAM,CAAA;IACnC,UAAU,CAAC,EAAE,OAAO,GAAG,OAAO,CAAA;IAC9B,WAAW,CAAC,EAAE,SAAS,GAAG,SAAS,CAAA;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,2EAA2E;IAC3E,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,8DAA8D;IAC9D,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,mEAAmE;IACnE,2BAA2B,CAAC,EAAE,OAAO,CAAA;CACtC;AAuBD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAEzD;AAqBD,wBAAsB,cAAc,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CA4BjF;AAED,wBAAsB,cAAc,CAAC,KAAK,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAc3G"}
@@ -28,7 +28,7 @@ const REVIEW_OWNED_KEYS = [
28
28
  * Machine runtime state (RUNTIME_KEYS) never enters settings — it stays in this
29
29
  * package's own sidecar so a settings edit can never silently flip tunnel state.
30
30
  */
31
- function runtimeStatePath(dshHome) {
31
+ export function runtimeStatePath(dshHome) {
32
32
  return join(resolveDshHome(dshHome), 'dsh-maestro-review', 'runtime.json');
33
33
  }
34
34
  async function readRuntimeState(dshHome) {
@@ -1 +1 @@
1
- {"version":3,"file":"config-store.js","sourceRoot":"","sources":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,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;IACjC,CAAC;IACD,IAAI,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1C,MAAM,gBAAgB,CAAC,aAAa,EAAE,EAAE,OAAO,EAAE,CAAC,CAAA;IACpD,CAAC;IACD,IAAI,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACzC,MAAM,iBAAiB,CAAC,YAAY,EAAE,OAAO,CAAC,CAAA;IAChD,CAAC;IACD,OAAO,cAAc,CAAC,OAAO,CAAC,CAAA;AAChC,CAAC"}
package/lib/events.d.ts CHANGED
@@ -1,54 +1,14 @@
1
- export interface MrOpenedPayload {
2
- projectPath: string;
3
- projectId: number;
4
- mrIid: number;
5
- sourceBranch: string;
6
- }
7
- export type ReviewMode = 'quick' | 'deep';
8
- export type ReviewScope = {
9
- kind: 'mr';
10
- } | {
11
- kind: 'discussion';
12
- discussionId: string;
13
- path: string;
14
- line: number;
15
- };
16
- import type { ReviewSkillProfile } from './skills-tool.js';
17
- export interface ReviewRequest extends MrOpenedPayload {
18
- /** `push` arrives only when auto re-review on push is enabled and passes the completed-history gate. */
19
- trigger: 'reviewer-assignment' | 'mention' | 'push';
20
- mode: ReviewMode;
21
- scope: ReviewScope;
22
- /**
23
- * CI-only override (ci-trigger sets it from REVIEW_PROFILE). The GitLab webhook
24
- * producer never sets it — mapped projects resolve their profile from the mapping.
25
- * Undefined preserves the legacy diff-only generic review.
26
- */
27
- reviewProfile?: ReviewSkillProfile;
28
- /**
29
- * CI-only: MR head SHA from fetchMrDetail (ci-trigger sets it). Feeds the
30
- * comment marker so later CI runs can yield to this review. The GitLab
31
- * webhook producer never sets it — webhook comments stay marker-free.
32
- */
33
- headSha?: string;
34
- /** Short (8-char) head-sha hint for `push` triggers, taken from the webhook
35
- * body — feeds the in-flight key so two concurrent pushes stop deduping
36
- * each other. Absent when the body carries no sha. */
37
- pushSha?: string;
38
- }
39
- export interface ReviewResult {
40
- /** false = the review could not run or failed outright (infra error) — a CI caller should exit non-zero. */
41
- ok: boolean;
42
- summary?: string;
43
- failures: string[];
44
- durationMs: number;
45
- }
1
+ import type { ReviewRequest, ReviewResult } from '@ddtcorex/maestro-reviewer/lib/events.js';
2
+ import type { ReviewEngine } from '@ddtcorex/maestro-reviewer/lib/engine.js';
3
+ /** Host contracts: the webhook emits review requests, the host orchestrator runs them. */
46
4
  declare module '@deepseek-ai/cordis' {
47
5
  interface Events {
48
6
  'maestro/review-request': (payload: ReviewRequest) => void;
49
7
  }
50
8
  interface Context {
51
9
  reviewRunner: (payload: ReviewRequest) => Promise<ReviewResult>;
10
+ /** Provided by the engine's `maestro-review-engine` row (redeclared here: the engine augments its own cordis copy). */
11
+ reviewEngine: ReviewEngine;
52
12
  }
53
13
  }
54
14
  //# sourceMappingURL=events.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/host/events.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,MAAM,CAAA;AAEzC,MAAM,MAAM,WAAW,GACnB;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,GACd;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAE5E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAE1D,MAAM,WAAW,aAAc,SAAQ,eAAe;IACpD,wGAAwG;IACxG,OAAO,EAAE,qBAAqB,GAAG,SAAS,GAAG,MAAM,CAAA;IACnD,IAAI,EAAE,UAAU,CAAA;IAChB,KAAK,EAAE,WAAW,CAAA;IAClB;;;;OAIG;IACH,aAAa,CAAC,EAAE,kBAAkB,CAAA;IAClC;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;0DAEsD;IACtD,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,YAAY;IAC3B,4GAA4G;IAC5G,EAAE,EAAE,OAAO,CAAA;IACX,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,MAAM;QACd,wBAAwB,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAA;KAC3D;IACD,UAAU,OAAO;QACf,YAAY,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,OAAO,CAAC,YAAY,CAAC,CAAA;KAChE;CACF"}
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/host/events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAA;AAC3F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAA;AAE5E,0FAA0F;AAC1F,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,MAAM;QACd,wBAAwB,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAA;KAC3D;IACD,UAAU,OAAO;QACf,YAAY,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,OAAO,CAAC,YAAY,CAAC,CAAA;QAC/D,uHAAuH;QACvH,YAAY,EAAE,YAAY,CAAA;KAC3B;CACF"}
@@ -0,0 +1,128 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import z from '@deepseek-ai/schemastery';
3
+ import type { ReviewSkillProfile } from '@ddtcorex/maestro-reviewer/lib/skills-tool.js';
4
+ import { type EngineRunOptions } from '@ddtcorex/maestro-reviewer/lib/engine.js';
5
+ /** The engine's model selection type (its own dsh-agent copy). */
6
+ type ModelSelection = EngineRunOptions['model'];
7
+ import { type MaestroUserConfig, type ProjectMapping, type ReviewModelSelection } from './config-store.js';
8
+ import './events.js';
9
+ /**
10
+ * Row `maestro-review-host-orchestrator`: the DSH host side of a review. It
11
+ * listens for `maestro/review-request` (webhook intake), resolves user
12
+ * settings and project mappings, applies the trigger gates, prepares worktrees
13
+ * (vendor and govard environment linking) and calls the engine.
14
+ */
15
+ export declare const name = "maestro-review-host-orchestrator";
16
+ export declare const inject: string[];
17
+ /**
18
+ * Resolve the model to use for an automated review. Priority: per-project
19
+ * override > global reviewModel (Maestro Settings) > row-config reviewModel
20
+ * (lets a headless profile such as reviewer-ci pin a model from env vars,
21
+ * where there is no Settings UI) > DSH default (`fallback`).
22
+ */
23
+ export declare function resolveReviewModel(userConfig: MaestroUserConfig, mapping: {
24
+ reviewModel?: ReviewModelSelection | null;
25
+ projectPath?: string;
26
+ } | undefined, fallback: ModelSelection, rowSelection?: ReviewModelSelection | null): ModelSelection;
27
+ /** Effective auto-trigger flags: per-project row overrides global, unset inherits (design §4). */
28
+ export declare function resolveReviewTriggers(userConfig: MaestroUserConfig, mapping?: ProjectMapping): {
29
+ onPush: boolean;
30
+ onAssign: boolean;
31
+ };
32
+ export interface Config {
33
+ projectMappings: Array<{
34
+ projectPath: string;
35
+ localRepoPath: string;
36
+ reviewProfile: ReviewSkillProfile;
37
+ }>;
38
+ gitlabBaseUrl: string;
39
+ /**
40
+ * Fallback when Maestro Settings has no token; optional so a deployment that
41
+ * configures everything through Settings boots without env vars.
42
+ */
43
+ gitlabToken?: string;
44
+ botUsername: string;
45
+ /** Hard ceiling on one automated agent's turn. */
46
+ agentTimeoutMs: number;
47
+ /**
48
+ * Deployment-level model pin, below Maestro Settings in precedence. Lets a
49
+ * headless profile (reviewer-ci) select the review model from env vars —
50
+ * e.g. REVIEW_MODEL_PROVIDER/REVIEW_MODEL — where no Settings UI exists.
51
+ *
52
+ * Deliberately absent from the zod schema below: schemastery object schemas
53
+ * always descend into inner fields (probed — even `.required(false)` still
54
+ * throws on undefined), so declaring it would fail every boot without the
55
+ * vars. Unknown keys pass validation through (same precedent as mapping-level
56
+ * reviewModel, which the projectMappings schema doesn't declare either),
57
+ * and resolveReviewModel reads it at review time.
58
+ */
59
+ reviewModel?: ReviewModelSelection | null;
60
+ }
61
+ export declare const DEFAULT_AGENT_TIMEOUT_MS: number;
62
+ export declare const Config: z<Config>;
63
+ /** Upper bound for the best-effort `govard env down -v` run by the orchestrator. */
64
+ export declare const GOVARD_TEARDOWN_TIMEOUT_MS = 120000;
65
+ type TeardownRun = (file: string, args: string[], opts: {
66
+ cwd: string;
67
+ timeout: number;
68
+ }) => Promise<unknown>;
69
+ /**
70
+ * Tear down the review worktree's govard environment (`govard env down -v`,
71
+ * cwd = the worktree, whose `.govard.local.yml` names the per-MR project).
72
+ * Never throws: it runs in cleanup paths where a failure must not mask the
73
+ * review result, so a failure is logged as a warning instead.
74
+ */
75
+ export declare function teardownGovardEnvironment(worktreePath: string, run?: TeardownRun): Promise<void>;
76
+ /**
77
+ * Keep a Govard audit worktree isolated from the developer's primary checkout.
78
+ * Without this local override, both checkouts inherit the same `project_name`
79
+ * and Govard may either reject the worktree or run commands in the wrong stack.
80
+ */
81
+ export declare function govardWorktreeOverride(projectId: number, mrIid: number, keySuffix?: string): string;
82
+ export declare function ensureWorktree(localRepoPath: string, sourceBranch: string, projectId: number, mrIid: number, keySuffix?: string): Promise<string>;
83
+ /**
84
+ * A vendor dir only counts as installed dependencies when the composer
85
+ * autoloader is a real file. Magento tracks `vendor/.htaccess`, so every
86
+ * worktree has a vendor/ stub — that stub must not pass for real deps, and
87
+ * must not block the container bind that provides them.
88
+ */
89
+ export declare function vendorHasAutoload(dir: string): Promise<boolean>;
90
+ /**
91
+ * Share the primary checkout's `vendor/` (and `app/etc/env.php` when the
92
+ * auditor needs a database) into the review worktree via symlinks, so
93
+ * phpunit/static analysis run against real dependencies instead of falling
94
+ * back to static-only. Links point INTO the worktree only — the primary
95
+ * checkout is never written to — and `git worktree remove --force` deletes
96
+ * the links along with the worktree. Missing sources, or targets that
97
+ * already exist (e.g. Magento's tracked `vendor/.htaccess` stub), are
98
+ * skipped quietly: the review still runs, the auditor discloses it.
99
+ */
100
+ export declare function linkVendorIntoWorktree(localRepoPath: string, worktreePath: string): Promise<string[]>;
101
+ /**
102
+ * Render a compose override that bind-mounts the primary checkout's vendor/
103
+ * read-only into the php service. A host-side symlink alone dangles inside
104
+ * containers (absolute host path), so container tools (phpunit) need this
105
+ * bind to see real dependencies.
106
+ *
107
+ * The project mount (`.`) MUST be repeated first: govard merges overrides
108
+ * with MergeMap, which REPLACES lists instead of appending — an override
109
+ * carrying only the vendor bind would wipe `.:<workdir>` and leave the
110
+ * container docroot holding nothing but vendor/. Relative `.` resolves
111
+ * against the project root because govard passes --project-directory.
112
+ *
113
+ * Only the always-present `php` service is targeted: `php-debug` drops out
114
+ * of the rendered base when xdebug is off, and a volumes-only override
115
+ * entry would recreate it as a hollow service that fails compose validation.
116
+ */
117
+ export declare function buildVendorOverrideYaml(vendorHostPath: string, envHostPath?: string, containerWorkDir?: string): string;
118
+ /**
119
+ * Drop the vendor bind override into the worktree (merged by govard via
120
+ * `.govard/docker-compose.override.yml`). Binds only when the primary
121
+ * checkout carries installed deps and the worktree does not — never shadow
122
+ * real deps with a possibly stale bind. Returns the written path, or
123
+ * undefined when skipped.
124
+ */
125
+ export declare function writeContainerVendorOverride(localRepoPath: string, worktreePath: string): Promise<string | undefined>;
126
+ export declare function apply(ctx: Context, config: Config): void;
127
+ export {};
128
+ //# sourceMappingURL=host-orchestrator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host-orchestrator.d.ts","sourceRoot":"","sources":["../src/host/host-orchestrator.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,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