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.
Files changed (280) hide show
  1. package/README.md +1009 -996
  2. package/bin/create-sentinelayer.js +5 -5
  3. package/bin/sentinelayer-cli.js +4 -4
  4. package/bin/sl.js +5 -5
  5. package/package.json +64 -63
  6. package/src/agents/ai-governance/index.js +12 -0
  7. package/src/agents/ai-governance/tools/base.js +171 -0
  8. package/src/agents/ai-governance/tools/eval-regression.js +47 -0
  9. package/src/agents/ai-governance/tools/hitl-audit.js +81 -0
  10. package/src/agents/ai-governance/tools/index.js +52 -0
  11. package/src/agents/ai-governance/tools/prompt-drift.js +42 -0
  12. package/src/agents/ai-governance/tools/provenance-check.js +69 -0
  13. package/src/agents/backend/index.js +12 -0
  14. package/src/agents/backend/tools/base.js +189 -0
  15. package/src/agents/backend/tools/circuit-breaker-check.js +123 -0
  16. package/src/agents/backend/tools/idempotency-audit.js +105 -0
  17. package/src/agents/backend/tools/index.js +87 -0
  18. package/src/agents/backend/tools/retry-audit.js +132 -0
  19. package/src/agents/backend/tools/timeout-audit.js +144 -0
  20. package/src/agents/code-quality/index.js +12 -0
  21. package/src/agents/code-quality/tools/base.js +159 -0
  22. package/src/agents/code-quality/tools/complexity-measure.js +197 -0
  23. package/src/agents/code-quality/tools/coupling-analysis.js +81 -0
  24. package/src/agents/code-quality/tools/cycle-detect.js +49 -0
  25. package/src/agents/code-quality/tools/dep-graph.js +196 -0
  26. package/src/agents/code-quality/tools/index.js +89 -0
  27. package/src/agents/data-layer/index.js +12 -0
  28. package/src/agents/data-layer/tools/base.js +181 -0
  29. package/src/agents/data-layer/tools/index-audit.js +165 -0
  30. package/src/agents/data-layer/tools/index.js +83 -0
  31. package/src/agents/data-layer/tools/migration-scan.js +135 -0
  32. package/src/agents/data-layer/tools/query-explain.js +120 -0
  33. package/src/agents/data-layer/tools/tenancy-scan.js +166 -0
  34. package/src/agents/documentation/index.js +12 -0
  35. package/src/agents/documentation/tools/api-diff.js +91 -0
  36. package/src/agents/documentation/tools/base.js +151 -0
  37. package/src/agents/documentation/tools/dead-link-check.js +58 -0
  38. package/src/agents/documentation/tools/docstring-coverage.js +78 -0
  39. package/src/agents/documentation/tools/index.js +52 -0
  40. package/src/agents/documentation/tools/readme-freshness.js +61 -0
  41. package/src/agents/envelope/fix-cycle.js +45 -0
  42. package/src/agents/envelope/index.js +31 -0
  43. package/src/agents/envelope/loop.js +150 -0
  44. package/src/agents/envelope/pulse.js +18 -0
  45. package/src/agents/envelope/stream.js +40 -0
  46. package/src/agents/infrastructure/index.js +12 -0
  47. package/src/agents/infrastructure/tools/base.js +171 -0
  48. package/src/agents/infrastructure/tools/checkov-run.js +32 -0
  49. package/src/agents/infrastructure/tools/drift-detect.js +59 -0
  50. package/src/agents/infrastructure/tools/iam-least-priv-check.js +78 -0
  51. package/src/agents/infrastructure/tools/index.js +52 -0
  52. package/src/agents/infrastructure/tools/tflint-run.js +31 -0
  53. package/src/agents/jules/config/definition.js +160 -160
  54. package/src/agents/jules/config/system-prompt.js +182 -182
  55. package/src/agents/jules/error-intake.js +51 -51
  56. package/src/agents/jules/fix-cycle.js +17 -17
  57. package/src/agents/jules/loop.js +460 -450
  58. package/src/agents/jules/pulse.js +10 -10
  59. package/src/agents/jules/stream.js +187 -186
  60. package/src/agents/jules/swarm/file-scanner.js +74 -74
  61. package/src/agents/jules/swarm/index.js +11 -11
  62. package/src/agents/jules/swarm/orchestrator.js +362 -362
  63. package/src/agents/jules/swarm/pattern-hunter.js +123 -123
  64. package/src/agents/jules/swarm/sub-agent.js +315 -309
  65. package/src/agents/jules/tools/aidenid-email.js +189 -189
  66. package/src/agents/jules/tools/auth-audit.js +1708 -1691
  67. package/src/agents/jules/tools/dispatch.js +340 -335
  68. package/src/agents/jules/tools/file-edit.js +2 -2
  69. package/src/agents/jules/tools/file-read.js +2 -2
  70. package/src/agents/jules/tools/frontend-analyze.js +570 -570
  71. package/src/agents/jules/tools/glob.js +2 -2
  72. package/src/agents/jules/tools/grep.js +2 -2
  73. package/src/agents/jules/tools/index.js +29 -29
  74. package/src/agents/jules/tools/path-guards.js +2 -2
  75. package/src/agents/jules/tools/runtime-audit.js +507 -507
  76. package/src/agents/jules/tools/shell.js +2 -2
  77. package/src/agents/jules/tools/url-policy.js +100 -100
  78. package/src/agents/mode.js +113 -0
  79. package/src/agents/observability/index.js +12 -0
  80. package/src/agents/observability/tools/alert-audit.js +39 -0
  81. package/src/agents/observability/tools/base.js +181 -0
  82. package/src/agents/observability/tools/dashboard-gap.js +42 -0
  83. package/src/agents/observability/tools/index.js +54 -0
  84. package/src/agents/observability/tools/log-schema-check.js +74 -0
  85. package/src/agents/observability/tools/span-coverage.js +74 -0
  86. package/src/agents/persona-visuals.js +102 -61
  87. package/src/agents/release/index.js +12 -0
  88. package/src/agents/release/tools/base.js +181 -0
  89. package/src/agents/release/tools/changelog-diff.js +86 -0
  90. package/src/agents/release/tools/feature-flag-audit.js +126 -0
  91. package/src/agents/release/tools/index.js +61 -0
  92. package/src/agents/release/tools/rollback-verify.js +129 -0
  93. package/src/agents/release/tools/semver-check.js +109 -0
  94. package/src/agents/reliability/index.js +12 -0
  95. package/src/agents/reliability/tools/backpressure-check.js +129 -0
  96. package/src/agents/reliability/tools/base.js +181 -0
  97. package/src/agents/reliability/tools/chaos-probe.js +109 -0
  98. package/src/agents/reliability/tools/graceful-degradation-check.js +114 -0
  99. package/src/agents/reliability/tools/health-check-audit.js +111 -0
  100. package/src/agents/reliability/tools/index.js +87 -0
  101. package/src/agents/run-persona.js +109 -0
  102. package/src/agents/security/index.js +12 -0
  103. package/src/agents/security/tools/authz-audit.js +134 -0
  104. package/src/agents/security/tools/base.js +190 -0
  105. package/src/agents/security/tools/crypto-review.js +175 -0
  106. package/src/agents/security/tools/index.js +97 -0
  107. package/src/agents/security/tools/sast-scan.js +175 -0
  108. package/src/agents/security/tools/secrets-scan.js +216 -0
  109. package/src/agents/shared-tools/dispatch-core.js +320 -315
  110. package/src/agents/shared-tools/file-edit.js +180 -180
  111. package/src/agents/shared-tools/file-read.js +100 -100
  112. package/src/agents/shared-tools/glob.js +168 -168
  113. package/src/agents/shared-tools/grep.js +228 -228
  114. package/src/agents/shared-tools/index.js +46 -46
  115. package/src/agents/shared-tools/path-guards.js +161 -161
  116. package/src/agents/shared-tools/shell.js +383 -383
  117. package/src/agents/supply-chain/index.js +12 -0
  118. package/src/agents/supply-chain/tools/attestation-check.js +42 -0
  119. package/src/agents/supply-chain/tools/base.js +151 -0
  120. package/src/agents/supply-chain/tools/index.js +52 -0
  121. package/src/agents/supply-chain/tools/lockfile-integrity.js +73 -0
  122. package/src/agents/supply-chain/tools/package-verify.js +56 -0
  123. package/src/agents/supply-chain/tools/sbom-diff.js +34 -0
  124. package/src/agents/testing/index.js +12 -0
  125. package/src/agents/testing/tools/base.js +202 -0
  126. package/src/agents/testing/tools/coverage-gap.js +144 -0
  127. package/src/agents/testing/tools/flake-detect.js +125 -0
  128. package/src/agents/testing/tools/index.js +85 -0
  129. package/src/agents/testing/tools/mutation-test.js +143 -0
  130. package/src/agents/testing/tools/snapshot-diff.js +103 -0
  131. package/src/ai/aidenid.js +1021 -1009
  132. package/src/ai/client.js +553 -553
  133. package/src/ai/domain-target-store.js +268 -268
  134. package/src/ai/identity-store.js +270 -270
  135. package/src/ai/proxy.js +137 -137
  136. package/src/ai/site-store.js +145 -145
  137. package/src/audit/agents/architecture.js +180 -180
  138. package/src/audit/agents/compliance.js +179 -179
  139. package/src/audit/agents/documentation.js +165 -165
  140. package/src/audit/agents/performance.js +145 -145
  141. package/src/audit/agents/security.js +215 -215
  142. package/src/audit/agents/testing.js +172 -172
  143. package/src/audit/orchestrator.js +557 -557
  144. package/src/audit/package.js +204 -204
  145. package/src/audit/registry.js +284 -284
  146. package/src/audit/replay.js +103 -103
  147. package/src/auth/gate.js +428 -371
  148. package/src/auth/http.js +681 -611
  149. package/src/auth/service.js +1106 -1106
  150. package/src/auth/session-store.js +813 -813
  151. package/src/cli.js +257 -252
  152. package/src/commands/ai/identity-lifecycle.js +1338 -1338
  153. package/src/commands/ai/provision-governance.js +1272 -1272
  154. package/src/commands/ai/shared.js +147 -147
  155. package/src/commands/ai.js +11 -11
  156. package/src/commands/apply.js +12 -12
  157. package/src/commands/audit.js +1171 -1166
  158. package/src/commands/auth.js +419 -419
  159. package/src/commands/chat.js +184 -191
  160. package/src/commands/config.js +184 -184
  161. package/src/commands/cost.js +311 -311
  162. package/src/commands/daemon/core.js +850 -850
  163. package/src/commands/daemon/extended.js +1048 -1048
  164. package/src/commands/daemon/shared.js +213 -213
  165. package/src/commands/daemon.js +11 -11
  166. package/src/commands/guide.js +174 -174
  167. package/src/commands/ingest.js +58 -58
  168. package/src/commands/init.js +55 -55
  169. package/src/commands/legacy-args.js +20 -10
  170. package/src/commands/mcp.js +461 -461
  171. package/src/commands/omargate.js +63 -29
  172. package/src/commands/persona.js +65 -20
  173. package/src/commands/plugin.js +260 -260
  174. package/src/commands/policy.js +132 -132
  175. package/src/commands/prompt.js +238 -238
  176. package/src/commands/review.js +704 -704
  177. package/src/commands/scan.js +865 -872
  178. package/src/commands/session.js +1238 -0
  179. package/src/commands/spec.js +771 -716
  180. package/src/commands/swarm.js +651 -651
  181. package/src/commands/telemetry.js +202 -202
  182. package/src/commands/watch.js +511 -511
  183. package/src/config/agent-dictionary.js +182 -182
  184. package/src/config/io.js +56 -56
  185. package/src/config/paths.js +18 -18
  186. package/src/config/schema.js +55 -55
  187. package/src/config/service.js +184 -184
  188. package/src/coord/events-log.js +141 -0
  189. package/src/coord/handshake.js +719 -0
  190. package/src/coord/index.js +35 -0
  191. package/src/coord/paths.js +84 -0
  192. package/src/coord/priority.js +62 -0
  193. package/src/coord/tarjan.js +157 -0
  194. package/src/cost/budget.js +235 -235
  195. package/src/cost/history.js +188 -188
  196. package/src/cost/tokenizer.js +160 -0
  197. package/src/cost/tracker.js +232 -171
  198. package/src/daemon/artifact-lineage.js +896 -534
  199. package/src/daemon/assignment-ledger.js +1083 -770
  200. package/src/daemon/ast-drift.js +496 -0
  201. package/src/daemon/ast-parser-layer.js +258 -258
  202. package/src/daemon/budget-governor.js +633 -633
  203. package/src/daemon/callgraph-overlay.js +646 -646
  204. package/src/daemon/error-worker.js +1209 -626
  205. package/src/daemon/fix-cycle.js +384 -377
  206. package/src/daemon/hybrid-mapper.js +929 -929
  207. package/src/daemon/ingest-refresh.js +79 -11
  208. package/src/daemon/jira-lifecycle.js +767 -632
  209. package/src/daemon/operator-control.js +657 -657
  210. package/src/daemon/pulse.js +327 -327
  211. package/src/daemon/reliability-lane.js +471 -471
  212. package/src/daemon/scope-engine.js +1068 -0
  213. package/src/daemon/watchdog.js +971 -971
  214. package/src/events/schema.js +190 -0
  215. package/src/guide/generator.js +316 -316
  216. package/src/ingest/engine.js +933 -918
  217. package/src/ingest/ownership.js +380 -0
  218. package/src/interactive/index.js +97 -97
  219. package/src/legacy-cli.js +3228 -2994
  220. package/src/mcp/registry.js +695 -695
  221. package/src/memory/blackboard.js +301 -301
  222. package/src/memory/retrieval.js +581 -581
  223. package/src/orchestrator/kai-chen.js +126 -0
  224. package/src/plugin/manifest.js +553 -553
  225. package/src/policy/packs.js +144 -144
  226. package/src/prompt/generator.js +136 -118
  227. package/src/review/ai-review.js +672 -679
  228. package/src/review/compliance-pack.js +389 -0
  229. package/src/review/investor-dd-config.js +54 -0
  230. package/src/review/investor-dd-file-loop.js +303 -0
  231. package/src/review/investor-dd-file-router.js +406 -0
  232. package/src/review/investor-dd-html-report.js +233 -0
  233. package/src/review/investor-dd-notification.js +120 -0
  234. package/src/review/investor-dd-orchestrator.js +405 -0
  235. package/src/review/investor-dd-persona-runner.js +275 -0
  236. package/src/review/live-validator.js +253 -0
  237. package/src/review/local-review.js +1351 -1305
  238. package/src/review/omargate-interactive.js +68 -68
  239. package/src/review/omargate-orchestrator.js +492 -300
  240. package/src/review/persona-prompts.js +484 -296
  241. package/src/review/reconciliation-rules.js +329 -0
  242. package/src/review/replay.js +235 -235
  243. package/src/review/report.js +664 -664
  244. package/src/review/reproducibility-chain.js +136 -0
  245. package/src/review/scan-modes.js +147 -42
  246. package/src/review/spec-binding.js +487 -487
  247. package/src/scaffold/generator.js +67 -67
  248. package/src/scaffold/templates.js +150 -150
  249. package/src/scan/generator.js +418 -418
  250. package/src/scan/gh-secrets.js +107 -107
  251. package/src/session/agent-registry.js +359 -0
  252. package/src/session/analytics.js +479 -0
  253. package/src/session/daemon.js +1396 -0
  254. package/src/session/file-locks.js +666 -0
  255. package/src/session/paths.js +37 -0
  256. package/src/session/recap.js +567 -0
  257. package/src/session/redact.js +82 -0
  258. package/src/session/runtime-bridge.js +762 -0
  259. package/src/session/scoring.js +406 -0
  260. package/src/session/setup-guides.js +304 -0
  261. package/src/session/store.js +704 -0
  262. package/src/session/stream.js +333 -0
  263. package/src/session/sync.js +753 -0
  264. package/src/session/tasks.js +1054 -0
  265. package/src/session/templates.js +188 -0
  266. package/src/spec/generator.js +619 -519
  267. package/src/spec/regenerate.js +237 -237
  268. package/src/spec/templates.js +91 -91
  269. package/src/swarm/dashboard.js +247 -247
  270. package/src/swarm/factory.js +363 -363
  271. package/src/swarm/pentest.js +934 -934
  272. package/src/swarm/registry.js +419 -419
  273. package/src/swarm/report.js +158 -158
  274. package/src/swarm/runtime.js +569 -576
  275. package/src/swarm/scenario-dsl.js +272 -272
  276. package/src/telemetry/ledger.js +302 -302
  277. package/src/telemetry/session-tracker.js +234 -234
  278. package/src/telemetry/sync.js +203 -203
  279. package/src/ui/command-hints.js +13 -13
  280. package/src/ui/markdown.js +220 -220
package/README.md CHANGED
@@ -1,996 +1,1009 @@
1
- # sentinelayer-cli
2
-
3
- `npx sentinelayer-cli@latest <project-name>`
4
-
5
- Scaffolds Sentinelayer spec/prompt/guide artifacts and bootstraps `SENTINELAYER_TOKEN` without manual copy/paste, with optional `BYOK` mode.
6
-
7
- CLI binaries:
8
-
9
- - `sentinelayer-cli` (primary)
10
- - `create-sentinelayer` (compatibility alias)
11
- - `sentinel` (legacy alias)
12
- - `sl` (short alias)
13
-
14
- ## What it does
15
-
16
- - runs an interactive project interview
17
- - opens browser auth at Sentinelayer `/cli-auth`
18
- - receives approved auth session in terminal
19
- - supports explicit `BYOK` mode (skip Sentinelayer browser auth/token bootstrap)
20
- - optionally opens GitHub auth (`gh auth login -w`) and lets you arrow-select a repo
21
- - optionally clones the selected repo into the current folder for in-place feature work
22
- - generates `spec + build guide + execution prompt + omar workflow + todo + handoff prompt`
23
- - issues bootstrap `SENTINELAYER_TOKEN` when managed auth mode is used
24
- - writes token to local `.env` when managed auth mode is used
25
- - optionally injects token to GitHub Actions secret via `gh secret set` in managed auth mode
26
- - ensures target workspace is a git repo (`git init` + `origin` when needed)
27
-
28
- ## Current Production Bundle
29
-
30
- Initial production scope is intentionally narrow and hardened:
31
-
32
- - Omar baseline gate workflows and deterministic local gate checks
33
- - Jules Tanaka deep frontend audits (`sl audit frontend --stream`)
34
- - Reproducible review/audit artifacts and runtime telemetry
35
-
36
- Primary commands in this shipping lane:
37
-
38
- ```bash
39
- sl auth login --api-url https://api.sentinelayer.com
40
- sl scan init --path . --non-interactive
41
- sl omargate deep --path .
42
- sl audit frontend --path ./my-react-app --stream
43
- sl review --diff
44
- sl watch run-events --run-id <run-id>
45
- ```
46
-
47
- Windows PowerShell note: `sl` is a built-in alias for `Set-Location`. Use `sentinelayer-cli` (or short alias `slc`) instead.
48
-
49
- ## 60-second flow
50
-
51
- 1. Trigger:
52
-
53
- ```bash
54
- npx sentinelayer-cli@latest my-agent-app
55
- ```
56
-
57
- 2. Interview prompts (project goal, provider, coding agent, auth mode, depth, audience, project type, optional repo connect).
58
- 3. If repo connect is enabled:
59
- - choose repo source: current repo, GitHub picker, or manual `owner/repo`
60
- - optional browser GitHub authorization
61
- - optional clone into local workspace for existing-codebase feature work
62
- 4. Browser auth opens automatically in managed auth mode.
63
- 5. Token + artifacts are generated.
64
- 6. CLI prints handoff and next command:
65
-
66
- ```bash
67
- npm run sentinel:start
68
- ```
69
-
70
- ## Non-interactive mode (CI/E2E)
71
-
72
- Use non-interactive mode to run full scaffolding in automation:
73
-
74
- ```bash
75
- SENTINELAYER_CLI_INTERVIEW_JSON='{"projectName":"demo-app","projectDescription":"Build an autonomous secure code review orchestrator.","aiProvider":"openai","codingAgent":"codex","authMode":"sentinelayer","generationMode":"detailed","audienceLevel":"developer","projectType":"greenfield","techStack":["TypeScript","Node.js"],"features":["auth","scan"],"connectRepo":false,"injectSecret":false}' \
76
- npx sentinelayer-cli@latest demo-app --non-interactive --skip-browser-open
77
- ```
78
-
79
- Inputs for non-interactive mode:
80
-
81
- - `SENTINELAYER_CLI_INTERVIEW_JSON` (JSON string)
82
- - interview JSON supports `authMode: "sentinelayer" | "byok"` (default: `sentinelayer`)
83
- - or `--interview-file <path-to-json>`
84
- - `--non-interactive` is required to disable prompts
85
- - `--skip-browser-open` avoids launching local browser in headless runs
86
- - `--help` / `-h` prints CLI usage
87
- - `--version` / `-v` prints CLI version
88
- - `SENTINELAYER_GITHUB_CLONE_BASE_URL` overrides clone base (default `https://github.com`)
89
-
90
- ## Generated files
91
-
92
- - `docs/spec.md`
93
- - `docs/build-guide.md`
94
- - `prompts/execution-prompt.md`
95
- - `.github/workflows/omar-gate.yml`
96
- - `tasks/todo.md`
97
- - `AGENT_HANDOFF_PROMPT.md` (read order + Omar loop + local command matrix + workflow tuning options)
98
- - coding-agent config file for selected agent when supported (examples: `CLAUDE.md`, `.cursorrules`, `.github/copilot-instructions.md`)
99
- - `package.json` (adds `sentinel:start`, `sentinel:omargate`, `sentinel:omargate:json`, `sentinel:audit`, `sentinel:audit:json`, `sentinel:persona:*`, `sentinel:apply` when missing)
100
- - `.env` with `SENTINELAYER_TOKEN` (or API-provided secret name) in managed auth mode
101
-
102
- ## Advanced options
103
-
104
- When `Advanced options?` is enabled:
105
-
106
- - `Auth mode` (`sentinelayer` or `byok`)
107
- - `Connect a GitHub repo and inject Actions secret?`
108
- - `How should we choose the repo?` (current / GitHub picker / manual)
109
- - GitHub picker reads all accessible repos via paginated `gh api`
110
- - `Clone this repo locally and build directly into it now?`
111
- - `Inject SENTINELAYER_TOKEN into GitHub Actions secrets now?` (managed auth mode only)
112
- - Final review step lets you proceed, restart interview, or cancel cleanly
113
-
114
- The CLI validates repo format and secret-name format before injection.
115
-
116
- ## Existing codebase mode
117
-
118
- When `Clone this repo locally and build directly into it now?` is enabled:
119
-
120
- - the CLI clones `<owner>/<repo>` into `./<repo-name>` unless current folder already matches that repo
121
- - it writes generated docs/prompts/tasks/workflow into that cloned repo
122
- - it extracts a deterministic repo summary and includes it in generation context
123
- - if the repo is empty, scaffolding still proceeds deterministically
124
- - if the target folder already contains a different non-empty repo, CLI fails fast with a clear error
125
- - if the target folder is a git repo without a detectable GitHub `origin`, CLI refuses to continue
126
-
127
- ## Token handling model
128
-
129
- - browser auth JWT is used in-memory only
130
- - in managed auth mode, CLI stores only bootstrap token in `.env`
131
- - in managed auth mode, GitHub secret injection uses stdin (`gh secret set ...`) and never writes token to command history
132
- - in managed auth mode, secret injection is verified with `gh secret list --repo <owner/repo>`
133
- - API fallback secret name is pinned to `SENTINELAYER_TOKEN` if server response is invalid
134
- - in BYOK mode, no Sentinelayer token is created or injected
135
-
136
- ## Persistent CLI auth sessions (Phase 4 foundation slice)
137
-
138
- For long-running agent/operator workflows, the CLI now supports persistent auth sessions:
139
-
140
- - `sl auth login --api-url https://api.sentinelayer.com --skip-browser-open`
141
- - `sl auth status`
142
- - `sl auth logout`
143
- - `sl auth sessions`
144
- - `sl auth revoke --token-id <token-id>`
145
-
146
- On Windows PowerShell, run these as `sentinelayer-cli auth ...` or `slc auth ...`.
147
-
148
- Behavior:
149
-
150
- - login uses browser approval (`/api/v1/auth/cli/sessions/*`)
151
- - after approval, CLI mints a long-lived API token (`/api/v1/auth/api-tokens`)
152
- - session metadata is stored at `~/.sentinelayer/credentials.json`
153
- - token storage uses OS keyring only when explicitly enabled (`SENTINELAYER_KEYRING_MODE=keyring`) and `keytar` is installed; file fallback is used otherwise
154
- - near-expiry token rotation is automatic on command use for stored sessions
155
- - env/config tokens still take precedence:
156
- - `SENTINELAYER_TOKEN`
157
- - `.sentinelayer.yml` `sentinelayerToken`
158
-
159
- Opt-in to keyring usage:
160
-
161
- - `SENTINELAYER_KEYRING_MODE=keyring` (requires `npm install keytar`)
162
-
163
- Opt-out of keyring usage (overrides any opt-in):
164
-
165
- - `SENTINELAYER_DISABLE_KEYRING=1`
166
-
167
- ## Runtime watch streaming (Phase 9 foundation slice)
168
-
169
- You can stream runtime run events directly from the CLI:
170
-
171
- - `sl watch run-events --run-id <run-id>`
172
- - `sl watch runtime --run-id <run-id>` (alias)
173
- - `sl watch history` (list persisted watch summaries)
174
-
175
- Options:
176
-
177
- - `--poll-seconds <seconds>` polling interval
178
- - `--max-idle-seconds <seconds>` optional idle timeout
179
- - `--output-dir <path>` artifact root override
180
- - `--json` machine-readable event stream + summary
181
-
182
- By default, watch output is persisted to:
183
-
184
- - `.sentinelayer/observability/runtime-watch/<run-id>/events-<timestamp>.ndjson`
185
- - `.sentinelayer/observability/runtime-watch/<run-id>/summary-<timestamp>.json`
186
-
187
- ## Chat command foundation (Phase 2.1 slice)
188
-
189
- The CLI now includes a low-latency chat command surface:
190
-
191
- - `sl chat ask --prompt "Summarize this diff" --dry-run`
192
- - `sl chat ask --prompt "Explain this failure" --provider openai --model gpt-4o`
193
-
194
- Each call appends reproducible transcript entries to:
195
-
196
- - `.sentinelayer/chat/sessions/<session-id>.jsonl`
197
-
198
- ## Deterministic review pipeline (Phase 9.2 foundation slice)
199
-
200
- The default `review` command now runs a layered deterministic pipeline:
201
-
202
- - `sl review` (full workspace mode)
203
- - `sl review --diff` (staged + unstaged + untracked git changes)
204
- - `sl review --staged` (staged changes only)
205
-
206
- Each run writes reproducible artifacts to:
207
-
208
- - `.sentinelayer/reviews/<run-id>/REVIEW_DETERMINISTIC.md`
209
- - `.sentinelayer/reviews/<run-id>/REVIEW_DETERMINISTIC.json`
210
- - `.sentinelayer/reviews/<run-id>/checks/*.log` (static check output)
211
-
212
- For compatibility, lightweight scan mode remains available:
213
-
214
- - `sl review scan --mode full|diff|staged`
215
- - `.sentinelayer/reports/review-scan-<mode>-<timestamp>.md`
216
-
217
- ## AI review layers (Phase 9.3 slice)
218
-
219
- The `review` command can now add budget-governed AI reasoning on top of deterministic findings:
220
-
221
- - `sl review --ai --provider openai --model gpt-5.3-codex`
222
- - `sl review --ai --ai-dry-run` (no provider call; deterministic synthetic output)
223
- - `sl review --ai --max-cost 1.0 --max-tokens 0 --max-runtime-ms 0 --max-tool-calls 0`
224
-
225
- AI artifacts are persisted in the same run folder:
226
-
227
- - `.sentinelayer/reviews/<run-id>/REVIEW_AI_PROMPT.txt`
228
- - `.sentinelayer/reviews/<run-id>/REVIEW_AI.md`
229
- - `.sentinelayer/reviews/<run-id>/REVIEW_AI.json`
230
-
231
- AI usage, cost, and stop-class telemetry are appended to:
232
-
233
- - `.sentinelayer/cost-history.json`
234
- - `.sentinelayer/observability/run-events.jsonl`
235
-
236
- ## Unified review report + HITL (Phase 9.4 slice)
237
-
238
- Every `review` run now emits reconciled findings:
239
-
240
- - `.sentinelayer/reviews/<run-id>/REVIEW_REPORT.md`
241
- - `.sentinelayer/reviews/<run-id>/REVIEW_REPORT.json`
242
-
243
- Capabilities:
244
-
245
- - `sl review show [--run-id <id>]`
246
- - `sl review export --format sarif|json|md|github-annotations`
247
- - `sl review accept <finding-id> --run-id <id>`
248
- - `sl review reject <finding-id> --run-id <id>`
249
- - `sl review defer <finding-id> --run-id <id>`
250
-
251
- Reconciliation behavior:
252
-
253
- - deduplicates deterministic + AI findings by location/message fingerprint
254
- - preserves highest severity finding in each duplicate cluster
255
- - assigns confidence (`100%` deterministic, model-derived for AI)
256
- - persists HITL decisions in `.sentinelayer/reviews/<run-id>/REVIEW_DECISIONS.json`
257
-
258
- ## Review replay + diff (Phase 9.5 slice)
259
-
260
- Reproducibility commands:
261
-
262
- - `sl review replay <run-id>`
263
- - `sl review diff <base-run-id> <candidate-run-id>`
264
-
265
- Run metadata and comparison artifacts:
266
-
267
- - `.sentinelayer/reviews/<run-id>/REVIEW_RUN_CONTEXT.json`
268
- - `.sentinelayer/reviews/<run-id>/REVIEW_COMPARISON_<base>_vs_<candidate>.json`
269
-
270
- ## Audit orchestrator foundation (Phase 10.1 slice)
271
-
272
- The CLI now includes an audit swarm orchestrator with a built-in 13-agent registry:
273
-
274
- - `sl audit --dry-run`
275
- - `sl audit --agents security,architecture,testing --max-parallel 3`
276
- - `sl audit registry`
277
- - `sl audit security`
278
- - `sl audit architecture`
279
- - `sl audit testing`
280
- - `sl audit performance`
281
- - `sl audit compliance`
282
- - `sl audit documentation`
283
- - `sl audit package --run-id <id>` (or omit `--run-id` to package latest run)
284
- - `sl audit replay <run-id>`
285
- - `sl audit diff <base-run-id> <candidate-run-id>`
286
- - `sl audit local` (legacy compatibility path for `/audit`)
287
-
288
- Artifacts are written to:
289
-
290
- - `.sentinelayer/audits/<run-id>/AUDIT_REPORT.md`
291
- - `.sentinelayer/audits/<run-id>/AUDIT_REPORT.json`
292
- - `.sentinelayer/audits/<run-id>/agents/<agent-id>.json`
293
- - `.sentinelayer/audits/<run-id>/agents/SECURITY_AGENT_REPORT.md` (security specialist)
294
- - `.sentinelayer/audits/<run-id>/agents/ARCHITECTURE_AGENT_REPORT.md` (architecture specialist)
295
- - `.sentinelayer/audits/<run-id>/agents/TESTING_AGENT_REPORT.md` (testing specialist)
296
- - `.sentinelayer/audits/<run-id>/agents/PERFORMANCE_AGENT_REPORT.md` (performance specialist)
297
- - `.sentinelayer/audits/<run-id>/agents/COMPLIANCE_AGENT_REPORT.md` (compliance specialist)
298
- - `.sentinelayer/audits/<run-id>/agents/DOCUMENTATION_AGENT_REPORT.md` (documentation specialist)
299
- - `.sentinelayer/audits/<run-id>/DD_PACKAGE_MANIFEST.json`
300
- - `.sentinelayer/audits/<run-id>/DD_FINDINGS_INDEX.json`
301
- - `.sentinelayer/audits/<run-id>/DD_EXEC_SUMMARY.md`
302
- - `.sentinelayer/audits/<run-id>/AUDIT_COMPARISON_<base>_vs_<candidate>.json`
303
-
304
- ## QA swarm orchestrator factory (Phase 12.1 slice)
305
-
306
- The CLI now includes OMAR-led swarm planning commands for governed long-running runs:
307
-
308
- - `sl swarm registry`
309
- - `sl swarm plan --path . --scenario error_event_remediation --agents security,testing,reliability --json`
310
-
311
- `swarm plan` outputs deterministic orchestration artifacts (assignments, budgets, and phase graph):
312
-
313
- - `.sentinelayer/swarms/<run-id>/SWARM_PLAN.json`
314
- - `.sentinelayer/swarms/<run-id>/SWARM_PLAN.md`
315
-
316
- Global budgets can be set per run:
317
-
318
- - `--max-cost-usd`
319
- - `--max-output-tokens`
320
- - `--max-runtime-ms`
321
- - `--max-tool-calls`
322
- - `--warning-threshold-percent`
323
-
324
- ## Playwright agent runtime (Phase 12.2 slice)
325
-
326
- The swarm runtime loop can now be executed directly from CLI:
327
-
328
- - `sl swarm run --path . --agents security,testing --json` (default mock runtime, dry-run)
329
- - `sl swarm run --plan-file .sentinelayer/swarms/<plan-run-id>/SWARM_PLAN.json --engine playwright --execute --start-url https://example.com`
330
-
331
- Runtime artifacts are persisted under:
332
-
333
- - `.sentinelayer/swarms/<runtime-run-id>/runtime/SWARM_RUNTIME.json`
334
- - `.sentinelayer/swarms/<runtime-run-id>/runtime/SWARM_RUNTIME.md`
335
- - `.sentinelayer/swarms/<runtime-run-id>/runtime/events.ndjson`
336
-
337
- Optional Playwright actions can be provided via playbook JSON:
338
-
339
- - `--playbook-file <path>` where file contract is `{ "actions": [ ... ] }`
340
-
341
- ## Scenario DSL (Phase 12.3 slice)
342
-
343
- Swarm runtime now supports a deterministic scenario DSL (`.sls`):
344
-
345
- - `sl swarm scenario init nightly-smoke --path .`
346
- - `sl swarm scenario validate --file .sentinelayer/scenarios/nightly-smoke.sls`
347
- - `sl swarm run --scenario-file .sentinelayer/scenarios/nightly-smoke.sls --json`
348
-
349
- DSL commands:
350
-
351
- - `scenario "<id>"`
352
- - `start_url "<url>"`
353
- - `tag "<value>"`
354
- - `action goto "<url>"`
355
- - `action click "<selector>"`
356
- - `action fill "<selector>" "<text>"`
357
- - `action wait <ms>`
358
- - `action screenshot "<relative-path>"`
359
-
360
- ## Realtime swarm dashboard (Phase 12.4 slice)
361
-
362
- The CLI now supports runtime swarm dashboard snapshots and watch streaming:
363
-
364
- - `sl swarm dashboard --run-id <runtime-run-id>`
365
- - `sl swarm dashboard --watch --run-id <runtime-run-id> --poll-seconds 2 --max-idle-seconds 20`
366
-
367
- Machine-readable output:
368
-
369
- - `sl swarm dashboard --json`
370
- - `sl swarm dashboard --watch --json`
371
-
372
- Dashboard data includes per-agent status rows, usage counters, stop class, and recent timeline events.
373
-
374
- ## Swarm execution report (Phase 12.5 slice)
375
-
376
- You can package runtime artifacts into a deterministic execution report bundle:
377
-
378
- - `sl swarm report --run-id <runtime-run-id>`
379
- - `sl swarm report --json`
380
-
381
- Report artifacts:
382
-
383
- - `.sentinelayer/swarms/<runtime-run-id>/runtime/SWARM_EXECUTION_REPORT.json`
384
- - `.sentinelayer/swarms/<runtime-run-id>/runtime/SWARM_EXECUTION_REPORT.md`
385
-
386
- The report links runtime usage, stop class, per-agent status summary, recent events, and plan/runtime artifact paths.
387
-
388
- ## Security pen-test mode (Phase 12.6 slice)
389
-
390
- The CLI now includes a governed pen-test swarm entrypoint:
391
-
392
- - `sl swarm create --scenario pen-test --pen-test-scenario auth-bypass --target https://app.customer.local --target-id <target-id>`
393
- - `sl swarm create --scenario input-validation --target https://app.customer.local --target-id <target-id> --execute`
394
-
395
- Built-in pen-test scenarios:
396
-
397
- - `auth-bypass`
398
- - `rate-limit-probe`
399
- - `input-validation`
400
- - `privilege-escalation`
401
-
402
- Policy enforcement is strict:
403
-
404
- - target must exist in local AIdenID target registry and be `VERIFIED`
405
- - target must not be frozen/inactive
406
- - target host must match `--target`
407
- - scenario, methods, and paths must stay within target policy (`allowedScenarios`, `allowedMethods`, `allowedPaths`)
408
-
409
- Pen-test artifacts:
410
-
411
- - `.sentinelayer/swarms/<pentest-run-id>/pentest/REQUEST_PLAN.json`
412
- - `.sentinelayer/swarms/<pentest-run-id>/pentest/audit.jsonl` (full request/response headers+body)
413
- - `.sentinelayer/swarms/<pentest-run-id>/pentest/PENTEST_REPORT.json`
414
- - `.sentinelayer/swarms/<pentest-run-id>/pentest/PENTEST_REPORT.md`
415
-
416
- `PENTEST_REPORT` findings are keyed to OWASP categories and surface `P0-P3` severity summary + blocking status.
417
-
418
- ## Swarm identity hardening (Phase 12.7 slice)
419
-
420
- Identity security controls now include:
421
-
422
- - zero-trust swarm identity manifest per run (`IDENTITY_ISOLATION.json`)
423
- - cryptographic audit chain on pen-test request logs (`previousEntryHash` + `entryHash` + `entryHmac`)
424
- - crash-safe cleanup contract artifact (`CLEANUP_CONTRACT.json`) for post-run squash scheduling
425
- - legal-hold guardrails on revoke/revoke-children commands
426
-
427
- New identity lifecycle commands:
428
-
429
- - `sl ai identity audit --stale --json`
430
- - `sl ai identity legal-hold status <identity-id> --json`
431
- - `sl ai identity kill-all --tags <tag1,tag2> [--execute] --json`
432
-
433
- `kill-all --execute` blocks legal-hold identities and marks eligible tagged identities as `SQUASHED` in local registry with campaign metadata.
434
-
435
- ## Error daemon worker (Phase 13.1 slice)
436
-
437
- The CLI now includes an OMAR daemon lane for deterministic error intake and routed queue generation:
438
-
439
- - `sl daemon error record --service sentinelayer-api --endpoint /v1/runtime/runs --error-code RUNTIME_TIMEOUT --severity P1 --message "runtime timeout"`
440
- - `sl daemon error worker --max-events 200 --json`
441
- - `sl daemon error queue --json`
442
-
443
- Daemon artifacts:
444
-
445
- - `.sentinelayer/observability/error-daemon/admin-error-stream.ndjson` (append-only intake stream)
446
- - `.sentinelayer/observability/error-daemon/queue.json` (deduped routed queue work items)
447
- - `.sentinelayer/observability/error-daemon/worker-state.json` (stream cursor + aggregate stats)
448
- - `.sentinelayer/observability/error-daemon/intake/intake-*.json` (per-event intake snapshots)
449
- - `.sentinelayer/observability/error-daemon/runs/error-daemon-run-*.json` (worker tick execution evidence)
450
-
451
- Queue routing behavior:
452
-
453
- - events are fingerprinted from service, endpoint, error code, stack fingerprint, and commit sha
454
- - matching open fingerprints are deduped with `occurrenceCount` increments and severity escalation
455
- - worker cursor tracks processed stream offset for deterministic resumability across ticks
456
-
457
- ## Global assignment ledger (Phase 13.2 slice)
458
-
459
- Daemon assignment controls now support explicit claim/heartbeat/release/reassign flow with lease tracking:
460
-
461
- - `sl daemon assign claim <work-item-id> --agent maya.markov@sentinelayer.local --lease-ttl-seconds 1800 --stage triage --run-id run_001 --jira-issue-key SL-101`
462
- - `sl daemon assign heartbeat <work-item-id> --agent maya.markov@sentinelayer.local --stage analysis --run-id run_002`
463
- - `sl daemon assign reassign <work-item-id> --from-agent maya.markov@sentinelayer.local --to-agent mark.rao@sentinelayer.local --stage fix`
464
- - `sl daemon assign release <work-item-id> --agent mark.rao@sentinelayer.local --status DONE --reason "fix merged"`
465
- - `sl daemon assign list --status DONE --agent mark.rao@sentinelayer.local --json`
466
-
467
- Ledger artifacts:
468
-
469
- - `.sentinelayer/observability/error-daemon/assignment-ledger.json` (current assignment state)
470
- - `.sentinelayer/observability/error-daemon/assignment-events.ndjson` (claim/heartbeat/reassign/release event history)
471
-
472
- Tracked assignment fields include:
473
-
474
- - `workItemId`
475
- - `assignedAgentIdentity`
476
- - `leasedAt`
477
- - `leaseTtlSeconds`
478
- - `leaseExpiresAt`
479
- - `status`
480
- - `stage`
481
- - `runId`
482
- - `jiraIssueKey`
483
- - `budgetSnapshot`
484
-
485
- ## Jira lifecycle automation (Phase 13.3 slice)
486
-
487
- Daemon Jira lifecycle commands now support ticket create/start/comment/transition traces tied to work items:
488
-
489
- - `sl daemon jira open <work-item-id> --issue-key-prefix SL`
490
- - `sl daemon jira start <work-item-id> --plan "1) reproduce 2) patch 3) verify" --actor maya.markov@sentinelayer.local --assignee maya.markov@sentinelayer.local`
491
- - `sl daemon jira comment --work-item-id <work-item-id> --type checkpoint --message "patch applied"`
492
- - `sl daemon jira transition --work-item-id <work-item-id> --to DONE --reason "fix merged"`
493
- - `sl daemon jira list --status DONE --work-item-id <work-item-id> --json`
494
-
495
- Lifecycle artifacts:
496
-
497
- - `.sentinelayer/observability/error-daemon/jira-lifecycle.json` (issue state, comments, transitions)
498
- - `.sentinelayer/observability/error-daemon/jira-events.ndjson` (append-only lifecycle event feed)
499
-
500
- When an assignment exists for the same work item, Jira issue keys are synced into assignment ledger records for deterministic handoff continuity.
501
-
502
- ## Runtime budget quarantine (Phase 13.4 slice)
503
-
504
- Daemon budget governor commands now enforce hard-limit transitions with quarantine grace and deterministic kill path:
505
-
506
- - `sl daemon budget check <work-item-id> --usage-json '{"tokensUsed":150}' --budget-json '{"maxTokens":100,"quarantineGraceSeconds":30}'`
507
- - `sl daemon budget status --work-item-id <work-item-id> --json`
508
-
509
- Lifecycle states:
510
-
511
- - `WITHIN_BUDGET`
512
- - `WARNING_THRESHOLD`
513
- - `HARD_LIMIT_QUARANTINED`
514
- - `HARD_LIMIT_SQUASHED`
515
-
516
- Governor behavior:
517
-
518
- - crossing a hard limit transitions the work item into quarantine (`action=QUARANTINE`, queue/assignment status `BLOCKED`)
519
- - if hard-limit usage persists past `quarantineGraceSeconds`, governor triggers deterministic kill (`action=KILL`, queue/assignment status `SQUASHED`)
520
- - warning thresholds (`warningThresholdPercent`) surface near-limit signals without blocking
521
-
522
- Budget artifacts:
523
-
524
- - `.sentinelayer/observability/error-daemon/budget-state.json`
525
- - `.sentinelayer/observability/error-daemon/budget-events.ndjson`
526
- - `.sentinelayer/observability/error-daemon/budget-runs/budget-check-*.json`
527
-
528
- ## Operator control plane (Phase 13.5 slice)
529
-
530
- Daemon operator control commands now provide unified queue/assignment/jira/budget visibility with explicit stop controls:
531
-
532
- - `sl daemon control --json`
533
- - `sl daemon control snapshot --status ASSIGNED,BLOCKED --agent maya.markov@sentinelayer.local --json`
534
- - `sl daemon control stop <work-item-id> --mode QUARANTINE --reason "manual triage hold" --confirm --json`
535
- - `sl daemon control stop <work-item-id> --mode SQUASH --reason "kill switch activated" --confirm --json`
536
-
537
- Control-plane snapshot fields include:
538
-
539
- - per-work-item budget health color (`GREEN`, `YELLOW`, `RED`)
540
- - session timers (`sessionElapsedSeconds`, `sessionIdleSeconds`)
541
- - assignment + Jira linkage (`assignedAgentIdentity`, `assignmentStatus`, `jiraIssueKey`, `jiraStatus`)
542
- - agent roster aggregates (`activeWorkItemCount`, `blockedCount`, `squashedCount`, longest-session duration)
543
-
544
- Operator control artifacts:
545
-
546
- - `.sentinelayer/observability/error-daemon/operator-control-state.json`
547
- - `.sentinelayer/observability/error-daemon/operator-events.ndjson`
548
- - `.sentinelayer/observability/error-daemon/operator-snapshots/operator-snapshot-*.json`
549
-
550
- ## Artifact lineage tree (Phase 13.6 slice)
551
-
552
- Daemon lineage commands now index reproducibility links across queue, assignment, Jira, budget, and operator artifacts:
553
-
554
- - `sl daemon lineage build --json`
555
- - `sl daemon lineage list --status ASSIGNED,BLOCKED --json`
556
- - `sl daemon lineage show <work-item-id> --json`
557
-
558
- Lineage index fields include:
559
-
560
- - work-item links (`agentIdentity`, `assignmentStatus`, `loopRunId`, `jiraIssueKey`, `budgetLifecycleState`)
561
- - artifact pointers (queue/ledger/jira/budget/operator state files + per-work-item run artifacts)
562
- - reproducibility run catalogs (`errorDaemonRuns`, `budgetChecks`, `operatorSnapshots`)
563
-
564
- Lineage artifacts:
565
-
566
- - `.sentinelayer/observability/error-daemon/lineage/lineage-index.json`
567
- - `.sentinelayer/observability/error-daemon/lineage/lineage-events.ndjson`
568
-
569
- ## Hybrid mapping overlay (Phase 13.7 slice)
570
-
571
- Daemon hybrid mapping commands now combine deterministic signal routing with on-demand import-graph expansion and semantic scoring:
572
-
573
- - `sl daemon map scope <work-item-id> --max-files 40 --graph-depth 2 --json`
574
- - `sl daemon map list --work-item-id <work-item-id> --json`
575
- - `sl daemon map show <work-item-id> --json`
576
-
577
- Hybrid scope map output includes:
578
-
579
- - deterministic seed files from endpoint/error/service token matches
580
- - import-graph overlay (`graphDepth`) from seed files
581
- - semantic scoring from endpoint/signal token matches in file content
582
- - ranked scoped file set with per-file reasons (`deterministic_path_match`, `semantic_content_match`, `import_graph_distance`)
583
-
584
- Hybrid mapping artifacts:
585
-
586
- - `.sentinelayer/observability/error-daemon/mapping/hybrid-map-index.json`
587
- - `.sentinelayer/observability/error-daemon/mapping/hybrid-map-events.ndjson`
588
- - `.sentinelayer/observability/error-daemon/mapping/runs/hybrid-map-*.json`
589
-
590
- ## Midnight reliability lane (Phase 13.8 slice)
591
-
592
- Daemon reliability commands now support scheduled synthetic checks and maintenance-billboard automation:
593
-
594
- - `sl daemon reliability run --region us-east-1 --timezone America/New_York --json`
595
- - `sl daemon reliability run --simulate-failure aidenid_password_reset_flow --json`
596
- - `sl daemon reliability status --json`
597
- - `sl daemon maintenance status|on|off --json`
598
-
599
- Lane behavior:
600
-
601
- - failures enqueue deterministic daemon error events (`source=reliability_lane`) and execute one worker tick
602
- - failures can auto-enable maintenance billboard for operator/HITL visibility
603
- - passing runs can automatically clear reliability-opened maintenance state
604
- - manual maintenance controls remain available (`maintenance on|off`) with reason/actor audit trail
605
-
606
- Reliability artifacts:
607
-
608
- - `.sentinelayer/observability/error-daemon/reliability/lane-config.json`
609
- - `.sentinelayer/observability/error-daemon/reliability/maintenance-billboard.json`
610
- - `.sentinelayer/observability/error-daemon/reliability/reliability-events.ndjson`
611
- - `.sentinelayer/observability/error-daemon/reliability/runs/reliability-lane-*.json`
612
-
613
- ## MCP registry schema foundation (Phase 6 foundation slice)
614
-
615
- The CLI now includes deterministic MCP registry commands:
616
-
617
- - `sl mcp schema show`
618
- - `sl mcp schema write`
619
- - `sl mcp registry init-aidenid`
620
- - `sl mcp registry init-aidenid-adapter`
621
- - `sl mcp registry validate --file <path>`
622
- - `sl mcp registry validate-aidenid-adapter --file <path> [--registry-file <path>]`
623
- - `sl mcp server init --id <server-id> --registry-file <path>`
624
- - `sl mcp server validate --file <path>`
625
- - `sl mcp bridge init-vscode --server-id <server-id> --server-config <path>`
626
-
627
- Use `init-aidenid` to scaffold an Anthropic-compatible tool schema wrapper for AIdenID provisioning APIs, then customize transport/auth before runtime wiring.
628
- Use `init-aidenid-adapter` to scaffold a deterministic AIdenID provisioning API contract (tool binding -> HTTP path/method -> response field mapping) and cross-check it against the registry with `validate-aidenid-adapter`.
629
-
630
- ## Plugin governance foundation (Phase 5.2 slice)
631
-
632
- The CLI now includes deterministic plugin/template/policy pack governance commands:
633
-
634
- - `sl plugin init --id <plugin-id> --pack-type plugin|template_pack|policy_pack|hybrid --stage pre_scan|scan|post_scan|reporting`
635
- - `sl plugin validate --file <manifest.json>`
636
- - `sl plugin list`
637
- - `sl plugin order [--stage <stage>]` (deterministic load-order resolution + cycle detection)
638
-
639
- ## Policy packs (Phase 5.3 slice)
640
-
641
- The CLI now includes policy-pack selection commands:
642
-
643
- - `sl policy list`
644
- - `sl policy use strict --scope project`
645
- - `sl policy use compliance-soc2 --scope global`
646
-
647
- Built-in packs: `community` (default), `strict`, `compliance-soc2`, `compliance-hipaa`.
648
- Policy selection is stored in config (`defaultPolicyPack`) and applied during `scan init` / `scan validate` / `scan precheck` profile resolution.
649
-
650
- ## AIdenID CLI foundation (Phase 11 foundation slice)
651
-
652
- The CLI now includes an `sl ai` surface for AIdenID identity provisioning:
653
-
654
- - `sl ai provision-email --json` (dry-run artifact generation)
655
- - `sl ai provision-email --execute --api-key <key> --org-id <id> --project-id <id>` (live API call)
656
- - `sl ai identity list --json` (list locally tracked identities)
657
- - `sl ai identity show <identity-id> --json`
658
- - `sl ai identity revoke <identity-id> --execute --api-key <key> --org-id <id> --project-id <id>`
659
- - `sl ai identity create-child <parent-identity-id> --event-budget 25 --execute --api-key <key> --org-id <id> --project-id <id>`
660
- - `sl ai identity lineage <identity-id> --json`
661
- - `sl ai identity revoke-children <parent-identity-id> --execute --api-key <key> --org-id <id> --project-id <id>`
662
- - `sl ai identity domain create|verify|freeze ...` (domain proof + freeze lifecycle controls)
663
- - `sl ai identity target create|verify|show ...` (managed target policy/proof controls)
664
- - `sl ai identity site create <identity-id> --domain-id <domain-id> --execute ...`
665
- - `sl ai identity site list [--identity-id <identity-id>]`
666
- - `sl ai identity events <identity-id> --json` (list inbound events with cursor/limit support)
667
- - `sl ai identity latest <identity-id> --json` (latest event + extraction metadata)
668
- - `sl ai identity wait-for-otp <identity-id> --min-confidence 0.8 --timeout 60 --json`
669
-
670
- Identity lifecycle records are persisted to:
671
-
672
- - `.sentinelayer/aidenid/identity-registry.json`
673
-
674
- Credential env fallbacks for live execution:
675
-
676
- - `AIDENID_API_KEY`
677
- - `AIDENID_ORG_ID`
678
- - `AIDENID_PROJECT_ID`
679
-
680
- Extraction responses include deterministic source metadata (`RULES` vs `LLM`) and confidence scores.
681
-
682
- ## Manual fallback (if auto injection is skipped)
683
-
684
- 1. Set local token:
685
-
686
- ```bash
687
- echo "SENTINELAYER_TOKEN=<your-token>" >> .env
688
- ```
689
-
690
- 2. Inject repo secret:
691
-
692
- ```bash
693
- gh secret set SENTINELAYER_TOKEN --repo <owner/repo>
694
- gh secret list --repo <owner/repo>
695
- ```
696
-
697
- 3. For manual setup details: `https://sentinelayer.com/docs/getting-started/install-workflow`
698
-
699
- 4. BYOK mode (no Sentinelayer token):
700
- - keep generated `docs/spec.md`, `docs/build-guide.md`, `prompts/execution-prompt.md`, and `tasks/todo.md`
701
- - run your coding agent directly with your provider key (`OPENAI_API_KEY` / `ANTHROPIC_API_KEY` / `GOOGLE_API_KEY`)
702
- - generated workflow is a BYOK reminder workflow; wire `SENTINELAYER_TOKEN` later to enable Omar Gate action
703
-
704
- ## Environment overrides
705
-
706
- - `SENTINELAYER_API_URL` (default: `https://api.sentinelayer.com`)
707
- - `SENTINELAYER_WEB_URL` (default: `https://sentinelayer.com`)
708
- - `SENTINELAYER_DISABLE_KEYRING=1` (force file-based credential storage)
709
- - `AIDENID_API_KEY`, `AIDENID_ORG_ID`, `AIDENID_PROJECT_ID` (used by `sl ai provision-email --execute`)
710
-
711
- ## Layered config (PR 0.2)
712
-
713
- The CLI supports layered config resolution:
714
-
715
- - global: `~/.sentinelayer/config.yml`
716
- - project: `.sentinelayer.yml` at repo root
717
- - env overrides: `SENTINELAYER_API_URL`, `SENTINELAYER_WEB_URL`, `SENTINELAYER_TOKEN`, `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `GOOGLE_API_KEY`
718
-
719
- Commands:
720
-
721
- - `sentinelayer-cli config list --scope resolved --json`
722
- - `sentinelayer-cli config get apiUrl --scope resolved`
723
- - `sentinelayer-cli config set defaultModelProvider openai --scope project`
724
- - `sentinelayer-cli config edit --scope project`
725
-
726
- ## Codebase ingest (PR 1.1 slice)
727
-
728
- Run deterministic mapping and emit `CODEBASE_INGEST.json`:
729
-
730
- - `sentinelayer-cli ingest map --path .`
731
- - `sentinelayer-cli ingest map --path . --json`
732
- - `sentinelayer-cli ingest map --path . --output-file artifacts/CODEBASE_INGEST.json`
733
-
734
- The ingest artifact includes language/LOC breakdown, framework hints, entry points, risk-surface hints, and a bounded file index to support deterministic handoff context.
735
-
736
- ## Offline spec generation (PR 1.2 slice)
737
-
738
- Generate a local `SPEC.md` without calling the API:
739
-
740
- - `sentinelayer-cli spec list-templates`
741
- - `sentinelayer-cli spec show-template api-service`
742
- - `sentinelayer-cli spec generate --path . --template api-service --description \"Build secure autonomous review orchestration\"`
743
- - `sentinelayer-cli spec show --path .`
744
- - `sentinelayer-cli spec show --path . --plain`
745
- - `sentinelayer-cli spec regenerate --path . --dry-run --json`
746
- - `sentinelayer-cli spec regenerate --path . --max-diff-lines 120`
747
- - `sentinelayer-cli spec regenerate --path . --dry-run --quiet`
748
-
749
- The generator uses deterministic ingest context plus template architecture/security checklists.
750
-
751
- ## AI-enhanced spec generation (PR 3.3 slice)
752
-
753
- Generate a deterministic base spec, then optionally refine it with a provider model:
754
-
755
- - `sentinelayer-cli spec generate --path . --template api-service --description "Harden auth and release workflows" --ai`
756
- - `sentinelayer-cli spec generate --path . --ai --provider openai --model gpt-5.3-codex --max-cost 1 --warn-at-percent 80`
757
-
758
- `--ai` mode behavior:
759
-
760
- - deterministic `SPEC.md` draft is always generated first
761
- - AI refinement prompt includes ingest summary + template context + base markdown
762
- - usage is recorded in `.sentinelayer/cost-history.json`
763
- - telemetry usage/stop events are recorded in `.sentinelayer/observability/run-events.jsonl`
764
- - budget governors apply (`--max-cost`, `--max-tokens`, `--max-runtime-ms`, `--max-tool-calls`, `--max-no-progress`)
765
-
766
- ## Prompt generation (PR 1.3 slice)
767
-
768
- Generate execution prompts directly from `SPEC.md`:
769
-
770
- - `sentinelayer-cli prompt generate --path . --agent codex`
771
- - `sentinelayer-cli prompt preview --path . --agent claude --max-lines 40`
772
- - `sentinelayer-cli prompt show --path . --agent codex`
773
- - `sentinelayer-cli prompt show --path . --file docs/PROMPT_codex.md --plain`
774
-
775
- Supported targets: `claude`, `cursor`, `copilot`, `codex`, `generic`.
776
-
777
- ## Omar workflow generation (PR 1.4 slice)
778
-
779
- Generate and validate a spec-aligned security workflow:
780
-
781
- - `sentinelayer-cli scan init --path . --non-interactive`
782
- - `sentinelayer-cli scan init --path . --has-e2e-tests yes --playwright-mode auto`
783
- - `sentinelayer-cli scan validate --path . --json`
784
-
785
- `scan init` writes `.github/workflows/omar-gate.yml` and derives:
786
-
787
- - `scan_mode` + `severity_gate` from spec risk profile
788
- - `playwright_mode` from spec signals + optional E2E wizard/flags
789
- - `sbom_mode` from supply-chain/dependency signals in spec
790
- - Action bridge parity: generated `scan_mode` options align to `sentinelayer-v1-action` (`baseline`, `deep`, `audit`, `full-depth`) and use the pinned action ref.
791
-
792
- `scan validate` checks workflow drift against the current spec profile and exits non-zero when mismatched.
793
-
794
- AI-assisted pre-scan triage (budgeted + telemetry-instrumented):
795
-
796
- - `sentinelayer-cli scan precheck --path . --provider openai --model gpt-5.3-codex`
797
- - `sentinelayer-cli scan precheck --path . --max-cost 0.5 --warn-at-percent 80 --json`
798
-
799
- `scan precheck` writes an AI report to `.sentinelayer/reports/scan-precheck-*.md` (or configured output root), records usage in `.sentinelayer/cost-history.json`, and emits usage/stop events to `.sentinelayer/observability/run-events.jsonl`.
800
-
801
- ## Build guide generation (PR 1.5 slice)
802
-
803
- Generate phase-by-phase implementation guides from `SPEC.md`:
804
-
805
- - `sentinelayer-cli guide generate --path .`
806
- - `sentinelayer-cli guide generate --path . --output-file docs/BUILD_GUIDE.md`
807
- - `sentinelayer-cli guide show --path .`
808
- - `sentinelayer-cli guide show --path . --plain`
809
-
810
- Export phases as issue-ready payloads:
811
-
812
- - `sentinelayer-cli guide export --path . --format jira`
813
- - `sentinelayer-cli guide export --path . --format linear`
814
- - `sentinelayer-cli guide export --path . --format github-issues`
815
-
816
- `guide generate` writes `BUILD_GUIDE.md` with per-phase effort estimates, dependencies, implementation tasks, and acceptance criteria. `guide export` transforms phases into tracker-friendly artifacts.
817
-
818
- ## Multi-provider AI client contract (PR 3.1 slice)
819
-
820
- `src/ai/client.js` now provides a reusable contract for future AI-enabled commands:
821
-
822
- - provider support: `openai`, `anthropic`, `google`
823
- - provider auto-detection from `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `GOOGLE_API_KEY`
824
- - model resolution defaults per provider with explicit override support
825
- - retry + exponential backoff on retryable statuses (`429`, `5xx`)
826
- - non-stream and streaming invocation APIs with provider-normalized text output
827
-
828
- ## Cost tracking and budgets (PR 3.2 slice)
829
-
830
- The CLI now includes deterministic cost-ledger commands:
831
-
832
- - `sentinelayer-cli cost show --path .`
833
- - `sentinelayer-cli cost record --path . --provider openai --model gpt-5.3-codex --input-tokens 1000 --output-tokens 500`
834
-
835
- Ledger path:
836
-
837
- - `.sentinelayer/cost-history.json` (or configured output root)
838
-
839
- Budget controls in `cost record`:
840
-
841
- - `--max-cost <usd>` (default `1`)
842
- - `--max-tokens <count>` (default `0`, disabled)
843
- - `--max-runtime-ms <n>` (default `0`, disabled)
844
- - `--max-tool-calls <n>` (default `0`, disabled)
845
- - `--max-no-progress <count>` diminishing-returns guard (default `3`)
846
- - `--warn-at-percent <n>` near-limit warning threshold (default `80`)
847
-
848
- Usage counters tracked per invocation/session:
849
-
850
- - `--duration-ms <n>`
851
- - `--tool-calls <n>`
852
-
853
- Each `cost record` call now emits observability events to:
854
-
855
- - `.sentinelayer/observability/run-events.jsonl`
856
-
857
- including normalized usage snapshots and blocking stop-class events when budgets are exceeded.
858
-
859
- ## Observability telemetry contract (PR 3.5 slice)
860
-
861
- The CLI now supports a deterministic run-event ledger and stop-class schema:
862
-
863
- - `sentinelayer-cli telemetry show --path .`
864
- - `sentinelayer-cli telemetry record --path . --event-type tool_call --tool-calls 1`
865
- - `sentinelayer-cli telemetry record --path . --event-type run_stop --stop-class MAX_RUNTIME_MS_EXCEEDED --reason-codes MAX_RUNTIME_MS_EXCEEDED --blocking`
866
-
867
- Ledger contract:
868
-
869
- - file: `.sentinelayer/observability/run-events.jsonl`
870
- - event types: `run_start`, `run_step`, `tool_call`, `usage`, `budget_check`, `run_stop`
871
- - stop classes: `MAX_COST_EXCEEDED`, `MAX_OUTPUT_TOKENS_EXCEEDED`, `DIMINISHING_RETURNS`, `MAX_RUNTIME_MS_EXCEEDED`, `MAX_TOOL_CALLS_EXCEEDED`, `MANUAL_STOP`, `ERROR`, `UNKNOWN`
872
-
873
- ## Requirements
874
-
875
- - Node `>=20.0`
876
- - network access to Sentinelayer API/web
877
- - optional: GitHub CLI (`gh`) authenticated for secret injection
878
-
879
- ## Release to npm
880
-
881
- This repo includes `.github/workflows/release.yml`.
882
- Automated version/tag PR flow is handled by `.github/workflows/release-please.yml`.
883
- Primary gate enforcement is Omar-first:
884
- - `.github/workflows/omar-gate.yml` (`Omar Gate`) for AppSec findings and merge thresholds
885
- - `.github/workflows/quality-gates.yml` (`Quality Summary`) for deterministic build/test/package checks
886
- - `.github/workflows/attestations.yml` (`Attestation Summary`) for provenance verification
887
-
888
- Prerequisites:
889
-
890
- - npm package name is available (`sentinelayer-cli`)
891
- - one publish auth path is configured:
892
- - repository secret `NPM_TOKEN` with publish access, or
893
- - npm trusted publishing for this repository/tag workflow
894
-
895
- Release options:
896
-
897
- 1. Merge to `main` and let `Release Please` open/update the release PR and tag.
898
- 2. Push a tag like `v0.1.1` to publish automatically (or via release-please tag creation).
899
- 3. Run `Release` manually (`workflow_dispatch`) to validate gates and rollback readiness without publishing.
900
- 4. Tag-triggered publish resolves auth mode at runtime (`NPM_TOKEN` first, otherwise trusted publishing OIDC).
901
- 5. If neither auth mode is available, publish fails closed with an explicit workflow error.
902
-
903
- Release publish now enforces tarball checksum-manifest validation and attestation verification bound to `.github/workflows/release.yml` before `npm publish`.
904
-
905
- Release guardrails now require successful upstream checks on the target commit:
906
-
907
- - `Quality Summary`
908
- - `Omar Gate`
909
- - `Attestation Summary`
910
-
911
- ## Local verification
912
-
913
- ```bash
914
- npm run verify
915
- ```
916
-
917
- This runs:
918
-
919
- - CLI syntax check
920
- - unit tests for core offline generators/config/cost tracking
921
- - end-to-end automated scaffolding tests (mock API + mock `gh`)
922
- - coverage enforcement (`>=80%` lines/functions/statements, `>=70%` branches for core modules)
923
- - package tarball dry-run
924
-
925
- Additional test commands:
926
-
927
- - `npm run test:unit`
928
- - `npm run test:e2e`
929
- - `npm run test:coverage`
930
-
931
- ## Local commands (MVP)
932
-
933
- The CLI now supports a command tree, while keeping slash-command compatibility:
934
-
935
- - `sentinelayer-cli init <project-name>` runs scaffold/auth generation (legacy top-level invocation still works)
936
- - `sentinelayer-cli omargate deep --path <repo>` runs a local credential/policy scan and writes `.sentinelayer/reports/omargate-deep-*.md` (non-zero exit if P1 findings exist)
937
- - Local `/omargate` is a local preflight engine; GitHub PR gate execution runs through `sentinelayer-v1-action` -> Sentinelayer API (`/api/v1/github-app/trigger` + `/api/v1/github-app/runs/{id}/status`).
938
- - `sentinelayer-cli audit [--agents <ids>] [--max-parallel <n>]` runs orchestrated audit agents and writes `.sentinelayer/audits/<run-id>/AUDIT_REPORT.{md,json}`
939
- - `sentinelayer-cli audit registry` lists built-in/customized audit-agent registry records
940
- - `sentinelayer-cli audit security` runs the security specialist agent and writes a dedicated `SECURITY_AGENT_REPORT.md`
941
- - `sentinelayer-cli audit architecture` runs the architecture specialist agent and writes a dedicated `ARCHITECTURE_AGENT_REPORT.md`
942
- - `sentinelayer-cli audit testing` runs the testing specialist agent and writes a dedicated `TESTING_AGENT_REPORT.md`
943
- - `sentinelayer-cli audit performance` runs the performance specialist agent and writes a dedicated `PERFORMANCE_AGENT_REPORT.md`
944
- - `sentinelayer-cli audit compliance` runs the compliance specialist agent and writes a dedicated `COMPLIANCE_AGENT_REPORT.md`
945
- - `sentinelayer-cli audit documentation` runs the documentation specialist agent and writes a dedicated `DOCUMENTATION_AGENT_REPORT.md`
946
- - `sentinelayer-cli audit package [--run-id <id>]` builds/rebuilds unified DD package artifacts from the requested (or latest) run
947
- - `sentinelayer-cli audit replay <run-id>` reruns the same selected agent set and writes a replay comparison artifact
948
- - `sentinelayer-cli audit diff <base-run-id> <candidate-run-id>` compares two runs and emits reproducibility drift deltas
949
- - `sentinelayer-cli audit local --path <repo>` runs legacy readiness + scan audit and writes `.sentinelayer/reports/audit-*.md`
950
- - `sentinelayer-cli persona orchestrator --mode <builder|reviewer|hardener> --path <repo>` generates mode-specific execution instructions with repo context
951
- - `sentinelayer-cli apply --plan tasks/todo.md --path <repo>` parses plan tasks into deterministic execution order preview
952
- - `sentinelayer-cli auth login|status|logout` manages persistent CLI sessions for long-running automation
953
- - `sentinelayer-cli auth sessions|revoke` supports session inventory and explicit token revocation controls
954
- - `sentinelayer-cli watch run-events --run-id <id>` streams runtime events with local artifact persistence
955
- - `sentinelayer-cli daemon error record|worker|queue` ingests admin errors and routes deterministic daemon queue work items
956
- - `sentinelayer-cli daemon assign claim|heartbeat|release|reassign|list` manages shared daemon assignment leases and lifecycle states
957
- - `sentinelayer-cli daemon jira open|start|comment|transition|list` manages Jira lifecycle evidence tied to daemon work items
958
- - `sentinelayer-cli daemon budget check|status` enforces budget warning/quarantine/kill governance with reproducible artifacts
959
- - `sentinelayer-cli daemon control|snapshot|stop` provides operator roster snapshots and explicit confirmed stop controls
960
- - `sentinelayer-cli daemon lineage build|list|show` indexes reproducible work-item artifact lineage across queue/assignment/jira/budget/operator runs
961
- - `sentinelayer-cli daemon map scope|list|show` builds hybrid deterministic+semantic impact scopes with import-graph overlay for daemon work items
962
- - `sentinelayer-cli daemon reliability run|status` and `daemon maintenance status|on|off` operate the midnight synthetic lane and maintenance billboard lifecycle
963
- - `sentinelayer-cli mcp schema|registry|server|bridge ...` manages MCP registry schema, server configs, and VS Code bridge scaffolds
964
- - `sentinelayer-cli plugin init|validate|list|order` manages plugin/template/policy packs and deterministic load-order governance
965
- - `sentinelayer-cli policy list|use <pack-id>` manages active policy pack selection (`community`, `strict`, `compliance-soc2`, `compliance-hipaa`, plugin packs)
966
- - `sentinelayer-cli ai provision-email` scaffolds and optionally executes AIdenID identity provisioning requests
967
- - `sentinelayer-cli ai identity list|show|revoke|create-child|lineage|revoke-children` manages local identity lifecycle and lineage workflows
968
- - `sentinelayer-cli ai identity domain create|verify|freeze` manages domain proof registration and containment controls
969
- - `sentinelayer-cli ai identity target create|verify|show` manages target policy registration and verification controls
970
- - `sentinelayer-cli ai identity site create|list` manages ephemeral callback site provisioning and local lifecycle tracking
971
- - `sentinelayer-cli ai identity events|latest|wait-for-otp` manages extraction/event polling for OTP and verification-link retrieval
972
- - `sentinelayer-cli chat ask` runs low-latency prompt/response chat with transcript persistence
973
- - `sentinelayer-cli review [path] [--diff|--staged]` runs layered deterministic review and writes reproducible artifacts under `.sentinelayer/reviews/<run-id>/`
974
- - `sentinelayer-cli review [path] [--diff|--staged] [--ai]` adds budget-governed AI reasoning over deterministic findings
975
- - `sentinelayer-cli review show|export|accept|reject|defer ...` manages reconciled unified reports and HITL adjudication
976
- - `sentinelayer-cli review replay|diff ...` runs reproducibility replay and run-to-run drift comparisons
977
- - `sentinelayer-cli review scan --mode full|diff|staged` runs lightweight deterministic scan mode for compatibility
978
- - add `--json` to `omargate`, `audit`, `persona orchestrator`, or `apply` for machine-readable summaries in CI
979
- - add `--output-dir <dir>` to local commands to write reports outside the default `.sentinelayer/reports`
980
-
981
- Legacy slash commands are still supported:
982
-
983
- - `sentinelayer-cli /omargate deep --path .`
984
- - `sentinel /omargate deep --path .`
985
-
986
- Roadmap:
987
-
988
- - persona orchestrator command set for specialized review/execution modes
989
-
990
- ## Troubleshooting
991
-
992
- - `Authentication timed out`: rerun and approve browser session faster.
993
- - `GitHub CLI not installed`: install `gh` or run manual fallback.
994
- - `Invalid repo format`: use exact `owner/repo`.
995
- - `Missing token in workflow`: ensure `.github/workflows/omar-gate.yml` maps `sentinelayer_token: ${{ secrets.SENTINELAYER_TOKEN }}`.
996
-
1
+ # sentinelayer-cli
2
+
3
+ `npx sentinelayer-cli@latest <project-name>`
4
+
5
+ Scaffolds Sentinelayer spec/prompt/guide artifacts and bootstraps `SENTINELAYER_TOKEN` without manual copy/paste, with optional `BYOK` mode.
6
+
7
+ CLI binaries:
8
+
9
+ - `sentinelayer-cli` (primary)
10
+ - `create-sentinelayer` (compatibility alias)
11
+ - `sentinel` (legacy alias)
12
+ - `sl` (short alias)
13
+
14
+ ## What it does
15
+
16
+ - runs an interactive project interview
17
+ - opens browser auth at Sentinelayer `/cli-auth`
18
+ - receives approved auth session in terminal
19
+ - supports explicit `BYOK` mode (skip Sentinelayer browser auth/token bootstrap)
20
+ - optionally opens GitHub auth (`gh auth login -w`) and lets you arrow-select a repo
21
+ - optionally clones the selected repo into the current folder for in-place feature work
22
+ - generates `spec + build guide + execution prompt + omar workflow + todo + handoff prompt`
23
+ - issues bootstrap `SENTINELAYER_TOKEN` when managed auth mode is used
24
+ - writes token to local `.env` when managed auth mode is used
25
+ - optionally injects token to GitHub Actions secret via `gh secret set` in managed auth mode
26
+ - ensures target workspace is a git repo (`git init` + `origin` when needed)
27
+
28
+ ## Current Production Bundle
29
+
30
+ Initial production scope is intentionally narrow and hardened:
31
+
32
+ - Omar baseline gate workflows and deterministic local gate checks
33
+ - Jules Tanaka deep frontend audits (`sl audit frontend --stream`)
34
+ - Reproducible review/audit artifacts and runtime telemetry
35
+
36
+ Primary commands in this shipping lane:
37
+
38
+ ```bash
39
+ sl auth login --api-url https://api.sentinelayer.com
40
+ sl scan init --path . --non-interactive
41
+ sl omargate deep --path .
42
+ sl audit frontend --path ./my-react-app --stream
43
+ sl review --diff
44
+ sl watch run-events --run-id <run-id>
45
+ ```
46
+
47
+ Windows PowerShell note: `sl` is a built-in alias for `Set-Location`. Use `sentinelayer-cli` (or short alias `slc`) instead.
48
+
49
+ ## 60-second flow
50
+
51
+ 1. Trigger:
52
+
53
+ ```bash
54
+ npx sentinelayer-cli@latest my-agent-app
55
+ ```
56
+
57
+ 2. Interview prompts (project goal, provider, coding agent, auth mode, depth, audience, project type, optional repo connect).
58
+ 3. If repo connect is enabled:
59
+ - choose repo source: current repo, GitHub picker, or manual `owner/repo`
60
+ - optional browser GitHub authorization
61
+ - optional clone into local workspace for existing-codebase feature work
62
+ 4. Browser auth opens automatically in managed auth mode.
63
+ 5. Token + artifacts are generated.
64
+ 6. CLI prints handoff and next command:
65
+
66
+ ```bash
67
+ npm run sentinel:start
68
+ ```
69
+
70
+ ## Non-interactive mode (CI/E2E)
71
+
72
+ Use non-interactive mode to run full scaffolding in automation:
73
+
74
+ ```bash
75
+ SENTINELAYER_CLI_INTERVIEW_JSON='{"projectName":"demo-app","projectDescription":"Build an autonomous secure code review orchestrator.","aiProvider":"openai","codingAgent":"codex","authMode":"sentinelayer","generationMode":"detailed","audienceLevel":"developer","projectType":"greenfield","techStack":["TypeScript","Node.js"],"features":["auth","scan"],"connectRepo":false,"injectSecret":false}' \
76
+ npx sentinelayer-cli@latest demo-app --non-interactive --skip-browser-open
77
+ ```
78
+
79
+ Inputs for non-interactive mode:
80
+
81
+ - `SENTINELAYER_CLI_INTERVIEW_JSON` (JSON string)
82
+ - interview JSON supports `authMode: "sentinelayer" | "byok"` (default: `sentinelayer`)
83
+ - or `--interview-file <path-to-json>`
84
+ - `--non-interactive` is required to disable prompts
85
+ - `--skip-browser-open` avoids launching local browser in headless runs
86
+ - `--help` / `-h` prints CLI usage
87
+ - `--version` / `-v` prints CLI version
88
+ - `SENTINELAYER_GITHUB_CLONE_BASE_URL` overrides clone base (default `https://github.com`)
89
+
90
+ ## Generated files
91
+
92
+ - `docs/spec.md`
93
+ - `docs/build-guide.md`
94
+ - `prompts/execution-prompt.md`
95
+ - `.github/workflows/omar-gate.yml`
96
+ - `tasks/todo.md`
97
+ - `AGENT_HANDOFF_PROMPT.md` (read order + Omar loop + local command matrix + workflow tuning options)
98
+ - coding-agent config file for selected agent when supported (examples: `CLAUDE.md`, `.cursorrules`, `.github/copilot-instructions.md`)
99
+ - `package.json` (adds `sentinel:start`, `sentinel:omargate`, `sentinel:omargate:json`, `sentinel:audit`, `sentinel:audit:json`, `sentinel:persona:*`, `sentinel:apply` when missing)
100
+ - `.env` with `SENTINELAYER_TOKEN` (or API-provided secret name) in managed auth mode
101
+
102
+ ## Multi-Agent Session Workflow
103
+
104
+ Sentinelayer includes a deterministic session coordination surface for multi-agent coding loops:
105
+
106
+ - session event stream and replay (`start`, `join`, `say`, `read`, `status`, `leave`, `list`, `kill`)
107
+ - agent lifecycle controls (join/heartbeat/leave/kill)
108
+ - recap and context briefing for late-joining agents
109
+ - analytics + lineage artifacts at session closeout
110
+
111
+ Read the full guide: [docs/sessions.md](docs/sessions.md)
112
+
113
+ For strategy context, see the long-form blog draft: [docs/blog/slack-for-ai-coding-agents.md](docs/blog/slack-for-ai-coding-agents.md)
114
+
115
+ ## Advanced options
116
+
117
+ When `Advanced options?` is enabled:
118
+
119
+ - `Auth mode` (`sentinelayer` or `byok`)
120
+ - `Connect a GitHub repo and inject Actions secret?`
121
+ - `How should we choose the repo?` (current / GitHub picker / manual)
122
+ - GitHub picker reads all accessible repos via paginated `gh api`
123
+ - `Clone this repo locally and build directly into it now?`
124
+ - `Inject SENTINELAYER_TOKEN into GitHub Actions secrets now?` (managed auth mode only)
125
+ - Final review step lets you proceed, restart interview, or cancel cleanly
126
+
127
+ The CLI validates repo format and secret-name format before injection.
128
+
129
+ ## Existing codebase mode
130
+
131
+ When `Clone this repo locally and build directly into it now?` is enabled:
132
+
133
+ - the CLI clones `<owner>/<repo>` into `./<repo-name>` unless current folder already matches that repo
134
+ - it writes generated docs/prompts/tasks/workflow into that cloned repo
135
+ - it extracts a deterministic repo summary and includes it in generation context
136
+ - if the repo is empty, scaffolding still proceeds deterministically
137
+ - if the target folder already contains a different non-empty repo, CLI fails fast with a clear error
138
+ - if the target folder is a git repo without a detectable GitHub `origin`, CLI refuses to continue
139
+
140
+ ## Token handling model
141
+
142
+ - browser auth JWT is used in-memory only
143
+ - in managed auth mode, CLI stores only bootstrap token in `.env`
144
+ - in managed auth mode, GitHub secret injection uses stdin (`gh secret set ...`) and never writes token to command history
145
+ - in managed auth mode, secret injection is verified with `gh secret list --repo <owner/repo>`
146
+ - API fallback secret name is pinned to `SENTINELAYER_TOKEN` if server response is invalid
147
+ - in BYOK mode, no Sentinelayer token is created or injected
148
+
149
+ ## Persistent CLI auth sessions (Phase 4 foundation slice)
150
+
151
+ For long-running agent/operator workflows, the CLI now supports persistent auth sessions:
152
+
153
+ - `sl auth login --api-url https://api.sentinelayer.com --skip-browser-open`
154
+ - `sl auth status`
155
+ - `sl auth logout`
156
+ - `sl auth sessions`
157
+ - `sl auth revoke --token-id <token-id>`
158
+
159
+ On Windows PowerShell, run these as `sentinelayer-cli auth ...` or `slc auth ...`.
160
+
161
+ Behavior:
162
+
163
+ - login uses browser approval (`/api/v1/auth/cli/sessions/*`)
164
+ - after approval, CLI mints a long-lived API token (`/api/v1/auth/api-tokens`)
165
+ - session metadata is stored at `~/.sentinelayer/credentials.json`
166
+ - token storage uses OS keyring only when explicitly enabled (`SENTINELAYER_KEYRING_MODE=keyring`) and `keytar` is installed; file fallback is used otherwise
167
+ - near-expiry token rotation is automatic on command use for stored sessions
168
+ - env/config tokens still take precedence:
169
+ - `SENTINELAYER_TOKEN`
170
+ - `.sentinelayer.yml` `sentinelayerToken`
171
+
172
+ Opt-in to keyring usage:
173
+
174
+ - `SENTINELAYER_KEYRING_MODE=keyring` (requires `npm install keytar`)
175
+
176
+ Opt-out of keyring usage (overrides any opt-in):
177
+
178
+ - `SENTINELAYER_DISABLE_KEYRING=1`
179
+
180
+ ## Runtime watch streaming (Phase 9 foundation slice)
181
+
182
+ You can stream runtime run events directly from the CLI:
183
+
184
+ - `sl watch run-events --run-id <run-id>`
185
+ - `sl watch runtime --run-id <run-id>` (alias)
186
+ - `sl watch history` (list persisted watch summaries)
187
+
188
+ Options:
189
+
190
+ - `--poll-seconds <seconds>` polling interval
191
+ - `--max-idle-seconds <seconds>` optional idle timeout
192
+ - `--output-dir <path>` artifact root override
193
+ - `--json` machine-readable event stream + summary
194
+
195
+ By default, watch output is persisted to:
196
+
197
+ - `.sentinelayer/observability/runtime-watch/<run-id>/events-<timestamp>.ndjson`
198
+ - `.sentinelayer/observability/runtime-watch/<run-id>/summary-<timestamp>.json`
199
+
200
+ ## Chat command foundation (Phase 2.1 slice)
201
+
202
+ The CLI now includes a low-latency chat command surface:
203
+
204
+ - `sl chat ask --prompt "Summarize this diff" --dry-run`
205
+ - `sl chat ask --prompt "Explain this failure" --provider openai --model gpt-4o`
206
+
207
+ Each call appends reproducible transcript entries to:
208
+
209
+ - `.sentinelayer/chat/sessions/<session-id>.jsonl`
210
+
211
+ ## Deterministic review pipeline (Phase 9.2 foundation slice)
212
+
213
+ The default `review` command now runs a layered deterministic pipeline:
214
+
215
+ - `sl review` (full workspace mode)
216
+ - `sl review --diff` (staged + unstaged + untracked git changes)
217
+ - `sl review --staged` (staged changes only)
218
+
219
+ Each run writes reproducible artifacts to:
220
+
221
+ - `.sentinelayer/reviews/<run-id>/REVIEW_DETERMINISTIC.md`
222
+ - `.sentinelayer/reviews/<run-id>/REVIEW_DETERMINISTIC.json`
223
+ - `.sentinelayer/reviews/<run-id>/checks/*.log` (static check output)
224
+
225
+ For compatibility, lightweight scan mode remains available:
226
+
227
+ - `sl review scan --mode full|diff|staged`
228
+ - `.sentinelayer/reports/review-scan-<mode>-<timestamp>.md`
229
+
230
+ ## AI review layers (Phase 9.3 slice)
231
+
232
+ The `review` command can now add budget-governed AI reasoning on top of deterministic findings:
233
+
234
+ - `sl review --ai --provider openai --model gpt-5.3-codex`
235
+ - `sl review --ai --ai-dry-run` (no provider call; deterministic synthetic output)
236
+ - `sl review --ai --max-cost 1.0 --max-tokens 0 --max-runtime-ms 0 --max-tool-calls 0`
237
+
238
+ AI artifacts are persisted in the same run folder:
239
+
240
+ - `.sentinelayer/reviews/<run-id>/REVIEW_AI_PROMPT.txt`
241
+ - `.sentinelayer/reviews/<run-id>/REVIEW_AI.md`
242
+ - `.sentinelayer/reviews/<run-id>/REVIEW_AI.json`
243
+
244
+ AI usage, cost, and stop-class telemetry are appended to:
245
+
246
+ - `.sentinelayer/cost-history.json`
247
+ - `.sentinelayer/observability/run-events.jsonl`
248
+
249
+ ## Unified review report + HITL (Phase 9.4 slice)
250
+
251
+ Every `review` run now emits reconciled findings:
252
+
253
+ - `.sentinelayer/reviews/<run-id>/REVIEW_REPORT.md`
254
+ - `.sentinelayer/reviews/<run-id>/REVIEW_REPORT.json`
255
+
256
+ Capabilities:
257
+
258
+ - `sl review show [--run-id <id>]`
259
+ - `sl review export --format sarif|json|md|github-annotations`
260
+ - `sl review accept <finding-id> --run-id <id>`
261
+ - `sl review reject <finding-id> --run-id <id>`
262
+ - `sl review defer <finding-id> --run-id <id>`
263
+
264
+ Reconciliation behavior:
265
+
266
+ - deduplicates deterministic + AI findings by location/message fingerprint
267
+ - preserves highest severity finding in each duplicate cluster
268
+ - assigns confidence (`100%` deterministic, model-derived for AI)
269
+ - persists HITL decisions in `.sentinelayer/reviews/<run-id>/REVIEW_DECISIONS.json`
270
+
271
+ ## Review replay + diff (Phase 9.5 slice)
272
+
273
+ Reproducibility commands:
274
+
275
+ - `sl review replay <run-id>`
276
+ - `sl review diff <base-run-id> <candidate-run-id>`
277
+
278
+ Run metadata and comparison artifacts:
279
+
280
+ - `.sentinelayer/reviews/<run-id>/REVIEW_RUN_CONTEXT.json`
281
+ - `.sentinelayer/reviews/<run-id>/REVIEW_COMPARISON_<base>_vs_<candidate>.json`
282
+
283
+ ## Audit orchestrator foundation (Phase 10.1 slice)
284
+
285
+ The CLI now includes an audit swarm orchestrator with a built-in 13-agent registry:
286
+
287
+ - `sl audit --dry-run`
288
+ - `sl audit --agents security,architecture,testing --max-parallel 3`
289
+ - `sl audit registry`
290
+ - `sl audit security`
291
+ - `sl audit architecture`
292
+ - `sl audit testing`
293
+ - `sl audit performance`
294
+ - `sl audit compliance`
295
+ - `sl audit documentation`
296
+ - `sl audit package --run-id <id>` (or omit `--run-id` to package latest run)
297
+ - `sl audit replay <run-id>`
298
+ - `sl audit diff <base-run-id> <candidate-run-id>`
299
+ - `sl audit local` (legacy compatibility path for `/audit`)
300
+
301
+ Artifacts are written to:
302
+
303
+ - `.sentinelayer/audits/<run-id>/AUDIT_REPORT.md`
304
+ - `.sentinelayer/audits/<run-id>/AUDIT_REPORT.json`
305
+ - `.sentinelayer/audits/<run-id>/agents/<agent-id>.json`
306
+ - `.sentinelayer/audits/<run-id>/agents/SECURITY_AGENT_REPORT.md` (security specialist)
307
+ - `.sentinelayer/audits/<run-id>/agents/ARCHITECTURE_AGENT_REPORT.md` (architecture specialist)
308
+ - `.sentinelayer/audits/<run-id>/agents/TESTING_AGENT_REPORT.md` (testing specialist)
309
+ - `.sentinelayer/audits/<run-id>/agents/PERFORMANCE_AGENT_REPORT.md` (performance specialist)
310
+ - `.sentinelayer/audits/<run-id>/agents/COMPLIANCE_AGENT_REPORT.md` (compliance specialist)
311
+ - `.sentinelayer/audits/<run-id>/agents/DOCUMENTATION_AGENT_REPORT.md` (documentation specialist)
312
+ - `.sentinelayer/audits/<run-id>/DD_PACKAGE_MANIFEST.json`
313
+ - `.sentinelayer/audits/<run-id>/DD_FINDINGS_INDEX.json`
314
+ - `.sentinelayer/audits/<run-id>/DD_EXEC_SUMMARY.md`
315
+ - `.sentinelayer/audits/<run-id>/AUDIT_COMPARISON_<base>_vs_<candidate>.json`
316
+
317
+ ## QA swarm orchestrator factory (Phase 12.1 slice)
318
+
319
+ The CLI now includes OMAR-led swarm planning commands for governed long-running runs:
320
+
321
+ - `sl swarm registry`
322
+ - `sl swarm plan --path . --scenario error_event_remediation --agents security,testing,reliability --json`
323
+
324
+ `swarm plan` outputs deterministic orchestration artifacts (assignments, budgets, and phase graph):
325
+
326
+ - `.sentinelayer/swarms/<run-id>/SWARM_PLAN.json`
327
+ - `.sentinelayer/swarms/<run-id>/SWARM_PLAN.md`
328
+
329
+ Global budgets can be set per run:
330
+
331
+ - `--max-cost-usd`
332
+ - `--max-output-tokens`
333
+ - `--max-runtime-ms`
334
+ - `--max-tool-calls`
335
+ - `--warning-threshold-percent`
336
+
337
+ ## Playwright agent runtime (Phase 12.2 slice)
338
+
339
+ The swarm runtime loop can now be executed directly from CLI:
340
+
341
+ - `sl swarm run --path . --agents security,testing --json` (default mock runtime, dry-run)
342
+ - `sl swarm run --plan-file .sentinelayer/swarms/<plan-run-id>/SWARM_PLAN.json --engine playwright --execute --start-url https://example.com`
343
+
344
+ Runtime artifacts are persisted under:
345
+
346
+ - `.sentinelayer/swarms/<runtime-run-id>/runtime/SWARM_RUNTIME.json`
347
+ - `.sentinelayer/swarms/<runtime-run-id>/runtime/SWARM_RUNTIME.md`
348
+ - `.sentinelayer/swarms/<runtime-run-id>/runtime/events.ndjson`
349
+
350
+ Optional Playwright actions can be provided via playbook JSON:
351
+
352
+ - `--playbook-file <path>` where file contract is `{ "actions": [ ... ] }`
353
+
354
+ ## Scenario DSL (Phase 12.3 slice)
355
+
356
+ Swarm runtime now supports a deterministic scenario DSL (`.sls`):
357
+
358
+ - `sl swarm scenario init nightly-smoke --path .`
359
+ - `sl swarm scenario validate --file .sentinelayer/scenarios/nightly-smoke.sls`
360
+ - `sl swarm run --scenario-file .sentinelayer/scenarios/nightly-smoke.sls --json`
361
+
362
+ DSL commands:
363
+
364
+ - `scenario "<id>"`
365
+ - `start_url "<url>"`
366
+ - `tag "<value>"`
367
+ - `action goto "<url>"`
368
+ - `action click "<selector>"`
369
+ - `action fill "<selector>" "<text>"`
370
+ - `action wait <ms>`
371
+ - `action screenshot "<relative-path>"`
372
+
373
+ ## Realtime swarm dashboard (Phase 12.4 slice)
374
+
375
+ The CLI now supports runtime swarm dashboard snapshots and watch streaming:
376
+
377
+ - `sl swarm dashboard --run-id <runtime-run-id>`
378
+ - `sl swarm dashboard --watch --run-id <runtime-run-id> --poll-seconds 2 --max-idle-seconds 20`
379
+
380
+ Machine-readable output:
381
+
382
+ - `sl swarm dashboard --json`
383
+ - `sl swarm dashboard --watch --json`
384
+
385
+ Dashboard data includes per-agent status rows, usage counters, stop class, and recent timeline events.
386
+
387
+ ## Swarm execution report (Phase 12.5 slice)
388
+
389
+ You can package runtime artifacts into a deterministic execution report bundle:
390
+
391
+ - `sl swarm report --run-id <runtime-run-id>`
392
+ - `sl swarm report --json`
393
+
394
+ Report artifacts:
395
+
396
+ - `.sentinelayer/swarms/<runtime-run-id>/runtime/SWARM_EXECUTION_REPORT.json`
397
+ - `.sentinelayer/swarms/<runtime-run-id>/runtime/SWARM_EXECUTION_REPORT.md`
398
+
399
+ The report links runtime usage, stop class, per-agent status summary, recent events, and plan/runtime artifact paths.
400
+
401
+ ## Security pen-test mode (Phase 12.6 slice)
402
+
403
+ The CLI now includes a governed pen-test swarm entrypoint:
404
+
405
+ - `sl swarm create --scenario pen-test --pen-test-scenario auth-bypass --target https://app.customer.local --target-id <target-id>`
406
+ - `sl swarm create --scenario input-validation --target https://app.customer.local --target-id <target-id> --execute`
407
+
408
+ Built-in pen-test scenarios:
409
+
410
+ - `auth-bypass`
411
+ - `rate-limit-probe`
412
+ - `input-validation`
413
+ - `privilege-escalation`
414
+
415
+ Policy enforcement is strict:
416
+
417
+ - target must exist in local AIdenID target registry and be `VERIFIED`
418
+ - target must not be frozen/inactive
419
+ - target host must match `--target`
420
+ - scenario, methods, and paths must stay within target policy (`allowedScenarios`, `allowedMethods`, `allowedPaths`)
421
+
422
+ Pen-test artifacts:
423
+
424
+ - `.sentinelayer/swarms/<pentest-run-id>/pentest/REQUEST_PLAN.json`
425
+ - `.sentinelayer/swarms/<pentest-run-id>/pentest/audit.jsonl` (full request/response headers+body)
426
+ - `.sentinelayer/swarms/<pentest-run-id>/pentest/PENTEST_REPORT.json`
427
+ - `.sentinelayer/swarms/<pentest-run-id>/pentest/PENTEST_REPORT.md`
428
+
429
+ `PENTEST_REPORT` findings are keyed to OWASP categories and surface `P0-P3` severity summary + blocking status.
430
+
431
+ ## Swarm identity hardening (Phase 12.7 slice)
432
+
433
+ Identity security controls now include:
434
+
435
+ - zero-trust swarm identity manifest per run (`IDENTITY_ISOLATION.json`)
436
+ - cryptographic audit chain on pen-test request logs (`previousEntryHash` + `entryHash` + `entryHmac`)
437
+ - crash-safe cleanup contract artifact (`CLEANUP_CONTRACT.json`) for post-run squash scheduling
438
+ - legal-hold guardrails on revoke/revoke-children commands
439
+
440
+ New identity lifecycle commands:
441
+
442
+ - `sl ai identity audit --stale --json`
443
+ - `sl ai identity legal-hold status <identity-id> --json`
444
+ - `sl ai identity kill-all --tags <tag1,tag2> [--execute] --json`
445
+
446
+ `kill-all --execute` blocks legal-hold identities and marks eligible tagged identities as `SQUASHED` in local registry with campaign metadata.
447
+
448
+ ## Error daemon worker (Phase 13.1 slice)
449
+
450
+ The CLI now includes an OMAR daemon lane for deterministic error intake and routed queue generation:
451
+
452
+ - `sl daemon error record --service sentinelayer-api --endpoint /v1/runtime/runs --error-code RUNTIME_TIMEOUT --severity P1 --message "runtime timeout"`
453
+ - `sl daemon error worker --max-events 200 --json`
454
+ - `sl daemon error queue --json`
455
+
456
+ Daemon artifacts:
457
+
458
+ - `.sentinelayer/observability/error-daemon/admin-error-stream.ndjson` (append-only intake stream)
459
+ - `.sentinelayer/observability/error-daemon/queue.json` (deduped routed queue work items)
460
+ - `.sentinelayer/observability/error-daemon/worker-state.json` (stream cursor + aggregate stats)
461
+ - `.sentinelayer/observability/error-daemon/intake/intake-*.json` (per-event intake snapshots)
462
+ - `.sentinelayer/observability/error-daemon/runs/error-daemon-run-*.json` (worker tick execution evidence)
463
+
464
+ Queue routing behavior:
465
+
466
+ - events are fingerprinted from service, endpoint, error code, stack fingerprint, and commit sha
467
+ - matching open fingerprints are deduped with `occurrenceCount` increments and severity escalation
468
+ - worker cursor tracks processed stream offset for deterministic resumability across ticks
469
+
470
+ ## Global assignment ledger (Phase 13.2 slice)
471
+
472
+ Daemon assignment controls now support explicit claim/heartbeat/release/reassign flow with lease tracking:
473
+
474
+ - `sl daemon assign claim <work-item-id> --agent maya.markov@sentinelayer.local --lease-ttl-seconds 1800 --stage triage --run-id run_001 --jira-issue-key SL-101`
475
+ - `sl daemon assign heartbeat <work-item-id> --agent maya.markov@sentinelayer.local --stage analysis --run-id run_002`
476
+ - `sl daemon assign reassign <work-item-id> --from-agent maya.markov@sentinelayer.local --to-agent mark.rao@sentinelayer.local --stage fix`
477
+ - `sl daemon assign release <work-item-id> --agent mark.rao@sentinelayer.local --status DONE --reason "fix merged"`
478
+ - `sl daemon assign list --status DONE --agent mark.rao@sentinelayer.local --json`
479
+
480
+ Ledger artifacts:
481
+
482
+ - `.sentinelayer/observability/error-daemon/assignment-ledger.json` (current assignment state)
483
+ - `.sentinelayer/observability/error-daemon/assignment-events.ndjson` (claim/heartbeat/reassign/release event history)
484
+
485
+ Tracked assignment fields include:
486
+
487
+ - `workItemId`
488
+ - `assignedAgentIdentity`
489
+ - `leasedAt`
490
+ - `leaseTtlSeconds`
491
+ - `leaseExpiresAt`
492
+ - `status`
493
+ - `stage`
494
+ - `runId`
495
+ - `jiraIssueKey`
496
+ - `budgetSnapshot`
497
+
498
+ ## Jira lifecycle automation (Phase 13.3 slice)
499
+
500
+ Daemon Jira lifecycle commands now support ticket create/start/comment/transition traces tied to work items:
501
+
502
+ - `sl daemon jira open <work-item-id> --issue-key-prefix SL`
503
+ - `sl daemon jira start <work-item-id> --plan "1) reproduce 2) patch 3) verify" --actor maya.markov@sentinelayer.local --assignee maya.markov@sentinelayer.local`
504
+ - `sl daemon jira comment --work-item-id <work-item-id> --type checkpoint --message "patch applied"`
505
+ - `sl daemon jira transition --work-item-id <work-item-id> --to DONE --reason "fix merged"`
506
+ - `sl daemon jira list --status DONE --work-item-id <work-item-id> --json`
507
+
508
+ Lifecycle artifacts:
509
+
510
+ - `.sentinelayer/observability/error-daemon/jira-lifecycle.json` (issue state, comments, transitions)
511
+ - `.sentinelayer/observability/error-daemon/jira-events.ndjson` (append-only lifecycle event feed)
512
+
513
+ When an assignment exists for the same work item, Jira issue keys are synced into assignment ledger records for deterministic handoff continuity.
514
+
515
+ ## Runtime budget quarantine (Phase 13.4 slice)
516
+
517
+ Daemon budget governor commands now enforce hard-limit transitions with quarantine grace and deterministic kill path:
518
+
519
+ - `sl daemon budget check <work-item-id> --usage-json '{"tokensUsed":150}' --budget-json '{"maxTokens":100,"quarantineGraceSeconds":30}'`
520
+ - `sl daemon budget status --work-item-id <work-item-id> --json`
521
+
522
+ Lifecycle states:
523
+
524
+ - `WITHIN_BUDGET`
525
+ - `WARNING_THRESHOLD`
526
+ - `HARD_LIMIT_QUARANTINED`
527
+ - `HARD_LIMIT_SQUASHED`
528
+
529
+ Governor behavior:
530
+
531
+ - crossing a hard limit transitions the work item into quarantine (`action=QUARANTINE`, queue/assignment status `BLOCKED`)
532
+ - if hard-limit usage persists past `quarantineGraceSeconds`, governor triggers deterministic kill (`action=KILL`, queue/assignment status `SQUASHED`)
533
+ - warning thresholds (`warningThresholdPercent`) surface near-limit signals without blocking
534
+
535
+ Budget artifacts:
536
+
537
+ - `.sentinelayer/observability/error-daemon/budget-state.json`
538
+ - `.sentinelayer/observability/error-daemon/budget-events.ndjson`
539
+ - `.sentinelayer/observability/error-daemon/budget-runs/budget-check-*.json`
540
+
541
+ ## Operator control plane (Phase 13.5 slice)
542
+
543
+ Daemon operator control commands now provide unified queue/assignment/jira/budget visibility with explicit stop controls:
544
+
545
+ - `sl daemon control --json`
546
+ - `sl daemon control snapshot --status ASSIGNED,BLOCKED --agent maya.markov@sentinelayer.local --json`
547
+ - `sl daemon control stop <work-item-id> --mode QUARANTINE --reason "manual triage hold" --confirm --json`
548
+ - `sl daemon control stop <work-item-id> --mode SQUASH --reason "kill switch activated" --confirm --json`
549
+
550
+ Control-plane snapshot fields include:
551
+
552
+ - per-work-item budget health color (`GREEN`, `YELLOW`, `RED`)
553
+ - session timers (`sessionElapsedSeconds`, `sessionIdleSeconds`)
554
+ - assignment + Jira linkage (`assignedAgentIdentity`, `assignmentStatus`, `jiraIssueKey`, `jiraStatus`)
555
+ - agent roster aggregates (`activeWorkItemCount`, `blockedCount`, `squashedCount`, longest-session duration)
556
+
557
+ Operator control artifacts:
558
+
559
+ - `.sentinelayer/observability/error-daemon/operator-control-state.json`
560
+ - `.sentinelayer/observability/error-daemon/operator-events.ndjson`
561
+ - `.sentinelayer/observability/error-daemon/operator-snapshots/operator-snapshot-*.json`
562
+
563
+ ## Artifact lineage tree (Phase 13.6 slice)
564
+
565
+ Daemon lineage commands now index reproducibility links across queue, assignment, Jira, budget, and operator artifacts:
566
+
567
+ - `sl daemon lineage build --json`
568
+ - `sl daemon lineage list --status ASSIGNED,BLOCKED --json`
569
+ - `sl daemon lineage show <work-item-id> --json`
570
+
571
+ Lineage index fields include:
572
+
573
+ - work-item links (`agentIdentity`, `assignmentStatus`, `loopRunId`, `jiraIssueKey`, `budgetLifecycleState`)
574
+ - artifact pointers (queue/ledger/jira/budget/operator state files + per-work-item run artifacts)
575
+ - reproducibility run catalogs (`errorDaemonRuns`, `budgetChecks`, `operatorSnapshots`)
576
+
577
+ Lineage artifacts:
578
+
579
+ - `.sentinelayer/observability/error-daemon/lineage/lineage-index.json`
580
+ - `.sentinelayer/observability/error-daemon/lineage/lineage-events.ndjson`
581
+
582
+ ## Hybrid mapping overlay (Phase 13.7 slice)
583
+
584
+ Daemon hybrid mapping commands now combine deterministic signal routing with on-demand import-graph expansion and semantic scoring:
585
+
586
+ - `sl daemon map scope <work-item-id> --max-files 40 --graph-depth 2 --json`
587
+ - `sl daemon map list --work-item-id <work-item-id> --json`
588
+ - `sl daemon map show <work-item-id> --json`
589
+
590
+ Hybrid scope map output includes:
591
+
592
+ - deterministic seed files from endpoint/error/service token matches
593
+ - import-graph overlay (`graphDepth`) from seed files
594
+ - semantic scoring from endpoint/signal token matches in file content
595
+ - ranked scoped file set with per-file reasons (`deterministic_path_match`, `semantic_content_match`, `import_graph_distance`)
596
+
597
+ Hybrid mapping artifacts:
598
+
599
+ - `.sentinelayer/observability/error-daemon/mapping/hybrid-map-index.json`
600
+ - `.sentinelayer/observability/error-daemon/mapping/hybrid-map-events.ndjson`
601
+ - `.sentinelayer/observability/error-daemon/mapping/runs/hybrid-map-*.json`
602
+
603
+ ## Midnight reliability lane (Phase 13.8 slice)
604
+
605
+ Daemon reliability commands now support scheduled synthetic checks and maintenance-billboard automation:
606
+
607
+ - `sl daemon reliability run --region us-east-1 --timezone America/New_York --json`
608
+ - `sl daemon reliability run --simulate-failure aidenid_password_reset_flow --json`
609
+ - `sl daemon reliability status --json`
610
+ - `sl daemon maintenance status|on|off --json`
611
+
612
+ Lane behavior:
613
+
614
+ - failures enqueue deterministic daemon error events (`source=reliability_lane`) and execute one worker tick
615
+ - failures can auto-enable maintenance billboard for operator/HITL visibility
616
+ - passing runs can automatically clear reliability-opened maintenance state
617
+ - manual maintenance controls remain available (`maintenance on|off`) with reason/actor audit trail
618
+
619
+ Reliability artifacts:
620
+
621
+ - `.sentinelayer/observability/error-daemon/reliability/lane-config.json`
622
+ - `.sentinelayer/observability/error-daemon/reliability/maintenance-billboard.json`
623
+ - `.sentinelayer/observability/error-daemon/reliability/reliability-events.ndjson`
624
+ - `.sentinelayer/observability/error-daemon/reliability/runs/reliability-lane-*.json`
625
+
626
+ ## MCP registry schema foundation (Phase 6 foundation slice)
627
+
628
+ The CLI now includes deterministic MCP registry commands:
629
+
630
+ - `sl mcp schema show`
631
+ - `sl mcp schema write`
632
+ - `sl mcp registry init-aidenid`
633
+ - `sl mcp registry init-aidenid-adapter`
634
+ - `sl mcp registry validate --file <path>`
635
+ - `sl mcp registry validate-aidenid-adapter --file <path> [--registry-file <path>]`
636
+ - `sl mcp server init --id <server-id> --registry-file <path>`
637
+ - `sl mcp server validate --file <path>`
638
+ - `sl mcp bridge init-vscode --server-id <server-id> --server-config <path>`
639
+
640
+ Use `init-aidenid` to scaffold an Anthropic-compatible tool schema wrapper for AIdenID provisioning APIs, then customize transport/auth before runtime wiring.
641
+ Use `init-aidenid-adapter` to scaffold a deterministic AIdenID provisioning API contract (tool binding -> HTTP path/method -> response field mapping) and cross-check it against the registry with `validate-aidenid-adapter`.
642
+
643
+ ## Plugin governance foundation (Phase 5.2 slice)
644
+
645
+ The CLI now includes deterministic plugin/template/policy pack governance commands:
646
+
647
+ - `sl plugin init --id <plugin-id> --pack-type plugin|template_pack|policy_pack|hybrid --stage pre_scan|scan|post_scan|reporting`
648
+ - `sl plugin validate --file <manifest.json>`
649
+ - `sl plugin list`
650
+ - `sl plugin order [--stage <stage>]` (deterministic load-order resolution + cycle detection)
651
+
652
+ ## Policy packs (Phase 5.3 slice)
653
+
654
+ The CLI now includes policy-pack selection commands:
655
+
656
+ - `sl policy list`
657
+ - `sl policy use strict --scope project`
658
+ - `sl policy use compliance-soc2 --scope global`
659
+
660
+ Built-in packs: `community` (default), `strict`, `compliance-soc2`, `compliance-hipaa`.
661
+ Policy selection is stored in config (`defaultPolicyPack`) and applied during `scan init` / `scan validate` / `scan precheck` profile resolution.
662
+
663
+ ## AIdenID CLI foundation (Phase 11 foundation slice)
664
+
665
+ The CLI now includes an `sl ai` surface for AIdenID identity provisioning:
666
+
667
+ - `sl ai provision-email --json` (dry-run artifact generation)
668
+ - `sl ai provision-email --execute --api-key <key> --org-id <id> --project-id <id>` (live API call)
669
+ - `sl ai identity list --json` (list locally tracked identities)
670
+ - `sl ai identity show <identity-id> --json`
671
+ - `sl ai identity revoke <identity-id> --execute --api-key <key> --org-id <id> --project-id <id>`
672
+ - `sl ai identity create-child <parent-identity-id> --event-budget 25 --execute --api-key <key> --org-id <id> --project-id <id>`
673
+ - `sl ai identity lineage <identity-id> --json`
674
+ - `sl ai identity revoke-children <parent-identity-id> --execute --api-key <key> --org-id <id> --project-id <id>`
675
+ - `sl ai identity domain create|verify|freeze ...` (domain proof + freeze lifecycle controls)
676
+ - `sl ai identity target create|verify|show ...` (managed target policy/proof controls)
677
+ - `sl ai identity site create <identity-id> --domain-id <domain-id> --execute ...`
678
+ - `sl ai identity site list [--identity-id <identity-id>]`
679
+ - `sl ai identity events <identity-id> --json` (list inbound events with cursor/limit support)
680
+ - `sl ai identity latest <identity-id> --json` (latest event + extraction metadata)
681
+ - `sl ai identity wait-for-otp <identity-id> --min-confidence 0.8 --timeout 60 --json`
682
+
683
+ Identity lifecycle records are persisted to:
684
+
685
+ - `.sentinelayer/aidenid/identity-registry.json`
686
+
687
+ Credential env fallbacks for live execution:
688
+
689
+ - `AIDENID_API_KEY`
690
+ - `AIDENID_ORG_ID`
691
+ - `AIDENID_PROJECT_ID`
692
+
693
+ Extraction responses include deterministic source metadata (`RULES` vs `LLM`) and confidence scores.
694
+
695
+ ## Manual fallback (if auto injection is skipped)
696
+
697
+ 1. Set local token:
698
+
699
+ ```bash
700
+ echo "SENTINELAYER_TOKEN=<your-token>" >> .env
701
+ ```
702
+
703
+ 2. Inject repo secret:
704
+
705
+ ```bash
706
+ gh secret set SENTINELAYER_TOKEN --repo <owner/repo>
707
+ gh secret list --repo <owner/repo>
708
+ ```
709
+
710
+ 3. For manual setup details: `https://sentinelayer.com/docs/getting-started/install-workflow`
711
+
712
+ 4. BYOK mode (no Sentinelayer token):
713
+ - keep generated `docs/spec.md`, `docs/build-guide.md`, `prompts/execution-prompt.md`, and `tasks/todo.md`
714
+ - run your coding agent directly with your provider key (`OPENAI_API_KEY` / `ANTHROPIC_API_KEY` / `GOOGLE_API_KEY`)
715
+ - generated workflow is a BYOK reminder workflow; wire `SENTINELAYER_TOKEN` later to enable Omar Gate action
716
+
717
+ ## Environment overrides
718
+
719
+ - `SENTINELAYER_API_URL` (default: `https://api.sentinelayer.com`)
720
+ - `SENTINELAYER_WEB_URL` (default: `https://sentinelayer.com`)
721
+ - `SENTINELAYER_DISABLE_KEYRING=1` (force file-based credential storage)
722
+ - `AIDENID_API_KEY`, `AIDENID_ORG_ID`, `AIDENID_PROJECT_ID` (used by `sl ai provision-email --execute`)
723
+
724
+ ## Layered config (PR 0.2)
725
+
726
+ The CLI supports layered config resolution:
727
+
728
+ - global: `~/.sentinelayer/config.yml`
729
+ - project: `.sentinelayer.yml` at repo root
730
+ - env overrides: `SENTINELAYER_API_URL`, `SENTINELAYER_WEB_URL`, `SENTINELAYER_TOKEN`, `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `GOOGLE_API_KEY`
731
+
732
+ Commands:
733
+
734
+ - `sentinelayer-cli config list --scope resolved --json`
735
+ - `sentinelayer-cli config get apiUrl --scope resolved`
736
+ - `sentinelayer-cli config set defaultModelProvider openai --scope project`
737
+ - `sentinelayer-cli config edit --scope project`
738
+
739
+ ## Codebase ingest (PR 1.1 slice)
740
+
741
+ Run deterministic mapping and emit `CODEBASE_INGEST.json`:
742
+
743
+ - `sentinelayer-cli ingest map --path .`
744
+ - `sentinelayer-cli ingest map --path . --json`
745
+ - `sentinelayer-cli ingest map --path . --output-file artifacts/CODEBASE_INGEST.json`
746
+
747
+ The ingest artifact includes language/LOC breakdown, framework hints, entry points, risk-surface hints, and a bounded file index to support deterministic handoff context.
748
+
749
+ ## Offline spec generation (PR 1.2 slice)
750
+
751
+ Generate a local `SPEC.md` without calling the API:
752
+
753
+ - `sentinelayer-cli spec list-templates`
754
+ - `sentinelayer-cli spec show-template api-service`
755
+ - `sentinelayer-cli spec generate --path . --template api-service --description \"Build secure autonomous review orchestration\"`
756
+ - `sentinelayer-cli spec show --path .`
757
+ - `sentinelayer-cli spec show --path . --plain`
758
+ - `sentinelayer-cli spec regenerate --path . --dry-run --json`
759
+ - `sentinelayer-cli spec regenerate --path . --max-diff-lines 120`
760
+ - `sentinelayer-cli spec regenerate --path . --dry-run --quiet`
761
+
762
+ The generator uses deterministic ingest context plus template architecture/security checklists.
763
+
764
+ ## AI-enhanced spec generation (PR 3.3 slice)
765
+
766
+ Generate a deterministic base spec, then optionally refine it with a provider model:
767
+
768
+ - `sentinelayer-cli spec generate --path . --template api-service --description "Harden auth and release workflows" --ai`
769
+ - `sentinelayer-cli spec generate --path . --ai --provider openai --model gpt-5.3-codex --max-cost 1 --warn-at-percent 80`
770
+
771
+ `--ai` mode behavior:
772
+
773
+ - deterministic `SPEC.md` draft is always generated first
774
+ - AI refinement prompt includes ingest summary + template context + base markdown
775
+ - usage is recorded in `.sentinelayer/cost-history.json`
776
+ - telemetry usage/stop events are recorded in `.sentinelayer/observability/run-events.jsonl`
777
+ - budget governors apply (`--max-cost`, `--max-tokens`, `--max-runtime-ms`, `--max-tool-calls`, `--max-no-progress`)
778
+
779
+ ## Prompt generation (PR 1.3 slice)
780
+
781
+ Generate execution prompts directly from `SPEC.md`:
782
+
783
+ - `sentinelayer-cli prompt generate --path . --agent codex`
784
+ - `sentinelayer-cli prompt preview --path . --agent claude --max-lines 40`
785
+ - `sentinelayer-cli prompt show --path . --agent codex`
786
+ - `sentinelayer-cli prompt show --path . --file docs/PROMPT_codex.md --plain`
787
+
788
+ Supported targets: `claude`, `cursor`, `copilot`, `codex`, `generic`.
789
+
790
+ ## Omar workflow generation (PR 1.4 slice)
791
+
792
+ Generate and validate a spec-aligned security workflow:
793
+
794
+ - `sentinelayer-cli scan init --path . --non-interactive`
795
+ - `sentinelayer-cli scan init --path . --has-e2e-tests yes --playwright-mode auto`
796
+ - `sentinelayer-cli scan validate --path . --json`
797
+
798
+ `scan init` writes `.github/workflows/omar-gate.yml` and derives:
799
+
800
+ - `scan_mode` + `severity_gate` from spec risk profile
801
+ - `playwright_mode` from spec signals + optional E2E wizard/flags
802
+ - `sbom_mode` from supply-chain/dependency signals in spec
803
+ - Action bridge parity: generated `scan_mode` options align to `sentinelayer-v1-action` (`baseline`, `deep`, `audit`, `full-depth`) and use the pinned action ref.
804
+
805
+ `scan validate` checks workflow drift against the current spec profile and exits non-zero when mismatched.
806
+
807
+ AI-assisted pre-scan triage (budgeted + telemetry-instrumented):
808
+
809
+ - `sentinelayer-cli scan precheck --path . --provider openai --model gpt-5.3-codex`
810
+ - `sentinelayer-cli scan precheck --path . --max-cost 0.5 --warn-at-percent 80 --json`
811
+
812
+ `scan precheck` writes an AI report to `.sentinelayer/reports/scan-precheck-*.md` (or configured output root), records usage in `.sentinelayer/cost-history.json`, and emits usage/stop events to `.sentinelayer/observability/run-events.jsonl`.
813
+
814
+ ## Build guide generation (PR 1.5 slice)
815
+
816
+ Generate phase-by-phase implementation guides from `SPEC.md`:
817
+
818
+ - `sentinelayer-cli guide generate --path .`
819
+ - `sentinelayer-cli guide generate --path . --output-file docs/BUILD_GUIDE.md`
820
+ - `sentinelayer-cli guide show --path .`
821
+ - `sentinelayer-cli guide show --path . --plain`
822
+
823
+ Export phases as issue-ready payloads:
824
+
825
+ - `sentinelayer-cli guide export --path . --format jira`
826
+ - `sentinelayer-cli guide export --path . --format linear`
827
+ - `sentinelayer-cli guide export --path . --format github-issues`
828
+
829
+ `guide generate` writes `BUILD_GUIDE.md` with per-phase effort estimates, dependencies, implementation tasks, and acceptance criteria. `guide export` transforms phases into tracker-friendly artifacts.
830
+
831
+ ## Multi-provider AI client contract (PR 3.1 slice)
832
+
833
+ `src/ai/client.js` now provides a reusable contract for future AI-enabled commands:
834
+
835
+ - provider support: `openai`, `anthropic`, `google`
836
+ - provider auto-detection from `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `GOOGLE_API_KEY`
837
+ - model resolution defaults per provider with explicit override support
838
+ - retry + exponential backoff on retryable statuses (`429`, `5xx`)
839
+ - non-stream and streaming invocation APIs with provider-normalized text output
840
+
841
+ ## Cost tracking and budgets (PR 3.2 slice)
842
+
843
+ The CLI now includes deterministic cost-ledger commands:
844
+
845
+ - `sentinelayer-cli cost show --path .`
846
+ - `sentinelayer-cli cost record --path . --provider openai --model gpt-5.3-codex --input-tokens 1000 --output-tokens 500`
847
+
848
+ Ledger path:
849
+
850
+ - `.sentinelayer/cost-history.json` (or configured output root)
851
+
852
+ Budget controls in `cost record`:
853
+
854
+ - `--max-cost <usd>` (default `1`)
855
+ - `--max-tokens <count>` (default `0`, disabled)
856
+ - `--max-runtime-ms <n>` (default `0`, disabled)
857
+ - `--max-tool-calls <n>` (default `0`, disabled)
858
+ - `--max-no-progress <count>` diminishing-returns guard (default `3`)
859
+ - `--warn-at-percent <n>` near-limit warning threshold (default `80`)
860
+
861
+ Usage counters tracked per invocation/session:
862
+
863
+ - `--duration-ms <n>`
864
+ - `--tool-calls <n>`
865
+
866
+ Each `cost record` call now emits observability events to:
867
+
868
+ - `.sentinelayer/observability/run-events.jsonl`
869
+
870
+ including normalized usage snapshots and blocking stop-class events when budgets are exceeded.
871
+
872
+ ## Observability telemetry contract (PR 3.5 slice)
873
+
874
+ The CLI now supports a deterministic run-event ledger and stop-class schema:
875
+
876
+ - `sentinelayer-cli telemetry show --path .`
877
+ - `sentinelayer-cli telemetry record --path . --event-type tool_call --tool-calls 1`
878
+ - `sentinelayer-cli telemetry record --path . --event-type run_stop --stop-class MAX_RUNTIME_MS_EXCEEDED --reason-codes MAX_RUNTIME_MS_EXCEEDED --blocking`
879
+
880
+ Ledger contract:
881
+
882
+ - file: `.sentinelayer/observability/run-events.jsonl`
883
+ - event types: `run_start`, `run_step`, `tool_call`, `usage`, `budget_check`, `run_stop`
884
+ - stop classes: `MAX_COST_EXCEEDED`, `MAX_OUTPUT_TOKENS_EXCEEDED`, `DIMINISHING_RETURNS`, `MAX_RUNTIME_MS_EXCEEDED`, `MAX_TOOL_CALLS_EXCEEDED`, `MANUAL_STOP`, `ERROR`, `UNKNOWN`
885
+
886
+ ## Requirements
887
+
888
+ - Node `>=20.0`
889
+ - network access to Sentinelayer API/web
890
+ - optional: GitHub CLI (`gh`) authenticated for secret injection
891
+
892
+ ## Release to npm
893
+
894
+ This repo includes `.github/workflows/release.yml`.
895
+ Automated version/tag PR flow is handled by `.github/workflows/release-please.yml`.
896
+ Primary gate enforcement is Omar-first:
897
+ - `.github/workflows/omar-gate.yml` (`Omar Gate`) for AppSec findings and merge thresholds
898
+ - `.github/workflows/quality-gates.yml` (`Quality Summary`) for deterministic build/test/package checks
899
+ - `.github/workflows/attestations.yml` (`Attestation Summary`) for provenance verification
900
+
901
+ Prerequisites:
902
+
903
+ - npm package name is available (`sentinelayer-cli`)
904
+ - one publish auth path is configured:
905
+ - repository secret `NPM_TOKEN` with publish access, or
906
+ - npm trusted publishing for this repository/tag workflow
907
+
908
+ Release options:
909
+
910
+ 1. Merge to `main` and let `Release Please` open/update the release PR and tag.
911
+ 2. Push a tag like `v0.1.1` to publish automatically (or via release-please tag creation).
912
+ 3. Run `Release` manually (`workflow_dispatch`) to validate gates and rollback readiness without publishing.
913
+ 4. Tag-triggered publish resolves auth mode at runtime (`NPM_TOKEN` first, otherwise trusted publishing OIDC).
914
+ 5. If neither auth mode is available, publish fails closed with an explicit workflow error.
915
+
916
+ Release publish now enforces tarball checksum-manifest validation and attestation verification bound to `.github/workflows/release.yml` before `npm publish`.
917
+
918
+ Release guardrails now require successful upstream checks on the target commit:
919
+
920
+ - `Quality Summary`
921
+ - `Omar Gate`
922
+ - `Attestation Summary`
923
+
924
+ ## Local verification
925
+
926
+ ```bash
927
+ npm run verify
928
+ ```
929
+
930
+ This runs:
931
+
932
+ - CLI syntax check
933
+ - unit tests for core offline generators/config/cost tracking
934
+ - end-to-end automated scaffolding tests (mock API + mock `gh`)
935
+ - coverage enforcement (`>=80%` lines/functions/statements, `>=70%` branches for core modules)
936
+ - package tarball dry-run
937
+
938
+ Additional test commands:
939
+
940
+ - `npm run test:unit`
941
+ - `npm run test:e2e`
942
+ - `npm run test:coverage`
943
+
944
+ ## Local commands (MVP)
945
+
946
+ The CLI now supports a command tree, while keeping slash-command compatibility:
947
+
948
+ - `sentinelayer-cli init <project-name>` runs scaffold/auth generation (legacy top-level invocation still works)
949
+ - `sentinelayer-cli omargate deep --path <repo>` runs a local credential/policy scan and writes `.sentinelayer/reports/omargate-deep-*.md` (non-zero exit if P1 findings exist)
950
+ - Local `/omargate` is a local preflight engine; GitHub PR gate execution runs through `sentinelayer-v1-action` -> Sentinelayer API (`/api/v1/github-app/trigger` + `/api/v1/github-app/runs/{id}/status`).
951
+ - `sentinelayer-cli audit [--agents <ids>] [--max-parallel <n>]` runs orchestrated audit agents and writes `.sentinelayer/audits/<run-id>/AUDIT_REPORT.{md,json}`
952
+ - `sentinelayer-cli audit registry` lists built-in/customized audit-agent registry records
953
+ - `sentinelayer-cli audit security` runs the security specialist agent and writes a dedicated `SECURITY_AGENT_REPORT.md`
954
+ - `sentinelayer-cli audit architecture` runs the architecture specialist agent and writes a dedicated `ARCHITECTURE_AGENT_REPORT.md`
955
+ - `sentinelayer-cli audit testing` runs the testing specialist agent and writes a dedicated `TESTING_AGENT_REPORT.md`
956
+ - `sentinelayer-cli audit performance` runs the performance specialist agent and writes a dedicated `PERFORMANCE_AGENT_REPORT.md`
957
+ - `sentinelayer-cli audit compliance` runs the compliance specialist agent and writes a dedicated `COMPLIANCE_AGENT_REPORT.md`
958
+ - `sentinelayer-cli audit documentation` runs the documentation specialist agent and writes a dedicated `DOCUMENTATION_AGENT_REPORT.md`
959
+ - `sentinelayer-cli audit package [--run-id <id>]` builds/rebuilds unified DD package artifacts from the requested (or latest) run
960
+ - `sentinelayer-cli audit replay <run-id>` reruns the same selected agent set and writes a replay comparison artifact
961
+ - `sentinelayer-cli audit diff <base-run-id> <candidate-run-id>` compares two runs and emits reproducibility drift deltas
962
+ - `sentinelayer-cli audit local --path <repo>` runs legacy readiness + scan audit and writes `.sentinelayer/reports/audit-*.md`
963
+ - `sentinelayer-cli persona orchestrator --mode <builder|reviewer|hardener> --path <repo>` generates mode-specific execution instructions with repo context
964
+ - `sentinelayer-cli apply --plan tasks/todo.md --path <repo>` parses plan tasks into deterministic execution order preview
965
+ - `sentinelayer-cli auth login|status|logout` manages persistent CLI sessions for long-running automation
966
+ - `sentinelayer-cli auth sessions|revoke` supports session inventory and explicit token revocation controls
967
+ - `sentinelayer-cli watch run-events --run-id <id>` streams runtime events with local artifact persistence
968
+ - `sentinelayer-cli daemon error record|worker|queue` ingests admin errors and routes deterministic daemon queue work items
969
+ - `sentinelayer-cli daemon assign claim|heartbeat|release|reassign|list` manages shared daemon assignment leases and lifecycle states
970
+ - `sentinelayer-cli daemon jira open|start|comment|transition|list` manages Jira lifecycle evidence tied to daemon work items
971
+ - `sentinelayer-cli daemon budget check|status` enforces budget warning/quarantine/kill governance with reproducible artifacts
972
+ - `sentinelayer-cli daemon control|snapshot|stop` provides operator roster snapshots and explicit confirmed stop controls
973
+ - `sentinelayer-cli daemon lineage build|list|show` indexes reproducible work-item artifact lineage across queue/assignment/jira/budget/operator runs
974
+ - `sentinelayer-cli daemon map scope|list|show` builds hybrid deterministic+semantic impact scopes with import-graph overlay for daemon work items
975
+ - `sentinelayer-cli daemon reliability run|status` and `daemon maintenance status|on|off` operate the midnight synthetic lane and maintenance billboard lifecycle
976
+ - `sentinelayer-cli mcp schema|registry|server|bridge ...` manages MCP registry schema, server configs, and VS Code bridge scaffolds
977
+ - `sentinelayer-cli plugin init|validate|list|order` manages plugin/template/policy packs and deterministic load-order governance
978
+ - `sentinelayer-cli policy list|use <pack-id>` manages active policy pack selection (`community`, `strict`, `compliance-soc2`, `compliance-hipaa`, plugin packs)
979
+ - `sentinelayer-cli ai provision-email` scaffolds and optionally executes AIdenID identity provisioning requests
980
+ - `sentinelayer-cli ai identity list|show|revoke|create-child|lineage|revoke-children` manages local identity lifecycle and lineage workflows
981
+ - `sentinelayer-cli ai identity domain create|verify|freeze` manages domain proof registration and containment controls
982
+ - `sentinelayer-cli ai identity target create|verify|show` manages target policy registration and verification controls
983
+ - `sentinelayer-cli ai identity site create|list` manages ephemeral callback site provisioning and local lifecycle tracking
984
+ - `sentinelayer-cli ai identity events|latest|wait-for-otp` manages extraction/event polling for OTP and verification-link retrieval
985
+ - `sentinelayer-cli chat ask` runs low-latency prompt/response chat with transcript persistence
986
+ - `sentinelayer-cli review [path] [--diff|--staged]` runs layered deterministic review and writes reproducible artifacts under `.sentinelayer/reviews/<run-id>/`
987
+ - `sentinelayer-cli review [path] [--diff|--staged] [--ai]` adds budget-governed AI reasoning over deterministic findings
988
+ - `sentinelayer-cli review show|export|accept|reject|defer ...` manages reconciled unified reports and HITL adjudication
989
+ - `sentinelayer-cli review replay|diff ...` runs reproducibility replay and run-to-run drift comparisons
990
+ - `sentinelayer-cli review scan --mode full|diff|staged` runs lightweight deterministic scan mode for compatibility
991
+ - add `--json` to `omargate`, `audit`, `persona orchestrator`, or `apply` for machine-readable summaries in CI
992
+ - add `--output-dir <dir>` to local commands to write reports outside the default `.sentinelayer/reports`
993
+
994
+ Legacy slash commands are still supported:
995
+
996
+ - `sentinelayer-cli /omargate deep --path .`
997
+ - `sentinel /omargate deep --path .`
998
+
999
+ Roadmap:
1000
+
1001
+ - persona orchestrator command set for specialized review/execution modes
1002
+
1003
+ ## Troubleshooting
1004
+
1005
+ - `Authentication timed out`: rerun and approve browser session faster.
1006
+ - `GitHub CLI not installed`: install `gh` or run manual fallback.
1007
+ - `Invalid repo format`: use exact `owner/repo`.
1008
+ - `Missing token in workflow`: ensure `.github/workflows/omar-gate.yml` maps `sentinelayer_token: ${{ secrets.SENTINELAYER_TOKEN }}`.
1009
+