Skip to content

notify: say how to start when notifications or a kind are missing - #41

Merged
phasenull merged 1 commit into
mainfrom
fix/notify-templates-start-hint
Nov 7, 2026
Merged

phasenull merged 1 commit into
mainfrom
fix/notify-templates-start-hint

Conversation

@phasenull

Copy link
Copy Markdown
Member

What

typetorch notify templates set test <id> in a repo with no notifications section used to say only typetorch.json has no "notifications" section. Now:

  • No notifications section (templates, templates set, push): the error prints a minimal block you can paste in as is. It has dailyCap, quietAfterLeaveMinutes, lapse, unopenedBackoff, and kinds with the kind you asked for: its text placeholder, priority, repeat and send. It ends with a link to the docs' Kinds section.
  • An undeclared kind (templates set): the error names the kind, lists the declared ones, and shows a stub to paste under notifications.kinds, plus the same link.
error: typetorch.json has no "notifications" section. Add one to start (a minimal block, valid as it is; rewrite the text):

  "notifications": {
    "dailyCap": 1,
    "quietAfterLeaveMinutes": 120,
    "lapse": [[14, 7], [30, 2], [60, 1]],
    "unopenedBackoff": { ... },
    "kinds": {
      "test": {
        "text": "Your message with a {placeholder}",
        "priority": 50,
        "repeat": "daily",
        "send": "preferred_hour"
      }
    }
  }

Kinds (priority, repeat, send, text and {placeholders}): https://github.com/typetorch/docs/blob/main/guides/notifications.md#kinds

Nothing is written to typetorch.json in either case.

Test plan

  • A new test in test/notify.test.ts checks:
    • the block parses and passes validateNotifications as is, and names the requested kind;
    • push and templates show the same hint;
    • an undeclared kind shows its stub, and the stub validates;
    • the file is left unchanged.
  • tsc --noEmit clean. bun test test/notify.test.ts: 83/0.
  • Full bun test: 859 pass, 1 fail. The failure is the known backend bless full-run one, which also fails on main.
  • The build and smoke checks pass.
  • Checked by hand in a scratch project: both errors print as above.

CLI CHANGELOG (gitignored), for the next patch: "notify templates / templates set / push: a missing notifications section or kind prints a ready-to-paste block and the Kinds docs link."

No release.

🤖 Generated with Claude Code

A typetorch.json with no "notifications" section (templates, templates set,
push) now gets a minimal ready-to-paste block naming the kind asked for, valid
as it is, and a link to the docs' Kinds section; templates set on a kind that
isn't declared names it and shows its stub.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@phasenull
phasenull merged commit b334ba1 into main Nov 7, 2026
1 check passed
@phasenull
phasenull deleted the fix/notify-templates-start-hint branch November 7, 2026 14:17
@phasenull
phasenull restored the fix/notify-templates-start-hint branch November 27, 2026 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant