sentinelayer-cli 0.6.2 → 0.8.1
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.
- package/README.md +1009 -996
- package/bin/create-sentinelayer.js +5 -5
- package/bin/sentinelayer-cli.js +4 -4
- package/bin/sl.js +5 -5
- package/package.json +64 -63
- package/src/agents/ai-governance/index.js +12 -0
- package/src/agents/ai-governance/tools/base.js +171 -0
- package/src/agents/ai-governance/tools/eval-regression.js +47 -0
- package/src/agents/ai-governance/tools/hitl-audit.js +81 -0
- package/src/agents/ai-governance/tools/index.js +52 -0
- package/src/agents/ai-governance/tools/prompt-drift.js +42 -0
- package/src/agents/ai-governance/tools/provenance-check.js +69 -0
- package/src/agents/backend/index.js +12 -0
- package/src/agents/backend/tools/base.js +189 -0
- package/src/agents/backend/tools/circuit-breaker-check.js +123 -0
- package/src/agents/backend/tools/idempotency-audit.js +105 -0
- package/src/agents/backend/tools/index.js +87 -0
- package/src/agents/backend/tools/retry-audit.js +132 -0
- package/src/agents/backend/tools/timeout-audit.js +144 -0
- package/src/agents/code-quality/index.js +12 -0
- package/src/agents/code-quality/tools/base.js +159 -0
- package/src/agents/code-quality/tools/complexity-measure.js +197 -0
- package/src/agents/code-quality/tools/coupling-analysis.js +81 -0
- package/src/agents/code-quality/tools/cycle-detect.js +49 -0
- package/src/agents/code-quality/tools/dep-graph.js +196 -0
- package/src/agents/code-quality/tools/index.js +89 -0
- package/src/agents/data-layer/index.js +12 -0
- package/src/agents/data-layer/tools/base.js +181 -0
- package/src/agents/data-layer/tools/index-audit.js +165 -0
- package/src/agents/data-layer/tools/index.js +83 -0
- package/src/agents/data-layer/tools/migration-scan.js +135 -0
- package/src/agents/data-layer/tools/query-explain.js +120 -0
- package/src/agents/data-layer/tools/tenancy-scan.js +166 -0
- package/src/agents/documentation/index.js +12 -0
- package/src/agents/documentation/tools/api-diff.js +91 -0
- package/src/agents/documentation/tools/base.js +151 -0
- package/src/agents/documentation/tools/dead-link-check.js +58 -0
- package/src/agents/documentation/tools/docstring-coverage.js +78 -0
- package/src/agents/documentation/tools/index.js +52 -0
- package/src/agents/documentation/tools/readme-freshness.js +61 -0
- package/src/agents/envelope/fix-cycle.js +45 -0
- package/src/agents/envelope/index.js +31 -0
- package/src/agents/envelope/loop.js +150 -0
- package/src/agents/envelope/pulse.js +18 -0
- package/src/agents/envelope/stream.js +40 -0
- package/src/agents/infrastructure/index.js +12 -0
- package/src/agents/infrastructure/tools/base.js +171 -0
- package/src/agents/infrastructure/tools/checkov-run.js +32 -0
- package/src/agents/infrastructure/tools/drift-detect.js +59 -0
- package/src/agents/infrastructure/tools/iam-least-priv-check.js +78 -0
- package/src/agents/infrastructure/tools/index.js +52 -0
- package/src/agents/infrastructure/tools/tflint-run.js +31 -0
- package/src/agents/jules/config/definition.js +160 -160
- package/src/agents/jules/config/system-prompt.js +182 -182
- package/src/agents/jules/error-intake.js +51 -51
- package/src/agents/jules/fix-cycle.js +17 -17
- package/src/agents/jules/loop.js +460 -450
- package/src/agents/jules/pulse.js +10 -10
- package/src/agents/jules/stream.js +187 -186
- package/src/agents/jules/swarm/file-scanner.js +74 -74
- package/src/agents/jules/swarm/index.js +11 -11
- package/src/agents/jules/swarm/orchestrator.js +362 -362
- package/src/agents/jules/swarm/pattern-hunter.js +123 -123
- package/src/agents/jules/swarm/sub-agent.js +315 -309
- package/src/agents/jules/tools/aidenid-email.js +189 -189
- package/src/agents/jules/tools/auth-audit.js +1708 -1691
- package/src/agents/jules/tools/dispatch.js +340 -335
- package/src/agents/jules/tools/file-edit.js +2 -2
- package/src/agents/jules/tools/file-read.js +2 -2
- package/src/agents/jules/tools/frontend-analyze.js +570 -570
- package/src/agents/jules/tools/glob.js +2 -2
- package/src/agents/jules/tools/grep.js +2 -2
- package/src/agents/jules/tools/index.js +29 -29
- package/src/agents/jules/tools/path-guards.js +2 -2
- package/src/agents/jules/tools/runtime-audit.js +507 -507
- package/src/agents/jules/tools/shell.js +2 -2
- package/src/agents/jules/tools/url-policy.js +100 -100
- package/src/agents/mode.js +113 -0
- package/src/agents/observability/index.js +12 -0
- package/src/agents/observability/tools/alert-audit.js +39 -0
- package/src/agents/observability/tools/base.js +181 -0
- package/src/agents/observability/tools/dashboard-gap.js +42 -0
- package/src/agents/observability/tools/index.js +54 -0
- package/src/agents/observability/tools/log-schema-check.js +74 -0
- package/src/agents/observability/tools/span-coverage.js +74 -0
- package/src/agents/persona-visuals.js +102 -61
- package/src/agents/release/index.js +12 -0
- package/src/agents/release/tools/base.js +181 -0
- package/src/agents/release/tools/changelog-diff.js +86 -0
- package/src/agents/release/tools/feature-flag-audit.js +126 -0
- package/src/agents/release/tools/index.js +61 -0
- package/src/agents/release/tools/rollback-verify.js +129 -0
- package/src/agents/release/tools/semver-check.js +109 -0
- package/src/agents/reliability/index.js +12 -0
- package/src/agents/reliability/tools/backpressure-check.js +129 -0
- package/src/agents/reliability/tools/base.js +181 -0
- package/src/agents/reliability/tools/chaos-probe.js +109 -0
- package/src/agents/reliability/tools/graceful-degradation-check.js +114 -0
- package/src/agents/reliability/tools/health-check-audit.js +111 -0
- package/src/agents/reliability/tools/index.js +87 -0
- package/src/agents/run-persona.js +109 -0
- package/src/agents/security/index.js +12 -0
- package/src/agents/security/tools/authz-audit.js +134 -0
- package/src/agents/security/tools/base.js +190 -0
- package/src/agents/security/tools/crypto-review.js +175 -0
- package/src/agents/security/tools/index.js +97 -0
- package/src/agents/security/tools/sast-scan.js +175 -0
- package/src/agents/security/tools/secrets-scan.js +216 -0
- package/src/agents/shared-tools/dispatch-core.js +320 -315
- package/src/agents/shared-tools/file-edit.js +180 -180
- package/src/agents/shared-tools/file-read.js +100 -100
- package/src/agents/shared-tools/glob.js +168 -168
- package/src/agents/shared-tools/grep.js +228 -228
- package/src/agents/shared-tools/index.js +46 -46
- package/src/agents/shared-tools/path-guards.js +161 -161
- package/src/agents/shared-tools/shell.js +383 -383
- package/src/agents/supply-chain/index.js +12 -0
- package/src/agents/supply-chain/tools/attestation-check.js +42 -0
- package/src/agents/supply-chain/tools/base.js +151 -0
- package/src/agents/supply-chain/tools/index.js +52 -0
- package/src/agents/supply-chain/tools/lockfile-integrity.js +73 -0
- package/src/agents/supply-chain/tools/package-verify.js +56 -0
- package/src/agents/supply-chain/tools/sbom-diff.js +34 -0
- package/src/agents/testing/index.js +12 -0
- package/src/agents/testing/tools/base.js +202 -0
- package/src/agents/testing/tools/coverage-gap.js +144 -0
- package/src/agents/testing/tools/flake-detect.js +125 -0
- package/src/agents/testing/tools/index.js +85 -0
- package/src/agents/testing/tools/mutation-test.js +143 -0
- package/src/agents/testing/tools/snapshot-diff.js +103 -0
- package/src/ai/aidenid.js +1021 -1009
- package/src/ai/client.js +553 -553
- package/src/ai/domain-target-store.js +268 -268
- package/src/ai/identity-store.js +270 -270
- package/src/ai/proxy.js +137 -137
- package/src/ai/site-store.js +145 -145
- package/src/audit/agents/architecture.js +180 -180
- package/src/audit/agents/compliance.js +179 -179
- package/src/audit/agents/documentation.js +165 -165
- package/src/audit/agents/performance.js +145 -145
- package/src/audit/agents/security.js +215 -215
- package/src/audit/agents/testing.js +172 -172
- package/src/audit/orchestrator.js +557 -557
- package/src/audit/package.js +204 -204
- package/src/audit/registry.js +284 -284
- package/src/audit/replay.js +103 -103
- package/src/auth/gate.js +428 -371
- package/src/auth/http.js +681 -611
- package/src/auth/service.js +1106 -1106
- package/src/auth/session-store.js +813 -813
- package/src/cli.js +257 -252
- package/src/commands/ai/identity-lifecycle.js +1338 -1338
- package/src/commands/ai/provision-governance.js +1272 -1272
- package/src/commands/ai/shared.js +147 -147
- package/src/commands/ai.js +11 -11
- package/src/commands/apply.js +12 -12
- package/src/commands/audit.js +1171 -1166
- package/src/commands/auth.js +419 -419
- package/src/commands/chat.js +184 -191
- package/src/commands/config.js +184 -184
- package/src/commands/cost.js +311 -311
- package/src/commands/daemon/core.js +850 -850
- package/src/commands/daemon/extended.js +1048 -1048
- package/src/commands/daemon/shared.js +213 -213
- package/src/commands/daemon.js +11 -11
- package/src/commands/guide.js +174 -174
- package/src/commands/ingest.js +58 -58
- package/src/commands/init.js +55 -55
- package/src/commands/legacy-args.js +20 -10
- package/src/commands/mcp.js +461 -461
- package/src/commands/omargate.js +63 -29
- package/src/commands/persona.js +65 -20
- package/src/commands/plugin.js +260 -260
- package/src/commands/policy.js +132 -132
- package/src/commands/prompt.js +238 -238
- package/src/commands/review.js +704 -704
- package/src/commands/scan.js +865 -872
- package/src/commands/session.js +1238 -0
- package/src/commands/spec.js +771 -716
- package/src/commands/swarm.js +651 -651
- package/src/commands/telemetry.js +202 -202
- package/src/commands/watch.js +511 -511
- package/src/config/agent-dictionary.js +182 -182
- package/src/config/io.js +56 -56
- package/src/config/paths.js +18 -18
- package/src/config/schema.js +55 -55
- package/src/config/service.js +184 -184
- package/src/coord/events-log.js +141 -0
- package/src/coord/handshake.js +719 -0
- package/src/coord/index.js +35 -0
- package/src/coord/paths.js +84 -0
- package/src/coord/priority.js +62 -0
- package/src/coord/tarjan.js +157 -0
- package/src/cost/budget.js +235 -235
- package/src/cost/history.js +188 -188
- package/src/cost/tokenizer.js +160 -0
- package/src/cost/tracker.js +232 -171
- package/src/daemon/artifact-lineage.js +896 -534
- package/src/daemon/assignment-ledger.js +1083 -770
- package/src/daemon/ast-drift.js +496 -0
- package/src/daemon/ast-parser-layer.js +258 -258
- package/src/daemon/budget-governor.js +633 -633
- package/src/daemon/callgraph-overlay.js +646 -646
- package/src/daemon/error-worker.js +1209 -626
- package/src/daemon/fix-cycle.js +384 -377
- package/src/daemon/hybrid-mapper.js +929 -929
- package/src/daemon/ingest-refresh.js +79 -11
- package/src/daemon/jira-lifecycle.js +767 -632
- package/src/daemon/operator-control.js +657 -657
- package/src/daemon/pulse.js +327 -327
- package/src/daemon/reliability-lane.js +471 -471
- package/src/daemon/scope-engine.js +1068 -0
- package/src/daemon/watchdog.js +971 -971
- package/src/events/schema.js +190 -0
- package/src/guide/generator.js +316 -316
- package/src/ingest/engine.js +933 -918
- package/src/ingest/ownership.js +380 -0
- package/src/interactive/index.js +97 -97
- package/src/legacy-cli.js +3228 -2994
- package/src/mcp/registry.js +695 -695
- package/src/memory/blackboard.js +301 -301
- package/src/memory/retrieval.js +581 -581
- package/src/orchestrator/kai-chen.js +126 -0
- package/src/plugin/manifest.js +553 -553
- package/src/policy/packs.js +144 -144
- package/src/prompt/generator.js +136 -118
- package/src/review/ai-review.js +672 -679
- package/src/review/compliance-pack.js +389 -0
- package/src/review/investor-dd-config.js +54 -0
- package/src/review/investor-dd-file-loop.js +303 -0
- package/src/review/investor-dd-file-router.js +406 -0
- package/src/review/investor-dd-html-report.js +233 -0
- package/src/review/investor-dd-notification.js +120 -0
- package/src/review/investor-dd-orchestrator.js +405 -0
- package/src/review/investor-dd-persona-runner.js +275 -0
- package/src/review/live-validator.js +253 -0
- package/src/review/local-review.js +1351 -1305
- package/src/review/omargate-interactive.js +68 -68
- package/src/review/omargate-orchestrator.js +492 -300
- package/src/review/persona-prompts.js +484 -296
- package/src/review/reconciliation-rules.js +329 -0
- package/src/review/replay.js +235 -235
- package/src/review/report.js +664 -664
- package/src/review/reproducibility-chain.js +136 -0
- package/src/review/scan-modes.js +147 -42
- package/src/review/spec-binding.js +487 -487
- package/src/scaffold/generator.js +67 -67
- package/src/scaffold/templates.js +150 -150
- package/src/scan/generator.js +418 -418
- package/src/scan/gh-secrets.js +107 -107
- package/src/session/agent-registry.js +359 -0
- package/src/session/analytics.js +479 -0
- package/src/session/daemon.js +1396 -0
- package/src/session/file-locks.js +666 -0
- package/src/session/paths.js +37 -0
- package/src/session/recap.js +567 -0
- package/src/session/redact.js +82 -0
- package/src/session/runtime-bridge.js +762 -0
- package/src/session/scoring.js +406 -0
- package/src/session/setup-guides.js +304 -0
- package/src/session/store.js +704 -0
- package/src/session/stream.js +333 -0
- package/src/session/sync.js +753 -0
- package/src/session/tasks.js +1054 -0
- package/src/session/templates.js +188 -0
- package/src/spec/generator.js +619 -519
- package/src/spec/regenerate.js +237 -237
- package/src/spec/templates.js +91 -91
- package/src/swarm/dashboard.js +247 -247
- package/src/swarm/factory.js +363 -363
- package/src/swarm/pentest.js +934 -934
- package/src/swarm/registry.js +419 -419
- package/src/swarm/report.js +158 -158
- package/src/swarm/runtime.js +569 -576
- package/src/swarm/scenario-dsl.js +272 -272
- package/src/telemetry/ledger.js +302 -302
- package/src/telemetry/session-tracker.js +234 -234
- package/src/telemetry/sync.js +203 -203
- package/src/ui/command-hints.js +13 -13
- package/src/ui/markdown.js +220 -220
package/src/daemon/fix-cycle.js
CHANGED
|
@@ -1,377 +1,384 @@
|
|
|
1
|
-
import { execFileSync } from "node:child_process";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
import fsp from "node:fs/promises";
|
|
4
|
-
import { startJiraLifecycle, commentJiraIssue, transitionJiraIssue } from "./jira-lifecycle.js";
|
|
5
|
-
import { claimAssignment, heartbeatAssignment, releaseAssignment } from "./assignment-ledger.js";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* Jira
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
emit("
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
//
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
"
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
const
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
if (
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
function
|
|
289
|
-
return
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
parts.push("
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
parts.push("
|
|
308
|
-
parts.push("
|
|
309
|
-
parts.
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
parts
|
|
314
|
-
|
|
315
|
-
parts.push("
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
parts
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
if (
|
|
334
|
-
parts.push("
|
|
335
|
-
parts.
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
1
|
+
import { execFileSync } from "node:child_process";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import fsp from "node:fs/promises";
|
|
4
|
+
import { startJiraLifecycle, commentJiraIssue, transitionJiraIssue } from "./jira-lifecycle.js";
|
|
5
|
+
import { claimAssignment, heartbeatAssignment, releaseAssignment } from "./assignment-ledger.js";
|
|
6
|
+
import { createAgentEvent } from "../events/schema.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Jules Tanaka — Autonomous Fix Cycle
|
|
10
|
+
*
|
|
11
|
+
* Complete lifecycle:
|
|
12
|
+
* claim → Jira open → worktree create → agentic fix → test →
|
|
13
|
+
* Jira comment findings → PR create → Omar Gate watch →
|
|
14
|
+
* fix P0-P2 from comments → merge → Jira close → artifact → release
|
|
15
|
+
*
|
|
16
|
+
* Failure path: BLOCKED status + Jira comment + release assignment
|
|
17
|
+
* Worktree cleanup: always in finally block
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
const LEASE_TTL_SECONDS = 1800;
|
|
21
|
+
const HEARTBEAT_INTERVAL_MS = 300000;
|
|
22
|
+
// MAX_FIX_ATTEMPTS reserved for future agentic retry loop
|
|
23
|
+
const OMAR_POLL_INTERVAL_MS = 15000;
|
|
24
|
+
const OMAR_POLL_MAX_ATTEMPTS = 40; // 10 minutes max wait
|
|
25
|
+
|
|
26
|
+
export async function runFixCycle({ workItemId, workItem, rootPath, scopeMap, findings, onEvent, agentIdentity }) {
|
|
27
|
+
const agentDef = agentIdentity || { id: "unknown", persona: "Unknown Agent", color: "white", avatar: "", signature: "" };
|
|
28
|
+
const emit = (ev, pl) => {
|
|
29
|
+
if (onEvent) onEvent(createAgentEvent({
|
|
30
|
+
event: ev,
|
|
31
|
+
agent: {
|
|
32
|
+
id: agentDef.id,
|
|
33
|
+
persona: agentDef.persona,
|
|
34
|
+
color: agentDef.color,
|
|
35
|
+
avatar: agentDef.avatar,
|
|
36
|
+
},
|
|
37
|
+
payload: { workItemId, ...pl },
|
|
38
|
+
workItemId,
|
|
39
|
+
}));
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const artDir = path.join(rootPath, ".sentinelayer", "observability", "fixes", workItemId);
|
|
43
|
+
await fsp.mkdir(artDir, { recursive: true });
|
|
44
|
+
|
|
45
|
+
let jiraKey = null;
|
|
46
|
+
let prNumber = null;
|
|
47
|
+
let worktreePath = null;
|
|
48
|
+
let branchName = null;
|
|
49
|
+
let hbTimer = null;
|
|
50
|
+
|
|
51
|
+
try {
|
|
52
|
+
// ── [1] CLAIM ─────────────────────────────────────────────────
|
|
53
|
+
emit("fix_claim", { status: "claiming" });
|
|
54
|
+
await claimAssignment({
|
|
55
|
+
targetPath: rootPath, workItemId,
|
|
56
|
+
agentIdentity: "jules-tanaka@frontend",
|
|
57
|
+
leaseTtlSeconds: LEASE_TTL_SECONDS, stage: "fix",
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
hbTimer = setInterval(async () => {
|
|
61
|
+
try {
|
|
62
|
+
await heartbeatAssignment({
|
|
63
|
+
targetPath: rootPath, workItemId,
|
|
64
|
+
agentIdentity: "jules-tanaka@frontend",
|
|
65
|
+
leaseTtlSeconds: LEASE_TTL_SECONDS, stage: "fix",
|
|
66
|
+
});
|
|
67
|
+
} catch { /* heartbeat failure is non-blocking */ }
|
|
68
|
+
}, HEARTBEAT_INTERVAL_MS);
|
|
69
|
+
|
|
70
|
+
// ── [2] JIRA OPEN ─────────────────────────────────────────────
|
|
71
|
+
emit("fix_jira", { status: "opening" });
|
|
72
|
+
const sev = workItem?.severity || "P2";
|
|
73
|
+
const endpoint = workItem?.endpoint || "unknown";
|
|
74
|
+
const errorCode = workItem?.errorCode || "UNKNOWN";
|
|
75
|
+
|
|
76
|
+
const jr = await startJiraLifecycle({
|
|
77
|
+
targetPath: rootPath, workItemId, actor: agentDef.persona,
|
|
78
|
+
summary: "[" + sev + "] Frontend: " + errorCode + " at " + endpoint,
|
|
79
|
+
description: buildDescription(workItem, findings),
|
|
80
|
+
labels: ["sentinelayer", "jules-tanaka", "frontend", "severity-" + sev.toLowerCase()],
|
|
81
|
+
planMessage: buildPlan(workItem, scopeMap, findings),
|
|
82
|
+
issueKeyPrefix: "SLD",
|
|
83
|
+
});
|
|
84
|
+
jiraKey = jr.issue?.issueKey;
|
|
85
|
+
emit("fix_jira", { status: "opened", issueKey: jiraKey });
|
|
86
|
+
|
|
87
|
+
// ── [3] WORKTREE CREATE ───────────────────────────────────────
|
|
88
|
+
branchName = "fix/jules-" + workItemId.replace(/[^a-zA-Z0-9-]/g, "-");
|
|
89
|
+
worktreePath = path.join(rootPath, ".jules-worktree-" + workItemId);
|
|
90
|
+
emit("fix_worktree", { status: "creating", branch: branchName });
|
|
91
|
+
|
|
92
|
+
safeExecFile("git", ["fetch", "origin"], rootPath);
|
|
93
|
+
safeExecFile("git", ["worktree", "add", "-b", branchName, worktreePath, "origin/main"], rootPath);
|
|
94
|
+
emit("fix_worktree", { status: "created", path: worktreePath });
|
|
95
|
+
|
|
96
|
+
// ── [4] INVESTIGATE + FIX ─────────────────────────────────────
|
|
97
|
+
emit("fix_investigate", { status: "analyzing" });
|
|
98
|
+
|
|
99
|
+
// Comment Jira with findings before fix attempt
|
|
100
|
+
if (jiraKey && findings && findings.length > 0) {
|
|
101
|
+
await commentJiraIssue({
|
|
102
|
+
targetPath: rootPath, workItemId, issueKey: jiraKey,
|
|
103
|
+
actor: agentDef.persona, type: "finding",
|
|
104
|
+
message: buildFindingsComment(findings),
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// Fix generation: the caller is responsible for writing changes to the
|
|
109
|
+
// worktree before invoking runFixCycle, or for wiring julesAuditLoop
|
|
110
|
+
// in fix mode with FileEdit tool access. runFixCycle handles the full
|
|
111
|
+
// PR/Omar/merge/Jira lifecycle for whatever changes exist in the worktree.
|
|
112
|
+
|
|
113
|
+
// ── [5] PUSH + PR ─────────────────────────────────────────────
|
|
114
|
+
emit("fix_pr", { status: "pushing" });
|
|
115
|
+
|
|
116
|
+
// Check if there are changes to commit in the worktree
|
|
117
|
+
const diffOutput = safeExecFile("git", ["diff", "--stat"], worktreePath);
|
|
118
|
+
const untrackedOutput = safeExecFile("git", ["ls-files", "--others", "--exclude-standard"], worktreePath);
|
|
119
|
+
const hasChanges = diffOutput.trim().length > 0 || untrackedOutput.trim().length > 0;
|
|
120
|
+
|
|
121
|
+
if (hasChanges) {
|
|
122
|
+
safeExecFile("git", ["add", "-A"], worktreePath);
|
|
123
|
+
safeExecFile("git", ["commit", "-m", "[Jules] Fix " + errorCode + " at " + endpoint], worktreePath);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
safeExecFile("git", ["push", "-u", "origin", branchName], worktreePath);
|
|
127
|
+
|
|
128
|
+
const prBody = buildPrBody(workItem, findings, jiraKey);
|
|
129
|
+
const prUrl = safeExecFile("gh", [
|
|
130
|
+
"pr", "create",
|
|
131
|
+
"--title", "[Jules] Fix " + errorCode,
|
|
132
|
+
"--body", prBody,
|
|
133
|
+
"--head", branchName,
|
|
134
|
+
], worktreePath).trim();
|
|
135
|
+
|
|
136
|
+
const prMatch = prUrl.match(/\/pull\/(\d+)/);
|
|
137
|
+
prNumber = prMatch ? parseInt(prMatch[1]) : null;
|
|
138
|
+
emit("fix_pr", { status: "created", prNumber, url: prUrl });
|
|
139
|
+
|
|
140
|
+
// ── [6] OMAR GATE WATCH ───────────────────────────────────────
|
|
141
|
+
if (prNumber) {
|
|
142
|
+
emit("fix_omar", { status: "watching", prNumber });
|
|
143
|
+
const omarPassed = await watchOmarGate(rootPath, branchName, emit);
|
|
144
|
+
|
|
145
|
+
if (!omarPassed) {
|
|
146
|
+
emit("fix_omar", { status: "failed" });
|
|
147
|
+
// Comment Jira about Omar failure
|
|
148
|
+
if (jiraKey) {
|
|
149
|
+
await commentJiraIssue({
|
|
150
|
+
targetPath: rootPath, workItemId, issueKey: jiraKey,
|
|
151
|
+
actor: agentDef.persona, type: "operator_stop",
|
|
152
|
+
message: "## Omar Gate Failed\nPR #" + prNumber + " did not pass Omar Gate.\nEscalating to human review.\n\n" + agentDef.signature,
|
|
153
|
+
});
|
|
154
|
+
await transitionJiraIssue({
|
|
155
|
+
targetPath: rootPath, workItemId, issueKey: jiraKey,
|
|
156
|
+
toStatus: "BLOCKED", actor: agentDef.persona,
|
|
157
|
+
reason: "Omar Gate failed on PR #" + prNumber,
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
await releaseAssignment({
|
|
161
|
+
targetPath: rootPath, workItemId,
|
|
162
|
+
agentIdentity: "jules-tanaka@frontend",
|
|
163
|
+
status: "BLOCKED", reason: "Omar Gate failed on PR #" + prNumber,
|
|
164
|
+
});
|
|
165
|
+
return {
|
|
166
|
+
workItemId, jiraIssueKey: jiraKey, prNumber,
|
|
167
|
+
status: "blocked_omar", signature: agentDef.signature,
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
emit("fix_omar", { status: "passed", prNumber });
|
|
172
|
+
|
|
173
|
+
// ── [7] MERGE ───────────────────────────────────────────────
|
|
174
|
+
emit("fix_merge", { status: "merging", prNumber });
|
|
175
|
+
try {
|
|
176
|
+
safeExecFile("gh", ["pr", "merge", String(prNumber), "--squash", "--delete-branch"], rootPath);
|
|
177
|
+
emit("fix_merge", { status: "merged", prNumber });
|
|
178
|
+
} catch (mergeErr) {
|
|
179
|
+
emit("fix_merge", { status: "failed", error: mergeErr.message });
|
|
180
|
+
// PR created but merge failed — still better than nothing
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// ── [8] JIRA CLOSE ────────────────────────────────────────────
|
|
185
|
+
if (jiraKey) {
|
|
186
|
+
await commentJiraIssue({
|
|
187
|
+
targetPath: rootPath, workItemId, issueKey: jiraKey,
|
|
188
|
+
actor: agentDef.persona, type: "fix",
|
|
189
|
+
message: "## Resolution\nPR #" + (prNumber || "pending") + " merged.\nOmar Gate: passed.\nFindings addressed: " + (findings?.length || 0) + "\n\n" + agentDef.signature,
|
|
190
|
+
});
|
|
191
|
+
await transitionJiraIssue({
|
|
192
|
+
targetPath: rootPath, workItemId, issueKey: jiraKey,
|
|
193
|
+
toStatus: "DONE", actor: agentDef.persona,
|
|
194
|
+
reason: "Fixed in PR #" + (prNumber || "pending"),
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// ── [9] ARTIFACT + S3 UPLOAD ────────────────────────────────────
|
|
199
|
+
const result = {
|
|
200
|
+
workItemId, jiraIssueKey: jiraKey, prNumber,
|
|
201
|
+
status: "completed",
|
|
202
|
+
findingsAddressed: findings?.length || 0,
|
|
203
|
+
signature: agentDef.signature,
|
|
204
|
+
};
|
|
205
|
+
await fsp.writeFile(
|
|
206
|
+
path.join(artDir, "fix-result.json"),
|
|
207
|
+
JSON.stringify(result, null, 2),
|
|
208
|
+
);
|
|
209
|
+
|
|
210
|
+
// Upload to S3 for compliance archive + agent training data
|
|
211
|
+
emit("fix_s3", { status: "uploading" });
|
|
212
|
+
const s3Result = await uploadFixArtifactsToS3(artDir, workItemId, rootPath);
|
|
213
|
+
emit("fix_s3", { status: s3Result.uploaded ? "uploaded" : "skipped", reason: s3Result.reason });
|
|
214
|
+
|
|
215
|
+
// ── [10] RELEASE ──────────────────────────────────────────────
|
|
216
|
+
await releaseAssignment({
|
|
217
|
+
targetPath: rootPath, workItemId,
|
|
218
|
+
agentIdentity: "jules-tanaka@frontend",
|
|
219
|
+
status: "DONE",
|
|
220
|
+
reason: "PR #" + (prNumber || "pending") + " merged. " + agentDef.signature,
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
emit("fix_complete", { prNumber, jiraIssueKey: jiraKey, status: "completed" });
|
|
224
|
+
return result;
|
|
225
|
+
|
|
226
|
+
} catch (err) {
|
|
227
|
+
emit("fix_error", { error: err.message });
|
|
228
|
+
try {
|
|
229
|
+
await releaseAssignment({
|
|
230
|
+
targetPath: rootPath, workItemId,
|
|
231
|
+
agentIdentity: "jules-tanaka@frontend",
|
|
232
|
+
status: "BLOCKED", reason: "Fix cycle failed: " + err.message,
|
|
233
|
+
});
|
|
234
|
+
} catch { /* release failure non-blocking */ }
|
|
235
|
+
if (jiraKey) {
|
|
236
|
+
try {
|
|
237
|
+
await commentJiraIssue({
|
|
238
|
+
targetPath: rootPath, workItemId, issueKey: jiraKey,
|
|
239
|
+
actor: agentDef.persona, type: "operator_stop",
|
|
240
|
+
message: "## Fix Failed\n" + err.message + "\nEscalating to human.\n\n" + agentDef.signature,
|
|
241
|
+
});
|
|
242
|
+
await transitionJiraIssue({
|
|
243
|
+
targetPath: rootPath, workItemId, issueKey: jiraKey,
|
|
244
|
+
toStatus: "BLOCKED", actor: agentDef.persona,
|
|
245
|
+
reason: "Fix cycle failed: " + err.message,
|
|
246
|
+
});
|
|
247
|
+
} catch { /* Jira failure non-blocking */ }
|
|
248
|
+
}
|
|
249
|
+
return { workItemId, jiraIssueKey: jiraKey, prNumber, status: "failed", error: err.message, signature: agentDef.signature };
|
|
250
|
+
} finally {
|
|
251
|
+
if (hbTimer) clearInterval(hbTimer);
|
|
252
|
+
if (worktreePath) {
|
|
253
|
+
try { safeExecFile("git", ["worktree", "remove", worktreePath, "--force"], rootPath); } catch { /* best effort */ }
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// ── Omar Gate Watch ──────────────────────────────────────────────────
|
|
259
|
+
|
|
260
|
+
async function watchOmarGate(rootPath, branchName, emit) {
|
|
261
|
+
for (let attempt = 0; attempt < OMAR_POLL_MAX_ATTEMPTS; attempt++) {
|
|
262
|
+
await sleep(OMAR_POLL_INTERVAL_MS);
|
|
263
|
+
try {
|
|
264
|
+
const runJson = safeExecFile("gh", [
|
|
265
|
+
"run", "list", "--workflow", "Omar Gate", "--branch", branchName,
|
|
266
|
+
"--limit", "1", "--json", "databaseId,status,conclusion",
|
|
267
|
+
], rootPath);
|
|
268
|
+
const runs = JSON.parse(runJson || "[]");
|
|
269
|
+
if (runs.length === 0) continue;
|
|
270
|
+
|
|
271
|
+
const run = runs[0];
|
|
272
|
+
if (run.status === "completed") {
|
|
273
|
+
emit("fix_omar", { status: "completed", conclusion: run.conclusion, runId: run.databaseId });
|
|
274
|
+
return run.conclusion === "success";
|
|
275
|
+
}
|
|
276
|
+
if (attempt % 4 === 0) {
|
|
277
|
+
emit("fix_omar", { status: "waiting", attempt, runId: run.databaseId });
|
|
278
|
+
}
|
|
279
|
+
} catch { /* polling failure non-blocking, will retry */ }
|
|
280
|
+
}
|
|
281
|
+
// Timed out waiting for Omar
|
|
282
|
+
emit("fix_omar", { status: "timeout" });
|
|
283
|
+
return false;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
// ── Helpers ──────────────────────────────────────────────────────────
|
|
287
|
+
|
|
288
|
+
function safeExecFile(bin, args, cwd) {
|
|
289
|
+
return execFileSync(bin, args, {
|
|
290
|
+
cwd, encoding: "utf-8", timeout: 60000,
|
|
291
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
function sleep(ms) {
|
|
296
|
+
return new Promise(resolve => setTimeout(resolve, ms));
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
function buildDescription(w, f) {
|
|
300
|
+
const parts = [];
|
|
301
|
+
parts.push("**Service:** " + (w?.service || "unknown"));
|
|
302
|
+
parts.push("**Endpoint:** " + (w?.endpoint || "unknown"));
|
|
303
|
+
parts.push("**Error:** " + (w?.errorCode || "UNKNOWN"));
|
|
304
|
+
parts.push("**Severity:** " + (w?.severity || "P2"));
|
|
305
|
+
if (w?.message) parts.push("**Message:** " + w.message.slice(0, 500));
|
|
306
|
+
if (w?.stackFingerprint) parts.push("**Stack fingerprint:** " + w.stackFingerprint);
|
|
307
|
+
if (f?.length) parts.push("\n**Related findings:** " + f.length);
|
|
308
|
+
parts.push("\n" + agentDef.signature);
|
|
309
|
+
return parts.join("\n");
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
function buildPlan(w, s, f) {
|
|
313
|
+
const parts = [];
|
|
314
|
+
parts.push("## Investigation Plan");
|
|
315
|
+
parts.push("1. Scope reconstruction from error at " + (w?.endpoint || "unknown"));
|
|
316
|
+
parts.push("2. Read " + ((s?.primary || []).length) + " primary scope files");
|
|
317
|
+
parts.push("3. Identify root cause from stack trace + code analysis");
|
|
318
|
+
parts.push("4. Apply fix in isolated worktree");
|
|
319
|
+
parts.push("5. Run tests to verify fix");
|
|
320
|
+
parts.push("6. Open PR and watch Omar Gate");
|
|
321
|
+
if (f?.length) parts.push("\n**Pre-existing findings:** " + f.length);
|
|
322
|
+
parts.push("\n" + agentDef.signature);
|
|
323
|
+
return parts.join("\n");
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
function buildFindingsComment(f) {
|
|
327
|
+
const parts = ["## Findings"];
|
|
328
|
+
const items = f || [];
|
|
329
|
+
for (const finding of items.slice(0, 10)) {
|
|
330
|
+
parts.push("- **[" + (finding.severity || "P3") + "]** " + (finding.file || "") + ":" + (finding.line || "") + " " + (finding.title || finding.type || ""));
|
|
331
|
+
if (finding.evidence) parts.push(" Evidence: " + String(finding.evidence).slice(0, 200));
|
|
332
|
+
}
|
|
333
|
+
if (items.length > 10) parts.push("... and " + (items.length - 10) + " more");
|
|
334
|
+
parts.push("\n" + agentDef.signature);
|
|
335
|
+
return parts.join("\n");
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
function buildPrBody(w, f, jiraKey) {
|
|
339
|
+
const parts = [];
|
|
340
|
+
if (jiraKey) parts.push("Fixes " + jiraKey);
|
|
341
|
+
parts.push("Error: " + (w?.errorCode || "UNKNOWN") + " at " + (w?.endpoint || "unknown"));
|
|
342
|
+
parts.push("Severity: " + (w?.severity || "P2"));
|
|
343
|
+
if (f?.length) parts.push("Findings addressed: " + f.length);
|
|
344
|
+
parts.push("");
|
|
345
|
+
parts.push(agentDef.signature);
|
|
346
|
+
return parts.join("\n");
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
// ── S3 Upload ────────────────────────────────────────────────────────
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* Upload fix artifacts to S3 for compliance archive and agent training.
|
|
353
|
+
* Uses AWS CLI (must be configured in environment).
|
|
354
|
+
* Fails silently — S3 upload must never block the fix cycle.
|
|
355
|
+
*
|
|
356
|
+
* Bucket: SENTINELAYER_AUDIT_S3_BUCKET env var (default: sentinelayer-audit-artifacts)
|
|
357
|
+
* Key pattern: {repo}/{date}/jules-tanaka/{workItemId}/
|
|
358
|
+
*/
|
|
359
|
+
async function uploadFixArtifactsToS3(artifactDir, workItemId, rootPath) {
|
|
360
|
+
const bucket = process.env.SENTINELAYER_AUDIT_S3_BUCKET;
|
|
361
|
+
if (!bucket) {
|
|
362
|
+
return { uploaded: false, reason: "SENTINELAYER_AUDIT_S3_BUCKET not set" };
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
try {
|
|
366
|
+
// Derive repo name from git remote or directory name
|
|
367
|
+
let repoName = "unknown-repo";
|
|
368
|
+
try {
|
|
369
|
+
const remote = safeExecFile("git", ["remote", "get-url", "origin"], rootPath).trim();
|
|
370
|
+
const match = remote.match(/\/([^/]+?)(?:\.git)?$/);
|
|
371
|
+
if (match) repoName = match[1];
|
|
372
|
+
} catch { /* use default */ }
|
|
373
|
+
|
|
374
|
+
const date = new Date().toISOString().split("T")[0];
|
|
375
|
+
const s3Key = repoName + "/" + date + "/jules-tanaka/" + workItemId + "/";
|
|
376
|
+
const s3Url = "s3://" + bucket + "/" + s3Key;
|
|
377
|
+
|
|
378
|
+
safeExecFile("aws", ["s3", "sync", artifactDir, s3Url, "--quiet", "--sse", "AES256"], rootPath);
|
|
379
|
+
|
|
380
|
+
return { uploaded: true, bucket, key: s3Key };
|
|
381
|
+
} catch (err) {
|
|
382
|
+
return { uploaded: false, reason: "S3 upload failed: " + err.message };
|
|
383
|
+
}
|
|
384
|
+
}
|