bradsansnow Codex commited on
Commit
e0d4a65
·
1 Parent(s): 08db0a7

fix: align blocked sync warnings with exact-sync precheck

Browse files
.claude/skills/sync-nowai-leaderboard/SKILL.md CHANGED
@@ -49,10 +49,13 @@ From the repo root:
49
  (`*.powerplatform.com`), so `lib/teams.mjs` posts an **Adaptive Card** in the
50
  `message/attachments` envelope that template expects — not a raw MessageCard.
51
  - Cards: green ✅ success (with "Open staging" button), red ❌ failure, amber ⚠️
52
- sanity-gate abort, blue 📋 Friday heartbeat (no changes detected — shows last
53
- date `data/leaderboard.json` actually changed). No card on "no changes" Mon–Thu.
 
 
54
  - The daily 14:00 launchd job (`~/.nowai-sync/`) loads `TEAMS_WEBHOOK_URL` from
55
- `.env` and also fires a local macOS desktop notification for every outcome.
 
56
 
57
  ## Logs
58
 
 
49
  (`*.powerplatform.com`), so `lib/teams.mjs` posts an **Adaptive Card** in the
50
  `message/attachments` envelope that template expects — not a raw MessageCard.
51
  - Cards: green ✅ success (with "Open staging" button), red ❌ failure, amber ⚠️
52
+ sanity-gate abort, amber ⚠️ blocked preflight warning (dirty worktree / wrong
53
+ branch / fetch failure / local main out of sync with `origin/main`), blue 📋
54
+ Friday heartbeat (no changes detected — shows last date
55
+ `data/leaderboard.json` actually changed). No card on "no changes" Mon–Thu.
56
  - The daily 14:00 launchd job (`~/.nowai-sync/`) loads `TEAMS_WEBHOOK_URL` from
57
+ `.env`, posts blocked-preflight warnings through `notify-blocked.mjs`, and
58
+ still fires a local macOS desktop notification for every outcome.
59
 
60
  ## Logs
61
 
.claude/skills/sync-nowai-leaderboard/lib/blocked-notify.mjs CHANGED
@@ -2,7 +2,7 @@ const REASON_LABELS = {
2
  'dirty-worktree': 'Worktree has uncommitted files',
3
  'wrong-branch': 'Current branch is not main',
4
  'fetch-failed': 'git fetch origin main failed',
5
- 'behind-or-diverged': 'Local main is behind or diverged from origin/main',
6
  };
7
 
8
  const FACT_LABELS = {
 
2
  'dirty-worktree': 'Worktree has uncommitted files',
3
  'wrong-branch': 'Current branch is not main',
4
  'fetch-failed': 'git fetch origin main failed',
5
+ 'behind-or-diverged': 'Local main is not exactly in sync with origin/main',
6
  };
7
 
8
  const FACT_LABELS = {
.claude/skills/sync-nowai-leaderboard/test/blocked-notify.test.mjs CHANGED
@@ -22,6 +22,21 @@ test('buildBlockedNotification maps dirty-worktree to a warning card payload', (
22
  ]);
23
  });
24
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  test('parseBlockedCliArgs accepts repeated --fact pairs', () => {
26
  const out = parseBlockedCliArgs([
27
  '--reason', 'behind-or-diverged',
 
22
  ]);
23
  });
24
 
25
+ test('buildBlockedNotification uses exact-sync wording for local-ahead blocked runs', () => {
26
+ const out = buildBlockedNotification({
27
+ reason: 'behind-or-diverged',
28
+ facts: [['Branch', 'main'], ['RemoteAhead', '0'], ['LocalAhead', '1']],
29
+ now: new Date('2026-07-01T21:00:00Z'),
30
+ });
31
+
32
+ assert.deepEqual(out.facts, [
33
+ ['Reason', 'Local main is not exactly in sync with origin/main'],
34
+ ['Branch', 'main'],
35
+ ['RemoteAhead', '0'],
36
+ ['LocalAhead', '1'],
37
+ ]);
38
+ });
39
+
40
  test('parseBlockedCliArgs accepts repeated --fact pairs', () => {
41
  const out = parseBlockedCliArgs([
42
  '--reason', 'behind-or-diverged',