@misterhuydo/sentinel 1.5.44 → 1.5.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@misterhuydo/sentinel",
3
- "version": "1.5.44",
3
+ "version": "1.5.46",
4
4
  "description": "Sentinel — Autonomous DevOps Agent installer and manager",
5
5
  "bin": {
6
6
  "sentinel": "./bin/sentinel.js"
@@ -1 +1 @@
1
- __version__ = "1.5.44"
1
+ __version__ = "1.5.46"
@@ -120,6 +120,7 @@ class RepoConfig:
120
120
  cicd_job_url: str = ""
121
121
  cicd_user: str = "" # Jenkins username for Basic auth (defaults to "sentinel")
122
122
  health_url: str = "" # optional: HTTP endpoint returning {"Status": "true"}
123
+ service_aliases: list[str] = field(default_factory=list) # short names that route to this repo (e.g. ["STS", "SecurityTokenService"])
123
124
  cicd_token: str = ""
124
125
  git_ssh_user_key: str = "" # personal GitHub SSH key (contributor on org repos)
125
126
  git_ssh_deploy_key: str = "" # repo-specific deploy key (repos you own/admin)
@@ -345,6 +346,7 @@ class ConfigLoader:
345
346
  r.cicd_user = d.get("CICD_USER", "")
346
347
  r.cicd_token = d.get("CICD_TOKEN", "")
347
348
  r.health_url = d.get("HEALTH_URL", "")
349
+ r.service_aliases = _csv(d.get("SERVICE_ALIASES", ""))
348
350
  raw_user_key = d.get("GIT_SSH_USER_KEY", "")
349
351
  raw_deploy_key = d.get("GIT_SSH_DEPLOY_KEY", "") or d.get("GIT_SSH_KEY", "") or d.get("SSH_KEY_FILE", "")
350
352
  r.git_ssh_user_key = os.path.expanduser(raw_user_key) if raw_user_key else default_user_key
@@ -563,27 +563,23 @@ When to act vs. when to ask:
563
563
  When filter_logs returns no hits after a recent release, always retry with search_logs before
564
564
  telling the user the log line isn't there.
565
565
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
566
- LOG RESULTS DO NOT PROVE DEPLOYMENT STATUS
566
+ LOG SEARCH RESULTS REPORT ONLY WHAT WAS FOUND
567
567
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
568
- You are FORBIDDEN from asserting "release X is not deployed" or "servers are still on old version"
569
- based solely on log search results not from zero hits, not from finding old lines without new ones.
568
+ When the user asks to filter, search, or fetch logs: report exactly what the tool returned.
569
+ Do NOT add deployment status, release status, version conclusions, or "next steps" about Jenkins.
570
+ The user asked for log lines — give them the log lines (or "no matches found"), nothing more.
570
571
 
571
- WHY: A log line only appears when that exact code path executes. Finding 0 hits or only old log
572
- lines says nothing about what code version is running. The new line simply hasn't been triggered yet.
573
-
574
- WRONG NEVER SAY THESE:
575
- "Zero hits for '<feature log pattern>'. Release X.Y.Z has not deployed."
576
- "Found old log entries but no new ones — servers are still on the previous version."
577
- "The new code from release X.Y.Z is still not deployed."
572
+ WRONG (user asked for log results, not deployment analysis):
573
+ "Found 3 matches. The new code from release X.Y.Z is still not deployed."
574
+ "No matches — the servers haven't picked up the new release yet."
575
+ "Zero hits. Check Jenkins to confirm the build status."
578
576
 
579
577
  CORRECT:
580
- "No '<feature log pattern>' lines yet — the code path hasn't been triggered since the last
581
- fetch. This says nothing about whether the release is deployed."
578
+ "3 matches found: [table of results]"
579
+ "No matches for '<pattern>' in <source>."
582
580
 
583
- To verify if a release is live:
584
- 1. FIRST: call check_health for the relevant source/repo it returns the live version directly.
585
- 2. If no HEALTH_URL is configured: search_logs with query "Starting|started in|version|initialized".
586
- NEVER state deployment status without calling check_health first.
581
+ Deployment/version questions are separate. If the user asks "is version X deployed?", THEN
582
+ call check_health (returns live version from HEALTH_URL) or search_logs for startup lines.
587
583
  - If a tool call will take a moment (search, fetch, pull), prefix your reply with a brief "working" line ending in "..." before the results, e.g. "Searching SSOLWA for TryDig activity..." then the actual output.
588
584
  Never just say a working line and stop — always follow it with the results in the same message.
589
585
 
@@ -185,8 +185,9 @@ def _infer_target_repo(text: str, repos: dict, store=None) -> str:
185
185
  """
186
186
  Try to infer a target repo from bot message content.
187
187
  Checks in order:
188
- 1. Saved aliases in DB (e.g. "STS" → "Whydah-SecurityTokenService")
189
- 2. Case-insensitive substring match against repo names
188
+ 1. SERVICE_ALIASES declared in repo config files (e.g. SERVICE_ALIASES=STS,SecurityTokenService)
189
+ 2. Saved aliases in DB (learned at runtime via Boss conversation)
190
+ 3. Case-insensitive substring match against repo names
190
191
  Returns the repo name on a unique match, empty string otherwise.
191
192
  """
192
193
  import re as _re
@@ -195,13 +196,22 @@ def _infer_target_repo(text: str, repos: dict, store=None) -> str:
195
196
 
196
197
  for hint in hints:
197
198
  hint_clean = hint.rstrip(".,:")
198
- # 1. Saved alias lookup
199
+ hint_lower = hint_clean.lower()
200
+
201
+ # 1. Config-declared SERVICE_ALIASES (authoritative, version-controlled)
202
+ for repo_name, repo in repos.items():
203
+ declared = getattr(repo, "service_aliases", [])
204
+ if any(hint_lower == a.lower() for a in declared):
205
+ return repo_name
206
+
207
+ # 2. Runtime DB aliases (learned via Boss conversation)
199
208
  if store:
200
209
  alias = store.get_service_alias(hint_clean)
201
210
  if alias and alias in repos:
202
211
  return alias
203
- # 2. Case-insensitive substring match
204
- sub_matches = [r for r in repos if hint_clean.lower() in r.lower()]
212
+
213
+ # 3. Case-insensitive substring match against repo names
214
+ sub_matches = [r for r in repos if hint_lower in r.lower()]
205
215
  if len(sub_matches) == 1:
206
216
  return sub_matches[0]
207
217