@raidiant/notifai 7.0.0 → 7.0.2

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.
@@ -59,6 +59,27 @@ describe('semantic session labels', () => {
59
59
  ).toEqual({ ok: true, label: 'NotifAI question lifecycle', source: 'harness' })
60
60
  })
61
61
 
62
+ it('does not replace a frozen fallback when a managed semantic title appears later', () => {
63
+ const { env, now } = fixture()
64
+ const frozen = resolveSessionLabel({
65
+ env,
66
+ now,
67
+ sessionId: 'claude-session-before-orca-metadata',
68
+ harness: 'claude-code',
69
+ })
70
+ expect(frozen.ok && frozen.source).toBe('fallback')
71
+
72
+ expect(
73
+ resolveSessionLabel({
74
+ env,
75
+ now: now + 1_000,
76
+ sessionId: 'claude-session-before-orca-metadata',
77
+ harness: 'claude-code',
78
+ harnessLabel: 'Worker - semantic session implementation',
79
+ }),
80
+ ).toEqual(frozen)
81
+ })
82
+
62
83
  it('does not freeze OpenCode placeholder titles before the semantic title arrives', () => {
63
84
  const { env, now } = fixture()
64
85
  const file = path.join(stateDir(env), 'session-labels.json')
package/src/skill.test.ts CHANGED
@@ -60,6 +60,18 @@ describe('Notifai agent skill', () => {
60
60
  expect(decide).toBeLessThan(compose)
61
61
  })
62
62
 
63
+ it('keeps session instructions out of config and agent paraphrase out of criteria', () => {
64
+ // The rule this pins: a conversational instruction is followed, not
65
+ // persisted, and criteria are stored in the user's words verbatim. An
66
+ // agent once turned "guide me when you need me" into a persisted
67
+ // notify_criteria in its own wording, silently via --yes.
68
+ const decide = section('## Decide whether to notify')
69
+ expect(decide).toMatch(/never touches config/i)
70
+ expect(decide).toMatch(/words\s+verbatim/i)
71
+ expect(decide).toMatch(/paraphrase must never masquerade/i)
72
+ expect(decide).toMatch(/`--yes` skips the\s+CLI's confirmation/i)
73
+ })
74
+
63
75
  it('names every notification kind the CLI accepts', () => {
64
76
  for (const kind of NOTIFICATION_KINDS) {
65
77
  expect(skill).toContain(`\`${kind}\``)
@@ -102,8 +114,10 @@ describe('Notifai agent skill', () => {
102
114
  expect(send).toContain('--session-label')
103
115
  expect(send).toMatch(/first Notification\s+Request/i)
104
116
  expect(send).toMatch(/2-6 words/i)
105
- expect(send).toMatch(/OpenCode supplies its own title/i)
106
- expect(send).toMatch(/Claude Code, Codex, and Cursor/i)
117
+ expect(send).toMatch(/Managed OpenCode and Orca-managed Claude Code/i)
118
+ expect(send).toMatch(/omit `--session-label` there/i)
119
+ expect(send).toMatch(/Outside those managed sources/i)
120
+ expect(send).toMatch(/Claude Code, Codex,\s+and Cursor/i)
107
121
  expect(send).toMatch(/freezes the first accepted name/i)
108
122
  expect(send).toMatch(/omit the\s+flag on later sends and questions/i)
109
123
  expect(send).toMatch(/never pass\s+`--session-id`/i)