chati-dev 4.3.0 → 4.4.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.
Files changed (156) hide show
  1. package/README.md +18 -13
  2. package/bin/chati.js +32 -4
  3. package/framework/agents/build/dev.md +9 -5
  4. package/framework/agents/discover/brief.md +2 -0
  5. package/framework/agents/discover/brownfield-wu.md +2 -0
  6. package/framework/agents/discover/greenfield-wu.md +18 -1
  7. package/framework/agents/plan/detail.md +2 -0
  8. package/framework/agents/plan/tasks.md +31 -0
  9. package/framework/agents/plan/ux-brand-architect.md +21 -2
  10. package/framework/agents/plan/ux-component-engineer.md +10 -0
  11. package/framework/agents/quality/qa-implementation.md +1 -1
  12. package/framework/agents/quality/qa-planning.md +1 -1
  13. package/framework/agents/quality/qa-visual.md +33 -21
  14. package/framework/config.yaml +5 -4
  15. package/framework/constitution.md +58 -11
  16. package/framework/context/governance.md +12 -10
  17. package/framework/context/root.md +2 -2
  18. package/framework/data/entity-registry.yaml +12 -4
  19. package/framework/data/qa-rubrics.yaml +335 -0
  20. package/framework/domains/constitution.yaml +3 -3
  21. package/framework/executors/json-validate.js +80 -0
  22. package/framework/executors/npm-script.js +72 -0
  23. package/framework/executors/path-check.js +67 -0
  24. package/framework/executors/registry.yaml +36 -0
  25. package/framework/hooks/advance-trigger.js +47 -3
  26. package/framework/hooks/constitution-guard.js +9 -4
  27. package/framework/hooks/git-push-authority.js +113 -0
  28. package/framework/hooks/license-guard.js +59 -9
  29. package/framework/hooks/model-governance.js +40 -17
  30. package/framework/hooks/prism-engine.js +78 -11
  31. package/framework/hooks/session-digest.js +12 -3
  32. package/framework/hooks/settings.json +7 -3
  33. package/framework/hooks/style-guard.js +52 -3
  34. package/framework/hooks/team-quality-gate.js +43 -5
  35. package/framework/i18n/en.yaml +3 -3
  36. package/framework/i18n/es.yaml +3 -3
  37. package/framework/i18n/fr.yaml +3 -3
  38. package/framework/i18n/pt.yaml +3 -3
  39. package/framework/intelligence/confidence.yaml +85 -6
  40. package/framework/intelligence/context-engine.md +9 -5
  41. package/framework/intelligence/decision-engine.md +1 -1
  42. package/framework/orchestrator/chati-router.js +59 -5
  43. package/framework/orchestrator/chati-update.md +19 -3
  44. package/framework/orchestrator/chati.md +20 -1
  45. package/framework/quality-gates/planning-gate.md +2 -0
  46. package/framework/rules/human-writing-style.md +47 -0
  47. package/framework/scaffold/motion-premium/README.md +12 -2
  48. package/framework/scaffold/motion-premium/lib/animations/tokens.ts.template +1 -1
  49. package/framework/scaffold/motion-premium/scaffold.yaml +6 -1
  50. package/framework/scaffold/motion-premium-3d/README.md +10 -0
  51. package/framework/scaffold/motion-premium-3d/components/webgl/WebGLContext.tsx.template +1 -1
  52. package/framework/scaffold/motion-premium-3d/scaffold.yaml +3 -0
  53. package/framework/scaffold/saas-dashboard/README.md +58 -0
  54. package/framework/scaffold/saas-dashboard/app/dashboard/page.tsx.template +546 -0
  55. package/framework/scaffold/saas-dashboard/app/globals.css.template +746 -0
  56. package/framework/scaffold/saas-dashboard/app/layout.tsx.template +192 -0
  57. package/framework/scaffold/saas-dashboard/app/shell.css.template +1070 -0
  58. package/framework/scaffold/saas-dashboard/components/data/Chart.tsx.template +725 -0
  59. package/framework/scaffold/saas-dashboard/components/data/DataTable.tsx.template +623 -0
  60. package/framework/scaffold/saas-dashboard/components/data/DataTable.types.ts.template +104 -0
  61. package/framework/scaffold/saas-dashboard/components/data/DataTablePagination.tsx.template +234 -0
  62. package/framework/scaffold/saas-dashboard/components/data/SkeletonBlock.tsx.template +111 -0
  63. package/framework/scaffold/saas-dashboard/components/data/StatCard.tsx.template +393 -0
  64. package/framework/scaffold/saas-dashboard/components/data/StatCardGrid.tsx.template +121 -0
  65. package/framework/scaffold/saas-dashboard/components/feedback/EmptyState.tsx.template +281 -0
  66. package/framework/scaffold/saas-dashboard/components/interaction/CommandPalette.tsx.template +767 -0
  67. package/framework/scaffold/saas-dashboard/components/interaction/Field.tsx.template +351 -0
  68. package/framework/scaffold/saas-dashboard/components/interaction/Form.tsx.template +424 -0
  69. package/framework/scaffold/saas-dashboard/components/primitives/Badge.tsx.template +193 -0
  70. package/framework/scaffold/saas-dashboard/components/primitives/Button.tsx.template +261 -0
  71. package/framework/scaffold/saas-dashboard/components/primitives/Card.tsx.template +287 -0
  72. package/framework/scaffold/saas-dashboard/components/primitives/Input.tsx.template +310 -0
  73. package/framework/scaffold/saas-dashboard/components/primitives/Spinner.tsx.template +135 -0
  74. package/framework/scaffold/saas-dashboard/components/primitives/index.ts.template +60 -0
  75. package/framework/scaffold/saas-dashboard/components/shell/AppShell.tsx.template +174 -0
  76. package/framework/scaffold/saas-dashboard/components/shell/Breadcrumb.tsx.template +186 -0
  77. package/framework/scaffold/saas-dashboard/components/shell/Container.tsx.template +86 -0
  78. package/framework/scaffold/saas-dashboard/components/shell/NavItem.tsx.template +147 -0
  79. package/framework/scaffold/saas-dashboard/components/shell/Sidebar.tsx.template +378 -0
  80. package/framework/scaffold/saas-dashboard/components/shell/SidebarContext.tsx.template +169 -0
  81. package/framework/scaffold/saas-dashboard/components/shell/ThemeToggle.tsx.template +128 -0
  82. package/framework/scaffold/saas-dashboard/components/shell/Topbar.tsx.template +301 -0
  83. package/framework/scaffold/saas-dashboard/lib/brand.ts.template +324 -0
  84. package/framework/scaffold/saas-dashboard/scaffold.yaml +225 -0
  85. package/framework/schemas/session.schema.json +5 -0
  86. package/framework/schemas/task.schema.json +9 -0
  87. package/framework/scripts/visual-qa.js +101 -3
  88. package/framework/tasks/orchestrator-health.md +4 -4
  89. package/framework/tasks/qa-impl-verdict.md +11 -5
  90. package/framework/templates/brandbook-html-tmpl.md +1 -1
  91. package/framework/templates/qa-gate-tmpl.yaml +24 -11
  92. package/package.json +4 -3
  93. package/src/config/context-file-generator.js +0 -6
  94. package/src/dashboard/renderer.js +0 -36
  95. package/src/executors/runner.js +204 -0
  96. package/src/installer/core.js +13 -3
  97. package/src/installer/templates.js +5 -6
  98. package/src/intelligence/registry-manager.js +1 -1
  99. package/src/license/client.js +9 -3
  100. package/src/license/commands.js +12 -2
  101. package/src/license/machine-id.js +42 -1
  102. package/src/memory/gotchas.js +58 -40
  103. package/src/memory/magic-docs.js +1 -1
  104. package/src/memory/session-digest.js +9 -4
  105. package/src/orchestrator/cli.js +186 -15
  106. package/src/orchestrator/doctor.js +98 -16
  107. package/src/orchestrator/pipeline-manager.js +44 -22
  108. package/src/orchestrator/session-manager.js +64 -8
  109. package/src/telemetry/sender.js +7 -19
  110. package/src/terminal/run-team.js +3 -3
  111. package/src/upgrade/tracked-files-detector.js +34 -16
  112. package/src/utils/feature-flags.js +1 -1
  113. package/src/utils/flatten-entities.js +4 -40
  114. package/src/utils/schema-validator.js +0 -14
  115. package/src/wizard/i18n.js +3 -3
  116. package/src/api/index.js +0 -120
  117. package/src/autonomy/autonomous-gate.js +0 -294
  118. package/src/autonomy/build-loop.js +0 -281
  119. package/src/autonomy/build-state.js +0 -286
  120. package/src/autonomy/cause-analyzer.js +0 -177
  121. package/src/autonomy/escalation.js +0 -214
  122. package/src/autonomy/index.js +0 -51
  123. package/src/autonomy/mode-manager.js +0 -225
  124. package/src/autonomy/mode-suggester.js +0 -283
  125. package/src/autonomy/progress-reporter.js +0 -275
  126. package/src/autonomy/safety-net.js +0 -370
  127. package/src/config/agent-customizer.js +0 -231
  128. package/src/decision/analyzer.js +0 -291
  129. package/src/decision/engine.js +0 -250
  130. package/src/decision/index.js +0 -38
  131. package/src/decision/registry-healer.js +0 -468
  132. package/src/decision/registry-updater.js +0 -339
  133. package/src/extensions/loader.js +0 -145
  134. package/src/extensions/registry.js +0 -134
  135. package/src/gates/circuit-breaker.js +0 -151
  136. package/src/gates/g1-planning-complete.js +0 -154
  137. package/src/gates/g2-qa-planning.js +0 -156
  138. package/src/gates/g3-implementation.js +0 -215
  139. package/src/gates/g4-qa-implementation.js +0 -240
  140. package/src/gates/g5-deploy-ready.js +0 -181
  141. package/src/gates/gate-base.js +0 -185
  142. package/src/gates/index.js +0 -46
  143. package/src/health/auto-fix.js +0 -216
  144. package/src/health/engine.js +0 -246
  145. package/src/merger/semantic-merger.js +0 -292
  146. package/src/preview/detector.js +0 -238
  147. package/src/preview/index.js +0 -20
  148. package/src/preview/launcher.js +0 -235
  149. package/src/preview/log-buffer.js +0 -103
  150. package/src/quality/metrics-collector.js +0 -281
  151. package/src/quality/test-runner.js +0 -366
  152. package/src/tasks/executor.js +0 -195
  153. package/src/tasks/index.js +0 -4
  154. package/src/tasks/loader.js +0 -210
  155. package/src/tasks/router.js +0 -182
  156. package/src/utils/event-bus.js +0 -126
@@ -0,0 +1,192 @@
1
+ /*
2
+ * layout.tsx -- Root App Router Layout
3
+ * ============================================================
4
+ * WHY THIS FILE EXISTS
5
+ * --------------------
6
+ * Next.js App Router requires a root layout.tsx to wrap every
7
+ * route in the application. This file is the outermost server
8
+ * component and is responsible for exactly three concerns:
9
+ *
10
+ * 1. HTML document frame: <html> and <body> with the correct
11
+ * lang attribute, data-theme attribute (dark by default),
12
+ * and font CSS variables injected by next/font.
13
+ *
14
+ * 2. Font loading: Inter Variable (sans) and JetBrains Mono
15
+ * Variable (mono) are loaded via next/font/google so they
16
+ * are self-hosted, subset, and swap-safe. Font-feature-
17
+ * settings are applied to Inter to enable optical kerning
18
+ * (calt), stylistic sets for cleaner numerals (cv02, cv03,
19
+ * cv04), and tabular figures (tnum) for aligned metric
20
+ * columns in the dashboard.
21
+ *
22
+ * 3. Provider mounting: AppShell wraps all children. It owns
23
+ * the SidebarContext, the responsive grid, and the sticky
24
+ * Topbar. No layout logic lives in this file -- it
25
+ * delegates entirely to AppShell.
26
+ *
27
+ * DECISIONS
28
+ * ---------
29
+ * - data-theme='dark' is set on <html>. The ThemeToggle client
30
+ * component flips this attribute and persists the preference
31
+ * to localStorage. The server renders dark by default so
32
+ * there is no flash-of-unstyled-content on first paint.
33
+ *
34
+ * - Viewport meta is omitted here because Next.js App Router
35
+ * exports it via the `viewport` export (see below). Setting
36
+ * it in both places would cause a conflict.
37
+ *
38
+ * - globals.css is imported here (the single import point).
39
+ * Every other file receives token access via CSS custom
40
+ * properties; no component file imports globals.css again.
41
+ *
42
+ * - The <body> receives the Inter Variable class from next/font
43
+ * which injects --font-sans onto :root automatically when
44
+ * used with `variable` mode. This aligns with the token
45
+ * --font-sans defined in globals.css.
46
+ *
47
+ * WHAT THIS FILE DOES NOT DO
48
+ * --------------------------
49
+ * - It does not contain any interactive logic (it is a server
50
+ * component).
51
+ * - It does not set max-width or horizontal padding (Container
52
+ * is the sole authority for those).
53
+ * - It does not manage scroll position or focus (AppShell and
54
+ * individual route pages own those concerns).
55
+ */
56
+
57
+ import React from 'react';
58
+ import type { Metadata, Viewport } from 'next'
59
+ import { Inter, JetBrains_Mono } from 'next/font/google'
60
+ import './globals.css'
61
+ import './shell.css'
62
+ import { AppShell } from '@/components/shell/AppShell'
63
+ import { SidebarProvider } from '@/components/shell/SidebarContext'
64
+ import { CommandPaletteProvider } from '@/components/interaction/CommandPalette'
65
+
66
+ // ---------------------------------------------------------------------------
67
+ // Font configuration
68
+ // ---------------------------------------------------------------------------
69
+ // Inter Variable: the primary sans-serif typeface. We load the full variable
70
+ // axis (wght 100-900) so we can use all weight steps defined in our type
71
+ // scale without separate file requests. The `variable` option emits a CSS
72
+ // custom property (--font-inter) that we reference in globals.css.
73
+ // Subsets: latin is sufficient for the initial target market; add 'latin-ext'
74
+ // when supporting Eastern European locales.
75
+ const inter = Inter({
76
+ subsets: ['latin'],
77
+ axes: ['opsz'], // optical size axis for refined rendering at display sizes
78
+ variable: '--font-inter',
79
+ display: 'swap',
80
+ preload: true,
81
+ })
82
+
83
+ // JetBrains Mono Variable: used for code blocks, metric displays, and any
84
+ // tabular numeric context. Loaded lighter (wght 400-700 range) to keep the
85
+ // font bundle small. The `variable` option emits --font-jetbrains-mono.
86
+ const jetbrainsMono = JetBrains_Mono({
87
+ subsets: ['latin'],
88
+ variable: '--font-jetbrains-mono',
89
+ display: 'swap',
90
+ preload: false, // mono is not render-blocking for the initial paint
91
+ })
92
+
93
+ // ---------------------------------------------------------------------------
94
+ // Static metadata
95
+ // ---------------------------------------------------------------------------
96
+ // These values are the application defaults. Individual route segments can
97
+ // override them via their own `export const metadata` declarations.
98
+ export const metadata: Metadata = {
99
+ title: {
100
+ template: '%s | Dashboard',
101
+ default: 'Dashboard',
102
+ },
103
+ description: 'Your application dashboard.',
104
+ robots: {
105
+ index: false, // dashboards are authenticated; never indexed
106
+ follow: false,
107
+ },
108
+ // Open Graph is intentionally minimal for an authenticated product.
109
+ // Marketing pages in a separate route group would carry richer OG tags.
110
+ }
111
+
112
+ // ---------------------------------------------------------------------------
113
+ // Viewport configuration
114
+ // ---------------------------------------------------------------------------
115
+ // Setting width=device-width and initial-scale=1 ensures the layout renders
116
+ // correctly on mobile devices. interactiveWidget prevents the virtual
117
+ // keyboard from resizing the viewport (resizes-visual keeps the layout
118
+ // stable when a mobile keyboard opens inside a form field).
119
+ export const viewport: Viewport = {
120
+ width: 'device-width',
121
+ initialScale: 1,
122
+ themeColor: [
123
+ { media: '(prefers-color-scheme: dark)', color: '#0f1420' },
124
+ { media: '(prefers-color-scheme: light)', color: '#f7f8fa' },
125
+ ],
126
+ }
127
+
128
+ // ---------------------------------------------------------------------------
129
+ // Root layout component
130
+ // ---------------------------------------------------------------------------
131
+ export default function RootLayout({
132
+ children,
133
+ }: {
134
+ children: React.ReactNode
135
+ }) {
136
+ return (
137
+ <html
138
+ lang="en"
139
+ // Dark theme is the designed default for this dashboard preset.
140
+ // ThemeToggle (client component) will update this attribute on
141
+ // the fly and persist the user's choice to localStorage.
142
+ data-theme="dark"
143
+ // Suppress hydration warning: ThemeToggle reads localStorage on
144
+ // mount and may update data-theme, causing a server/client
145
+ // mismatch. Suppressing at the html element is the conventional
146
+ // Next.js pattern for theme persistence without a flash.
147
+ suppressHydrationWarning
148
+ className={`${inter.variable} ${jetbrainsMono.variable}`}
149
+ >
150
+ <head>
151
+ {/*
152
+ * Font-feature-settings for Inter: injected as a global style so
153
+ * it applies as early as possible. We enable:
154
+ * calt -- contextual alternates (optical kerning pairs)
155
+ * cv02 -- alternate figure style (cleaner '1')
156
+ * cv03 -- alternate figure style (open '6' and '9')
157
+ * cv04 -- alternate figure style (open '4')
158
+ * tnum -- tabular figures (monospaced width numbers for columns)
159
+ * These features are non-layout-shifting so they are safe to
160
+ * apply globally; they do not affect glyph advance widths except
161
+ * where tnum is used (columns automatically align).
162
+ */}
163
+ <style>{`
164
+ :root {
165
+ --font-sans: var(--font-inter), system-ui, -apple-system, sans-serif;
166
+ --font-mono: var(--font-jetbrains-mono), ui-monospace, 'Cascadia Code', monospace;
167
+ }
168
+ body {
169
+ font-family: var(--font-sans);
170
+ font-feature-settings: 'calt' 1, 'cv02' 1, 'cv03' 1, 'cv04' 1;
171
+ }
172
+ code, pre, kbd, samp, .tabular-nums {
173
+ font-family: var(--font-mono);
174
+ font-feature-settings: 'tnum' 1;
175
+ }
176
+ `}</style>
177
+ </head>
178
+ <body>
179
+ {/*
180
+ * SidebarProvider wraps the entire shell so any component in the
181
+ * tree can read or modify collapse state without prop drilling.
182
+ * AppShell consumes SidebarContext to build the responsive grid.
183
+ */}
184
+ <SidebarProvider>
185
+ <CommandPaletteProvider>
186
+ <AppShell>{children}</AppShell>
187
+ </CommandPaletteProvider>
188
+ </SidebarProvider>
189
+ </body>
190
+ </html>
191
+ )
192
+ }