@polymorphism-tech/morph-spec 8.45.0 → 8.47.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 (146) hide show
  1. package/CLAUDE.md +6 -5
  2. package/README.md +2 -2
  3. package/bin/morph-spec.js +2 -4
  4. package/bin/validate.js +4 -25
  5. package/claude-plugin.json +1 -1
  6. package/docs/CHEATSHEET.md +2 -2
  7. package/docs/QUICKSTART.md +1 -1
  8. package/framework/CLAUDE.md +2 -2
  9. package/framework/MORPH.md +9 -9
  10. package/framework/commands/create-umbraco-lp.md +2 -0
  11. package/framework/commands/migrate-lp-to-umbraco.md +2 -0
  12. package/framework/commands/morph-archive.md +1 -1
  13. package/framework/commands/morph-hotfix.md +1 -1
  14. package/framework/commands/morph-infra.md +17 -203
  15. package/framework/commands/morph-media.md +3 -0
  16. package/framework/commands/morph-preflight.md +5 -28
  17. package/framework/commands/morph-proposal.md +2 -2
  18. package/framework/commands/morph-troubleshoot.md +2 -14
  19. package/framework/docs/CLI.md +8 -7
  20. package/framework/hooks/claude-code/core/state-sync.js +13 -1
  21. package/framework/hooks/shared/e2e-check.js +3 -4
  22. package/framework/hooks/shared/state-writer.js +1 -0
  23. package/framework/rules/ai-agents-standards.md +18 -16
  24. package/framework/rules/asaas-standards.md +3 -1
  25. package/framework/rules/csharp-standards.md +10 -8
  26. package/framework/rules/data-standards.md +5 -5
  27. package/framework/rules/dotnet-templates.md +1 -1
  28. package/framework/rules/frontend-standards.md +4 -2
  29. package/framework/rules/gsap-standards.md +10 -5
  30. package/framework/rules/hangfire-standards.md +3 -1
  31. package/framework/rules/infrastructure-standards.md +4 -2
  32. package/framework/rules/morph-workflow.md +2 -2
  33. package/framework/rules/neon-auth-standards.md +3 -1
  34. package/framework/rules/neon-standards.md +6 -4
  35. package/framework/rules/nextjs-standards.md +13 -11
  36. package/framework/rules/nextjs-templates.md +1 -1
  37. package/framework/rules/resend-standards.md +3 -1
  38. package/framework/schemas/config.schema.json +4 -0
  39. package/framework/schemas/feature.schema.json +4 -4
  40. package/framework/skills/README.md +1 -1
  41. package/framework/skills/core/create-umbraco-lp/SKILL.md +3 -3
  42. package/framework/skills/core/migrate-lp-to-umbraco/SKILL.md +3 -3
  43. package/framework/skills/core/morph-apply/SKILL.md +3 -3
  44. package/framework/skills/core/morph-brainstorming/SKILL.md +3 -3
  45. package/framework/skills/core/morph-hotfix/SKILL.md +4 -4
  46. package/framework/skills/core/morph-implement/SKILL.md +3 -3
  47. package/framework/skills/core/morph-machine/SKILL.md +3 -3
  48. package/framework/skills/core/morph-media/SKILL.md +3 -3
  49. package/framework/skills/core/morph-plan/SKILL.md +3 -3
  50. package/framework/skills/core/morph-proposal/SKILL.md +3 -3
  51. package/framework/skills/core/morph-review/SKILL.md +30 -17
  52. package/framework/skills/core/morph-stack-scan/SKILL.md +3 -3
  53. package/framework/skills/core/morph-standards/SKILL.md +6 -6
  54. package/framework/skills/core/morph-uiux/SKILL.md +3 -3
  55. package/framework/standards/STANDARDS.json +59 -56
  56. package/framework/standards/ai-agents/evals-with-cache.md +1 -1
  57. package/framework/standards/ai-agents/llm-runtime-defaults.md +1 -1
  58. package/framework/standards/ai-agents/modalities-speech-to-text.md +36 -26
  59. package/framework/standards/ai-agents/prompt-sources.md +6 -4
  60. package/framework/standards/ai-agents/providers/model-registry.md +1 -1
  61. package/framework/standards/ai-agents/rag-custom-pgvector.md +67 -39
  62. package/framework/standards/ai-agents/setup.md +1 -1
  63. package/framework/standards/ai-agents/structured-output.md +1 -1
  64. package/framework/standards/ai-agents/sweet-spot.md +1 -1
  65. package/framework/standards/architecture/code-comments.md +2 -2
  66. package/framework/standards/architecture/vertical-slice/vertical-slice.md +18 -9
  67. package/framework/standards/backend/api/validation.md +135 -47
  68. package/framework/standards/backend/database/postgresql/database.md +11 -7
  69. package/framework/standards/backend/database/vector-search-rag.md +207 -324
  70. package/framework/standards/backend/dotnet/fluent-validation-vsa.md +14 -8
  71. package/framework/standards/backend/dotnet/result-pattern.md +40 -6
  72. package/framework/standards/backend/dotnet/scalar-ui.md +13 -7
  73. package/framework/standards/backend/dotnet/scrutor.md +1 -1
  74. package/framework/standards/backend/dotnet/testing.md +1 -1
  75. package/framework/standards/backend/dotnet/vsa-handler-patterns.md +7 -7
  76. package/framework/standards/backend/integrations/asaas/asaas-api.md +309 -165
  77. package/framework/standards/backend/integrations/hangfire/hangfire-jobs.md +134 -154
  78. package/framework/standards/data/nosql/cache/redis.md +120 -44
  79. package/framework/standards/data/nosql/cosmos-db.md +114 -71
  80. package/framework/standards/frontend/design-system/animations.md +1 -1
  81. package/framework/standards/frontend/design-system/naming.md +1 -1
  82. package/framework/standards/frontend/nextjs/motion-patterns.md +45 -29
  83. package/framework/standards/frontend/nextjs/naming-conventions.md +1 -1
  84. package/framework/standards/infrastructure/docker/coolify-deploy.md +8 -6
  85. package/framework/standards/infrastructure/neon/neon-pgvector.md +120 -75
  86. package/framework/standards/infrastructure/neon/neon-setup.md +53 -31
  87. package/framework/templates/code/dotnet/contracts/contracts-vsa.cs +2 -2
  88. package/framework/templates/code/dotnet/extensions/database-extensions.cs +1 -1
  89. package/framework/templates/code/dotnet/extensions/result-extensions.cs +27 -0
  90. package/framework/templates/code/dotnet/feature/endpoint.cs.hbs +2 -2
  91. package/framework/templates/dotnet/ai-kit/tests/Morph.AiKit.Tests/MediaDisclosureTests.cs +1 -1
  92. package/framework/templates/infrastructure/docker/coolify.template.json +3 -3
  93. package/framework/templates/infrastructure/github/README.md +2 -1
  94. package/framework/templates/infrastructure/github/workflows/deploy-coolify.yml.hbs +2 -1
  95. package/package.json +1 -1
  96. package/src/commands/observability/telemetry.js +3 -5
  97. package/src/commands/project/init.js +2 -1
  98. package/src/commands/project/update.js +16 -18
  99. package/src/commands/state/approve.js +17 -0
  100. package/src/commands/state/gate-check.js +4 -14
  101. package/src/commands/validation/verify.js +99 -57
  102. package/src/core/paths/output-schema.js +1 -1
  103. package/src/dashboard/app/App.jsx +0 -2
  104. package/src/dashboard/app/components/CommandPalette.jsx +2 -3
  105. package/src/dashboard/app/components/EntityLink.jsx +0 -1
  106. package/src/dashboard/app/components/Markdown.jsx +1 -1
  107. package/src/dashboard/app/components/Sidebar.jsx +1 -2
  108. package/src/dashboard/app/pages/RulesMap.jsx +3 -3
  109. package/src/dashboard/app/pages/SkillsLibrary.jsx +3 -3
  110. package/src/dashboard/scanner/activity-scanner.js +1 -1
  111. package/src/dashboard/scanner/docs-scanner.js +5 -23
  112. package/src/dashboard/scanner/features-scanner.js +1 -1
  113. package/src/dashboard/scanner/index.js +0 -2
  114. package/src/dashboard/scanner/rules-scanner.js +15 -10
  115. package/src/dashboard/scanner/skills-scanner.js +2 -3
  116. package/src/lib/ci/ci-verify.js +118 -0
  117. package/src/lib/ci/github-ci.js +192 -0
  118. package/src/lib/ci/workflow-scaffold.js +122 -0
  119. package/src/lib/evaluator-report.js +13 -0
  120. package/src/lib/risk-detector.js +8 -0
  121. package/src/lib/stack/stack-profile.js +1 -1
  122. package/src/lib/telemetry/verify-event.js +3 -2
  123. package/src/lib/validators/reuse/reuse-validator.js +2 -3
  124. package/src/lib/validators/reuse/symbol-scanner.js +2 -4
  125. package/src/lib/validators/validation-runner.js +8 -88
  126. package/src/lib/validators/verify-runner.js +22 -72
  127. package/src/scripts/setup-infra.js +33 -22
  128. package/src/utils/agents-installer.js +20 -8
  129. package/src/utils/file-copier.js +7 -5
  130. package/framework/commands/commit.md +0 -166
  131. package/framework/hooks/claude-code/__pycache__/statusline.cpython-313.pyc +0 -0
  132. package/framework/rubrics/backend.json +0 -41
  133. package/framework/rubrics/default.json +0 -36
  134. package/framework/rubrics/frontend.json +0 -36
  135. package/framework/templates/project/validate.js +0 -97
  136. package/src/dashboard/app/pages/Rubrics.jsx +0 -97
  137. package/src/dashboard/scanner/rubrics-scanner.js +0 -12
  138. package/src/lib/validators/architecture/architecture-validator.js +0 -270
  139. package/src/lib/validators/architecture/index.js +0 -7
  140. package/src/lib/validators/css/css-validator.js +0 -340
  141. package/src/lib/validators/css/index.js +0 -7
  142. package/src/lib/validators/design-system/design-system-validator.js +0 -237
  143. package/src/lib/validators/design-system/index.js +0 -7
  144. package/src/lib/validators/score-aggregator.js +0 -244
  145. package/src/lib/validators/ui/index.js +0 -7
  146. package/src/lib/validators/ui/ui-contrast-validator.js +0 -422
@@ -1,166 +0,0 @@
1
- ---
2
- allowed-tools: Bash(git add:*), Bash(git status:*), Bash(git commit:*), Bash(git diff:*), Bash(git log:*)
3
- argument-hint: [message] | --no-verify | --amend
4
- description: Create well-formatted commits with conventional commit format and emoji
5
- ---
6
-
7
- # Smart Git Commit
8
-
9
- Create well-formatted commit: $ARGUMENTS
10
-
11
- ## Current Repository State
12
-
13
- - Git status: !git status --porcelain
14
- - Current branch: !git branch --show-current
15
- - Staged changes: !git diff --cached --stat
16
- - Unstaged changes: !git diff --stat
17
- - Recent commits: !git log --oneline -5
18
-
19
- ## What This Command Does
20
-
21
- 1. Unless specified with --no-verify, automatically runs pre-commit checks:
22
- - pnpm lint to ensure code quality
23
- - pnpm build to verify the build succeeds
24
- - pnpm generate:docs to update documentation
25
- 2. Checks which files are staged with git status
26
- 3. If 0 files are staged, automatically adds all modified and new files with git add
27
- 4. Performs a git diff to understand what changes are being committed
28
- 5. Analyzes the diff to determine if multiple distinct logical changes are present
29
- 6. If multiple distinct changes are detected, suggests breaking the commit into multiple smaller commits
30
- 7. For each commit (or the single commit if not split), creates a commit message using emoji conventional commit format
31
-
32
- ## Best Practices for Commits
33
-
34
- - **Verify before committing**: Ensure code is linted, builds correctly, and documentation is updated
35
- - **Atomic commits**: Each commit should contain related changes that serve a single purpose
36
- - **Split large changes**: If changes touch multiple concerns, split them into separate commits
37
- - **Conventional commit format**: Use the format <type>: <description> where type is one of:
38
- - feat: A new feature
39
- - fix: A bug fix
40
- - docs: Documentation changes
41
- - style: Code style changes (formatting, etc)
42
- - refactor: Code changes that neither fix bugs nor add features
43
- - perf: Performance improvements
44
- - test: Adding or fixing tests
45
- - chore: Changes to the build process, tools, etc.
46
- - **Present tense, imperative mood**: Write commit messages as commands (e.g., "add feature" not "added feature")
47
- - **Concise first line**: Keep the first line under 72 characters
48
- - **Emoji**: Each commit type is paired with an appropriate emoji:
49
- - ✨ feat: New feature
50
- - 🐛 fix: Bug fix
51
- - 📝 docs: Documentation
52
- - 💄 style: Formatting/style
53
- - ♻️ refactor: Code refactoring
54
- - ⚡️ perf: Performance improvements
55
- - ✅ test: Tests
56
- - 🔧 chore: Tooling, configuration
57
- - 🚀 ci: CI/CD improvements
58
- - 🗑️ revert: Reverting changes
59
- - 🧪 test: Add a failing test
60
- - 🚨 fix: Fix compiler/linter warnings
61
- - 🔒️ fix: Fix security issues
62
- - 👥 chore: Add or update contributors
63
- - 🚚 refactor: Move or rename resources
64
- - 🏗️ refactor: Make architectural changes
65
- - 🔀 chore: Merge branches
66
- - 📦️ chore: Add or update compiled files or packages
67
- - ➕ chore: Add a dependency
68
- - ➖ chore: Remove a dependency
69
- - 🌱 chore: Add or update seed files
70
- - 🧑‍💻 chore: Improve developer experience
71
- - 🧵 feat: Add or update code related to multithreading or concurrency
72
- - 🔍️ feat: Improve SEO
73
- - 🏷️ feat: Add or update types
74
- - 💬 feat: Add or update text and literals
75
- - 🌐 feat: Internationalization and localization
76
- - 👔 feat: Add or update business logic
77
- - 📱 feat: Work on responsive design
78
- - 🚸 feat: Improve user experience / usability
79
- - 🩹 fix: Simple fix for a non-critical issue
80
- - 🥅 fix: Catch errors
81
- - 👽️ fix: Update code due to external API changes
82
- - 🔥 fix: Remove code or files
83
- - 🎨 style: Improve structure/format of the code
84
- - 🚑️ fix: Critical hotfix
85
- - 🎉 chore: Begin a project
86
- - 🔖 chore: Release/Version tags
87
- - 🚧 wip: Work in progress
88
- - 💚 fix: Fix CI build
89
- - 📌 chore: Pin dependencies to specific versions
90
- - 👷 ci: Add or update CI build system
91
- - 📈 feat: Add or update analytics or tracking code
92
- - ✏️ fix: Fix typos
93
- - ⏪️ revert: Revert changes
94
- - 📄 chore: Add or update license
95
- - 💥 feat: Introduce breaking changes
96
- - 🍱 assets: Add or update assets
97
- - ♿️ feat: Improve accessibility
98
- - 💡 docs: Add or update comments in source code
99
- - 🗃️ db: Perform database related changes
100
- - 🔊 feat: Add or update logs
101
- - 🔇 fix: Remove logs
102
- - 🤡 test: Mock things
103
- - 🥚 feat: Add or update an easter egg
104
- - 🙈 chore: Add or update .gitignore file
105
- - 📸 test: Add or update snapshots
106
- - ⚗️ experiment: Perform experiments
107
- - 🚩 feat: Add, update, or remove feature flags
108
- - 💫 ui: Add or update animations and transitions
109
- - ⚰️ refactor: Remove dead code
110
- - 🦺 feat: Add or update code related to validation
111
- - ✈️ feat: Improve offline support
112
-
113
- ## Guidelines for Splitting Commits
114
-
115
- When analyzing the diff, consider splitting commits based on these criteria:
116
-
117
- 1. **Different concerns**: Changes to unrelated parts of the codebase
118
- 2. **Different types of changes**: Mixing features, fixes, refactoring, etc.
119
- 3. **File patterns**: Changes to different types of files (e.g., source code vs documentation)
120
- 4. **Logical grouping**: Changes that would be easier to understand or review separately
121
- 5. **Size**: Very large changes that would be clearer if broken down
122
-
123
- ## Examples
124
-
125
- Good commit messages:
126
- - ✨ feat: add user authentication system
127
- - 🐛 fix: resolve memory leak in rendering process
128
- - 📝 docs: update API documentation with new endpoints
129
- - ♻️ refactor: simplify error handling logic in parser
130
- - 🚨 fix: resolve linter warnings in component files
131
- - 🧑‍💻 chore: improve developer tooling setup process
132
- - 👔 feat: implement business logic for transaction validation
133
- - 🩹 fix: address minor styling inconsistency in header
134
- - 🚑️ fix: patch critical security vulnerability in auth flow
135
- - 🎨 style: reorganize component structure for better readability
136
- - 🔥 fix: remove deprecated legacy code
137
- - 🦺 feat: add input validation for user registration form
138
- - 💚 fix: resolve failing CI pipeline tests
139
- - 📈 feat: implement analytics tracking for user engagement
140
- - 🔒️ fix: strengthen authentication password requirements
141
- - ♿️ feat: improve form accessibility for screen readers
142
-
143
- Example of splitting commits:
144
- - First commit: ✨ feat: add new solc version type definitions
145
- - Second commit: 📝 docs: update documentation for new solc versions
146
- - Third commit: 🔧 chore: update package.json dependencies
147
- - Fourth commit: 🏷️ feat: add type definitions for new API endpoints
148
- - Fifth commit: 🧵 feat: improve concurrency handling in worker threads
149
- - Sixth commit: 🚨 fix: resolve linting issues in new code
150
- - Seventh commit: ✅ test: add unit tests for new solc version features
151
- - Eighth commit: 🔒️ fix: update dependencies with security vulnerabilities
152
-
153
- ## Command Options
154
-
155
- - --no-verify: Skip running the pre-commit checks (lint, build, generate:docs)
156
-
157
- ## Important Notes
158
-
159
- - By default, pre-commit checks (pnpm lint, pnpm build, pnpm generate:docs) will run to ensure code quality
160
- - If these checks fail, you'll be asked if you want to proceed with the commit anyway or fix the issues first
161
- - If specific files are already staged, the command will only commit those files
162
- - If no files are staged, it will automatically stage all modified and new files
163
- - The commit message will be constructed based on the changes detected
164
- - Before committing, the command will review the diff to identify if multiple commits would be more appropriate
165
- - If suggesting multiple commits, it will help you stage and commit the changes separately
166
- - Always reviews the commit diff to ensure the message matches the changes
@@ -1,41 +0,0 @@
1
- {
2
- "id": "backend",
3
- "version": "1.1.0",
4
- "description": "Backend-focused rubric. Higher weight on architecture, security, and package health. Deterministic-validator weights for the verify validators node; the score is informational — the node fails on validator errors.",
5
- "categories": {
6
- "functionality": {
7
- "weight": 0.25,
8
- "validators": ["contract-compliance"],
9
- "description": "Core feature correctness and contract compliance"
10
- },
11
- "code_quality": {
12
- "weight": 0.25,
13
- "validators": ["architecture", "reuse", "code-budget"],
14
- "description": "Architecture patterns, dependency direction, code structure, reuse of what the codebase already has, and comment and test budget"
15
- },
16
- "design_ui": {
17
- "weight": 0.05,
18
- "validators": ["design-system", "css", "contrast", "nextjs-component"],
19
- "description": "Design system compliance (minimal weight for backend projects)"
20
- },
21
- "security": {
22
- "weight": 0.15,
23
- "validators": [],
24
- "description": "Security posture (agent-evaluated, no automated validator)"
25
- },
26
- "packages": {
27
- "weight": 0.20,
28
- "validators": ["packages"],
29
- "description": "Dependency health, version compatibility, and deprecated packages"
30
- },
31
- "maf_compliance": {
32
- "weight": 0.10,
33
- "validators": [],
34
- "description": "MAF agent compliance (agent-evaluated, applies only when the feature touches AI agents): Microsoft.Agents.AI GA packages used; Model Registry alias referenced not hardcoded models; structured output for pipelined agents; prompts from DB not hardcoded; no Semantic Kernel; no hosted agent services."
35
- }
36
- },
37
- "thresholds": {
38
- "approve": 9.0,
39
- "retry": 6.0
40
- }
41
- }
@@ -1,36 +0,0 @@
1
- {
2
- "id": "default",
3
- "version": "1.1.0",
4
- "description": "Default rubric for general-purpose projects. Balanced weights across all categories. Deterministic-validator weights for the verify validators node; the score is informational — the node fails on validator errors.",
5
- "categories": {
6
- "functionality": {
7
- "weight": 0.30,
8
- "validators": ["contract-compliance"],
9
- "description": "Core feature correctness and contract compliance"
10
- },
11
- "code_quality": {
12
- "weight": 0.25,
13
- "validators": ["architecture", "reuse", "code-budget"],
14
- "description": "Architecture patterns, code structure, reuse of what the codebase already has, and comment and test budget"
15
- },
16
- "design_ui": {
17
- "weight": 0.15,
18
- "validators": ["design-system", "css", "contrast", "nextjs-component"],
19
- "description": "Design system compliance, CSS quality, and UI correctness"
20
- },
21
- "security": {
22
- "weight": 0.15,
23
- "validators": [],
24
- "description": "Security posture (agent-evaluated, no automated validator)"
25
- },
26
- "packages": {
27
- "weight": 0.15,
28
- "validators": ["packages"],
29
- "description": "Dependency health and compatibility"
30
- }
31
- },
32
- "thresholds": {
33
- "approve": 9.0,
34
- "retry": 6.0
35
- }
36
- }
@@ -1,36 +0,0 @@
1
- {
2
- "id": "frontend",
3
- "version": "1.1.0",
4
- "description": "Frontend-focused rubric. Higher weight on design system compliance and UI quality. Deterministic-validator weights for the verify validators node; the score is informational — the node fails on validator errors.",
5
- "categories": {
6
- "functionality": {
7
- "weight": 0.25,
8
- "validators": ["contract-compliance"],
9
- "description": "Core feature correctness and contract compliance"
10
- },
11
- "code_quality": {
12
- "weight": 0.15,
13
- "validators": ["architecture", "reuse", "code-budget"],
14
- "description": "Architecture patterns, code structure, reuse of what the codebase already has, and comment and test budget"
15
- },
16
- "design_ui": {
17
- "weight": 0.35,
18
- "validators": ["design-system", "css", "contrast", "nextjs-component"],
19
- "description": "Design system compliance, CSS quality, contrast ratios, and component correctness"
20
- },
21
- "security": {
22
- "weight": 0.10,
23
- "validators": [],
24
- "description": "Security posture (agent-evaluated, no automated validator)"
25
- },
26
- "packages": {
27
- "weight": 0.15,
28
- "validators": ["packages"],
29
- "description": "Dependency health and compatibility"
30
- }
31
- },
32
- "thresholds": {
33
- "approve": 9.0,
34
- "retry": 6.0
35
- }
36
- }
@@ -1,97 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const validator = process.argv[2];
4
- const isJson = process.argv.includes('--json');
5
-
6
- if (!validator) {
7
- console.error('Usage: node bin/validate.js <validator> [--json]');
8
- process.exit(1);
9
- }
10
-
11
- const { execSync } = await import('child_process');
12
- const { existsSync } = await import('fs');
13
- const { join } = await import('path');
14
-
15
- const cwd = process.cwd();
16
-
17
- const results = {
18
- validator,
19
- errors: 0,
20
- warnings: 0,
21
- passed: true,
22
- issues: [],
23
- };
24
-
25
- function runCommand(cmd, options = {}) {
26
- try {
27
- const stdout = execSync(cmd, { cwd, stdio: ['pipe', 'pipe', 'pipe'], ...options }).toString();
28
- return { success: true, stdout, stderr: '' };
29
- } catch (err) {
30
- return {
31
- success: false,
32
- stdout: err.stdout?.toString() || '',
33
- stderr: err.stderr?.toString() || err.message,
34
- };
35
- }
36
- }
37
-
38
- const hasFrontend = existsSync(join(cwd, 'src/frontend')) || existsSync(join(cwd, 'frontend'));
39
- const hasBackend = existsSync(join(cwd, 'src/backend')) || existsSync(join(cwd, 'backend'));
40
- const hasSln = existsSync(join(cwd, 'src/backend/backend.sln')) ||
41
- existsSync(join(cwd, 'src/backend/Backend.sln'));
42
-
43
- const frontendDir = existsSync(join(cwd, 'src/frontend')) ? 'src/frontend' : 'frontend';
44
- const backendDir = existsSync(join(cwd, 'src/backend')) ? 'src/backend' : 'backend';
45
-
46
- switch (validator) {
47
- case 'architecture': {
48
- if (hasBackend && hasSln) {
49
- const slnFile = hasSln ? (
50
- existsSync(join(cwd, 'src/backend/backend.sln')) ? 'backend.sln' : 'Backend.sln'
51
- ) : '.';
52
- const result = runCommand(`dotnet build ${slnFile} --no-restore -warnaserror`, { cwd: join(cwd, backendDir) });
53
- if (!result.success) {
54
- results.errors++;
55
- results.passed = false;
56
- results.issues.push({ level: 'error', message: `dotnet build failed: ${result.stderr.split('\n')[0]}` });
57
- }
58
- }
59
- break;
60
- }
61
-
62
- case 'nextjs-component':
63
- case 'packages':
64
- case 'design-system': {
65
- if (hasFrontend) {
66
- const result = runCommand('npx tsc --noEmit', { cwd: join(cwd, frontendDir) });
67
- if (!result.success) {
68
- results.errors++;
69
- results.passed = false;
70
- results.issues.push({ level: 'error', message: `TypeScript errors found. Run: npx tsc --noEmit` });
71
- }
72
- }
73
- break;
74
- }
75
-
76
- case 'ui-contrast':
77
- case 'css': {
78
- results.issues.push({ level: 'info', message: `${validator} requires manual review` });
79
- break;
80
- }
81
-
82
- default:
83
- results.issues.push({ level: 'warning', message: `Unknown validator: ${validator}` });
84
- break;
85
- }
86
-
87
- if (isJson) {
88
- console.log(JSON.stringify(results, null, 2));
89
- } else {
90
- const icon = results.passed ? '✅' : '❌';
91
- console.log(`${icon} Validator: ${validator} — ${results.passed ? 'PASSED' : `FAILED (${results.errors} errors)`}`);
92
- for (const issue of results.issues) {
93
- console.log(` [${issue.level}] ${issue.message}`);
94
- }
95
- }
96
-
97
- process.exit(results.passed ? 0 : 1);
@@ -1,97 +0,0 @@
1
- import morphData from 'virtual:morph-data';
2
- import KnowledgeMarkdown from '../components/KnowledgeMarkdown.jsx';
3
- import { useSelection } from '../components/EntityLink.jsx';
4
-
5
- const DOCS = morphData.docs || { rubrics: [] };
6
- const CHECKLIST = DOCS.rubrics.find((r) => r.id === 'review-checklist');
7
- const VALIDATORS = morphData.rubrics || [];
8
-
9
- const GROUPS = [
10
- { title: 'Avaliador do Gate 3', hint: 'veredito e bloqueadores com evidência', items: CHECKLIST ? [{ key: 'dim:review-checklist', title: CHECKLIST.title, doc: CHECKLIST }] : [] },
11
- { title: 'Validadores determinísticos', hint: 'pesos por categoria no verify', items: VALIDATORS.map((v) => ({ key: `val:${v.id}`, title: `Rubrica ${v.id}`, validator: v })) },
12
- ].filter((g) => g.items.length);
13
-
14
- const ALL = GROUPS.flatMap((g) => g.items);
15
-
16
- function ValidatorRubric({ v }) {
17
- return (
18
- <article className="prose-morph">
19
- <h1>Rubrica {v.id}</h1>
20
- {v.description && <p>{v.description}</p>}
21
- <table>
22
- <thead><tr><th>Categoria</th><th>Peso</th><th>Validadores</th><th>O que mede</th></tr></thead>
23
- <tbody>
24
- {Object.entries(v.categories).map(([name, c]) => (
25
- <tr key={name}>
26
- <td>{name}</td>
27
- <td className="font-mono">{c.weight ?? '—'}</td>
28
- <td className="font-mono text-xs">{(c.validators || []).join(', ') || '—'}</td>
29
- <td>{c.description || ''}</td>
30
- </tr>
31
- ))}
32
- </tbody>
33
- </table>
34
- <p>O score é informativo: o nó de validadores do verify reprova por erro de validador, não pelo número.</p>
35
- </article>
36
- );
37
- }
38
-
39
- export function RubricsView({ sel, onSel }) {
40
- const current = ALL.find((i) => i.key === sel) || null;
41
- return (
42
- <div className="mx-auto max-w-7xl px-4 pb-24 pt-10 md:px-10 md:pt-14">
43
- <header className="rise mb-8">
44
- <h1 className="text-4xl font-semibold tracking-tight md:text-5xl">Rubricas</h1>
45
- <p className="mt-3 max-w-2xl text-sm leading-relaxed text-[var(--color-dim)]">
46
- Com o que o trabalho é julgado. O avaliador independente decide SHIP ou FIX, e só bloqueia com evidência de UC, teste, regressão ou segurança.
47
- Os validadores rodam no <span className="font-mono text-[var(--color-fg)]">morph-spec verify</span>, sem modelo.
48
- </p>
49
- </header>
50
- <div className="rise-2 grid gap-6 lg:grid-cols-[17rem_minmax(0,1fr)]">
51
- <nav aria-label="Rubricas" className="lg:sticky lg:top-4 lg:self-start">
52
- <button
53
- type="button"
54
- onClick={() => onSel(null)}
55
- aria-current={!current ? 'page' : undefined}
56
- className={['fluid mb-4 block w-full rounded-lg px-3 py-2 text-left text-sm transition-colors', !current ? 'bg-white/[0.08] text-[var(--color-fg)]' : 'text-[var(--color-dim)] hover:bg-white/[0.04]'].join(' ')}
57
- >
58
- Como o Gate 3 decide
59
- </button>
60
- {GROUPS.map((g) => (
61
- <div key={g.title} className="mb-5">
62
- <p className="px-3 text-xs text-[var(--color-faint)]">{g.title}</p>
63
- <p className="mb-1.5 px-3 text-[11px] text-[var(--color-faint)]">{g.hint}</p>
64
- <ul>
65
- {g.items.map((i) => (
66
- <li key={i.key}>
67
- <button
68
- type="button"
69
- onClick={() => onSel(i.key)}
70
- aria-current={current?.key === i.key ? 'page' : undefined}
71
- className={['fluid block w-full truncate rounded-lg px-3 py-1.5 text-left text-sm transition-colors', current?.key === i.key ? 'bg-white/[0.08] text-[var(--color-fg)]' : 'text-[var(--color-dim)] hover:bg-white/[0.04] hover:text-[var(--color-fg)]'].join(' ')}
72
- title={i.title}
73
- >
74
- {i.title}
75
- </button>
76
- </li>
77
- ))}
78
- </ul>
79
- </div>
80
- ))}
81
- </nav>
82
- <div className="bezel min-w-0">
83
- <div className="bezel-core min-w-0 px-6 py-8 md:px-12 md:py-10">
84
- {!current && (CHECKLIST ? <KnowledgeMarkdown text={CHECKLIST.content} /> : <p className="text-sm text-[var(--color-dim)]">Escolha uma rubrica.</p>)}
85
- {current?.doc && <KnowledgeMarkdown text={current.doc.content} />}
86
- {current?.validator && <ValidatorRubric v={current.validator} />}
87
- </div>
88
- </div>
89
- </div>
90
- </div>
91
- );
92
- }
93
-
94
- export default function Rubrics() {
95
- const [sel, setSel] = useSelection();
96
- return <RubricsView sel={sel} onSel={setSel} />;
97
- }
@@ -1,12 +0,0 @@
1
- import { readFileSync, readdirSync, existsSync } from 'fs';
2
- import { join } from 'path';
3
-
4
- export function scanRubrics(frameworkDir) {
5
- const dir = join(frameworkDir, 'rubrics');
6
- if (!existsSync(dir)) return [];
7
- return readdirSync(dir).filter(f => f.endsWith('.json')).map(f => {
8
- const d = JSON.parse(readFileSync(join(dir, f), 'utf8'));
9
- return { id: d.id, version: d.version || '1.0.0', description: d.description || '',
10
- categories: d.categories || {}, thresholds: d.thresholds || { approve: 9.0, retry: 6.0 } };
11
- });
12
- }