Skip to content

Commit 95bd9c3

Browse files
jonit-devTest Userclaude
authored
feat: job registry — scalable job architecture (#79)
* feat: job registry — scalable job architecture (#75) Add a central Job Registry that makes adding a new job type require only 2-3 file changes instead of 15+. ## Core changes - New `packages/core/src/jobs/job-registry.ts` with IJobDefinition, JOB_REGISTRY (6 jobs), and utility functions: getJobDef, getAllJobDefs, getJobDefByCommand, getJobDefByLogName, getValidJobTypes, getDefaultQueuePriority, getLogFileNames, getLockSuffix, normalizeJobConfig, buildJobEnvOverrides, camelToUpperSnake - VALID_JOB_TYPES, DEFAULT_QUEUE_PRIORITY, LOG_FILE_NAMES in constants.ts now derived from registry instead of hardcoded - config-normalize.ts: replace per-job qa/audit/analytics blocks with registry loop - config-env.ts: replace NW_QA_*/NW_AUDIT_*/NW_ANALYTICS_* blocks with registry loop ## Web changes - web/utils/jobs.ts: add IWebJobDefinition, WEB_JOB_REGISTRY (with getEnabled, getSchedule, buildEnabledPatch per job), getWebJobDef() - web/api.ts: add generic triggerJob(jobId) function - web/store/useStore.ts: add IWebJobState and getJobStates() computed getter - web/pages/Scheduling.tsx: replace handleJobToggle if/else chain and triggerMap with registry-driven code - web/store/useStore.ts: Zustand jobs computed slice ## Server changes - action.routes.ts: replace qa/audit/analytics/planner route handlers with JOB_REGISTRY loop Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: remove unused Provider import in config.ts Remove unused Provider type import that was flagged by ESLint. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(job-registry): remove dead migrateLegacy code and fix DRY violation in triggerJob - Remove `migrateLegacy` field from IJobDefinition interface and all 6 registry entries — the functions were defined and tested but never called in production code, creating false confidence about legacy migration coverage - Remove corresponding migrateLegacy test block (tests for dead code) - Fix `triggerJob` in web/api.ts: replace hardcoded endpointMap (which duplicated WEB_JOB_REGISTRY.triggerEndpoint) with a lookup via getWebJobDef() Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fixes --------- Co-authored-by: Test User <test@test.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 7b4ef17 commit 95bd9c3

51 files changed

Lines changed: 1918 additions & 651 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/prompts/pr-review.md

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Review the pull request and produce one standardized markdown review comment.
44
The output must be concise, specific, and action-oriented. Avoid generic praise, nitpicks, or repeated points.
55

66
**Focus areas**
7+
78
1. Code quality and maintainability
89
2. Functional correctness
910
3. Architecture and best practices
@@ -14,6 +15,7 @@ The output must be concise, specific, and action-oriented. Avoid generic praise,
1415
8. Non-blocking issues worth tracking
1516

1617
**Critical rules**
18+
1719
- Use the exact section order and heading names defined below.
1820
- Always include the score line exactly as `**🏆 Overall Score:** XX/100`.
1921
- Keep the summary and conclusion short.
@@ -23,6 +25,7 @@ The output must be concise, specific, and action-oriented. Avoid generic praise,
2325
- Do not output review boilerplate outside the required structure.
2426

2527
**Scoring guidance**
28+
2629
- 90-100: Exceptional quality, merge-ready with no meaningful concerns
2730
- 75-89: Strong implementation with minor issues or follow-ups
2831
- 60-74: Functional but has notable quality, correctness, or testing gaps
@@ -37,7 +40,7 @@ Use this exact structure:
3740

3841
**🏆 Overall Score:** XX/100
3942

40-
*1-2 sentence high-level summary of what the PR does and the overall quality assessment.*
43+
_1-2 sentence high-level summary of what the PR does and the overall quality assessment._
4144

4245
---
4346

@@ -63,27 +66,28 @@ If there are fewer than 3 real improvements, include only the meaningful ones.
6366

6467
Include this section only when you found at least one likely bug. Use this exact table shape:
6568

66-
| Bug Name | Affected Files | Description | Confidence |
67-
|----------|---------------|-------------|------------|
68-
| <bug name> | `<path>` | <why this is a bug and likely impact> | High 🟢 / Medium 🟡 / Low 🔴 |
69+
| Bug Name | Affected Files | Description | Confidence |
70+
| ---------- | -------------- | ------------------------------------- | ---------------------------- |
71+
| <bug name> | `<path>` | <why this is a bug and likely impact> | High 🟢 / Medium 🟡 / Low 🔴 |
6972

7073
---
7174

7275
### **📋 Issues Found**
7376

7477
Include this section only when you found non-bug issues worth flagging, such as performance, testing, maintainability, or design concerns. Use this exact table shape:
7578

76-
| Issue Type | Issue Name | Affected Components | Description | Impact/Severity |
77-
|------------|------------|---------------------|-------------|-----------------|
79+
| Issue Type | Issue Name | Affected Components | Description | Impact/Severity |
80+
| -------------------------------------------------- | ------------ | --------------------- | ------------------ | ------------------- |
7881
| Performance / Testing / Maintainability / Security | <issue name> | `<component or file>` | <specific concern> | High / Medium / Low |
7982

8083
---
8184

8285
### **🔚 Conclusion**
8386

84-
*1-2 sentence conclusion on merge readiness, seriousness of findings, and whether fixes are required before merge.*
87+
_1-2 sentence conclusion on merge readiness, seriousness of findings, and whether fixes are required before merge._
8588

8689
**Review quality bar**
90+
8791
- Prefer 2-3 substantial strengths and 0-3 meaningful improvements.
8892
- Distinguish clearly between bugs and non-bug issues.
8993
- Do not call something a bug unless there is a concrete failure mode.
@@ -95,7 +99,7 @@ Include this section only when you found non-bug issues worth flagging, such as
9599

96100
**🏆 Overall Score:** 85/100
97101

98-
*The PR implements a comprehensive feature with solid structure, good coverage, and only a few medium-priority follow-ups.*
102+
_The PR implements a comprehensive feature with solid structure, good coverage, and only a few medium-priority follow-ups._
99103

100104
---
101105

@@ -116,21 +120,21 @@ Include this section only when you found non-bug issues worth flagging, such as
116120

117121
### **🐛 Bugs Found**
118122

119-
| Bug Name | Affected Files | Description | Confidence |
120-
|----------|---------------|-------------|------------|
121-
| Example Integration Mismatch | `server/example.ts` | The endpoint path appears inconsistent with the client call, which could cause the integration to fail at runtime. | Medium 🟡 |
123+
| Bug Name | Affected Files | Description | Confidence |
124+
| ---------------------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------ | ---------- |
125+
| Example Integration Mismatch | `server/example.ts` | The endpoint path appears inconsistent with the client call, which could cause the integration to fail at runtime. | Medium 🟡 |
122126

123127
---
124128

125129
### **📋 Issues Found**
126130

127-
| Issue Type | Issue Name | Affected Components | Description | Impact/Severity |
128-
|------------|------------|---------------------|-------------|-----------------|
129-
| Performance | Sequential Checks | `matching.service.ts` | Multiple serial queries are executed per item, which may increase latency at scale. | Medium |
130-
| Testing | Fragile Mocks | `service.spec.ts` | Nested mocks make test setup hard to maintain and reason about. | Low |
131+
| Issue Type | Issue Name | Affected Components | Description | Impact/Severity |
132+
| ----------- | ----------------- | --------------------- | ----------------------------------------------------------------------------------- | --------------- |
133+
| Performance | Sequential Checks | `matching.service.ts` | Multiple serial queries are executed per item, which may increase latency at scale. | Medium |
134+
| Testing | Fragile Mocks | `service.spec.ts` | Nested mocks make test setup hard to maintain and reason about. | Low |
131135

132136
---
133137

134138
### **🔚 Conclusion**
135139

136-
*This is a strong PR with a clear structure and solid test coverage. The main follow-ups are manageable, but any real bugs identified should be addressed before merge.*
140+
_This is a strong PR with a clear structure and solid test coverage. The main follow-ups are manageable, but any real bugs identified should be addressed before merge._

docs/marketing/landing.md

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,20 @@ Marketing landing page for Night Watch CLI to convert visitors (developers, solo
3838
### 2. Hero Section
3939

4040
**Headline (large, bold):**
41+
4142
> Your repo's night shift.
4243
4344
**Subheadline (slate-400, 1-2 lines max):**
45+
4446
> Define work during the day. Night Watch executes overnight. Wake up to pull requests, reviewed code, and tested features.
4547
4648
**CTA buttons:**
49+
4750
- Primary: `npm install -g @jonit-dev/night-watch-cli` (copyable code block styled as a button, click-to-copy)
4851
- Secondary: "Read the docs" (ghost/outline button, links to docs)
4952

5053
**Below the fold teaser:**
54+
5155
- A single animated terminal recording (asciinema or typed.js simulation) showing:
5256
```
5357
$ night-watch init
@@ -63,11 +67,11 @@ Marketing landing page for Night Watch CLI to convert visitors (developers, solo
6367

6468
Three cards in a row, each with an icon, title, and 1-line description:
6569

66-
| Icon | Title | Description |
67-
|------|-------|-------------|
68-
| Moon/Clock | Async-first | Not pair-programming. Queued execution while you sleep. |
69-
| GitBranch | Safe isolation | Every task runs in its own git worktree. Your main branch stays clean. |
70-
| Eye/Shield | Human-in-the-loop | You review every PR. Configurable trust dials control auto-merge. |
70+
| Icon | Title | Description |
71+
| ---------- | ----------------- | ---------------------------------------------------------------------- |
72+
| Moon/Clock | Async-first | Not pair-programming. Queued execution while you sleep. |
73+
| GitBranch | Safe isolation | Every task runs in its own git worktree. Your main branch stays clean. |
74+
| Eye/Shield | Human-in-the-loop | You review every PR. Configurable trust dials control auto-merge. |
7175

7276
### 4. How It Works (horizontal stepper or vertical timeline)
7377

@@ -86,13 +90,13 @@ Four steps, each with a number, title, short description, and a small illustrati
8690

8791
Grid of 5 agent cards (2x3 or horizontal scroll on mobile). Each card:
8892

89-
| Agent | Role | Schedule hint |
90-
|-------|------|---------------|
91-
| Executor | Implements specs as code, opens PRs | Hourly |
92-
| Reviewer | Scores PRs, requests fixes, auto-merges | Every 3 hours |
93-
| QA | Generates and runs Playwright e2e tests | 4x daily |
94-
| Auditor | Scans codebase for quality issues | Weekly |
95-
| Slicer | Breaks roadmap items into granular specs | Every 6 hours |
93+
| Agent | Role | Schedule hint |
94+
| -------- | ---------------------------------------- | ------------- |
95+
| Executor | Implements specs as code, opens PRs | Hourly |
96+
| Reviewer | Scores PRs, requests fixes, auto-merges | Every 3 hours |
97+
| QA | Generates and runs Playwright e2e tests | 4x daily |
98+
| Auditor | Scans codebase for quality issues | Weekly |
99+
| Slicer | Breaks roadmap items into granular specs | Every 6 hours |
96100

97101
Each card should have a subtle colored accent bar on top (different color per agent) and a small icon. On hover, show a brief example of what the agent outputs (e.g., Reviewer: "Score: 87/100 — ready to merge").
98102

@@ -113,12 +117,14 @@ Each card should have a subtle colored accent bar on top (different color per ag
113117
Two-column layout:
114118

115119
**Night Watch is strongest when:** (green checkmarks)
120+
116121
- You already use structured specs, PRDs, or queued board items
117122
- You want async execution, not another pair-programming UI
118123
- Your work can be broken into small, reviewable pull requests
119124
- You care about overnight throughput on bounded tasks
120125

121126
**Night Watch is a weaker fit when:** (gray x-marks)
127+
122128
- Work starts vague and gets clarified only during implementation
123129
- Your team is not comfortable reviewing AI-generated pull requests
124130
- You want a general-purpose AI coding assistant
@@ -147,6 +153,7 @@ night-watch install # setup automated cron
147153
```
148154

149155
Below the code block:
156+
150157
- Link: "5-minute walkthrough" (→ docs/walkthrough.md)
151158
- Link: "Full docs" (→ docs/)
152159
- Link: "Commands reference" (→ docs/commands.md)
@@ -155,11 +162,11 @@ Below the code block:
155162

156163
Small horizontal strip showing supported providers:
157164

158-
| Provider | Mode |
159-
|----------|------|
160-
| Claude CLI | Default, with rate-limit fallback |
161-
| Codex CLI | Full support |
162-
| GLM-5 / Custom endpoints | Via `providerEnv` config |
165+
| Provider | Mode |
166+
| ------------------------ | --------------------------------- |
167+
| Claude CLI | Default, with rate-limit fallback |
168+
| Codex CLI | Full support |
169+
| GLM-5 / Custom endpoints | Via `providerEnv` config |
163170

164171
Caption: "Bring your own AI provider. Night Watch wraps the CLI — you stay in control of credentials and costs."
165172

@@ -209,14 +216,17 @@ Caption: "Bring your own AI provider. Night Watch wraps the CLI — you stay in
209216
## Copy Alternatives for Hero
210217

211218
Option A (current recommendation):
219+
212220
> **Your repo's night shift.**
213221
> Define work during the day. Night Watch executes overnight. Wake up to pull requests.
214222
215223
Option B:
224+
216225
> **Ship while you sleep.**
217226
> Night Watch turns your specs into reviewed pull requests — overnight, automatically, safely.
218227
219228
Option C:
229+
220230
> **Async PRD execution for AI-native teams.**
221231
> Queue specs. Night Watch implements, reviews, tests, and opens PRs while you're offline.
222232

docs/marketing/naming-branding.md

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
## Name Decision: Keep "Night Watch CLI"
44

55
### Why It's Fine
6+
67
- npm package is scoped (`@jonit-dev/night-watch-cli`) — no npm conflict
78
- CLI binary is `night-watch` — different from `nightwatch` (Nightwatch.js)
89
- Target audience finds the tool via GitHub, word-of-mouth, direct links — not by Googling "nightwatch"
910
- Search intent is completely different: testers find Nightwatch.js, developers automating spec execution find Night Watch CLI
1011

1112
### Nightwatch.js Overlap — Mitigated By
13+
1214
- Owning different keyword territory (see SEO section below)
1315
- Scoped npm package
1416
- Different CLI binary name
@@ -18,14 +20,17 @@
1820
## GitHub Description
1921

2022
**Recommended:**
23+
2124
> Turn GitHub issues into pull requests automatically. AI agents that implement, review, and test your specs on a schedule.
2225
2326
**Alternatives considered:**
27+
2428
- `Async AI execution layer for spec-driven teams. Queue work, wake up to PRs.`
2529
- `Cron-based AI coding agent. Specs in, pull requests out.`
2630
- `AI agent that implements your specs, opens PRs, reviews code, and runs tests — on a schedule.`
2731

2832
**What was rejected and why:**
33+
2934
- "Semi-autonomous software engineering app factory" — "app factory" implies it builds entire apps; "semi-autonomous" hedges weakly
3035
- "Autonomous PRD execution using AI Provider CLIs + cron" — too technical, not outcome-first
3136

@@ -34,6 +39,7 @@
3439
## SEO Strategy
3540

3641
### Keywords We Own (Nightwatch.js does NOT compete here)
42+
3743
- AI PR automation
3844
- async coding agent
3945
- PRD automation tool
@@ -44,6 +50,7 @@
4450
- spec to PR automation
4551

4652
### Keywords to Avoid (Nightwatch.js dominates)
53+
4754
- nightwatch e2e
4855
- nightwatch testing
4956
- nightwatchjs
@@ -54,24 +61,27 @@
5461
## Names Researched & Rejected
5562

5663
### Fully Available (domains + npm) — Rejected Alternatives
57-
| Name | Reason rejected |
58-
|------|----------------|
59-
| sentinelcli | Good but loses brand continuity |
60-
| nightcrew | Good vibe, weaker SEO |
61-
| nightshift | Best alternative if rebrand needed |
62-
| autohelm | Nautical metaphor, niche |
63-
| repocrew | Clear but generic |
64-
| cronpilot | Technical, not memorable |
65-
| specforge | SEO-strong but cold |
66-
| agentforge | Rides hype wave |
64+
65+
| Name | Reason rejected |
66+
| ----------- | ---------------------------------- |
67+
| sentinelcli | Good but loses brand continuity |
68+
| nightcrew | Good vibe, weaker SEO |
69+
| nightshift | Best alternative if rebrand needed |
70+
| autohelm | Nautical metaphor, niche |
71+
| repocrew | Clear but generic |
72+
| cronpilot | Technical, not memorable |
73+
| specforge | SEO-strong but cold |
74+
| agentforge | Rides hype wave |
6775

6876
### Why "AgenticSwarmCLI" Was Rejected
77+
6978
- "Agentic" is overused buzzword, will age poorly
7079
- "Swarm" implies chaos — opposite of the controlled, spec-driven philosophy
7180
- No personality or memorability
72-
- Describes *how* it works, not *what it does for you*
81+
- Describes _how_ it works, not _what it does for you_
7382

7483
### Naming Principles Applied
84+
7585
- Outcome-first over mechanism-first
7686
- Evocative metaphor > technical description
7787
- Short, speakable, memorable

0 commit comments

Comments
 (0)