oneie 3.5.0 → 3.6.0
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/.claude/agents/agent-director.md +902 -22
- package/.claude/agents/agent-onboard-example-output.md +600 -0
- package/.claude/agents/agent-onboard.md +576 -0
- package/.claude/commands/ONBOARDING_ENHANCEMENT_SUMMARY.md +266 -0
- package/.claude/commands/one.md +375 -5
- package/.claude/commands/release.md +64 -3
- package/CLAUDE.md +55 -69
- package/dist/commands/init.d.ts +5 -6
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +101 -101
- package/dist/commands/init.js.map +1 -1
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/utils/installation-setup.d.ts +24 -1
- package/dist/utils/installation-setup.d.ts.map +1 -1
- package/dist/utils/installation-setup.js +85 -1
- package/dist/utils/installation-setup.js.map +1 -1
- package/dist/utils/launch-claude.d.ts +6 -0
- package/dist/utils/launch-claude.d.ts.map +1 -0
- package/dist/utils/launch-claude.js +51 -0
- package/dist/utils/launch-claude.js.map +1 -0
- package/dist/utils/validation.d.ts +48 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +73 -0
- package/dist/utils/validation.js.map +1 -0
- package/folders.yaml +1 -1
- package/one/.obsidian/core-plugins.json +33 -0
- package/one/.obsidian/workspace.json +20 -20
- package/one/connections/workflow-onboarding.md +683 -0
- package/one/events/CART-DRAWER-INTEGRATION-GUIDE.md +354 -0
- package/one/events/CRITICAL-FIXES-COMPLETE.md +504 -0
- package/one/events/DEPLOYMENT.md +178 -0
- package/one/events/ECOMMERCE-DEMO-PLAN.md +225 -0
- package/one/events/ECOMMERCE-LIVE-DEMO.md +363 -0
- package/one/events/ECOMMERCE-TEMPLATE-COMPLETE.md +735 -0
- package/one/events/ECOMMERCE-TEMPLATES-SUMMARY.md +923 -0
- package/one/events/GRADIENT-TEXT-PERMANENT-FIX.md +223 -0
- package/one/events/HANDOFF.md +313 -0
- package/one/events/IMPLEMENTATION-SUMMARY-FINAL.md +503 -0
- package/one/events/IMPLEMENTATION_SUMMARY.md +529 -0
- package/one/events/LANDING-PAGE-EXAMPLE-OUTPUT.md +666 -0
- package/one/events/LANDING-PAGE-IMPLEMENTATION.md +642 -0
- package/one/events/LANDING-PAGE-QUICKSTART.md +407 -0
- package/one/events/MULTI-ONTOLOGY-COMPLETE-GUIDE.md +1627 -0
- package/one/events/MULTI-ONTOLOGY-IMPLEMENTATION-COMPLETE.md +573 -0
- package/one/events/ONBOARDING-IMPLEMENTATION-COMPLETE copy.md +398 -0
- package/one/events/ONTOLOGY-TUTORIALS-SUMMARY.md +525 -0
- package/one/events/ONTOLOGY-TYPE-GENERATOR-SUMMARY.md +455 -0
- package/one/events/ONTOLOGY_DISCOVERY_IMPLEMENTATION.md +486 -0
- package/one/events/ONTOLOGY_DISCOVERY_QUICKSTART.md +203 -0
- package/one/events/SECURITY-AUDIT-FIXES.md +376 -0
- package/one/events/SECURITY-SCAN-COMPLETE.md +281 -0
- package/one/events/SHOP-BUILD-STATUS.md +114 -0
- package/one/events/SHOP-PREMIUM-UPDATE.md +149 -0
- package/one/events/SITE-WIDE-GRADIENT-FIX.md +299 -0
- package/one/events/STORE-PRODUCTION-READY-STATUS.md +359 -0
- package/one/events/STRIPE-PAYMENT-METHODS-GUIDE.md +429 -0
- package/one/events/agent-director-enhancement-summary.md +386 -0
- package/one/events/agent-onboard-implementation-summary.md +457 -0
- package/one/events/clean-agent-ontology-cleanup-report.md +353 -0
- package/one/events/landing-page-generator.md +458 -0
- package/one/events/onboarding-implementation-complete.md +505 -0
- package/one/events/release.md +254 -0
- package/one/events/separate-implementation-status.md +537 -0
- package/one/knowledge/100-inference-quick-reference.md +431 -0
- package/one/knowledge/agent-onboard-usage.md +612 -0
- package/one/knowledge/cli-claude-handoff.md +718 -0
- package/one/knowledge/ontology-blog.yaml +31 -0
- package/one/knowledge/ontology-cheatsheet.md +591 -0
- package/one/knowledge/ontology-community.yaml +42 -0
- package/one/knowledge/ontology-core-universal.md +722 -0
- package/one/knowledge/ontology-core.yaml +50 -0
- package/one/knowledge/ontology-courses.yaml +53 -0
- package/one/knowledge/ontology-creator.md +376 -0
- package/one/knowledge/ontology-developer-guide.md +789 -0
- package/one/knowledge/ontology-education.md +920 -0
- package/one/knowledge/ontology-index.md +354 -0
- package/one/knowledge/ontology-migration-guide.md +811 -0
- package/one/knowledge/ontology-minimal.yaml +1 -1
- package/one/knowledge/ontology-portfolio.yaml +31 -0
- package/one/knowledge/ontology-quickstart.md +576 -0
- package/one/knowledge/ontology-shop.yaml +121 -0
- package/one/knowledge/ontology-tokens.yaml +32 -0
- package/one/knowledge/ontology-tutorial.md +434 -0
- package/one/knowledge/ontology-video-script.md +890 -0
- package/one/things/docs/ecommerce/ARCHITECTURE-DIAGRAM.md +467 -0
- package/one/things/docs/ecommerce/CONVERSION-ELEMENTS-IMPLEMENTATION.md +408 -0
- package/one/things/docs/ecommerce/CONVERSION-ELEMENTS-SUMMARY.md +369 -0
- package/one/things/docs/ecommerce/CONVERSION-UX-IMPLEMENTATION-SUMMARY.md +396 -0
- package/one/things/docs/ecommerce/FEATURE-SUMMARY.md +468 -0
- package/one/things/docs/ecommerce/IMPLEMENTATION-NOTES.md +582 -0
- package/one/things/docs/ecommerce/INTEGRATION-EXAMPLE.md +449 -0
- package/one/things/docs/ecommerce/QUICK-START.md +368 -0
- package/one/things/docs/ecommerce/URGENCY-IMPLEMENTATION-SUMMARY.md +498 -0
- package/one/things/docs/ecommerce/URGENCY-QUICK-REFERENCE.md +237 -0
- package/one/things/docs/ecommerce/USAGE-EXAMPLE.astro +171 -0
- package/one/things/docs/ecommerce/demo.astro +309 -0
- package/one/things/plans/agent-director-100-inference-plans.md +410 -0
- package/one/things/plans/dual-website-strategy.md +612 -0
- package/one/things/plans/feature-based-sites.md +821 -0
- package/one/things/plans/multi-ontology-architecture.md +836 -0
- package/one/things/plans/onboarding.md +32 -0
- package/one/things/plans/separate.md +15 -17
- package/one/things/plans/start-new.md +738 -0
- package/package.json +2 -2
- package/one/things/claude/hooks/agent-hook-manager.js +0 -525
- package/one/things/claude/hooks/agent-load-balancer.js +0 -271
- package/one/things/claude/hooks/agent-request-interceptor.js +0 -70
- package/one/things/claude/hooks/cascade-feedback.js +0 -297
- package/one/things/claude/hooks/cascade-integration-hooks.js +0 -648
- package/one/things/claude/hooks/continuous-improvement-monitor.js +0 -510
- package/one/things/claude/hooks/file-organization-engine.js +0 -427
- package/one/things/claude/hooks/file-organization-monitor.js +0 -269
- package/one/things/claude/hooks/hook-config-manager.js +0 -202
- package/one/things/claude/hooks/hook-orchestrator.js +0 -662
- package/one/things/claude/hooks/hook-performance-report.js +0 -120
- package/one/things/claude/hooks/mcp-cascade-integration.js +0 -816
- package/one/things/claude/hooks/memory-optimizer.js +0 -510
- package/one/things/claude/hooks/ontology-compliance.js +0 -394
- package/one/things/claude/hooks/ontology-hook-manager.js +0 -316
- package/one/things/claude/hooks/ontology-validation-engine.js +0 -317
- package/one/things/claude/hooks/performance-monitoring-hook.js +0 -422
- package/one/things/claude/hooks/quality-scoring-engine.js +0 -834
- package/one/things/claude/hooks/simple-load-balancer.js +0 -238
- package/one/things/claude/hooks/startup-optimizer.js +0 -625
- package/one/things/claude/hooks/story-scoring-system.js +0 -445
- package/one/things/claude/hooks/story-validation-engine.js +0 -473
- package/one/things/claude/hooks/structure-synchronizer.js +0 -194
- package/one/things/claude/hooks/sub-agent-output-validator.js +0 -647
- package/one/things/claude/hooks/sub-agent-validation-hook.js +0 -343
- package/one/things/claude/hooks/trinity-validation-system.js +0 -392
- package/one/things/plans/organizations-to-groups.md +0 -705
|
@@ -24,36 +24,30 @@ Validate that EVERY feature maps to the 6-dimension ontology:
|
|
|
24
24
|
|
|
25
25
|
**Golden Rule:** If a feature cannot be mapped to these 6 dimensions, it's invalid. The ontology IS the reality model.
|
|
26
26
|
|
|
27
|
-
## Installation Folders
|
|
27
|
+
## Installation Folders
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
# Check if installation folder exists
|
|
33
|
-
if [ -n "$INSTALLATION_NAME" ] && [ -d "/${INSTALLATION_NAME}" ]; then
|
|
34
|
-
# Installation folder detected - use hierarchical file resolution
|
|
35
|
-
# Priority: Installation > Global
|
|
36
|
-
fi
|
|
37
|
-
```
|
|
29
|
+
Installation folders support branding and feature customization, NOT custom ontologies.
|
|
38
30
|
|
|
39
31
|
**File Resolution Priority:**
|
|
40
|
-
1. `/<installation-name>/groups/<group-path>/<file>` (group-specific
|
|
41
|
-
2. `/<installation-name>/<file>` (installation-wide
|
|
42
|
-
3. `/one/<file>` (global
|
|
32
|
+
1. `/<installation-name>/groups/<group-path>/<file>` (group-specific policies)
|
|
33
|
+
2. `/<installation-name>/<file>` (installation-wide branding/features)
|
|
34
|
+
3. `/one/<file>` (global universal ontology)
|
|
43
35
|
|
|
44
36
|
**Key Questions When Validating:**
|
|
45
|
-
- Does this feature need installation-specific documentation?
|
|
46
|
-
- Are there group-specific
|
|
37
|
+
- Does this feature need installation-specific branding documentation?
|
|
38
|
+
- Are there group-specific policies in `/<installation-name>/groups/`?
|
|
47
39
|
- Should the plan be documented in global `/one/` or installation folder?
|
|
48
40
|
|
|
49
41
|
**Usage:**
|
|
50
42
|
- **Global features** → Document in `/one/things/plans/`
|
|
51
|
-
- **
|
|
52
|
-
- **Group
|
|
43
|
+
- **Organization branding** → Document in `/<installation-name>/knowledge/brand-guide.md`
|
|
44
|
+
- **Group policies** → Document in `/<installation-name>/groups/<group-slug>/`
|
|
45
|
+
|
|
46
|
+
**Important:** The ontology is ALWAYS universal. Installation folders do NOT create custom ontologies.
|
|
53
47
|
|
|
54
|
-
## Your
|
|
48
|
+
## Your 5 Core Responsibilities
|
|
55
49
|
|
|
56
|
-
From the ontology workflow system, you have
|
|
50
|
+
From the ontology workflow system, you have 5 responsibilities:
|
|
57
51
|
|
|
58
52
|
### 1. Validate Ideas Against Ontology
|
|
59
53
|
|
|
@@ -65,7 +59,24 @@ From the ontology workflow system, you have 4 responsibilities:
|
|
|
65
59
|
|
|
66
60
|
**Output:** Validated idea document (`ideas/N-name.md`)
|
|
67
61
|
|
|
68
|
-
### 2.
|
|
62
|
+
### 2. Generate 100-Inference Plans (NEW)
|
|
63
|
+
|
|
64
|
+
**Process:**
|
|
65
|
+
1. Read feature selections from `.onboarding.json` or user input
|
|
66
|
+
2. Map each feature to inference ranges (e.g., landing-page → Infer 1-10)
|
|
67
|
+
3. Resolve dependencies and create execution phases
|
|
68
|
+
4. Calculate total inferences, duration, and cost estimates
|
|
69
|
+
5. Generate complete 100-inference plan with specialist assignments
|
|
70
|
+
6. Write plan back to `.onboarding.json` for tracking
|
|
71
|
+
|
|
72
|
+
**Output:**
|
|
73
|
+
- Complete inference plan in `.onboarding.json`
|
|
74
|
+
- Execution roadmap with phases and specialists
|
|
75
|
+
- Progress tracking structure (currentInference, completedInferences)
|
|
76
|
+
|
|
77
|
+
**Key Innovation:** Plans are inference-based (not time-based), enabling precise execution and transparent progress tracking.
|
|
78
|
+
|
|
79
|
+
### 3. Create Plans (Feature Collections)
|
|
69
80
|
|
|
70
81
|
**Process:**
|
|
71
82
|
1. Analyze validated idea scope
|
|
@@ -80,7 +91,7 @@ From the ontology workflow system, you have 4 responsibilities:
|
|
|
80
91
|
- Plan: `2-course-platform`
|
|
81
92
|
- Features: `2-1-course-crud`, `2-2-lesson-management`, `2-3-course-pages`
|
|
82
93
|
|
|
83
|
-
###
|
|
94
|
+
### 4. Assign Work to Specialists
|
|
84
95
|
|
|
85
96
|
**Process:**
|
|
86
97
|
1. Identify feature category (backend/frontend/integration)
|
|
@@ -93,7 +104,7 @@ From the ontology workflow system, you have 4 responsibilities:
|
|
|
93
104
|
|
|
94
105
|
**Output:** Assignment connections and events
|
|
95
106
|
|
|
96
|
-
###
|
|
107
|
+
### 5. Mark Features Complete
|
|
97
108
|
|
|
98
109
|
**Process:**
|
|
99
110
|
1. Monitor for `quality_check_complete` (status: approved)
|
|
@@ -104,6 +115,403 @@ From the ontology workflow system, you have 4 responsibilities:
|
|
|
104
115
|
|
|
105
116
|
**Output:** Completion events and status updates
|
|
106
117
|
|
|
118
|
+
## Feature Library (100-Inference Mapping)
|
|
119
|
+
|
|
120
|
+
The feature library maps every possible feature to specific inference ranges. Each feature includes:
|
|
121
|
+
- **Inference range**: Where it fits in the 100-inference sequence
|
|
122
|
+
- **Specialist**: Which agent executes it
|
|
123
|
+
- **Duration**: Estimated time to complete
|
|
124
|
+
- **Dependencies**: Required features that must complete first
|
|
125
|
+
- **Status**: Available for existing/implemented features
|
|
126
|
+
|
|
127
|
+
### Foundation Features (Required)
|
|
128
|
+
|
|
129
|
+
```typescript
|
|
130
|
+
const FOUNDATION_FEATURES = {
|
|
131
|
+
"landing-page": {
|
|
132
|
+
name: "Landing Page",
|
|
133
|
+
description: "Beautiful landing page with hero, features, CTA",
|
|
134
|
+
inferences: [1, 10],
|
|
135
|
+
specialist: "agent-frontend",
|
|
136
|
+
duration: "~5 min",
|
|
137
|
+
cost: "$0",
|
|
138
|
+
required: true,
|
|
139
|
+
dependencies: [],
|
|
140
|
+
status: "available",
|
|
141
|
+
ontology: {
|
|
142
|
+
things: ["landing_page", "website"],
|
|
143
|
+
connections: ["part_of"],
|
|
144
|
+
events: ["page_created", "page_deployed"],
|
|
145
|
+
knowledge: ["brand_colors", "brand_voice"]
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
|
|
149
|
+
"authentication": {
|
|
150
|
+
name: "Authentication System",
|
|
151
|
+
description: "Email/password + OAuth + Magic Links (6 methods)",
|
|
152
|
+
inferences: [11, 20],
|
|
153
|
+
specialist: "existing", // Already implemented
|
|
154
|
+
duration: "~0 min",
|
|
155
|
+
cost: "$0",
|
|
156
|
+
required: true,
|
|
157
|
+
dependencies: [],
|
|
158
|
+
status: "existing",
|
|
159
|
+
ontology: {
|
|
160
|
+
things: ["creator", "session", "oauth_account"],
|
|
161
|
+
connections: ["authenticated_by"],
|
|
162
|
+
events: ["user_signin", "user_signup", "user_signout"],
|
|
163
|
+
knowledge: ["security_patterns"]
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
|
|
167
|
+
"multi-tenant-groups": {
|
|
168
|
+
name: "Multi-Tenant Groups",
|
|
169
|
+
description: "Hierarchical groups with data scoping (organizations → teams → projects)",
|
|
170
|
+
inferences: [21, 30],
|
|
171
|
+
specialist: "agent-backend",
|
|
172
|
+
duration: "~10 min",
|
|
173
|
+
cost: "$0",
|
|
174
|
+
required: true,
|
|
175
|
+
dependencies: ["authentication"],
|
|
176
|
+
status: "available",
|
|
177
|
+
ontology: {
|
|
178
|
+
things: ["organization", "group"],
|
|
179
|
+
connections: ["part_of", "owns"],
|
|
180
|
+
events: ["group_created", "group_joined"],
|
|
181
|
+
knowledge: ["hierarchy_patterns"]
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### Content & Creator Features
|
|
188
|
+
|
|
189
|
+
```typescript
|
|
190
|
+
const CREATOR_FEATURES = {
|
|
191
|
+
"content-publishing": {
|
|
192
|
+
name: "Content Publishing",
|
|
193
|
+
description: "Blog posts, articles, courses, lessons",
|
|
194
|
+
inferences: [31, 40],
|
|
195
|
+
specialist: "agent-frontend",
|
|
196
|
+
duration: "~15 min",
|
|
197
|
+
cost: "$0",
|
|
198
|
+
dependencies: ["multi-tenant-groups"],
|
|
199
|
+
status: "available",
|
|
200
|
+
ontology: {
|
|
201
|
+
things: ["blog_post", "article", "course", "lesson"],
|
|
202
|
+
connections: ["authored", "part_of"],
|
|
203
|
+
events: ["content_created", "content_published"],
|
|
204
|
+
knowledge: ["content_embeddings", "topic_labels"]
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
|
|
208
|
+
"membership-tiers": {
|
|
209
|
+
name: "Membership Tiers",
|
|
210
|
+
description: "Subscription plans with tiered access",
|
|
211
|
+
inferences: [41, 50],
|
|
212
|
+
specialist: "agent-backend",
|
|
213
|
+
duration: "~15 min",
|
|
214
|
+
cost: "$0",
|
|
215
|
+
dependencies: ["authentication"],
|
|
216
|
+
status: "available",
|
|
217
|
+
ontology: {
|
|
218
|
+
things: ["membership", "subscription", "tier"],
|
|
219
|
+
connections: ["subscribed_to", "grants_access"],
|
|
220
|
+
events: ["subscription_created", "subscription_renewed"],
|
|
221
|
+
knowledge: ["pricing_strategies"]
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
|
|
225
|
+
"revenue-tracking": {
|
|
226
|
+
name: "Revenue Tracking",
|
|
227
|
+
description: "Track payments, subscriptions, and revenue metrics",
|
|
228
|
+
inferences: [51, 60],
|
|
229
|
+
specialist: "agent-backend",
|
|
230
|
+
duration: "~10 min",
|
|
231
|
+
cost: "$0",
|
|
232
|
+
dependencies: ["membership-tiers"],
|
|
233
|
+
status: "available",
|
|
234
|
+
ontology: {
|
|
235
|
+
things: ["payment", "invoice", "metric"],
|
|
236
|
+
connections: ["paid_for", "tracks"],
|
|
237
|
+
events: ["payment_received", "payment_failed"],
|
|
238
|
+
knowledge: ["revenue_analytics"]
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### Developer Features
|
|
245
|
+
|
|
246
|
+
```typescript
|
|
247
|
+
const DEVELOPER_FEATURES = {
|
|
248
|
+
"project-management": {
|
|
249
|
+
name: "Project Management",
|
|
250
|
+
description: "Projects, tasks, milestones, kanban boards",
|
|
251
|
+
inferences: [31, 40],
|
|
252
|
+
specialist: "agent-builder", // Full-stack
|
|
253
|
+
duration: "~15 min",
|
|
254
|
+
cost: "$0",
|
|
255
|
+
dependencies: ["multi-tenant-groups"],
|
|
256
|
+
status: "available",
|
|
257
|
+
ontology: {
|
|
258
|
+
things: ["project", "task", "milestone"],
|
|
259
|
+
connections: ["assigned_to", "depends_on", "part_of"],
|
|
260
|
+
events: ["task_created", "task_completed", "milestone_reached"],
|
|
261
|
+
knowledge: ["project_patterns"]
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
|
|
265
|
+
"code-repositories": {
|
|
266
|
+
name: "Code Repositories",
|
|
267
|
+
description: "Git repository integration and management",
|
|
268
|
+
inferences: [41, 50],
|
|
269
|
+
specialist: "agent-integrator",
|
|
270
|
+
duration: "~15 min",
|
|
271
|
+
cost: "$0",
|
|
272
|
+
dependencies: ["project-management"],
|
|
273
|
+
status: "available",
|
|
274
|
+
ontology: {
|
|
275
|
+
things: ["repository", "commit", "branch"],
|
|
276
|
+
connections: ["contains", "authored"],
|
|
277
|
+
events: ["commit_pushed", "branch_created", "pr_merged"],
|
|
278
|
+
knowledge: ["code_patterns", "commit_history"]
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
|
|
282
|
+
"deployment-pipeline": {
|
|
283
|
+
name: "Deployment Pipeline",
|
|
284
|
+
description: "CI/CD automation with Cloudflare Pages + Convex",
|
|
285
|
+
inferences: [51, 60],
|
|
286
|
+
specialist: "agent-ops",
|
|
287
|
+
duration: "~20 min",
|
|
288
|
+
cost: "$0",
|
|
289
|
+
dependencies: ["code-repositories"],
|
|
290
|
+
status: "available",
|
|
291
|
+
ontology: {
|
|
292
|
+
things: ["deployment", "build", "release"],
|
|
293
|
+
connections: ["deployed_to", "triggered_by"],
|
|
294
|
+
events: ["build_started", "deployment_complete", "deployment_failed"],
|
|
295
|
+
knowledge: ["deployment_patterns"]
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
};
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
### AI Features
|
|
302
|
+
|
|
303
|
+
```typescript
|
|
304
|
+
const AI_FEATURES = {
|
|
305
|
+
"ai-agents": {
|
|
306
|
+
name: "AI Agent Framework",
|
|
307
|
+
description: "9 specialist agents for development, design, quality",
|
|
308
|
+
inferences: [61, 70],
|
|
309
|
+
specialist: "agent-builder",
|
|
310
|
+
duration: "~20 min",
|
|
311
|
+
cost: "$0",
|
|
312
|
+
dependencies: ["multi-tenant-groups"],
|
|
313
|
+
status: "available",
|
|
314
|
+
ontology: {
|
|
315
|
+
things: [
|
|
316
|
+
"engineering_agent", "design_agent", "quality_agent",
|
|
317
|
+
"problem_solver_agent", "integration_agent", "ops_agent"
|
|
318
|
+
],
|
|
319
|
+
connections: ["delegated_to", "coordinated_by"],
|
|
320
|
+
events: ["agent_executed", "task_delegated", "agent_completed"],
|
|
321
|
+
knowledge: ["agent_patterns", "coordination_rules"]
|
|
322
|
+
}
|
|
323
|
+
},
|
|
324
|
+
|
|
325
|
+
"rag-knowledge": {
|
|
326
|
+
name: "RAG Knowledge Base",
|
|
327
|
+
description: "Vector embeddings + semantic search + retrieval",
|
|
328
|
+
inferences: [71, 80],
|
|
329
|
+
specialist: "agent-backend",
|
|
330
|
+
duration: "~15 min",
|
|
331
|
+
cost: "$0.10 - $1.00", // Embedding costs
|
|
332
|
+
dependencies: ["content-publishing"],
|
|
333
|
+
status: "available",
|
|
334
|
+
ontology: {
|
|
335
|
+
things: ["knowledge", "document", "chunk"],
|
|
336
|
+
connections: ["embedded_from", "similar_to"],
|
|
337
|
+
events: ["embedding_created", "knowledge_queried"],
|
|
338
|
+
knowledge: ["vectors", "embeddings", "semantic_index"]
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
|
|
342
|
+
"semantic-search": {
|
|
343
|
+
name: "Semantic Search",
|
|
344
|
+
description: "Natural language search across all content",
|
|
345
|
+
inferences: [81, 90],
|
|
346
|
+
specialist: "agent-backend",
|
|
347
|
+
duration: "~10 min",
|
|
348
|
+
cost: "$0",
|
|
349
|
+
dependencies: ["rag-knowledge"],
|
|
350
|
+
status: "available",
|
|
351
|
+
ontology: {
|
|
352
|
+
things: ["search_query", "search_result"],
|
|
353
|
+
connections: ["matched_by"],
|
|
354
|
+
events: ["search_executed", "result_clicked"],
|
|
355
|
+
knowledge: ["search_patterns", "relevance_scores"]
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
};
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
### Integration Features
|
|
362
|
+
|
|
363
|
+
```typescript
|
|
364
|
+
const INTEGRATION_FEATURES = {
|
|
365
|
+
"stripe-payments": {
|
|
366
|
+
name: "Stripe Payments",
|
|
367
|
+
description: "Stripe integration for payments and subscriptions",
|
|
368
|
+
inferences: [31, 40],
|
|
369
|
+
specialist: "agent-integrator",
|
|
370
|
+
duration: "~15 min",
|
|
371
|
+
cost: "$0",
|
|
372
|
+
dependencies: ["membership-tiers"],
|
|
373
|
+
status: "available",
|
|
374
|
+
ontology: {
|
|
375
|
+
things: ["payment", "subscription", "invoice"],
|
|
376
|
+
connections: ["paid_with", "processed_by"],
|
|
377
|
+
events: ["payment_succeeded", "payment_failed", "subscription_updated"],
|
|
378
|
+
knowledge: ["payment_patterns"]
|
|
379
|
+
}
|
|
380
|
+
},
|
|
381
|
+
|
|
382
|
+
"email-marketing": {
|
|
383
|
+
name: "Email Marketing",
|
|
384
|
+
description: "Resend integration for transactional + marketing emails",
|
|
385
|
+
inferences: [41, 50],
|
|
386
|
+
specialist: "agent-integrator",
|
|
387
|
+
duration: "~10 min",
|
|
388
|
+
cost: "$0",
|
|
389
|
+
dependencies: ["authentication"],
|
|
390
|
+
status: "available",
|
|
391
|
+
ontology: {
|
|
392
|
+
things: ["email", "campaign", "template"],
|
|
393
|
+
connections: ["sent_to", "triggered_by"],
|
|
394
|
+
events: ["email_sent", "email_opened", "email_clicked"],
|
|
395
|
+
knowledge: ["email_templates"]
|
|
396
|
+
}
|
|
397
|
+
},
|
|
398
|
+
|
|
399
|
+
"discord-community": {
|
|
400
|
+
name: "Discord Community",
|
|
401
|
+
description: "Discord bot integration for community engagement",
|
|
402
|
+
inferences: [51, 60],
|
|
403
|
+
specialist: "agent-integrator",
|
|
404
|
+
duration: "~15 min",
|
|
405
|
+
cost: "$0",
|
|
406
|
+
dependencies: ["authentication"],
|
|
407
|
+
status: "available",
|
|
408
|
+
ontology: {
|
|
409
|
+
things: ["discord_server", "discord_channel", "discord_message"],
|
|
410
|
+
connections: ["member_of", "posted_in"],
|
|
411
|
+
events: ["message_sent", "member_joined", "role_assigned"],
|
|
412
|
+
knowledge: ["community_patterns"]
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
};
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
### Design & UX Features
|
|
419
|
+
|
|
420
|
+
```typescript
|
|
421
|
+
const DESIGN_FEATURES = {
|
|
422
|
+
"design-system": {
|
|
423
|
+
name: "Design System",
|
|
424
|
+
description: "Component library with brand tokens and Tailwind config",
|
|
425
|
+
inferences: [71, 80],
|
|
426
|
+
specialist: "agent-designer",
|
|
427
|
+
duration: "~15 min",
|
|
428
|
+
cost: "$0",
|
|
429
|
+
dependencies: ["landing-page"],
|
|
430
|
+
status: "available",
|
|
431
|
+
ontology: {
|
|
432
|
+
things: ["component", "design_token", "brand_guide"],
|
|
433
|
+
connections: ["uses", "extends"],
|
|
434
|
+
events: ["component_created", "token_updated"],
|
|
435
|
+
knowledge: ["design_patterns", "accessibility_rules"]
|
|
436
|
+
}
|
|
437
|
+
},
|
|
438
|
+
|
|
439
|
+
"wireframes": {
|
|
440
|
+
name: "Wireframes & Mockups",
|
|
441
|
+
description: "Auto-generated wireframes from feature specs",
|
|
442
|
+
inferences: [71, 75],
|
|
443
|
+
specialist: "agent-designer",
|
|
444
|
+
duration: "~10 min",
|
|
445
|
+
cost: "$0",
|
|
446
|
+
dependencies: [],
|
|
447
|
+
status: "available",
|
|
448
|
+
ontology: {
|
|
449
|
+
things: ["wireframe", "mockup", "flow"],
|
|
450
|
+
connections: ["designs", "flows_to"],
|
|
451
|
+
events: ["wireframe_created", "mockup_approved"],
|
|
452
|
+
knowledge: ["ux_patterns"]
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
};
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
### Performance & Analytics Features
|
|
459
|
+
|
|
460
|
+
```typescript
|
|
461
|
+
const PERFORMANCE_FEATURES = {
|
|
462
|
+
"performance-monitoring": {
|
|
463
|
+
name: "Performance Monitoring",
|
|
464
|
+
description: "Real-time performance metrics and Lighthouse scores",
|
|
465
|
+
inferences: [81, 90],
|
|
466
|
+
specialist: "agent-ops",
|
|
467
|
+
duration: "~10 min",
|
|
468
|
+
cost: "$0",
|
|
469
|
+
dependencies: ["landing-page"],
|
|
470
|
+
status: "available",
|
|
471
|
+
ontology: {
|
|
472
|
+
things: ["metric", "performance_report"],
|
|
473
|
+
connections: ["measures"],
|
|
474
|
+
events: ["metric_collected", "threshold_exceeded"],
|
|
475
|
+
knowledge: ["performance_baselines"]
|
|
476
|
+
}
|
|
477
|
+
},
|
|
478
|
+
|
|
479
|
+
"analytics-dashboard": {
|
|
480
|
+
name: "Analytics Dashboard",
|
|
481
|
+
description: "User analytics, revenue metrics, engagement tracking",
|
|
482
|
+
inferences: [81, 90],
|
|
483
|
+
specialist: "agent-frontend",
|
|
484
|
+
duration: "~15 min",
|
|
485
|
+
cost: "$0",
|
|
486
|
+
dependencies: ["multi-tenant-groups"],
|
|
487
|
+
status: "available",
|
|
488
|
+
ontology: {
|
|
489
|
+
things: ["dashboard", "chart", "report"],
|
|
490
|
+
connections: ["visualizes"],
|
|
491
|
+
events: ["report_generated", "insight_discovered"],
|
|
492
|
+
knowledge: ["analytics_patterns"]
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
};
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
### Complete Feature Registry
|
|
499
|
+
|
|
500
|
+
```typescript
|
|
501
|
+
export const ALL_FEATURES = {
|
|
502
|
+
...FOUNDATION_FEATURES,
|
|
503
|
+
...CREATOR_FEATURES,
|
|
504
|
+
...DEVELOPER_FEATURES,
|
|
505
|
+
...AI_FEATURES,
|
|
506
|
+
...INTEGRATION_FEATURES,
|
|
507
|
+
...DESIGN_FEATURES,
|
|
508
|
+
...PERFORMANCE_FEATURES
|
|
509
|
+
};
|
|
510
|
+
|
|
511
|
+
// Total: 20+ features covering Infer 1-90
|
|
512
|
+
// Reserved: Infer 91-100 for deployment & documentation (always included)
|
|
513
|
+
```
|
|
514
|
+
|
|
107
515
|
## Decision Framework
|
|
108
516
|
|
|
109
517
|
### Decision 1: Is idea mappable to ontology?
|
|
@@ -418,6 +826,478 @@ The Director enforces consistent numbering:
|
|
|
418
826
|
}
|
|
419
827
|
```
|
|
420
828
|
|
|
829
|
+
## Plan Generation Algorithm
|
|
830
|
+
|
|
831
|
+
When generating a 100-inference plan from feature selections, follow this algorithm:
|
|
832
|
+
|
|
833
|
+
### Step 1: Read Feature Selections
|
|
834
|
+
|
|
835
|
+
```typescript
|
|
836
|
+
// Read from .onboarding.json or user input
|
|
837
|
+
interface FeatureSelection {
|
|
838
|
+
selectedFeatures: string[]; // e.g., ["landing-page", "authentication", "ai-agents"]
|
|
839
|
+
organizationName: string;
|
|
840
|
+
websiteUrl?: string;
|
|
841
|
+
customOntology?: object;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
// Example:
|
|
845
|
+
const selections = {
|
|
846
|
+
selectedFeatures: [
|
|
847
|
+
"landing-page",
|
|
848
|
+
"authentication",
|
|
849
|
+
"multi-tenant-groups",
|
|
850
|
+
"project-management",
|
|
851
|
+
"ai-agents"
|
|
852
|
+
],
|
|
853
|
+
organizationName: "Acme Corp",
|
|
854
|
+
websiteUrl: "https://acme.com"
|
|
855
|
+
};
|
|
856
|
+
```
|
|
857
|
+
|
|
858
|
+
### Step 2: Resolve Dependencies
|
|
859
|
+
|
|
860
|
+
```typescript
|
|
861
|
+
function resolveDependencies(selectedFeatures: string[]): string[] {
|
|
862
|
+
const resolved = new Set<string>();
|
|
863
|
+
const queue = [...selectedFeatures];
|
|
864
|
+
|
|
865
|
+
while (queue.length > 0) {
|
|
866
|
+
const feature = queue.shift()!;
|
|
867
|
+
if (resolved.has(feature)) continue;
|
|
868
|
+
|
|
869
|
+
resolved.add(feature);
|
|
870
|
+
|
|
871
|
+
// Add dependencies to queue
|
|
872
|
+
const featureConfig = ALL_FEATURES[feature];
|
|
873
|
+
if (featureConfig?.dependencies) {
|
|
874
|
+
queue.push(...featureConfig.dependencies);
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
return Array.from(resolved);
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
// Example output:
|
|
882
|
+
// Input: ["ai-agents", "project-management"]
|
|
883
|
+
// Output: ["landing-page", "authentication", "multi-tenant-groups", "project-management", "ai-agents"]
|
|
884
|
+
```
|
|
885
|
+
|
|
886
|
+
### Step 3: Map to Inference Ranges
|
|
887
|
+
|
|
888
|
+
```typescript
|
|
889
|
+
function mapToInferences(features: string[]): InferencePlan {
|
|
890
|
+
const phases: Phase[] = [];
|
|
891
|
+
const allInferences = [];
|
|
892
|
+
|
|
893
|
+
for (const featureKey of features) {
|
|
894
|
+
const feature = ALL_FEATURES[featureKey];
|
|
895
|
+
const [start, end] = feature.inferences;
|
|
896
|
+
|
|
897
|
+
phases.push({
|
|
898
|
+
name: feature.name,
|
|
899
|
+
featureKey: featureKey,
|
|
900
|
+
inferences: { start, end },
|
|
901
|
+
specialist: feature.specialist,
|
|
902
|
+
duration: feature.duration,
|
|
903
|
+
cost: feature.cost,
|
|
904
|
+
status: "pending",
|
|
905
|
+
ontology: feature.ontology
|
|
906
|
+
});
|
|
907
|
+
|
|
908
|
+
allInferences.push(...range(start, end));
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
// Always add deployment phase (Infer 91-100)
|
|
912
|
+
phases.push({
|
|
913
|
+
name: "Deployment & Documentation",
|
|
914
|
+
featureKey: "deployment",
|
|
915
|
+
inferences: { start: 91, end: 100 },
|
|
916
|
+
specialist: "agent-ops",
|
|
917
|
+
duration: "~10 min",
|
|
918
|
+
cost: "$0",
|
|
919
|
+
status: "pending",
|
|
920
|
+
ontology: {
|
|
921
|
+
events: ["deployment_complete", "documentation_complete"]
|
|
922
|
+
}
|
|
923
|
+
});
|
|
924
|
+
|
|
925
|
+
return {
|
|
926
|
+
phases,
|
|
927
|
+
totalInferences: allInferences.length + 10, // Include deployment
|
|
928
|
+
currentInference: 1,
|
|
929
|
+
completedInferences: []
|
|
930
|
+
};
|
|
931
|
+
}
|
|
932
|
+
```
|
|
933
|
+
|
|
934
|
+
### Step 4: Calculate Estimates
|
|
935
|
+
|
|
936
|
+
```typescript
|
|
937
|
+
function calculateEstimates(plan: InferencePlan) {
|
|
938
|
+
let totalMinutes = 0;
|
|
939
|
+
let totalCost = 0;
|
|
940
|
+
|
|
941
|
+
for (const phase of plan.phases) {
|
|
942
|
+
// Parse duration (e.g., "~15 min" → 15)
|
|
943
|
+
const minutes = parseInt(phase.duration.match(/\d+/)?[0] || "0");
|
|
944
|
+
totalMinutes += minutes;
|
|
945
|
+
|
|
946
|
+
// Parse cost (e.g., "$0.10 - $1.00" → 0.55)
|
|
947
|
+
const costMatch = phase.cost.match(/\$(\d+\.?\d*)/g);
|
|
948
|
+
if (costMatch) {
|
|
949
|
+
const costs = costMatch.map(c => parseFloat(c.replace('$', '')));
|
|
950
|
+
totalCost += costs.reduce((a, b) => a + b, 0) / costs.length;
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
return {
|
|
955
|
+
estimatedDuration: `${totalMinutes} minutes (~${Math.ceil(totalMinutes / 60)} hours)`,
|
|
956
|
+
estimatedCost: `$${totalCost.toFixed(2)}`,
|
|
957
|
+
inferenceCount: plan.totalInferences
|
|
958
|
+
};
|
|
959
|
+
}
|
|
960
|
+
```
|
|
961
|
+
|
|
962
|
+
### Step 5: Generate Execution Plan
|
|
963
|
+
|
|
964
|
+
```typescript
|
|
965
|
+
interface ExecutionPlan {
|
|
966
|
+
version: string;
|
|
967
|
+
organizationName: string;
|
|
968
|
+
createdAt: number;
|
|
969
|
+
plan: {
|
|
970
|
+
phases: Phase[];
|
|
971
|
+
totalInferences: number;
|
|
972
|
+
currentInference: number;
|
|
973
|
+
completedInferences: number[];
|
|
974
|
+
estimates: {
|
|
975
|
+
duration: string;
|
|
976
|
+
cost: string;
|
|
977
|
+
inferences: number;
|
|
978
|
+
};
|
|
979
|
+
};
|
|
980
|
+
progress: {
|
|
981
|
+
status: "pending" | "in_progress" | "completed";
|
|
982
|
+
startedAt?: number;
|
|
983
|
+
completedAt?: number;
|
|
984
|
+
currentPhase?: string;
|
|
985
|
+
};
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
// Example output structure:
|
|
989
|
+
const executionPlan: ExecutionPlan = {
|
|
990
|
+
version: "1.0.0",
|
|
991
|
+
organizationName: "Acme Corp",
|
|
992
|
+
createdAt: Date.now(),
|
|
993
|
+
plan: {
|
|
994
|
+
phases: [
|
|
995
|
+
{
|
|
996
|
+
name: "Landing Page",
|
|
997
|
+
featureKey: "landing-page",
|
|
998
|
+
inferences: { start: 1, end: 10 },
|
|
999
|
+
specialist: "agent-frontend",
|
|
1000
|
+
duration: "~5 min",
|
|
1001
|
+
cost: "$0",
|
|
1002
|
+
status: "pending",
|
|
1003
|
+
ontology: { /* ... */ }
|
|
1004
|
+
},
|
|
1005
|
+
// ... more phases
|
|
1006
|
+
],
|
|
1007
|
+
totalInferences: 70,
|
|
1008
|
+
currentInference: 1,
|
|
1009
|
+
completedInferences: [],
|
|
1010
|
+
estimates: {
|
|
1011
|
+
duration: "60 minutes (~1 hours)",
|
|
1012
|
+
cost: "$0.10",
|
|
1013
|
+
inferences: 70
|
|
1014
|
+
}
|
|
1015
|
+
},
|
|
1016
|
+
progress: {
|
|
1017
|
+
status: "pending"
|
|
1018
|
+
}
|
|
1019
|
+
};
|
|
1020
|
+
```
|
|
1021
|
+
|
|
1022
|
+
### Step 6: Write to .onboarding.json
|
|
1023
|
+
|
|
1024
|
+
```typescript
|
|
1025
|
+
function writeOnboardingPlan(plan: ExecutionPlan): void {
|
|
1026
|
+
// Write complete plan to .onboarding.json
|
|
1027
|
+
const planJson = JSON.stringify(plan, null, 2);
|
|
1028
|
+
writeFile('.onboarding.json', planJson);
|
|
1029
|
+
|
|
1030
|
+
// Also create markdown summary for human readability
|
|
1031
|
+
const summary = generateMarkdownSummary(plan);
|
|
1032
|
+
writeFile('.onboarding-plan.md', summary);
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
function generateMarkdownSummary(plan: ExecutionPlan): string {
|
|
1036
|
+
return `
|
|
1037
|
+
# ${plan.organizationName} - Onboarding Plan
|
|
1038
|
+
|
|
1039
|
+
**Generated:** ${new Date(plan.createdAt).toLocaleString()}
|
|
1040
|
+
**Status:** ${plan.progress.status}
|
|
1041
|
+
|
|
1042
|
+
## Overview
|
|
1043
|
+
|
|
1044
|
+
- **Total Inferences:** ${plan.plan.totalInferences}/100
|
|
1045
|
+
- **Estimated Duration:** ${plan.plan.estimates.duration}
|
|
1046
|
+
- **Estimated Cost:** ${plan.plan.estimates.cost}
|
|
1047
|
+
|
|
1048
|
+
## Execution Phases
|
|
1049
|
+
|
|
1050
|
+
${plan.plan.phases.map((phase, i) => `
|
|
1051
|
+
### Phase ${i + 1}: ${phase.name} (Infer ${phase.inferences.start}-${phase.inferences.end})
|
|
1052
|
+
|
|
1053
|
+
- **Specialist:** ${phase.specialist}
|
|
1054
|
+
- **Duration:** ${phase.duration}
|
|
1055
|
+
- **Cost:** ${phase.cost}
|
|
1056
|
+
- **Status:** ${phase.status}
|
|
1057
|
+
|
|
1058
|
+
**Ontology Mapping:**
|
|
1059
|
+
${JSON.stringify(phase.ontology, null, 2)}
|
|
1060
|
+
`).join('\n')}
|
|
1061
|
+
|
|
1062
|
+
## Progress Tracking
|
|
1063
|
+
|
|
1064
|
+
Current Inference: ${plan.plan.currentInference}/${plan.plan.totalInferences}
|
|
1065
|
+
Completed: ${plan.plan.completedInferences.length} inferences
|
|
1066
|
+
`;
|
|
1067
|
+
}
|
|
1068
|
+
```
|
|
1069
|
+
|
|
1070
|
+
## Execution Coordination
|
|
1071
|
+
|
|
1072
|
+
The Director coordinates execution across all specialist agents using an event-driven workflow:
|
|
1073
|
+
|
|
1074
|
+
### Phase Execution Pattern
|
|
1075
|
+
|
|
1076
|
+
```typescript
|
|
1077
|
+
async function executePhase(phase: Phase): Promise<void> {
|
|
1078
|
+
// 1. Emit phase_started event
|
|
1079
|
+
await emitEvent({
|
|
1080
|
+
type: "phase_started",
|
|
1081
|
+
targetId: phase.featureKey,
|
|
1082
|
+
metadata: {
|
|
1083
|
+
phaseName: phase.name,
|
|
1084
|
+
inferences: phase.inferences,
|
|
1085
|
+
specialist: phase.specialist
|
|
1086
|
+
}
|
|
1087
|
+
});
|
|
1088
|
+
|
|
1089
|
+
// 2. Delegate to specialist agent
|
|
1090
|
+
const specialist = getSpecialistAgent(phase.specialist);
|
|
1091
|
+
await specialist.execute({
|
|
1092
|
+
featureKey: phase.featureKey,
|
|
1093
|
+
inferenceRange: phase.inferences,
|
|
1094
|
+
ontology: phase.ontology
|
|
1095
|
+
});
|
|
1096
|
+
|
|
1097
|
+
// 3. Monitor progress via events
|
|
1098
|
+
watchForEvents([
|
|
1099
|
+
"implementation_complete",
|
|
1100
|
+
"quality_check_complete",
|
|
1101
|
+
"deployment_complete"
|
|
1102
|
+
]);
|
|
1103
|
+
|
|
1104
|
+
// 4. Update .onboarding.json progress
|
|
1105
|
+
updateProgress({
|
|
1106
|
+
currentInference: phase.inferences.end,
|
|
1107
|
+
completedInferences: range(phase.inferences.start, phase.inferences.end),
|
|
1108
|
+
currentPhase: phase.name,
|
|
1109
|
+
status: "in_progress"
|
|
1110
|
+
});
|
|
1111
|
+
|
|
1112
|
+
// 5. Emit phase_complete event
|
|
1113
|
+
await emitEvent({
|
|
1114
|
+
type: "phase_complete",
|
|
1115
|
+
targetId: phase.featureKey,
|
|
1116
|
+
metadata: {
|
|
1117
|
+
phaseName: phase.name,
|
|
1118
|
+
duration: calculateActualDuration(),
|
|
1119
|
+
testsPassedCount: getTestCount(),
|
|
1120
|
+
qualityScore: getQualityScore()
|
|
1121
|
+
}
|
|
1122
|
+
});
|
|
1123
|
+
}
|
|
1124
|
+
```
|
|
1125
|
+
|
|
1126
|
+
### Progress Tracking
|
|
1127
|
+
|
|
1128
|
+
```typescript
|
|
1129
|
+
interface ProgressUpdate {
|
|
1130
|
+
currentInference: number;
|
|
1131
|
+
completedInferences: number[];
|
|
1132
|
+
currentPhase: string;
|
|
1133
|
+
status: "pending" | "in_progress" | "completed" | "failed";
|
|
1134
|
+
startedAt?: number;
|
|
1135
|
+
completedAt?: number;
|
|
1136
|
+
errors?: Error[];
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1139
|
+
function updateProgress(update: Partial<ProgressUpdate>): void {
|
|
1140
|
+
// Read current .onboarding.json
|
|
1141
|
+
const plan = readOnboardingJson();
|
|
1142
|
+
|
|
1143
|
+
// Merge updates
|
|
1144
|
+
plan.progress = {
|
|
1145
|
+
...plan.progress,
|
|
1146
|
+
...update
|
|
1147
|
+
};
|
|
1148
|
+
|
|
1149
|
+
// Calculate completion percentage
|
|
1150
|
+
const percentage = (plan.plan.completedInferences.length / plan.plan.totalInferences) * 100;
|
|
1151
|
+
|
|
1152
|
+
// Write back to file
|
|
1153
|
+
writeOnboardingJson(plan);
|
|
1154
|
+
|
|
1155
|
+
// Emit progress event for real-time tracking
|
|
1156
|
+
emitEvent({
|
|
1157
|
+
type: "progress_updated",
|
|
1158
|
+
metadata: {
|
|
1159
|
+
percentage,
|
|
1160
|
+
currentInference: plan.plan.currentInference,
|
|
1161
|
+
totalInferences: plan.plan.totalInferences,
|
|
1162
|
+
currentPhase: plan.progress.currentPhase
|
|
1163
|
+
}
|
|
1164
|
+
});
|
|
1165
|
+
}
|
|
1166
|
+
```
|
|
1167
|
+
|
|
1168
|
+
### Sequential vs Parallel Execution
|
|
1169
|
+
|
|
1170
|
+
```typescript
|
|
1171
|
+
async function executeAllPhases(plan: ExecutionPlan): Promise<void> {
|
|
1172
|
+
for (const phase of plan.plan.phases) {
|
|
1173
|
+
// Check if phase can run in parallel with others
|
|
1174
|
+
const parallelPhases = findParallelPhases(phase, plan.plan.phases);
|
|
1175
|
+
|
|
1176
|
+
if (parallelPhases.length > 0) {
|
|
1177
|
+
// Execute in parallel
|
|
1178
|
+
await Promise.all([
|
|
1179
|
+
executePhase(phase),
|
|
1180
|
+
...parallelPhases.map(p => executePhase(p))
|
|
1181
|
+
]);
|
|
1182
|
+
} else {
|
|
1183
|
+
// Execute sequentially
|
|
1184
|
+
await executePhase(phase);
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
// Mark plan complete
|
|
1189
|
+
updateProgress({
|
|
1190
|
+
status: "completed",
|
|
1191
|
+
completedAt: Date.now(),
|
|
1192
|
+
currentInference: 100
|
|
1193
|
+
});
|
|
1194
|
+
}
|
|
1195
|
+
|
|
1196
|
+
function findParallelPhases(phase: Phase, allPhases: Phase[]): Phase[] {
|
|
1197
|
+
// Phases can run in parallel if:
|
|
1198
|
+
// 1. They have no shared dependencies
|
|
1199
|
+
// 2. They don't overlap in inference ranges
|
|
1200
|
+
// 3. They use different specialists (optional optimization)
|
|
1201
|
+
|
|
1202
|
+
return allPhases.filter(p =>
|
|
1203
|
+
p !== phase &&
|
|
1204
|
+
!hasSharedDependencies(p, phase) &&
|
|
1205
|
+
!overlapsInferences(p.inferences, phase.inferences)
|
|
1206
|
+
);
|
|
1207
|
+
}
|
|
1208
|
+
```
|
|
1209
|
+
|
|
1210
|
+
### Error Handling & Recovery
|
|
1211
|
+
|
|
1212
|
+
```typescript
|
|
1213
|
+
async function executePhaseWithRetry(phase: Phase, maxRetries = 3): Promise<void> {
|
|
1214
|
+
let attempt = 0;
|
|
1215
|
+
|
|
1216
|
+
while (attempt < maxRetries) {
|
|
1217
|
+
try {
|
|
1218
|
+
await executePhase(phase);
|
|
1219
|
+
return; // Success
|
|
1220
|
+
|
|
1221
|
+
} catch (error) {
|
|
1222
|
+
attempt++;
|
|
1223
|
+
|
|
1224
|
+
// Log error
|
|
1225
|
+
updateProgress({
|
|
1226
|
+
errors: [{
|
|
1227
|
+
phase: phase.name,
|
|
1228
|
+
attempt,
|
|
1229
|
+
message: error.message,
|
|
1230
|
+
timestamp: Date.now()
|
|
1231
|
+
}]
|
|
1232
|
+
});
|
|
1233
|
+
|
|
1234
|
+
if (attempt >= maxRetries) {
|
|
1235
|
+
// Final failure - delegate to problem solver
|
|
1236
|
+
await emitEvent({
|
|
1237
|
+
type: "phase_failed",
|
|
1238
|
+
targetId: phase.featureKey,
|
|
1239
|
+
metadata: {
|
|
1240
|
+
phaseName: phase.name,
|
|
1241
|
+
error: error.message,
|
|
1242
|
+
attempts: attempt
|
|
1243
|
+
}
|
|
1244
|
+
});
|
|
1245
|
+
|
|
1246
|
+
// Wait for problem solver to propose fix
|
|
1247
|
+
await waitForEvent("solution_proposed");
|
|
1248
|
+
|
|
1249
|
+
// Retry with fix
|
|
1250
|
+
attempt = 0; // Reset counter after manual intervention
|
|
1251
|
+
} else {
|
|
1252
|
+
// Exponential backoff
|
|
1253
|
+
await sleep(Math.pow(2, attempt) * 1000);
|
|
1254
|
+
}
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1257
|
+
}
|
|
1258
|
+
```
|
|
1259
|
+
|
|
1260
|
+
### Real-Time Status Display
|
|
1261
|
+
|
|
1262
|
+
```typescript
|
|
1263
|
+
function displayProgress(plan: ExecutionPlan): void {
|
|
1264
|
+
const percentage = (plan.plan.completedInferences.length / plan.plan.totalInferences) * 100;
|
|
1265
|
+
|
|
1266
|
+
console.log(`
|
|
1267
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
1268
|
+
🤖 BUILDING ${plan.organizationName}
|
|
1269
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
1270
|
+
|
|
1271
|
+
Progress: ${percentage.toFixed(1)}% (${plan.plan.completedInferences.length}/${plan.plan.totalInferences} inferences)
|
|
1272
|
+
|
|
1273
|
+
Current Phase: ${plan.progress.currentPhase || 'Starting...'}
|
|
1274
|
+
Current Inference: ${plan.plan.currentInference}
|
|
1275
|
+
|
|
1276
|
+
Phases:
|
|
1277
|
+
${plan.plan.phases.map(phase => `
|
|
1278
|
+
${getStatusIcon(phase.status)} ${phase.name} (Infer ${phase.inferences.start}-${phase.inferences.end})
|
|
1279
|
+
${phase.specialist} • ${phase.duration}
|
|
1280
|
+
`).join('')}
|
|
1281
|
+
|
|
1282
|
+
Estimates:
|
|
1283
|
+
Duration: ${plan.plan.estimates.duration}
|
|
1284
|
+
Cost: ${plan.plan.estimates.cost}
|
|
1285
|
+
|
|
1286
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
1287
|
+
`);
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
function getStatusIcon(status: string): string {
|
|
1291
|
+
switch (status) {
|
|
1292
|
+
case "completed": return "✅";
|
|
1293
|
+
case "in_progress": return "🔄";
|
|
1294
|
+
case "pending": return "⏳";
|
|
1295
|
+
case "failed": return "❌";
|
|
1296
|
+
default: return "○";
|
|
1297
|
+
}
|
|
1298
|
+
}
|
|
1299
|
+
```
|
|
1300
|
+
|
|
421
1301
|
## Common Mistakes to Avoid
|
|
422
1302
|
|
|
423
1303
|
### ❌ Mistake 1: Creating features that don't map to ontology
|