@ouro.bot/cli 0.1.0-alpha.664 → 0.1.0-alpha.665

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/changelog.json CHANGED
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "_note": "This changelog is maintained as part of the PR/version-bump workflow. Agent-curated, not auto-generated. Agents read this file directly via read_file to understand what changed between versions.",
3
3
  "versions": [
4
+ {
5
+ "version": "0.1.0-alpha.665",
6
+ "changes": [
7
+ "Ignore Sentinel-owned daemon-health git dirt when computing the Sentinel bundle signal, preventing a self-sustaining health-receipt loop while keeping real bundle dirt visible."
8
+ ]
9
+ },
4
10
  {
5
11
  "version": "0.1.0-alpha.664",
6
12
  "changes": [
@@ -482,7 +482,7 @@ function healthSignals(results) {
482
482
  }
483
483
  function defaultGitStatus(agentRoot) {
484
484
  try {
485
- const porcelain = (0, child_process_1.execFileSync)("git", ["status", "--porcelain"], {
485
+ const porcelain = (0, child_process_1.execFileSync)("git", ["status", "--porcelain=v1", "-uall"], {
486
486
  cwd: agentRoot,
487
487
  encoding: "utf-8",
488
488
  stdio: ["ignore", "pipe", "pipe"],
@@ -494,7 +494,50 @@ function defaultGitStatus(agentRoot) {
494
494
  return { ok: false, error: String(error) };
495
495
  }
496
496
  }
497
- function bundleSignal(status) {
497
+ function gitStatusEntries(porcelain) {
498
+ return porcelain.split(/\r?\n/).filter((line) => line.trim().length > 0);
499
+ }
500
+ function normalizeGitStatusPath(entryPath) {
501
+ return entryPath.trim().replace(/^"|"$/g, "");
502
+ }
503
+ function gitStatusPaths(entry) {
504
+ const rawPath = entry.slice(3).trim();
505
+ const paths = [];
506
+ let start = 0;
507
+ let inQuote = false;
508
+ let escaped = false;
509
+ for (let index = 0; index < rawPath.length; index += 1) {
510
+ const char = rawPath[index];
511
+ if (escaped) {
512
+ escaped = false;
513
+ continue;
514
+ }
515
+ if (inQuote && char === "\\") {
516
+ escaped = true;
517
+ continue;
518
+ }
519
+ if (char === "\"") {
520
+ inQuote = !inQuote;
521
+ continue;
522
+ }
523
+ if (!inQuote && rawPath.startsWith(" -> ", index)) {
524
+ paths.push(rawPath.slice(start, index));
525
+ start = index + 4;
526
+ index += 3;
527
+ }
528
+ }
529
+ paths.push(rawPath.slice(start));
530
+ return paths.map(normalizeGitStatusPath);
531
+ }
532
+ function isSentinelGitStatusEntry(entry) {
533
+ const sentinelRoot = relativeSentinelRoot();
534
+ return gitStatusPaths(entry).every((entryPath) => {
535
+ const normalizedPath = entryPath.replace(/\/$/, "");
536
+ return normalizedPath === sentinelRoot || normalizedPath.startsWith(`${sentinelRoot}/`);
537
+ });
538
+ }
539
+ function bundleSignal(status, options = {}) {
540
+ const gitStatusCommand = "git status --porcelain=v1 -uall";
498
541
  if (!status.ok) {
499
542
  return {
500
543
  id: "bundle:git",
@@ -503,11 +546,12 @@ function bundleSignal(status) {
503
546
  severity: "warn",
504
547
  verdictImpact: "watch",
505
548
  summary: `bundle git status unavailable: ${status.error}`,
506
- source: { kind: "git", locator: "git status --porcelain" },
507
- repair: repair("agent-runnable", "bundle-cleanup", "Inspect bundle git state before assuming the local state is clean.", "git status --porcelain"),
549
+ source: { kind: "git", locator: gitStatusCommand },
550
+ repair: repair("agent-runnable", "bundle-cleanup", "Inspect bundle git state before assuming the local state is clean.", gitStatusCommand),
508
551
  };
509
552
  }
510
- const dirtyEntries = status.porcelain.split(/\r?\n/).filter((line) => line.trim().length > 0);
553
+ const dirtyEntries = gitStatusEntries(status.porcelain)
554
+ .filter((entry) => !(options.ignoreSentinelDirtyEntries && isSentinelGitStatusEntry(entry)));
511
555
  if (dirtyEntries.length > 0) {
512
556
  return {
513
557
  id: "bundle:git",
@@ -516,8 +560,8 @@ function bundleSignal(status) {
516
560
  severity: "warn",
517
561
  verdictImpact: "watch",
518
562
  summary: `bundle has ${dirtyEntries.length} uncommitted git status entr${dirtyEntries.length === 1 ? "y" : "ies"}`,
519
- source: { kind: "git", locator: "git status --porcelain" },
520
- repair: repair("agent-runnable", "bundle-cleanup", "Resolve or intentionally preserve local bundle changes before handoff.", "git status --porcelain"),
563
+ source: { kind: "git", locator: gitStatusCommand },
564
+ repair: repair("agent-runnable", "bundle-cleanup", "Resolve or intentionally preserve local bundle changes before handoff.", gitStatusCommand),
521
565
  meta: { dirtyEntries },
522
566
  };
523
567
  }
@@ -528,7 +572,7 @@ function bundleSignal(status) {
528
572
  severity: "info",
529
573
  verdictImpact: "none",
530
574
  summary: "bundle git status clean",
531
- source: { kind: "git", locator: "git status --porcelain" },
575
+ source: { kind: "git", locator: gitStatusCommand },
532
576
  };
533
577
  }
534
578
  function sentinelVerdict(signals) {
@@ -633,7 +677,9 @@ function makeReceipt(agentName, agentRoot, options, generatedAt) {
633
677
  gauntletSignal(report),
634
678
  ...deriveContextLossSentinelProviderSignals(providerVisibility),
635
679
  ...healthSignals(options.daemonHealthResults ?? []),
636
- bundleSignal((options.gitStatus ?? (() => defaultGitStatus(agentRoot)))()),
680
+ bundleSignal((options.gitStatus ?? (() => defaultGitStatus(agentRoot)))(), {
681
+ ignoreSentinelDirtyEntries: options.trigger === "daemon_health",
682
+ }),
637
683
  ];
638
684
  const verdict = sentinelVerdict(signals);
639
685
  const latestReady = readLatestReady(agentRoot);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.664",
3
+ "version": "0.1.0-alpha.665",
4
4
  "main": "dist/heart/daemon/ouro-entry.js",
5
5
  "bin": {
6
6
  "cli": "dist/heart/daemon/ouro-bot-entry.js",